1
0

bundle.js 827 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  52. let poolKey = {
  53. inHoleEft: "inHoleEft",
  54. d3ball: "d3ball",
  55. iceEft: "iceEft",
  56. hitEft: "hitEft",
  57. fireworksEft: "fireworksEft",
  58. };
  59. var GameMode;
  60. (function (GameMode) {
  61. GameMode[GameMode["classic"] = 0] = "classic";
  62. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  63. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  64. })(GameMode || (GameMode = {}));
  65. var SkillType;
  66. (function (SkillType) {
  67. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  68. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  69. SkillType[SkillType["ice"] = 2] = "ice";
  70. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  71. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  72. })(SkillType || (SkillType = {}));
  73. var ClassicWordsType;
  74. (function (ClassicWordsType) {
  75. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  76. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  77. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  78. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  79. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  80. })(ClassicWordsType || (ClassicWordsType = {}));
  81. var PressType;
  82. (function (PressType) {
  83. PressType[PressType["powerNode"] = 0] = "powerNode";
  84. PressType[PressType["d2Root"] = 1] = "d2Root";
  85. PressType[PressType["moveNode"] = 2] = "moveNode";
  86. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  87. })(PressType || (PressType = {}));
  88. var PlaceBallType;
  89. (function (PlaceBallType) {
  90. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  91. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  92. })(PlaceBallType || (PlaceBallType = {}));
  93. var EAdType;
  94. (function (EAdType) {
  95. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  96. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  97. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  98. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  99. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  100. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  101. EAdType[EAdType["sign"] = 6] = "sign";
  102. EAdType[EAdType["draw"] = 7] = "draw";
  103. EAdType[EAdType["triple"] = 8] = "triple";
  104. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  105. EAdType[EAdType["getPower"] = 10] = "getPower";
  106. EAdType[EAdType["box"] = 11] = "box";
  107. EAdType[EAdType["try"] = 12] = "try";
  108. EAdType[EAdType["againSign"] = 13] = "againSign";
  109. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  110. })(EAdType || (EAdType = {}));
  111. var Prop;
  112. (function (Prop) {
  113. Prop[Prop["diamond"] = 1] = "diamond";
  114. Prop[Prop["coin"] = 2] = "coin";
  115. Prop[Prop["gan1"] = 3] = "gan1";
  116. Prop[Prop["gan2"] = 4] = "gan2";
  117. Prop[Prop["gan3"] = 5] = "gan3";
  118. Prop[Prop["gan4"] = 6] = "gan4";
  119. })(Prop || (Prop = {}));
  120. var TipsType;
  121. (function (TipsType) {
  122. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  123. TipsType[TipsType["foul"] = 1] = "foul";
  124. })(TipsType || (TipsType = {}));
  125. class AwardType {
  126. constructor(type, num) {
  127. this.type = type;
  128. this.num = num;
  129. }
  130. }
  131. var define = /*#__PURE__*/Object.freeze({
  132. fguiRes: fguiRes,
  133. ballCamp: ballCamp,
  134. FoulType: FoulType,
  135. ALL_BALL_STOP: ALL_BALL_STOP,
  136. WAIT_SHOOT: WAIT_SHOOT,
  137. D3RES_LOADED: D3RES_LOADED,
  138. BALL_SHOOT: BALL_SHOOT,
  139. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  140. RESET_GAME: RESET_GAME,
  141. COIN_CHANGE: COIN_CHANGE,
  142. DIAMOND_CHANGE: DIAMOND_CHANGE,
  143. RESTART_GAME: RESTART_GAME,
  144. GET_USER_INFO: GET_USER_INFO,
  145. CHANGE_SECRETARY: CHANGE_SECRETARY,
  146. POWER_CHANGE: POWER_CHANGE,
  147. POWER_TIME: POWER_TIME,
  148. baseHeadUrl: baseHeadUrl,
  149. poolKey: poolKey,
  150. get GameMode () { return GameMode; },
  151. get SkillType () { return SkillType; },
  152. get ClassicWordsType () { return ClassicWordsType; },
  153. get PressType () { return PressType; },
  154. get PlaceBallType () { return PlaceBallType; },
  155. get EAdType () { return EAdType; },
  156. get Prop () { return Prop; },
  157. get TipsType () { return TipsType; },
  158. AwardType: AwardType
  159. });
  160. class CContext {
  161. constructor() {
  162. this.winSize = { width: 0, height: 0 };
  163. this.notchHeight = 0;
  164. this.bannerHeight = 0;
  165. }
  166. init(resList, callback) {
  167. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  168. this.notchHeight = this.getNotchHeight();
  169. this.bannerHeight = this.getBannerHeight();
  170. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  171. callback && callback();
  172. }));
  173. }
  174. getNotchHeight() {
  175. let notchHeight = 50;
  176. if (Laya.Browser.onMiniGame) {
  177. let deviceInfo = wx.getSystemInfoSync();
  178. if (Laya.Browser.onIOS) {
  179. if (deviceInfo.model.search('iPhone X') != -1) {
  180. notchHeight = deviceInfo.statusBarHeight - 10;
  181. }
  182. else {
  183. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  184. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  185. notchHeight = deviceInfo.statusBarHeight - 10;
  186. }
  187. }
  188. }
  189. else if (Laya.Browser.onAndroid) {
  190. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  191. notchHeight = deviceInfo.statusBarHeight;
  192. }
  193. }
  194. }
  195. return notchHeight;
  196. }
  197. getBannerHeight() {
  198. return 0;
  199. }
  200. }
  201. let context = new CContext();
  202. var Handler = Laya.Handler;
  203. var Tween = Laya.Tween;
  204. function playClickEffect(btn) {
  205. if (!btn)
  206. return;
  207. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  208. if (!btn)
  209. return;
  210. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  211. if (!btn)
  212. return;
  213. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  214. }), 0, true);
  215. }), 0, true);
  216. }
  217. function getNumList(strList) {
  218. let dataList = [];
  219. if (strList) {
  220. let list = strList;
  221. let array = list.split(',');
  222. for (var v in array) {
  223. dataList.push(Number(array[v]));
  224. }
  225. }
  226. return dataList;
  227. }
  228. function getStrList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split('|');
  233. for (var v in array) {
  234. dataList.push(String(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getRandStr(len) {
  240. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  241. let str = "";
  242. for (let i = 0; i < len; i++) {
  243. let rand = random(0, list.length);
  244. str += list[rand];
  245. }
  246. return str;
  247. }
  248. function getUserId() {
  249. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  250. return str;
  251. }
  252. function formatPos(pos, len = 2) {
  253. let v = Math.pow(10, len);
  254. pos.x = Math.floor(pos.x * v) / v;
  255. pos.y = Math.floor(pos.y * v) / v;
  256. if (pos.z)
  257. pos.z = Math.floor(pos.z * v) / v;
  258. return pos;
  259. }
  260. function setPosInt(pos) {
  261. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  262. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  263. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  264. return pos;
  265. }
  266. function random(min, max) {
  267. var rang = max - min;
  268. var rand = Math.random() * rang;
  269. return Math.floor(rand) + min;
  270. }
  271. function randomList(list, num) {
  272. if (list.length <= num)
  273. return list;
  274. let arry = [];
  275. list.forEach(item => {
  276. arry.push(item);
  277. });
  278. let nums = [];
  279. for (let i = 0; i < num; i++) {
  280. let rand = random(0, arry.length);
  281. let v = arry[rand];
  282. nums.push(v);
  283. arry.splice(rand, 1);
  284. }
  285. return nums;
  286. }
  287. function worldToScreen(camera, point, pos) {
  288. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  289. pos.x = pos.x / Laya.stage.clientScaleX;
  290. pos.y = pos.y / Laya.stage.clientScaleY;
  291. }
  292. function getStringLenght(str) {
  293. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  294. }
  295. function reviseString(str, len) {
  296. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  297. if (ld > len) {
  298. let sl = Math.floor(len / 2);
  299. let rs = str.substring(0, sl);
  300. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. while (d + 2 < len) {
  302. sl++;
  303. rs = str.substring(0, sl);
  304. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. return rs + "...";
  307. }
  308. return str;
  309. }
  310. function getCoinString(coin) {
  311. if (coin < 10000)
  312. return coin.toString();
  313. else if (coin < 1000000) {
  314. let vh = Math.ceil(coin / 100);
  315. return (vh / 10) + "k";
  316. }
  317. else if (coin < 1000000000) {
  318. var vh = Math.ceil(coin / 100000);
  319. return (vh / 10) + "m";
  320. }
  321. else if (coin < 1000000000000) {
  322. var vh = Math.ceil(coin / 100000000);
  323. return (vh / 10) + "b";
  324. }
  325. else if (coin < 1000000000000000) {
  326. var vh = Math.ceil(coin / 100000000000);
  327. return (vh / 10) + "t";
  328. }
  329. }
  330. function getV3Dest(pos, dir, dis, dest) {
  331. dir.x *= dis;
  332. dir.y *= dis;
  333. dir.z *= dis;
  334. Laya.Vector3.add(pos, dir, dest);
  335. return dest;
  336. }
  337. function getV2Dest(x1, y1, dir, dis, dest) {
  338. dest.x = x1 + dir.x * dis;
  339. dest.y = y1 + dir.y * dis;
  340. return dest;
  341. }
  342. function getV2Dir(x1, y1, x2, y2, dir) {
  343. dir.x = x2 - x1;
  344. dir.y = y2 - y1;
  345. Laya.Vector2.normalize(dir, dir);
  346. return dir;
  347. }
  348. function getV3Dir(p1, p2, dir) {
  349. Laya.Vector3.subtract(p1, p2, dir);
  350. Laya.Vector3.normalize(dir, dir);
  351. return dir;
  352. }
  353. function copyPos(ip, op) {
  354. op.x = ip.x;
  355. op.y = ip.y;
  356. if (ip.z)
  357. op.z = ip.z;
  358. return op;
  359. }
  360. function getScreenImg() {
  361. let gl = Laya.WebGLContext.mainContext;
  362. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  363. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  364. let w = gl.drawingBufferWidth;
  365. let h = gl.drawingBufferHeight;
  366. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  367. texture2d.setPixels(pixels);
  368. return new Laya.Texture(texture2d);
  369. }
  370. function playMoveByPositions(sp, positions, v, completeCallback) {
  371. let p;
  372. let play = () => {
  373. if (positions.length == 0) {
  374. completeCallback();
  375. return;
  376. }
  377. p = positions[0];
  378. positions.splice(0, 1);
  379. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  380. play();
  381. }));
  382. };
  383. play();
  384. }
  385. function setStarPos(node, num, max) {
  386. for (let i = 1; i <= 5; i++) {
  387. let img = node.getChildAt(i - 1);
  388. img.width = img.height = 30;
  389. img.pivotX = img.pivotY = 0.5;
  390. img.gray = i > num;
  391. img.visible = i <= max;
  392. if (max == 3) {
  393. img.x = node.width / 2 + (i - 2) * 30 - 15;
  394. img.y = node.height - 40;
  395. if (i == 2)
  396. img.y = node.height - 30;
  397. }
  398. else if (max == 5) {
  399. let ly = Math.abs(i - 3);
  400. img.x = node.width / 2 + (i - 3) * 20 - 15;
  401. img.y = node.height - ly * 8 - 30;
  402. }
  403. }
  404. }
  405. function playLoopAnimRotate(sp, time, clockwise = true) {
  406. let rotation;
  407. sp.rotation = sp.rotation % 360;
  408. if (clockwise) {
  409. rotation = -360;
  410. }
  411. else {
  412. rotation = 360;
  413. }
  414. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  415. this.playLoopAnimRotate(sp, time, clockwise);
  416. }));
  417. }
  418. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  419. let x, y;
  420. if (isBig) {
  421. x = valueXMin;
  422. y = valueYMin;
  423. }
  424. else {
  425. x = valueXMax;
  426. y = valueYMax;
  427. }
  428. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  429. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  430. }));
  431. }
  432. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  433. let scale;
  434. if (isBig) {
  435. scale = valueMin;
  436. }
  437. else {
  438. scale = valueMax;
  439. }
  440. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  441. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  442. }));
  443. }
  444. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  445. let value;
  446. if (isBig) {
  447. value = valueMin;
  448. }
  449. else {
  450. value = valueMax;
  451. }
  452. if (count) {
  453. count--;
  454. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  455. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  456. }));
  457. }
  458. else {
  459. sp.rotation = 0;
  460. }
  461. }
  462. function inRect(rect, p) {
  463. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  464. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  465. return true;
  466. }
  467. }
  468. return false;
  469. }
  470. function getNumberK(number) {
  471. if (number < 1000) {
  472. return number.toString();
  473. }
  474. else {
  475. return (number / 1000).toFixed(1) + "k";
  476. }
  477. }
  478. function pointInsideCircle(point, circle, r) {
  479. if (r === 0)
  480. return false;
  481. var dx = circle.x - point.x;
  482. var dy = circle.y - point.y;
  483. return dx * dx + dy * dy <= r * r;
  484. }
  485. function formatString(str, data) {
  486. if (!str || data == undefined) {
  487. return str;
  488. }
  489. if (typeof data === "object") {
  490. for (var key in data) {
  491. if (data.hasOwnProperty(key)) {
  492. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  493. }
  494. }
  495. }
  496. else {
  497. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  498. return str.replace(reg, function (match, index) {
  499. return args[index - (-1)];
  500. });
  501. }
  502. return str;
  503. }
  504. function getIntersection(a, b) {
  505. let t = [];
  506. for (var i = 0; i < a.length; i++) {
  507. for (var j = 0; j < b.length; j++) {
  508. if (a[i] == b[j]) {
  509. t.push(a[i]);
  510. }
  511. }
  512. }
  513. return t;
  514. }
  515. function getComplement(a, b) {
  516. let t = [];
  517. let count = false;
  518. for (var i = 0; i < a.length; i++) {
  519. count = false;
  520. for (var j = 0; j < b.length; j++) {
  521. if (a[i] == b[j]) {
  522. count = true;
  523. break;
  524. }
  525. }
  526. if (!count) {
  527. t.push(a[i]);
  528. }
  529. }
  530. return t;
  531. }
  532. function geSpriteStageRect(sp) {
  533. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  534. let rect = {
  535. x: point.x,
  536. y: point.y,
  537. width: sp.width * sp.globalScaleX,
  538. height: sp.height * sp.globalScaleY
  539. };
  540. return rect;
  541. }
  542. function touchButton(button) {
  543. let event = new Laya.Event();
  544. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  545. }
  546. function setColor(sprite, r, g, b) {
  547. var redMat = [
  548. r / 255, 0, 0, 0, 0,
  549. g / 255, 0, 0, 0, 0,
  550. b / 255, 0, 0, 0, 0,
  551. 0, 0, 0, 1, 0,
  552. ];
  553. var filter = new Laya.ColorFilter(redMat);
  554. sprite.filters = [filter];
  555. }
  556. function clone(obj, newobj = {}) {
  557. for (var attr in obj) {
  558. if (typeof obj[attr] == "object") {
  559. newobj[attr] = clone(obj[attr], newobj[attr]);
  560. }
  561. else {
  562. newobj[attr] = obj[attr];
  563. }
  564. }
  565. return newobj;
  566. }
  567. function _ms(arr, compare, begin, end) {
  568. const size = end - begin;
  569. if (size <= 1) {
  570. return;
  571. }
  572. const middle = (end + begin) >> 1;
  573. _ms(arr, compare, begin, middle);
  574. _ms(arr, compare, middle, end);
  575. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  576. return;
  577. }
  578. const merged = [];
  579. let leftIndex = begin, rightIndex = middle;
  580. while (merged.length < size) {
  581. if (leftIndex === middle) {
  582. merged.push(arr[rightIndex++]);
  583. }
  584. else if (rightIndex === end) {
  585. merged.push(arr[leftIndex++]);
  586. }
  587. else {
  588. const c = compare(arr[leftIndex], arr[rightIndex]);
  589. if (c <= 0) {
  590. merged.push(arr[leftIndex++]);
  591. }
  592. else {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. }
  596. }
  597. arr.splice(begin, size, ...merged);
  598. }
  599. function sort(arr, compare) {
  600. if (!Array.isArray(arr)) {
  601. throw new Error('sort的参数必须为数组');
  602. }
  603. _ms(arr, compare, 0, arr.length);
  604. return arr;
  605. }
  606. function getLanguage(id) {
  607. }
  608. function getLanguageByTip(id) {
  609. }
  610. function toWeights(array) {
  611. let max = 0;
  612. for (var i = 0; i < array.length; i++) {
  613. max = max + array[i];
  614. if (array[i] == 0) {
  615. array[i] = 0;
  616. }
  617. else {
  618. array[i] = max;
  619. }
  620. }
  621. return array;
  622. }
  623. function unique(array) {
  624. var n = {}, r = [], len = array.length, val, type;
  625. for (var i = 0; i < array.length; i++) {
  626. val = array[i];
  627. type = typeof val;
  628. if (!n[val]) {
  629. n[val] = [type];
  630. r.push(val);
  631. }
  632. else if (n[val].indexOf(type) < 0) {
  633. n[val].push(type);
  634. r.push(val);
  635. }
  636. }
  637. return r;
  638. }
  639. function unique1(array) {
  640. var r = [];
  641. for (var i = 0, l = array.length; i < l; i++) {
  642. for (var j = i + 1; j < l; j++)
  643. if (array[i] == array[j])
  644. j == ++i;
  645. r.push(array[i]);
  646. }
  647. return r;
  648. }
  649. function getDistance(x1, y1, x2, y2) {
  650. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  651. }
  652. function getV2Dis(pos1, pos2) {
  653. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  654. }
  655. function getV2SqDis(pos1, pos2) {
  656. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  657. }
  658. function getDis(x1, y1, x2, y2) {
  659. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  660. }
  661. function getDeltaxy(x1, y1, x2, y2) {
  662. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  663. }
  664. function getSymbolNumber(num) {
  665. if (num > 0) {
  666. return "+" + num;
  667. }
  668. else if (num < 0) {
  669. return num.toString();
  670. }
  671. return num.toString();
  672. }
  673. function fixNumber(num, length) {
  674. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  675. }
  676. function toThousands(num) {
  677. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  678. }
  679. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  680. function fmtMoney(money) {
  681. money = toThousands(money.replace(/^0+/, ''));
  682. if (money.length == 0) {
  683. money = "0";
  684. }
  685. let unit = 0;
  686. for (var i = 0; i < money.length; i++) {
  687. if (money.charAt(i) == ",") {
  688. unit++;
  689. }
  690. }
  691. if (unit == 0) {
  692. return money;
  693. }
  694. else {
  695. let idx = money.indexOf(",");
  696. if (idx) {
  697. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  698. }
  699. return money.replace(",", ".");
  700. }
  701. }
  702. function flatten(arr) {
  703. while (arr.some(item => Array.isArray(item))) {
  704. arr = [].concat(...arr);
  705. }
  706. return arr;
  707. }
  708. function getDistanceByPoint(p1, p2) {
  709. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  710. }
  711. function getAngleByPoint(p1, p2) {
  712. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  713. }
  714. function toIntByArray(array) {
  715. for (var index = 0; index < array.length; index++) {
  716. array[index] = parseInt(array[index]);
  717. }
  718. return array;
  719. }
  720. function getAngle0To360(angle) {
  721. while (angle < 0) {
  722. angle += 360;
  723. }
  724. while (angle >= 360) {
  725. angle -= 360;
  726. }
  727. return angle;
  728. }
  729. function toAngle(radian) {
  730. return radian * 180 / Math.PI;
  731. }
  732. function toRadian(angle) {
  733. return angle * Math.PI / 180;
  734. }
  735. function getArrayValueRandom(array) {
  736. return array[random(0, array.length - 1)];
  737. }
  738. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  739. }
  740. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function fmtTimeMMSS(time) {
  743. if (time < 0) {
  744. time = 0;
  745. }
  746. else
  747. time = Math.floor(time);
  748. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  749. }
  750. function fmtTimeMS(time) {
  751. if (time < 0) {
  752. time = 0;
  753. }
  754. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  755. }
  756. function fmtTimeHHMM(time) {
  757. if (time < 0) {
  758. time = 0;
  759. }
  760. time = Math.floor(time / 1000);
  761. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  762. }
  763. let severTime = 0;
  764. function getServerTime() {
  765. return new Date(new Date().getTime() - severTime);
  766. }
  767. function setServerTime(data) {
  768. severTime = (new Date().getTime() - data);
  769. }
  770. var tools = /*#__PURE__*/Object.freeze({
  771. playClickEffect: playClickEffect,
  772. getNumList: getNumList,
  773. getStrList: getStrList,
  774. getRandStr: getRandStr,
  775. getUserId: getUserId,
  776. formatPos: formatPos,
  777. setPosInt: setPosInt,
  778. random: random,
  779. randomList: randomList,
  780. worldToScreen: worldToScreen,
  781. getStringLenght: getStringLenght,
  782. reviseString: reviseString,
  783. getCoinString: getCoinString,
  784. getV3Dest: getV3Dest,
  785. getV2Dest: getV2Dest,
  786. getV2Dir: getV2Dir,
  787. getV3Dir: getV3Dir,
  788. copyPos: copyPos,
  789. getScreenImg: getScreenImg,
  790. playMoveByPositions: playMoveByPositions,
  791. setStarPos: setStarPos,
  792. playLoopAnimRotate: playLoopAnimRotate,
  793. playLoopAnimPosition: playLoopAnimPosition,
  794. playLoopAnimScale: playLoopAnimScale,
  795. playLoopAnimRotation: playLoopAnimRotation,
  796. inRect: inRect,
  797. getNumberK: getNumberK,
  798. pointInsideCircle: pointInsideCircle,
  799. formatString: formatString,
  800. getIntersection: getIntersection,
  801. getComplement: getComplement,
  802. geSpriteStageRect: geSpriteStageRect,
  803. touchButton: touchButton,
  804. setColor: setColor,
  805. clone: clone,
  806. sort: sort,
  807. getLanguage: getLanguage,
  808. getLanguageByTip: getLanguageByTip,
  809. toWeights: toWeights,
  810. unique: unique,
  811. unique1: unique1,
  812. getDistance: getDistance,
  813. getV2Dis: getV2Dis,
  814. getV2SqDis: getV2SqDis,
  815. getDis: getDis,
  816. getDeltaxy: getDeltaxy,
  817. getSymbolNumber: getSymbolNumber,
  818. fixNumber: fixNumber,
  819. toThousands: toThousands,
  820. fmtMoney: fmtMoney,
  821. flatten: flatten,
  822. getDistanceByPoint: getDistanceByPoint,
  823. getAngleByPoint: getAngleByPoint,
  824. toIntByArray: toIntByArray,
  825. getAngle0To360: getAngle0To360,
  826. toAngle: toAngle,
  827. toRadian: toRadian,
  828. getArrayValueRandom: getArrayValueRandom,
  829. promptByTip: promptByTip,
  830. promptByErrorCode: promptByErrorCode,
  831. fmtTimeMMSS: fmtTimeMMSS,
  832. fmtTimeMS: fmtTimeMS,
  833. fmtTimeHHMM: fmtTimeHHMM,
  834. getServerTime: getServerTime,
  835. setServerTime: setServerTime
  836. });
  837. class HttpMgr {
  838. constructor() {
  839. HttpMgr._instance = this;
  840. }
  841. static getInstance() {
  842. if (!this._instance) {
  843. this._instance = new HttpMgr();
  844. }
  845. return this._instance;
  846. }
  847. sendPost(url, data, call) {
  848. let httpObj = new Laya.HttpRequest();
  849. httpObj.http.timeout = 5000;
  850. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  851. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  852. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  853. function errorHandler(error) {
  854. console.log("errorHandler:" + error);
  855. }
  856. function completeHandler(data) {
  857. if (data && data.length > 0) {
  858. let jsonData = JSON.parse(data);
  859. if (call)
  860. call(jsonData);
  861. }
  862. }
  863. }
  864. sendGet(url, call) {
  865. let httpObj = new Laya.HttpRequest();
  866. httpObj.http.timeout = 5000;
  867. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  868. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  869. httpObj.send(url, '', 'get');
  870. function errorHandler(error) {
  871. console.log("errorHandler:" + error);
  872. }
  873. function completeHandler(data) {
  874. if (data && data.length > 0) {
  875. if (call)
  876. call(data);
  877. }
  878. }
  879. }
  880. }
  881. HttpMgr._instance = null;
  882. class LightShader extends Laya.Sprite {
  883. constructor() {
  884. super();
  885. this._time = 0;
  886. this._sin = 0;
  887. this.initShader();
  888. }
  889. initShader() {
  890. var vs = `
  891. #define FSHIGHPRECISION
  892. attribute vec4 posuv;
  893. uniform vec2 size;
  894. varying vec4 v_texcoord;
  895. void main() {
  896. vec4 pos = vec4(posuv.xy,0.,1.);
  897. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  898. gl_Position=pos1;
  899. v_texcoord.xy = posuv.xy;
  900. }
  901. `;
  902. var ps = `
  903. #define FSHIGHPRECISION
  904. precision highp float;
  905. varying vec4 v_texcoord;
  906. uniform vec2 size;
  907. uniform sampler2D texture;
  908. uniform float u_Time;
  909. void main() {
  910. vec4 color= texture2D(texture, v_texcoord.xy);
  911. float width = 0.2;
  912. float start = u_Time;
  913. float offset = 1.0;
  914. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  915. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  916. {
  917. color.r=1.1;
  918. color.g=1.1;
  919. color.b=1.1;
  920. gl_FragColor = color;
  921. } else {
  922. gl_FragColor = color;
  923. }
  924. }
  925. `;
  926. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  927. this.customRenderEnable = true;
  928. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  929. }
  930. customRender(context, x, y) {
  931. this.onUpdate();
  932. if (!this.texture)
  933. return;
  934. let xx = x - this.pivotX;
  935. let yy = y - this.pivotY;
  936. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  937. }
  938. onUpdate() {
  939. this._time += 2 * Laya.timer.delta * 0.001;
  940. this._sin = Math.sin(this._time);
  941. if (this._sin > 0.99) {
  942. this._sin = 0;
  943. this._time = 0;
  944. }
  945. this.shaderValue['u_Time'] = this._sin;
  946. }
  947. }
  948. LightShader.DissolveSurfaceSaveName = 9997;
  949. class UIBase extends fairygui.Window {
  950. constructor() {
  951. super();
  952. this.isEject = true;
  953. this.isHide = true;
  954. this.showbanner = true;
  955. this.className = "";
  956. this.isMuti = false;
  957. this.showbanner = false;
  958. this.onConstructor();
  959. }
  960. checkActive(show) {
  961. }
  962. getUIName() {
  963. return UIBase.uiName;
  964. }
  965. onConstructor() {
  966. }
  967. onInit() {
  968. if (!!this.contentPane) {
  969. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  970. }
  971. this.setPivot(0.5, 0.5, false);
  972. }
  973. doShowAnimation() {
  974. if (!this.isEject)
  975. return;
  976. super.doShowAnimation();
  977. Laya.Tween.clearTween(this);
  978. this.scaleX = this.scaleY = 0.8;
  979. let tweenFunc1 = (func) => {
  980. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  981. };
  982. let tweenFunc2 = (func) => {
  983. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  984. };
  985. tweenFunc1(tweenFunc2);
  986. }
  987. show(...args) {
  988. super.show();
  989. this._openParam = args;
  990. this.isHide = false;
  991. xGame.uiMgr.checkUIState();
  992. }
  993. moveBannerButton() {
  994. }
  995. showBannerButton() {
  996. this.bannerButton.visible = true;
  997. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  998. this.bannerButton.touchable = true;
  999. }));
  1000. }
  1001. hide() {
  1002. super.hide();
  1003. this.isHide = true;
  1004. xGame.uiMgr.checkUIState();
  1005. }
  1006. Dispose() {
  1007. super.dispose();
  1008. }
  1009. myUpdate(delay) {
  1010. }
  1011. refresh() { }
  1012. addUIClick(obj, func, arr = null) {
  1013. obj.onClick(this, func, arr);
  1014. obj.onClick(this, this.playBtnSound);
  1015. }
  1016. offUIClick(obj, func) {
  1017. obj.offClick(this, func);
  1018. }
  1019. playBtnSound() {
  1020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1021. }
  1022. }
  1023. UIBase.lastShowBanner = 0;
  1024. UIBase.showBannerNum = 0;
  1025. UIBase.uiName = "";
  1026. class ui_UIDraw extends fgui.GComponent {
  1027. static createInstance() {
  1028. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1029. }
  1030. onConstruct() {
  1031. this.n1 = (this.getChild("n1"));
  1032. this.extraNode = (this.getChild("extraNode"));
  1033. this.myNode = (this.getChild("myNode"));
  1034. this.closeNode = (this.getChild("closeNode"));
  1035. this.moneyNode = (this.getChild("moneyNode"));
  1036. this.n38 = (this.getChild("n38"));
  1037. this.secretary = (this.getChild("secretary"));
  1038. this.drawBtn = (this.getChild("drawBtn"));
  1039. this.talkNode = (this.getChild("talkNode"));
  1040. this.t0 = this.getTransition("t0");
  1041. }
  1042. }
  1043. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1044. class ui_UIBox extends fgui.GComponent {
  1045. static createInstance() {
  1046. return (fgui.UIPackage.createObject("game", "UIBox"));
  1047. }
  1048. onConstruct() {
  1049. this.n0 = (this.getChild("n0"));
  1050. this.n12 = (this.getChild("n12"));
  1051. this.n1 = (this.getChild("n1"));
  1052. this.n2 = (this.getChild("n2"));
  1053. this.bar = (this.getChild("bar"));
  1054. this.closeBtn = (this.getChild("closeBtn"));
  1055. this.openBtn = (this.getChild("openBtn"));
  1056. this.t0 = this.getTransition("t0");
  1057. this.t1 = this.getTransition("t1");
  1058. }
  1059. }
  1060. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1061. class GlobalManager {
  1062. constructor() {
  1063. }
  1064. registerMethod(name, method) {
  1065. console.log('zh: 注册全局方法', name);
  1066. this[name] = method;
  1067. }
  1068. callMethod(name, ...args) {
  1069. console.log('zh: 调用全局方法', name);
  1070. if (this[name]) {
  1071. return this[name](...args);
  1072. }
  1073. else {
  1074. console.error(`zh: 全局方法 Method ${name} not found`);
  1075. }
  1076. }
  1077. }
  1078. GlobalManager.instance = new GlobalManager();
  1079. class JSBridgeUtils {
  1080. constructor() { }
  1081. static get instance() {
  1082. if (!this._instance) {
  1083. this._instance = new JSBridgeUtils();
  1084. }
  1085. return this._instance;
  1086. }
  1087. initBridge() {
  1088. if (!Laya.Browser.onAndroid) {
  1089. console.log('zh:非android dev');
  1090. return;
  1091. }
  1092. let cfg = window['conchConfig'];
  1093. if (cfg) {
  1094. var os = cfg.getOS();
  1095. if (os == "Conch-android") {
  1096. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1097. if (this.bridge) {
  1098. return true;
  1099. }
  1100. else {
  1101. return false;
  1102. }
  1103. }
  1104. else {
  1105. return false;
  1106. }
  1107. }
  1108. else {
  1109. return false;
  1110. }
  1111. }
  1112. testAd1() {
  1113. if (!Laya.Browser.onAndroid) {
  1114. console.log('zh:非android dev');
  1115. return;
  1116. }
  1117. if (!this.initBridge()) {
  1118. return;
  1119. }
  1120. let rs = this.bridge.call("testString", "hello");
  1121. console.log('zh:testString rs=' + rs);
  1122. }
  1123. testAdCallBack() {
  1124. if (!this.initBridge()) {
  1125. return;
  1126. }
  1127. console.log("zh:testAdCallBack start");
  1128. const defaultObj = { code: 200, msg: "req update Ui" };
  1129. const reqObj = { code: 300, msg: "hello java ui" };
  1130. this.bridge.callWithBack((rsStr) => {
  1131. const rsObj = JSON.parse(rsStr);
  1132. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1133. }, "testAsyncCallback", JSON.stringify(reqObj));
  1134. }
  1135. showInternAd(mark) {
  1136. if (!Laya.Browser.onAndroid) {
  1137. console.log('zh:非android dev');
  1138. return false;
  1139. }
  1140. if (!this.initBridge()) {
  1141. return false;
  1142. }
  1143. let rs = this.bridge.call("showInternAd", mark);
  1144. console.log('zh:showInternAd rs= ' + rs + ' ,mark=' + mark);
  1145. try {
  1146. const result = JSON.parse(rs);
  1147. if (result.code === 200) {
  1148. console.log("zh:广告显示成功");
  1149. return true;
  1150. }
  1151. else {
  1152. console.warn("zh:广告显示失败:", result.msg);
  1153. return false;
  1154. }
  1155. }
  1156. catch (e) {
  1157. console.error("zh:解析桥接返回值失败:", e);
  1158. return false;
  1159. }
  1160. }
  1161. showRewardAd(mark) {
  1162. if (!Laya.Browser.onAndroid) {
  1163. console.log('zh:非android dev');
  1164. return false;
  1165. }
  1166. if (!this.initBridge()) {
  1167. return false;
  1168. }
  1169. let rs = this.bridge.call("showRewardAd", mark);
  1170. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1171. try {
  1172. const result = JSON.parse(rs);
  1173. if (result.code === 200) {
  1174. console.log("zh:广告显示成功");
  1175. return true;
  1176. }
  1177. else {
  1178. console.warn("zh:广告显示失败:", result.msg);
  1179. return false;
  1180. }
  1181. }
  1182. catch (e) {
  1183. console.error("zh:解析桥接返回值失败:", e);
  1184. return false;
  1185. }
  1186. }
  1187. nativeCallJs(msg) {
  1188. console.log("zh:nativeCallJs received data: 1111", msg);
  1189. if (msg === 'Ad1') {
  1190. GlobalManager.instance.callMethod('Ad1');
  1191. console.log("zh: Ad1 奖励发送成功");
  1192. }
  1193. else if (msg === 'Ad2') {
  1194. GlobalManager.instance.callMethod('Ad2');
  1195. console.log("zh: Ad2 奖励发送成功");
  1196. }
  1197. else if (msg === 'Ad3') {
  1198. GlobalManager.instance.callMethod('Ad3');
  1199. console.log("zh: Ad3 奖励发送成功");
  1200. }
  1201. else if (msg === 'Ad4') {
  1202. GlobalManager.instance.callMethod('Ad4');
  1203. console.log("zh: Ad4 奖励发送成功");
  1204. }
  1205. else if (msg === 'Ad5') {
  1206. console.log("zh: Ad5 奖励发送成功");
  1207. GlobalManager.instance.callMethod('Ad5');
  1208. }
  1209. }
  1210. }
  1211. class UIBox extends UIBase {
  1212. constructor() {
  1213. super();
  1214. this.boxNum = 0;
  1215. this.boxMax = 10;
  1216. this.inAd = false;
  1217. this.isClose = false;
  1218. }
  1219. onConstructor() {
  1220. this.ui = ui_UIBox.createInstance();
  1221. this.contentPane = this.ui;
  1222. this.isEject = false;
  1223. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1224. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1225. Laya.timer.loop(1000, this, this.update);
  1226. }
  1227. update() {
  1228. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1229. this.boxNum -= 1;
  1230. this.upBar();
  1231. }
  1232. }
  1233. upBar() {
  1234. if (this.boxNum > this.boxMax)
  1235. this.boxNum = this.boxMax;
  1236. this.ui.bar.value = this.boxNum * 10;
  1237. }
  1238. show() {
  1239. super.show();
  1240. this.isClose = false;
  1241. this.boxNum = 0;
  1242. this.inAd = false;
  1243. this.upBar();
  1244. this.ui.t0.play();
  1245. this.ui.closeBtn.visible = false;
  1246. Laya.timer.once(3000, this, () => {
  1247. this.ui.closeBtn.visible = true;
  1248. this.ui.bar.alpha = 1;
  1249. });
  1250. Laya.timer.once(500, this, () => {
  1251. this.ui.t1.play();
  1252. });
  1253. }
  1254. hide() {
  1255. Laya.timer.clearAll(this);
  1256. Moyu.showBannerAd(false);
  1257. super.hide();
  1258. }
  1259. onOpenBox() {
  1260. this.boxNum++;
  1261. if (this.boxNum < this.boxMax) {
  1262. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  1263. Moyu.showInsertAd(0, PlatMgr.insertGap);
  1264. }
  1265. else if (this.boxNum == this.boxMax) {
  1266. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1267. this.ui.openBtn.c1.selectedIndex = 13;
  1268. this.inAd = true;
  1269. }
  1270. else
  1271. this.getAward();
  1272. }
  1273. else if (this.inAd) {
  1274. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1275. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1276. }
  1277. else {
  1278. console.log('zh:AD 失败,直接发放奖励');
  1279. this.qjff_AD_for_UIBOX_onOpenBox();
  1280. }
  1281. }
  1282. this.upBar();
  1283. }
  1284. qjff_AD_for_UIBOX_onOpenBox() {
  1285. this.getAward();
  1286. }
  1287. onCloseBox() {
  1288. if (this.isClose)
  1289. this.hide();
  1290. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1291. this.isClose = true;
  1292. PlatMgr.showBanner(true, 0, 3000);
  1293. }
  1294. else
  1295. this.hide();
  1296. }
  1297. getAward() {
  1298. let str = "";
  1299. if (Math.random() < 0.5) {
  1300. let max = Moyu.isLegal ? 500 : 2500;
  1301. let num = xGame.tools.random(max, 500 + max);
  1302. DataMgr.setCoin(num);
  1303. str = "金币x" + num;
  1304. }
  1305. else {
  1306. let max = Moyu.isLegal ? 10 : 30;
  1307. let num = xGame.tools.random(max, 30 + max);
  1308. DataMgr.setDiamond(num);
  1309. str = "钻石x" + num;
  1310. }
  1311. xGame.showTip("恭喜获得-" + str);
  1312. this.hide();
  1313. }
  1314. }
  1315. UIBox.uiName = "UIBox";
  1316. class ui_UITry extends fgui.GComponent {
  1317. static createInstance() {
  1318. return (fgui.UIPackage.createObject("game", "UITry"));
  1319. }
  1320. onConstruct() {
  1321. this.n11 = (this.getChild("n11"));
  1322. this.myNode = (this.getChild("myNode"));
  1323. this.t0 = this.getTransition("t0");
  1324. }
  1325. }
  1326. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1327. class UITry extends UIBase {
  1328. constructor() {
  1329. super();
  1330. this.closeTime = 0;
  1331. this.closeNum = 0;
  1332. this.skillUrl = xGame.common.skillIconList;
  1333. }
  1334. onConstructor() {
  1335. this.ui = ui_UITry.createInstance();
  1336. this.contentPane = this.ui;
  1337. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1338. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1339. }
  1340. show() {
  1341. super.show();
  1342. this.closeNum = 0;
  1343. this.closeTime = 15;
  1344. this.ui.t0.play();
  1345. PlatMgr.showRateBanner();
  1346. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1347. Laya.timer.loop(1000, this, this.updateTime);
  1348. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1349. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1350. xGame.common.gameMgr.gamePause = true;
  1351. }
  1352. updateTime() {
  1353. if (this.closeTime > 1) {
  1354. this.closeTime--;
  1355. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1356. }
  1357. else
  1358. this.hide();
  1359. }
  1360. hide() {
  1361. Laya.timer.clearAll(this);
  1362. Moyu.showBannerAd(false);
  1363. super.hide();
  1364. xGame.common.gameMgr.gamePause = false;
  1365. }
  1366. onTry() {
  1367. console.log('zh:qjff_AD_for_uitry');
  1368. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1369. }
  1370. else {
  1371. console.log('zh:AD 失败,直接发放奖励');
  1372. this.qjff_AD_for_uitry();
  1373. }
  1374. }
  1375. qjff_AD_for_uitry() {
  1376. let select = xGame.common.curPlayerSkillType;
  1377. DataMgr.gameData.trySkill = select;
  1378. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1379. DataMgr.saveGameData();
  1380. DataMgr.setBigSkill(select, 1);
  1381. xGame.showTip("Trial Successful");
  1382. this.hide();
  1383. }
  1384. onCancel() {
  1385. if (this.closeNum > 0) {
  1386. this.closeNum--;
  1387. if (this.closeNum < 2)
  1388. this.hide();
  1389. return;
  1390. }
  1391. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1392. this.onTry();
  1393. }
  1394. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1395. this.closeNum = 3;
  1396. }
  1397. else
  1398. this.hide();
  1399. }
  1400. }
  1401. UITry.uiName = "UITry";
  1402. class PlatMgr {
  1403. static initConfig() {
  1404. this.lastVt = 0;
  1405. if (!Moyu.platConfig)
  1406. return;
  1407. for (let k in Moyu.platConfig) {
  1408. let pd = this[k];
  1409. let pc = Moyu.platConfig[k];
  1410. if (pd != undefined && pc != undefined)
  1411. this[k] = pc;
  1412. }
  1413. Moyu.setBannerPos(0.5, 1);
  1414. }
  1415. static rand100(num) {
  1416. return xGame.tools.random(0, 100) < num;
  1417. }
  1418. static isMisVideo() {
  1419. let dt = Laya.timer.currTimer - this.lastVt;
  1420. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1421. this.lastVt = Laya.timer.currTimer;
  1422. return true;
  1423. }
  1424. else {
  1425. if (this.rand100(this.fullVideoRate))
  1426. Moyu.showInsertAd(0, 0, 'full');
  1427. return false;
  1428. }
  1429. }
  1430. static showVideo(call, type) {
  1431. Moyu.showVideoAd(() => {
  1432. this.lastVt = Laya.timer.currTimer;
  1433. call && call();
  1434. }, type);
  1435. }
  1436. static showInsert(delay = false) {
  1437. if (this.getRand() < this.insertRate) {
  1438. let dt = delay ? this.insertDelay : 0;
  1439. Moyu.showInsertAd(dt, this.insertGap);
  1440. }
  1441. }
  1442. static gameInsert() {
  1443. if (this.getRand() < this.gameInsertRate) {
  1444. console.log('zh: 游戏中插屏 hhhhhhhhhhhhhhhhhh');
  1445. Moyu.showInsertAd(xGame.tools.random(2000, 5100), this.insertGap);
  1446. }
  1447. }
  1448. static showRateBanner() {
  1449. if (this.getRand() < this.bannerRate)
  1450. this.showBanner(true, this.bannerDelay, 3000);
  1451. }
  1452. static showBanner(show, delay = 0, hide = 0) {
  1453. if (!show)
  1454. Moyu.showBannerAd(false);
  1455. else {
  1456. Laya.timer.clear(this, this.bannerShow);
  1457. if (delay > 0)
  1458. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1459. else
  1460. this.bannerShow(true);
  1461. if (hide > 0)
  1462. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1463. }
  1464. }
  1465. static bannerShow(show) {
  1466. Moyu.showBannerAd(show);
  1467. console.log("showBanner" + show);
  1468. }
  1469. static getRand() {
  1470. return xGame.tools.random(0, 100);
  1471. }
  1472. static openBox() {
  1473. if (this.getRand() < this.boxRate)
  1474. xGame.uiMgr.Show(UIBox);
  1475. }
  1476. static openTry() {
  1477. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1478. return;
  1479. if (this.getRand() < this.tryRate)
  1480. xGame.uiMgr.Show(UITry);
  1481. else if (DataMgr.gameData.gameCount == 1)
  1482. xGame.uiMgr.Show(UITry);
  1483. }
  1484. }
  1485. PlatMgr.forceShare = 0;
  1486. PlatMgr.signAdRate = 0;
  1487. PlatMgr.forceVideoRate = 0;
  1488. PlatMgr.forceVideoGap = 0;
  1489. PlatMgr.fullVideoRate = 0;
  1490. PlatMgr.gameInsertRate = 0;
  1491. PlatMgr.insertGap = 0;
  1492. PlatMgr.insertDelay = 0;
  1493. PlatMgr.insertRate = 0;
  1494. PlatMgr.boxRate = 0;
  1495. PlatMgr.boxVideoRate = 0;
  1496. PlatMgr.boxInsertRate = 0;
  1497. PlatMgr.boxBannerRate = 0;
  1498. PlatMgr.tryRate = 0;
  1499. PlatMgr.tryClose3Rate = 0;
  1500. PlatMgr.tryVideoRate = 0;
  1501. PlatMgr.bannerRate = 0;
  1502. PlatMgr.lastVt = 0;
  1503. class ui_UIAddProp extends fgui.GComponent {
  1504. static createInstance() {
  1505. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1506. }
  1507. onConstruct() {
  1508. this.n11 = (this.getChild("n11"));
  1509. this.myNode = (this.getChild("myNode"));
  1510. this.closeBtn = (this.getChild("closeBtn"));
  1511. this.t0 = this.getTransition("t0");
  1512. }
  1513. }
  1514. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1515. class SpineMgr {
  1516. constructor(name, loadCb = null) {
  1517. this.loaded = false;
  1518. this.spineName = '';
  1519. this.loadedCallback = loadCb;
  1520. this.templet = new Laya.Templet();
  1521. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1522. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1523. if (name === 'mishu') {
  1524. this.templet.loadAni('spine/nvmishu.sk');
  1525. }
  1526. else {
  1527. this.templet.loadAni(`spine/${name}.sk`);
  1528. }
  1529. this.templet.lock = true;
  1530. this.spineName = name;
  1531. }
  1532. onError() {
  1533. console.log("zh:spine加载出错");
  1534. }
  1535. parseComplete() {
  1536. this.loaded = true;
  1537. this.loadedCallback && this.loadedCallback();
  1538. }
  1539. dispose() {
  1540. if (this.templet && !this.templet.destroyed) {
  1541. this.templet.destroy();
  1542. }
  1543. this.templet = null;
  1544. }
  1545. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1546. if (!this.loaded) {
  1547. return;
  1548. }
  1549. let spine;
  1550. if (mySpine) {
  1551. spine = mySpine;
  1552. }
  1553. else {
  1554. spine = this.createSpine(data, parent);
  1555. }
  1556. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1557. if (!isLoop) {
  1558. spine.on(Laya.Event.STOPPED, this, () => {
  1559. spine.offAll(Laya.Event.STOPPED);
  1560. callback && callback(spine);
  1561. });
  1562. }
  1563. return spine;
  1564. }
  1565. createSpine(data, parent, type = 1) {
  1566. let spine;
  1567. spine = this.templet.buildArmature(type);
  1568. spine.showSkinByIndex(0);
  1569. parent.addChild(spine);
  1570. spine.pos(data.x, data.y);
  1571. spine.scale(data.scaleX, data.scaleY, true);
  1572. return spine;
  1573. }
  1574. }
  1575. var AIState;
  1576. (function (AIState) {
  1577. AIState[AIState["none"] = 0] = "none";
  1578. AIState[AIState["idle"] = 1] = "idle";
  1579. AIState[AIState["reset"] = 2] = "reset";
  1580. AIState[AIState["move"] = 3] = "move";
  1581. AIState[AIState["wait"] = 4] = "wait";
  1582. AIState[AIState["select"] = 5] = "select";
  1583. AIState[AIState["turn"] = 6] = "turn";
  1584. AIState[AIState["shoot"] = 7] = "shoot";
  1585. AIState[AIState["leave"] = 8] = "leave";
  1586. })(AIState || (AIState = {}));
  1587. class AIPlayer {
  1588. constructor() {
  1589. this.dtime = 30;
  1590. this.awayTime = 0;
  1591. this.awayNum = 0;
  1592. this.hideTime = 0;
  1593. this.rootMoveTime = 0;
  1594. this.isGuide = false;
  1595. this.state = AIState.none;
  1596. this.waitTime = 0;
  1597. this.forceNum = 0;
  1598. this.forceMax = 0;
  1599. this.ballSize = 33;
  1600. this.selectNum = 0;
  1601. this.destRot = 0;
  1602. this.aiLv = 10;
  1603. this.kickBall = [];
  1604. this.lineBall = [];
  1605. this.scoreBall = [];
  1606. this.holeBall = [];
  1607. this.turnNum = 0;
  1608. this.setNum = 0;
  1609. this.setMax = 0;
  1610. this.setRate = 0;
  1611. this.rectL = 0;
  1612. this.rectR = 0;
  1613. this.rectT = 0;
  1614. this.rectB = 0;
  1615. this.rootPos = { x: 0, y: 0 };
  1616. this.bestForce = 0;
  1617. this.bestAngle = 180;
  1618. this.bestPos = { x: 0, y: 0 };
  1619. this.bestKick = { x: 0, y: 0 };
  1620. this.posList = [];
  1621. this.posIdx = 0;
  1622. this.chatTime = 3000;
  1623. this.tempDir1 = new Laya.Vector2();
  1624. this.tempDir2 = new Laya.Vector2();
  1625. this.tempDir3 = new Laya.Vector2();
  1626. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1627. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1628. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1629. this.gameSrc = xGame.common.gameUI;
  1630. this.hideTime = Laya.timer.currTimer;
  1631. Moyu.setOnTipCall((id) => {
  1632. if (id == 20012)
  1633. this.hideTime = Laya.timer.currTimer;
  1634. else
  1635. (id == 20011);
  1636. {
  1637. let dt = Laya.timer.currTimer - this.hideTime;
  1638. console.log("onshow" + dt);
  1639. if (dt > 30000 && this.state > AIState.none)
  1640. xGame.common.gameMgr.aiGameEnd(false);
  1641. }
  1642. }, this);
  1643. }
  1644. init() {
  1645. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1646. this.awayTime = xGame.tools.random(5000, 10000);
  1647. this.awayNum = 0;
  1648. this.hideTime = Laya.timer.currTimer;
  1649. let rect = xGame.common.d2World.borderRect;
  1650. this.rectL = Math.ceil(rect.x) + 17;
  1651. this.rectT = Math.ceil(rect.y) + 17;
  1652. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1653. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1654. this.wBall = xGame.common.d2World.rootBall;
  1655. this.ballSize = this.wBall.gameObj.width - 1;
  1656. if (this.posList.length < 1) {
  1657. let dp = 40;
  1658. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1659. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1660. let dx = i < this.rectR ? i : this.rectR;
  1661. let dy = j < this.rectB ? j : this.rectB;
  1662. let order = xGame.tools.random(0, 1000);
  1663. this.posList.push({ x: dx, y: dy, order: order });
  1664. }
  1665. }
  1666. this.posList.sort(function (a, b) {
  1667. return a.order - b.order;
  1668. });
  1669. this.setMax = this.posList.length;
  1670. }
  1671. this.state = AIState.idle;
  1672. }
  1673. setAiLevel(num) {
  1674. this.aiLv = num;
  1675. }
  1676. initBall() {
  1677. this.rootPos.x = this.wBall.gameObj.x;
  1678. this.rootPos.y = this.wBall.gameObj.y;
  1679. this.initHoleBall();
  1680. }
  1681. initHoleBall() {
  1682. this.kickBall = [];
  1683. this.lineBall = [];
  1684. this.scoreBall = [];
  1685. this.holeBall = [];
  1686. this.selectNum = 0;
  1687. this.forceNum = 0;
  1688. this.forceMax = 0;
  1689. this.turnNum = 0;
  1690. let list = xGame.common.d2World.ballArr;
  1691. if (list.length < 20 && !this.isGuide) {
  1692. let holes = xGame.common.gameMgr.holePosList;
  1693. for (let i = 0; i < list.length; i++) {
  1694. let obj = list[i];
  1695. if (!obj)
  1696. continue;
  1697. obj.kickPos.x = 0;
  1698. obj.kickPos.y = 0;
  1699. obj.poleAngle = 0;
  1700. obj.hard = 0;
  1701. obj.borderDis = 0;
  1702. obj.kickAngle = 180;
  1703. if (obj.number == 0)
  1704. continue;
  1705. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1706. continue;
  1707. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1708. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1709. continue;
  1710. }
  1711. let b = obj.gameObj;
  1712. let wbp = this.rootPos;
  1713. let bx = wbp.x - b.x;
  1714. let by = wbp.y - b.y;
  1715. obj.borderDis = xGame.tools.random(0, 100);
  1716. this.kickBall.push(obj);
  1717. if (!this.isLine(wbp, obj))
  1718. continue;
  1719. obj.kickAngle = xGame.tools.random(90, 180);
  1720. obj.kickPos.x = b.x;
  1721. obj.kickPos.y = b.y;
  1722. this.lineBall.push(obj);
  1723. let minDis = 999999;
  1724. let hole = false;
  1725. for (let j = 0; j < holes.length; j++) {
  1726. let hp = holes[j];
  1727. if (bx >= 0 && hp.x > b.x + 100)
  1728. continue;
  1729. if (bx <= 0 && hp.x < b.x - 100)
  1730. continue;
  1731. if (by < -10 && hp.y < wbp.y)
  1732. continue;
  1733. if (by > 10 && hp.y > wbp.y)
  1734. continue;
  1735. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1736. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1737. if (dis < minDis) {
  1738. let dx = b.x - this.tempDir1.x * this.ballSize;
  1739. let dy = b.y - this.tempDir1.y * this.ballSize;
  1740. this.tempDir3.x = this.tempDir1.x;
  1741. this.tempDir3.y = this.tempDir1.y;
  1742. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1743. obj.kickPos.x = dx;
  1744. obj.kickPos.y = dy;
  1745. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1746. if (num > 1)
  1747. num = 1;
  1748. obj.kickAngle = Math.acos(num) * 57.3;
  1749. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1750. dis = dis * 2;
  1751. if (Math.abs(hp.x - 600) < 100)
  1752. dis += 50;
  1753. obj.hard = dis + obj.kickAngle * 3;
  1754. hole = true;
  1755. }
  1756. }
  1757. }
  1758. }
  1759. if (hole) {
  1760. this.scoreBall.push(obj);
  1761. this.holeBall.push(obj);
  1762. }
  1763. }
  1764. this.scoreBall.sort(function (a, b) {
  1765. return a.hard - b.hard;
  1766. });
  1767. this.holeBall.sort(function (a, b) {
  1768. return a.kickAngle - b.kickAngle;
  1769. });
  1770. this.kickBall.sort(function (a, b) {
  1771. return a.borderDis - b.borderDis;
  1772. });
  1773. }
  1774. else {
  1775. let max = list.length - 1;
  1776. let i = xGame.tools.random(0, max);
  1777. for (i; i <= max; i++) {
  1778. let idx = i >= max ? i -= max : i;
  1779. let obj = list[idx];
  1780. if (obj && obj.number != 0) {
  1781. obj.kickAngle = xGame.tools.random(90, 180);
  1782. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1783. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1784. this.lineBall.push(obj);
  1785. break;
  1786. }
  1787. }
  1788. }
  1789. }
  1790. selectBall() {
  1791. let ball = null;
  1792. this.destRot = 0;
  1793. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1794. let ai = 110 - this.aiLv * 10;
  1795. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1796. let score = false;
  1797. if (this.scoreBall.length < 1) {
  1798. if (this.lineBall.length < 1) {
  1799. for (let i = 0; i < this.kickBall.length; i++) {
  1800. let list = [];
  1801. let bo = this.kickBall[i];
  1802. let bobj = bo.gameObj;
  1803. let rect = xGame.common.d2World.borderRect;
  1804. let mobj = this.wBall.gameObj;
  1805. let minb = bobj.y - rect.y - 20;
  1806. let minw = mobj.y - rect.y - 50;
  1807. if (minb > 0 && minw > 0) {
  1808. let dlenx = 0;
  1809. let dleny = mobj.y - rect.y;
  1810. let spx = mobj.x;
  1811. let spy = rect.y - dleny;
  1812. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1813. }
  1814. minb = rect.y + rect.height - bobj.y - 20;
  1815. minw = rect.y + rect.height - mobj.y - 50;
  1816. if (minb > 0 && minw > 0) {
  1817. let dlenx = 0;
  1818. let dleny = rect.y + rect.height - mobj.y;
  1819. let spx = mobj.x;
  1820. let spy = rect.y + rect.height + dleny;
  1821. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1822. }
  1823. minb = bobj.x - rect.x - 20;
  1824. minw = mobj.x - rect.x - 50;
  1825. if (minb > 0 && minw > 0) {
  1826. let dlenx = mobj.x - rect.x;
  1827. let dleny = 0;
  1828. let spx = rect.x - dlenx;
  1829. let spy = mobj.y;
  1830. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1831. }
  1832. minb = rect.x + rect.width - bobj.x - 20;
  1833. minw = rect.x + rect.width - mobj.x - 50;
  1834. if (minb > 0 && minw > 0) {
  1835. let dlenx = rect.x + rect.width - mobj.x;
  1836. let dleny = 0;
  1837. let spx = rect.x + rect.width + dlenx;
  1838. let spy = mobj.y;
  1839. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1840. }
  1841. list.sort(function (a, b) {
  1842. return a.order - b.order;
  1843. });
  1844. for (let i = 0; i < list.length; i++) {
  1845. let data = list[i];
  1846. let mx = mobj.x - bobj.x;
  1847. let my = mobj.y - bobj.y;
  1848. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1849. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1850. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1851. if (num > 1)
  1852. num = 1;
  1853. let cos = Math.acos(num);
  1854. if (cos > 1.57)
  1855. cos = 1.57;
  1856. else if (cos < 0.01)
  1857. cos = 0.01;
  1858. let tan = Math.tan(cos);
  1859. let dx = tan * data.dleny;
  1860. let dy = tan * data.dlenx;
  1861. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1862. if (Math.abs(bx - 667) < 40)
  1863. continue;
  1864. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1865. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1866. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1867. this.forceMax = dis * 0.08;
  1868. this.destRot += mis * 0.1;
  1869. this.setKick(bx, by);
  1870. return true;
  1871. }
  1872. }
  1873. }
  1874. }
  1875. else {
  1876. ball = xGame.common.getRandArrEle(this.lineBall);
  1877. }
  1878. }
  1879. else {
  1880. for (let i = 0; i < this.scoreBall.length; i++) {
  1881. if (i < this.scoreBall.length - 1) {
  1882. let rand = 70 + this.aiLv * 10 + i * 10;
  1883. if (xGame.tools.random(0, 100) < rand) {
  1884. ball = this.scoreBall[i];
  1885. break;
  1886. }
  1887. }
  1888. else {
  1889. ball = this.scoreBall[i];
  1890. break;
  1891. }
  1892. }
  1893. score = true;
  1894. this.selectNum++;
  1895. }
  1896. if (!ball)
  1897. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1898. if (this.selectNum >= max) {
  1899. let dx = ball.gameObj.x;
  1900. let dy = ball.gameObj.y;
  1901. let kickAngle = 0;
  1902. if (score) {
  1903. dx = ball.kickPos.x;
  1904. dy = ball.kickPos.y;
  1905. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1906. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1907. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1908. if (adot > 1)
  1909. adot = 1;
  1910. kickAngle = Math.acos(adot) * 57.3;
  1911. if (kickAngle > 45) {
  1912. let kdx = ball.kickPos.x - ball.gameObj.x;
  1913. let kdy = ball.kickPos.y - ball.gameObj.y;
  1914. dx = ball.kickPos.x - kdx * mis * 0.3;
  1915. dy = ball.kickPos.y - kdy * mis * 0.3;
  1916. }
  1917. else
  1918. this.destRot += mis;
  1919. }
  1920. else if (ball.poleAngle != 0) {
  1921. this.destRot += ball.poleAngle;
  1922. }
  1923. if (xGame.common.gameMode == 0) {
  1924. let af = kickAngle * 0.08;
  1925. this.forceMax = ball.hard * 0.1 + af * af;
  1926. }
  1927. this.setKick(dx, dy);
  1928. }
  1929. else {
  1930. let rand = this.aiLv * 5 + 40;
  1931. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1932. ball = xGame.common.getRandArrEle(this.scoreBall);
  1933. else
  1934. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1935. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1936. if (xGame.tools.random(0, 100) > rand) {
  1937. this.selectNum = max;
  1938. }
  1939. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1940. this.selectNum++;
  1941. }
  1942. ball.onClick(0, true);
  1943. }
  1944. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1945. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1946. let balls = xGame.common.d2World.ballArr;
  1947. let max = xGame.tools.getDis(hx, hy, bx, by);
  1948. for (let index = 0; index < balls.length; index++) {
  1949. let obj = balls[index];
  1950. if (obj.number == 0)
  1951. continue;
  1952. if (obj.number == bn || obj.number == dn)
  1953. continue;
  1954. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1955. if (dis * dis > max)
  1956. continue;
  1957. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1958. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1959. if (num > 1)
  1960. num = 1;
  1961. if (num < 0)
  1962. continue;
  1963. let gap = Math.sin(Math.acos(num)) * dis;
  1964. if (gap < this.ballSize)
  1965. return true;
  1966. }
  1967. return false;
  1968. }
  1969. isLine(xy, ball) {
  1970. let bx = xy.x;
  1971. let by = xy.y;
  1972. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  1973. let dis = ball.getDestDis(xy);
  1974. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  1975. let sin = Math.sin(angle);
  1976. let cos = Math.cos(angle);
  1977. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1978. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1979. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1980. let dx = bx + this.tempDir2.x * dis;
  1981. let dy = by + this.tempDir2.y * dis;
  1982. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  1983. sin = Math.sin(-angle);
  1984. cos = Math.cos(-angle);
  1985. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1986. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1987. dx = bx + this.tempDir2.x * dis;
  1988. dy = by + this.tempDir2.y * dis;
  1989. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  1990. if (isr && isl)
  1991. return false;
  1992. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  1993. }
  1994. return true;
  1995. }
  1996. turnPole() {
  1997. this.turnNum++;
  1998. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  1999. let dr = rot - this.destRot;
  2000. let abs = Math.abs(dr) % 360;
  2001. if (abs > 180) {
  2002. if (rot > 180)
  2003. rot -= 360;
  2004. if (this.destRot > 180)
  2005. this.destRot -= 360;
  2006. }
  2007. let max = this.turnNum * 5 + this.aiLv * 5;
  2008. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2009. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2010. let at = xGame.tools.random(1000, 2000);
  2011. if (!this.onAway(3))
  2012. at += xGame.tools.random(10000, 15000);
  2013. this.setState(AIState.shoot, at);
  2014. }
  2015. else {
  2016. let mr = 0;
  2017. if (abs > 3)
  2018. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2019. else if (Math.random() > 0.6)
  2020. mr = xGame.tools.random(1, 10) * 0.1;
  2021. mr = dr > 0 ? -mr : mr;
  2022. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2023. }
  2024. }
  2025. setKick(dx, dy) {
  2026. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2027. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2028. this.tempDir1.x = 0;
  2029. this.tempDir1.y = 1;
  2030. this.tempDir2.y = -this.tempDir2.y;
  2031. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2032. if (num > 1)
  2033. num = 1;
  2034. let rot = Math.acos(num) * 57.3;
  2035. if (this.tempDir2.x < 0)
  2036. rot = 360 - rot;
  2037. this.destRot += rot;
  2038. if (!xGame.common.gameMgr.finishOneShoot) {
  2039. this.forceMax += xGame.tools.random(10, 50);
  2040. this.forceMax -= this.aiLv * 2;
  2041. if (this.forceMax < 20)
  2042. this.forceMax = 20;
  2043. }
  2044. if (this.forceMax > 100)
  2045. this.forceMax = 101;
  2046. else if (this.forceMax < 10)
  2047. this.forceMax += xGame.tools.random(0, 10);
  2048. if (xGame.common.gameMode == 1)
  2049. this.forceMax = xGame.tools.random(80, 100);
  2050. else
  2051. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2052. let max = 2000 - this.aiLv * 100;
  2053. if (Math.random() > 0.8)
  2054. max += xGame.tools.random(100, 2000);
  2055. this.setState(AIState.turn, xGame.tools.random(500, max));
  2056. }
  2057. shoot() {
  2058. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2059. if (Math.random() > 0.8) {
  2060. this.gameSrc.aiForce(1);
  2061. this.setState(AIState.wait);
  2062. }
  2063. }
  2064. else {
  2065. let df = xGame.tools.random(3, 8);
  2066. if (this.forceNum < this.forceMax)
  2067. this.forceNum += df;
  2068. else
  2069. this.forceNum -= df;
  2070. let startY = this.gameSrc.ui.powerNode.y;
  2071. let height = this.gameSrc.ui.powerNode.height;
  2072. let force = startY + height * this.forceNum * 0.01;
  2073. this.gameSrc.aiForce(2, force);
  2074. }
  2075. }
  2076. reset() {
  2077. for (let i = 0; i < 4; i++) {
  2078. this.setRate--;
  2079. this.setNum++;
  2080. let pos = this.posList[this.posIdx];
  2081. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2082. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2083. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2084. this.rootPos.x = 387;
  2085. if (this.rootPos.x < this.rectL)
  2086. this.rootPos.x = this.rectL;
  2087. else if (this.rootPos.x > this.rectR)
  2088. this.rootPos.x = this.rectR;
  2089. if (this.rootPos.y < this.rectT)
  2090. this.rootPos.y = this.rectT;
  2091. else if (this.rootPos.y > this.rectB)
  2092. this.rootPos.y = this.rectB;
  2093. this.posIdx++;
  2094. let max = this.posList.length;
  2095. if (this.posIdx >= max)
  2096. this.posIdx -= max;
  2097. this.initHoleBall();
  2098. let ball = null;
  2099. if (this.scoreBall.length > 0)
  2100. ball = this.scoreBall[0];
  2101. else if (this.lineBall.length > 0)
  2102. ball = xGame.common.getRandArrEle(this.lineBall);
  2103. if (ball && ball.kickAngle < this.bestAngle) {
  2104. this.bestAngle = ball.kickAngle;
  2105. this.bestKick.x = ball.kickPos.x;
  2106. this.bestKick.y = ball.kickPos.y;
  2107. this.bestPos.x = this.rootPos.x;
  2108. this.bestPos.y = this.rootPos.y;
  2109. this.bestForce = ball.hard * 0.08;
  2110. }
  2111. }
  2112. if (this.setNum >= this.setMax)
  2113. this.setMax = 0;
  2114. if (this.setRate < 1) {
  2115. this.setState(AIState.move, 0);
  2116. this.rootMoveTime = Laya.timer.currTimer;
  2117. this.gameSrc.aiRootMove(true);
  2118. }
  2119. }
  2120. delayLine() {
  2121. this.gameSrc.aiRootMove(false);
  2122. }
  2123. move() {
  2124. if (this.bestPos.x < 1)
  2125. this.bestPos = this.rootPos;
  2126. let wObj = this.wBall.gameObj;
  2127. let destx = wObj.x;
  2128. let desty = wObj.y;
  2129. let dx = Math.abs(destx - this.bestPos.x);
  2130. let dy = Math.abs(desty - this.bestPos.y);
  2131. let mx = 3 + dx * 0.03;
  2132. let my = 3 + dy * 0.03;
  2133. if (dx < 4 && dy < 4) {
  2134. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2135. dt = dt < 1000 ? 1000 - dt : 0;
  2136. if (this.setMax > 0) {
  2137. let min = this.setMax * 0.3 + this.aiLv * 5;
  2138. this.setRate = xGame.tools.random(min, this.setMax);
  2139. this.setState(AIState.reset, 0);
  2140. }
  2141. else {
  2142. this.destRot = 0;
  2143. this.forceMax = this.bestForce;
  2144. this.setKick(this.bestKick.x, this.bestKick.y);
  2145. }
  2146. if (dt > 100) {
  2147. Laya.timer.clear(this, this.delayLine);
  2148. Laya.timer.once(dt, this, this.delayLine);
  2149. }
  2150. else
  2151. this.gameSrc.aiRootMove(false);
  2152. }
  2153. else {
  2154. if (dx > 4)
  2155. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2156. if (dy > 4)
  2157. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2158. this.gameSrc.onRootMove({ x: destx, y: desty });
  2159. }
  2160. }
  2161. resetRoot() {
  2162. this.bestAngle = 180;
  2163. this.bestForce = 0;
  2164. this.setMax = this.posList.length;
  2165. this.posIdx = xGame.tools.random(0, this.setMax);
  2166. let min = this.setMax * 0.3 + this.aiLv * 5;
  2167. this.setRate = xGame.tools.random(min, this.setMax);
  2168. let max = 2000 - this.aiLv * 100;
  2169. if (Math.random() > 0.8)
  2170. max += xGame.tools.random(100, 1000);
  2171. if (this.isGuide)
  2172. this.setState(AIState.select, 500);
  2173. else if (this.onAway(2))
  2174. this.setState(AIState.reset, xGame.tools.random(400, max));
  2175. else
  2176. this.setState(AIState.none);
  2177. if (xGame.common.gameMgr.finishOneShoot)
  2178. this.chat();
  2179. }
  2180. runAI() {
  2181. if (this.state > AIState.idle)
  2182. return;
  2183. this.initBall();
  2184. this.onGame(2500);
  2185. if (Math.random() > 0.6)
  2186. this.chat();
  2187. }
  2188. stopRun() {
  2189. this.setState(AIState.idle);
  2190. }
  2191. onGame(base) {
  2192. let max = base - this.aiLv * 100;
  2193. if (Math.random() > 0.8)
  2194. max += xGame.tools.random(100, 1000);
  2195. if (this.onAway(2))
  2196. this.setState(AIState.select, xGame.tools.random(500, max));
  2197. else
  2198. this.setState(AIState.none);
  2199. }
  2200. setState(sta, wt = 0) {
  2201. if (this.state == AIState.none)
  2202. return;
  2203. this.state = sta;
  2204. this.waitTime = wt;
  2205. }
  2206. onUpdate() {
  2207. if (this.state == AIState.none)
  2208. return;
  2209. this.awayTime -= this.dtime;
  2210. if (this.awayTime < 1) {
  2211. this.awayTime = xGame.tools.random(6000, 10000);
  2212. this.awayNum += (11 - this.aiLv);
  2213. this.onAway(1);
  2214. }
  2215. if (this.waitTime >= 0) {
  2216. this.waitTime -= this.dtime;
  2217. return;
  2218. }
  2219. switch (this.state) {
  2220. case AIState.idle:
  2221. this.chat();
  2222. break;
  2223. case AIState.reset:
  2224. this.reset();
  2225. break;
  2226. case AIState.move:
  2227. this.move();
  2228. break;
  2229. case AIState.leave:
  2230. this.state = AIState.none;
  2231. xGame.common.gameMgr.aiGameEnd(true);
  2232. break;
  2233. case AIState.select:
  2234. this.selectBall();
  2235. break;
  2236. case AIState.turn:
  2237. this.turnPole();
  2238. break;
  2239. case AIState.shoot:
  2240. this.shoot();
  2241. break;
  2242. }
  2243. }
  2244. onAway(type) {
  2245. if (type == 1) {
  2246. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2247. let num = this.awayNum + db * 20;
  2248. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2249. xGame.common.gameMgr.aiLeave();
  2250. this.setState(AIState.leave, 6666);
  2251. }
  2252. }
  2253. else if (type == 2) {
  2254. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2255. let num = this.awayNum + db * 30;
  2256. if (xGame.tools.random(0, 10000) < num)
  2257. return false;
  2258. }
  2259. else if (type == 3) {
  2260. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2261. let num = this.awayNum + db * 10;
  2262. if (xGame.tools.random(0, 4000) < num)
  2263. return false;
  2264. }
  2265. return true;
  2266. }
  2267. chat() {
  2268. if (this.chatTime > 0) {
  2269. this.chatTime -= this.dtime;
  2270. return;
  2271. }
  2272. this.chatTime = xGame.tools.random(2000, 10000);
  2273. let rand = xGame.tools.random(0, 100);
  2274. if (rand < 15)
  2275. this.talk();
  2276. else if (rand < 35)
  2277. this.emotion();
  2278. }
  2279. talk() {
  2280. xGame.common.talkMgr.showAITalk(0);
  2281. }
  2282. emotion() {
  2283. xGame.common.talkMgr.showAIEmotion(0);
  2284. }
  2285. resetAI() {
  2286. this.stopRun();
  2287. this.state = AIState.none;
  2288. }
  2289. }
  2290. class Partical extends Laya.Script3D {
  2291. constructor() {
  2292. super();
  2293. this.duration = 2000;
  2294. }
  2295. ;
  2296. onAwake() {
  2297. this.gameObj = this.owner;
  2298. }
  2299. onEnable() {
  2300. this.openTimer();
  2301. }
  2302. openTimer() {
  2303. Laya.timer.once(this.duration, this, this.disappear);
  2304. }
  2305. setCallback(obj, callback) {
  2306. this.obj = obj;
  2307. this.callback = callback;
  2308. Laya.timer.clearAll(this);
  2309. Laya.timer.once(this.duration, this, this.disappear);
  2310. }
  2311. disappear() {
  2312. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2313. this.callback && this.callback(this.obj);
  2314. }
  2315. }
  2316. class Ball extends Laya.Script3D {
  2317. constructor() {
  2318. super();
  2319. this.posV3 = new Laya.Vector3();
  2320. this.rotRate = 2.1;
  2321. this.rotSpeed = new Laya.Vector3();
  2322. this.myIndex = 0;
  2323. }
  2324. onAwake() {
  2325. this.gameObj = this.owner;
  2326. this.transform = this.gameObj.transform;
  2327. this.ballNode = this.gameObj.getChildByName("Ball");
  2328. this.shadowNode = this.gameObj.getChildByName("shadow");
  2329. }
  2330. initSelf(index, x, y, owner) {
  2331. this.d2BallSrc = owner;
  2332. this.myIndex = index;
  2333. this.setAlbedoTexture();
  2334. this.setTransPos(x, y);
  2335. this.setScale();
  2336. this.ballNode.transform.localRotationEulerX = 90;
  2337. if (index == 0) {
  2338. }
  2339. }
  2340. setAlbedoTexture(isIce = false) {
  2341. let url;
  2342. if (isIce) {
  2343. url = `res/d3Res/ballTexture/ice.jpg`;
  2344. }
  2345. else {
  2346. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2347. }
  2348. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2349. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2350. }));
  2351. }
  2352. runFireworks(obj, delay, callback) {
  2353. Laya.timer.clearAll(this);
  2354. Laya.timer.once(delay + 1, this, () => {
  2355. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2356. fire.transform.localPositionX = this.transform.localPositionX;
  2357. fire.transform.localPositionY = this.transform.localPositionY;
  2358. fire.transform.localPositionZ = this.transform.localPositionZ;
  2359. let src = fire.getComponent(Partical);
  2360. src.duration = 1000;
  2361. src.setCallback(obj, callback);
  2362. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2363. eft.transform.localPositionX = this.transform.localPositionX;
  2364. eft.transform.localPositionY = this.transform.localPositionY;
  2365. eft.transform.localPositionZ = this.transform.localPositionZ;
  2366. });
  2367. }
  2368. setTransPos(x, y) {
  2369. this.setRotation();
  2370. xGame.common.pos2to3Convert(x, y, this.posV3);
  2371. this.transform.localPositionX = this.posV3.x;
  2372. this.transform.localPositionY = 0;
  2373. this.transform.localPositionZ = this.posV3.z;
  2374. this.transform.localRotationEulerX = 0;
  2375. this.transform.localRotationEulerY = 0;
  2376. this.transform.localRotationEulerZ = 0;
  2377. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2378. this.shadowNode.transform.localPositionY = 0.1;
  2379. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2380. }
  2381. setRotation() {
  2382. if (this.d2BallSrc.canRot) {
  2383. let speed = this.d2BallSrc.rigy.linearVelocity;
  2384. this.rotSpeed.x = speed.x * this.rotRate;
  2385. this.rotSpeed.z = speed.y * this.rotRate;
  2386. this.rotSpeed.y = this.d2BallSrc.rotY;
  2387. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2388. }
  2389. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2390. this.rotSpeed.x = this.rotSpeed.y = 0;
  2391. this.rotSpeed.y = this.d2BallSrc.rotY;
  2392. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2393. }
  2394. }
  2395. setScale() {
  2396. let radius = xGame.common.d2World.rootBall.ui.width;
  2397. let scale = xGame.common.scale2to3Convert(radius);
  2398. this.transform.localScaleX = scale;
  2399. this.transform.localScaleY = scale;
  2400. this.transform.localScaleZ = scale;
  2401. }
  2402. playInHoleEft() {
  2403. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2404. eft.transform.position = this.transform.position;
  2405. }
  2406. playIceEft() {
  2407. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2408. eft.transform.position = this.transform.position;
  2409. }
  2410. get scaleXYZ() {
  2411. return this.transform.localScaleX;
  2412. }
  2413. set scaleXYZ(val) {
  2414. this.transform.localScaleX = val;
  2415. this.transform.localScaleY = val;
  2416. this.transform.localScaleZ = val;
  2417. }
  2418. get posX() {
  2419. return this.transform.localPositionX;
  2420. }
  2421. set posX(val) {
  2422. this.transform.localPositionX = val;
  2423. }
  2424. get posY() {
  2425. return this.transform.localPositionY;
  2426. }
  2427. set posY(val) {
  2428. this.transform.localPositionY = val;
  2429. }
  2430. get posZ() {
  2431. return this.transform.localPositionZ;
  2432. }
  2433. set posZ(val) {
  2434. this.transform.localPositionZ = val;
  2435. }
  2436. destroySelf() {
  2437. this.posV3 = null;
  2438. this.rotSpeed = null;
  2439. this.d2BallSrc = null;
  2440. this.ballNode = null;
  2441. this.gameObj.destroy(true);
  2442. this.transform = null;
  2443. this.destroy();
  2444. }
  2445. }
  2446. class ui_D2Ball extends fgui.GComponent {
  2447. static createInstance() {
  2448. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2449. }
  2450. onConstruct() {
  2451. this.myIcon = (this.getChild("myIcon"));
  2452. this.inner = (this.getChild("inner"));
  2453. this.n8 = (this.getChild("n8"));
  2454. this.n4 = (this.getChild("n4"));
  2455. this.wrongTips = (this.getChild("wrongTips"));
  2456. this.rightTips = (this.getChild("rightTips"));
  2457. this.breathAni = this.getTransition("breathAni");
  2458. }
  2459. }
  2460. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2461. class D2BallSrc extends Laya.Script {
  2462. constructor() {
  2463. super();
  2464. this.number = 0;
  2465. this.startX = 0;
  2466. this.startY = 0;
  2467. this.angleV2 = new Laya.Vector2();
  2468. this.isRootBall = false;
  2469. this.isBlackBall = false;
  2470. this.ballType = "";
  2471. this.canRot = true;
  2472. this.rotY = 0;
  2473. this.poleAngle = 0;
  2474. this.kickPos = { x: 0, y: 0 };
  2475. this.hard = 0;
  2476. this.kickAngle = 0;
  2477. this.borderDis = 0;
  2478. this.speedP10 = 5.6;
  2479. this.lastSpeed = { x: 0, y: 0 };
  2480. this.stillSpeed = 0.12;
  2481. this.ballFunc = "normal";
  2482. this.isRunSkillAni = false;
  2483. this.isInHole = false;
  2484. this.iceOwner = "";
  2485. this.forceRun = false;
  2486. this.myUNID = "";
  2487. this.rectL = 0;
  2488. this.rectR = 0;
  2489. this.rectT = 0;
  2490. this.rectB = 0;
  2491. this.forceVec = new Laya.Vector2();
  2492. this.lastDis = 0;
  2493. this.helpOut = { type: "", x: 0, y: 0 };
  2494. }
  2495. initSelf(number, x, y, d3Ball) {
  2496. if (!this.gameObj)
  2497. this.gameObj = this.owner;
  2498. this.number = number;
  2499. this.startX = x;
  2500. this.startY = y;
  2501. this.d3Ball = d3Ball;
  2502. this.isRootBall = false;
  2503. this.isBlackBall = false;
  2504. this.ballType = "";
  2505. if (number == 0) {
  2506. this.isRootBall = true;
  2507. }
  2508. else if (number == 8) {
  2509. this.isBlackBall = true;
  2510. }
  2511. else {
  2512. if (number <= 7) {
  2513. this.ballType = ballCamp.full;
  2514. }
  2515. else {
  2516. this.ballType = ballCamp.flower;
  2517. }
  2518. }
  2519. this.setInfo();
  2520. this.setD3Ball();
  2521. this.owner["mySrc"] = this;
  2522. this.rigy.linearDamping = 1;
  2523. D2BallSrc._unid++;
  2524. this.myUNID = "d2ball" + D2BallSrc._unid;
  2525. let rect = xGame.common.d2World.borderRect;
  2526. this.rectL = Math.ceil(rect.x) + 20;
  2527. this.rectT = Math.ceil(rect.y) + 20;
  2528. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2529. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2530. }
  2531. setInfo() {
  2532. this.gameObj.x = this.startX;
  2533. this.gameObj.y = this.startY;
  2534. let radius = this.ui.width / 2;
  2535. this.gameObj.width = radius * 2;
  2536. this.gameObj.height = radius * 2;
  2537. if (xGame.common.showDebug) {
  2538. this.ui.myIcon.alpha = 1;
  2539. this.ui.inner.alpha = 1;
  2540. }
  2541. else {
  2542. this.ui.myIcon.alpha = 0;
  2543. this.ui.inner.alpha = 0;
  2544. }
  2545. }
  2546. setD3Ball() {
  2547. this.d3Ball = this.d3Ball;
  2548. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2549. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2550. }
  2551. onUpdate() {
  2552. if (xGame.common.gameMgr.gamePause)
  2553. return;
  2554. if (this.isInHole)
  2555. return;
  2556. if (!xGame.common.d2World.openCheckStill)
  2557. return;
  2558. this.runBall();
  2559. }
  2560. runBall() {
  2561. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2562. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2563. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2564. this.judgeBorder();
  2565. }
  2566. getDestDis(dest) {
  2567. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2568. }
  2569. setmyXY(x, y) {
  2570. this.d3BallSrc.setTransPos(x, y);
  2571. }
  2572. getSpeed() {
  2573. let speed = this.rigy.linearVelocity;
  2574. return speed.x * speed.x + speed.y * speed.y;
  2575. }
  2576. onTriggerEnter(collider) {
  2577. if (!collider || !collider.owner)
  2578. return;
  2579. let coll = "collide";
  2580. let speed = this.getSpeed();
  2581. let sv2 = this.speedP10 * this.speedP10;
  2582. if (collider.label == "ball") {
  2583. if (speed < 9 && this.number != 0)
  2584. coll = "";
  2585. else if (speed < sv2)
  2586. coll = "collide_4";
  2587. else if (speed < sv2 * 6.2)
  2588. coll = "collide_3";
  2589. else if (speed < sv2 * 25)
  2590. coll = "collide_2";
  2591. else if (speed < sv2 * 56)
  2592. coll = "collide_1";
  2593. xGame.soundMgr.playSound(coll);
  2594. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2595. if (collider.owner) {
  2596. let rig = collider.owner.getComponent(D2BallSrc);
  2597. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2598. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2599. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2600. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2601. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2602. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2603. let rx = 0;
  2604. let ry = 0;
  2605. if (this.gameObj.x < this.rectL)
  2606. rx = vx;
  2607. else if (this.gameObj.x > this.rectR)
  2608. rx = -vx;
  2609. else if (this.gameObj.y < this.rectT)
  2610. ry = vy;
  2611. else if (this.gameObj.y > this.rectB)
  2612. ry = -vy;
  2613. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2614. }
  2615. }
  2616. if (this.number != 0) {
  2617. return;
  2618. }
  2619. else {
  2620. if (this.forceRun) {
  2621. console.log("randon force");
  2622. this.applyForce(collider);
  2623. }
  2624. }
  2625. if (xGame.common.d2World.isOnSameLine) {
  2626. xGame.common.d2World.isOnSameLine = false;
  2627. this.rigy.linearVelocity = { x: 0, y: 0 };
  2628. }
  2629. if (xGame.common.gameMgr.firstColliObj == null) {
  2630. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2631. xGame.common.gameMgr.isTouchedBall = true;
  2632. }
  2633. }
  2634. else {
  2635. xGame.common.recoverCameraView();
  2636. let wallStr = "";
  2637. if (speed < 9) { }
  2638. else if (speed < sv2) { }
  2639. else if (speed < sv2 * 6.2)
  2640. wallStr = "wall_30";
  2641. else if (speed < sv2 * 25)
  2642. wallStr = "wall_50";
  2643. else if (speed < sv2 * 56)
  2644. wallStr = "wall_80";
  2645. xGame.soundMgr.playSound(wallStr);
  2646. }
  2647. }
  2648. applyForce(collider) {
  2649. let src = collider.owner.mySrc;
  2650. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2651. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2652. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2653. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2654. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2655. }
  2656. checkWrongBall(playEft = true) {
  2657. if (this.isInHole)
  2658. return;
  2659. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2660. if (this.number != 0 && playEft)
  2661. this.d3BallSrc.playInHoleEft();
  2662. let coll = "inpocket_1";
  2663. let speed = this.getSpeed();
  2664. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2665. if (speed < 9 && this.number != 0)
  2666. coll = "";
  2667. else if (speed < sv2 * 6.2)
  2668. coll = "inpocket_4";
  2669. else if (speed < sv2 * 25)
  2670. coll = "collide_3";
  2671. else if (speed < sv2 * 56)
  2672. coll = "collide_2";
  2673. xGame.soundMgr.playSound(coll);
  2674. this.isInHole = true;
  2675. if (this.number == 0) {
  2676. console.log("白球进了。。");
  2677. this.reset();
  2678. this.rigy.linearVelocity = { x: 0, y: 0 };
  2679. this.hideSelf();
  2680. xGame.common.gameUI.ui.whiteAni.visible = true;
  2681. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2682. xGame.common.gameUI.ui.whiteAni.visible = false;
  2683. }));
  2684. }
  2685. else {
  2686. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2687. xGame.common.d2World.removeOneBall(this);
  2688. this.destroySelf();
  2689. xGame.common.playHappySound(this.number);
  2690. this.runFlyEft();
  2691. }
  2692. }
  2693. runFlyEft() {
  2694. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2695. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2696. }
  2697. }
  2698. hideSelf() {
  2699. if (this.d3Ball)
  2700. this.d3Ball.active = false;
  2701. }
  2702. showSelf() {
  2703. this.isInHole = false;
  2704. if (this.d3Ball && !this.d3Ball.active)
  2705. this.d3Ball.active = true;
  2706. }
  2707. isStill() {
  2708. let speed = this.rigy.linearVelocity;
  2709. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2710. this.rigy.linearVelocity = { x: 0, y: 0 };
  2711. return true;
  2712. }
  2713. return false;
  2714. }
  2715. reset() {
  2716. }
  2717. destroySelf() {
  2718. this.d3BallSrc.destroySelf();
  2719. if (!this.ui.isDisposed) {
  2720. this.ui.removeFromParent();
  2721. this.ui.dispose();
  2722. this.ui = null;
  2723. }
  2724. this.outColli = null;
  2725. this.innerColli = null;
  2726. this.rigy = null;
  2727. this.d3Ball = null;
  2728. this.d3BallSrc = null;
  2729. this.angleV2 = null;
  2730. this.gameObj.destroy(true);
  2731. this.destroy();
  2732. }
  2733. judgeBorder() {
  2734. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2735. return;
  2736. }
  2737. if (this.destroyed)
  2738. return;
  2739. if (xGame.common.gameMode == GameMode.classic)
  2740. return;
  2741. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2742. if (isOver) {
  2743. this.checkWrongBall();
  2744. }
  2745. }
  2746. onClick(e, force = false) {
  2747. if (this.number == 0)
  2748. return;
  2749. if (force) {
  2750. }
  2751. else {
  2752. if (xGame.common.d2World.openCheckStill)
  2753. return;
  2754. if (!xGame.common.gameMgr.selfTurn) {
  2755. return;
  2756. }
  2757. }
  2758. if (!xGame.common.gameMgr.finishOneShoot)
  2759. return;
  2760. let root = xGame.common.d2World.rootBall.gameObj;
  2761. let x = this.gameObj.x - root.x;
  2762. let y = this.gameObj.y - root.y;
  2763. let angle = xGame.common.getfguiRotation(x, y);
  2764. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2765. xGame.common.d2World.getHelpLine();
  2766. xGame.common.clickedBall = true;
  2767. this.checkGuide();
  2768. }
  2769. checkGuide() {
  2770. let guide = DataMgr.getSkillGuide();
  2771. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2772. xGame.common.guideStep++;
  2773. xGame.common.gameUI.ui.guide1.visible = false;
  2774. xGame.common.gameUI.ui.guide2.visible = true;
  2775. }
  2776. }
  2777. checkDistance(disX, disY, angle) {
  2778. let diameter = this.gameObj.width - 1;
  2779. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2780. if (!this.lastDis)
  2781. this.lastDis = dis;
  2782. else {
  2783. if (dis > this.lastDis) {
  2784. this.helpOut.type = "remove";
  2785. return this.helpOut;
  2786. }
  2787. }
  2788. if (dis <= Math.pow(diameter, 2)) {
  2789. let del = 0.01;
  2790. let offest = 0;
  2791. let realX = disX - this.gameObj.x;
  2792. let realY = disY - this.gameObj.y;
  2793. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2794. offest += del;
  2795. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2796. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2797. }
  2798. this.helpOut.type = "ok";
  2799. this.helpOut.x = realX + this.gameObj.x;
  2800. this.helpOut.y = realY + this.gameObj.y;
  2801. return this.helpOut;
  2802. }
  2803. else {
  2804. this.helpOut.type = "no";
  2805. return this.helpOut;
  2806. }
  2807. }
  2808. clearBallEft() {
  2809. this.clearBallRightEft();
  2810. this.clearBallWrongEft();
  2811. }
  2812. clearBallRightEft() {
  2813. this.ui.breathAni.stop();
  2814. this.ui.rightTips.visible = false;
  2815. }
  2816. clearBallWrongEft() {
  2817. this.ui.wrongTips.visible = false;
  2818. }
  2819. showWrongEft() {
  2820. if (!xGame.common.gameMgr.selfTurn)
  2821. return;
  2822. this.ui.wrongTips.visible = true;
  2823. }
  2824. showRightEft() {
  2825. if (!xGame.common.gameMgr.selfTurn)
  2826. return;
  2827. this.ui.rightTips.visible = true;
  2828. this.ui.rightTips.scaleX = 1;
  2829. this.ui.rightTips.scaleY = 1;
  2830. this.ui.breathAni.play();
  2831. }
  2832. setBallFunc(type, owner) {
  2833. if (type == "ice") {
  2834. this.ballFunc = type;
  2835. this.d3BallSrc.setAlbedoTexture(true);
  2836. this.rigy.type = "static";
  2837. this.iceOwner = owner;
  2838. }
  2839. else {
  2840. if (owner == this.iceOwner) {
  2841. this.ballFunc = type;
  2842. this.d3BallSrc.setAlbedoTexture(false);
  2843. this.rigy.type = "dynamic";
  2844. }
  2845. }
  2846. }
  2847. }
  2848. D2BallSrc._unid = 0;
  2849. class D2RootBallSrc extends D2BallSrc {
  2850. constructor() {
  2851. super();
  2852. this.maxSpeed = 0;
  2853. this.classicMaxSpeed = 2.2;
  2854. this.bigSkillMaxSpeed = 4;
  2855. this.angle = 0;
  2856. this.allPercent = 0;
  2857. this.linearPercent = 0;
  2858. this.anglePercent = 0;
  2859. this.maxAngleRate = 0.6;
  2860. this.baseRot = 7;
  2861. this.angleMax = 0;
  2862. this.speed = new Laya.Vector2();
  2863. this.rotSpeed = new Laya.Vector2();
  2864. }
  2865. isStill() {
  2866. let speed = this.rigy.linearVelocity;
  2867. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2868. if (this.anglePercent <= 0.1) {
  2869. this.rigy.linearVelocity = { x: 0, y: 0 };
  2870. return true;
  2871. }
  2872. }
  2873. return false;
  2874. }
  2875. reset() {
  2876. this.linearPercent = 0;
  2877. this.anglePercent = 0;
  2878. }
  2879. setSpeed(percent, angle) {
  2880. this.allPercent = percent;
  2881. this.angle = angle;
  2882. this.setAngleSpeed();
  2883. this.setLinearSpeed();
  2884. let hit = "hit";
  2885. if (percent < 25)
  2886. hit = "hit03";
  2887. else if (percent < 50)
  2888. hit = "hit02";
  2889. else if (percent < 75)
  2890. hit = "hit01";
  2891. xGame.soundMgr.playSound(hit);
  2892. }
  2893. setAngleSpeed() {
  2894. let offest = xGame.common.rodOffest;
  2895. let radius = 82;
  2896. let rate = Math.abs(offest.y / radius) * 0.5;
  2897. if (offest.y > 0)
  2898. this.angleMax = -this.baseRot * 2;
  2899. else
  2900. this.angleMax = this.baseRot;
  2901. this.rotY = -offest.x / radius * 100;
  2902. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2903. this.linearPercent = this.allPercent - this.anglePercent;
  2904. }
  2905. setLinearSpeed() {
  2906. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2907. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2908. if (!xGame.common.longHelpLine) {
  2909. let offset = -150 + xGame.common.randomNum(0, 300);
  2910. offset /= 100;
  2911. this.angle += offset;
  2912. }
  2913. }
  2914. }
  2915. let sin = Math.sin(this.angle * Math.PI / 180);
  2916. let cos = Math.cos(this.angle * Math.PI / 180);
  2917. switch (xGame.common.gameMode) {
  2918. case GameMode.classic:
  2919. this.maxSpeed = this.classicMaxSpeed;
  2920. break;
  2921. case GameMode.bigMove:
  2922. this.maxSpeed = this.bigSkillMaxSpeed;
  2923. break;
  2924. case GameMode.placeBall:
  2925. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2926. if (data.type == 1) {
  2927. this.maxSpeed = this.bigSkillMaxSpeed;
  2928. }
  2929. else {
  2930. this.maxSpeed = this.classicMaxSpeed;
  2931. }
  2932. break;
  2933. default:
  2934. break;
  2935. }
  2936. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2937. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2938. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2939. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2940. this.rigy.applyLinearImpulseToCenter(this.speed);
  2941. }
  2942. onUpdate() {
  2943. if (this.anglePercent > 0.1) {
  2944. this.anglePercent *= 0.97;
  2945. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2946. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2947. this.rigy.applyForceToCenter(this.rotSpeed);
  2948. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2949. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2950. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2951. if (num > 0.9)
  2952. this.canRot = true;
  2953. }
  2954. else
  2955. this.canRot = true;
  2956. if (Math.abs(this.rotY) > 0.1)
  2957. this.rotY *= 0.98;
  2958. super.onUpdate();
  2959. }
  2960. destroySelf() {
  2961. super.destroySelf();
  2962. this.speed = null;
  2963. }
  2964. }
  2965. class D2Ball extends Laya.Sprite {
  2966. constructor(isRootBall = false) {
  2967. super();
  2968. this.ui = ui_D2Ball.createInstance();
  2969. this.pivotX = this.ui.width / 2;
  2970. this.pivotY = this.ui.width / 2;
  2971. this.x = 0;
  2972. this.y = 0;
  2973. this.addChild(this.ui.displayObject);
  2974. this.ui.displayObject.x += this.ui.width / 2;
  2975. this.ui.displayObject.y += this.ui.width / 2;
  2976. if (isRootBall) {
  2977. this.d2Src = this.addComponent(D2RootBallSrc);
  2978. }
  2979. else {
  2980. this.d2Src = this.addComponent(D2BallSrc);
  2981. }
  2982. this.d2Src.ui = this.ui;
  2983. this.addCircleCollider();
  2984. this.addInnerCircleCollider();
  2985. this.addRigyBody();
  2986. }
  2987. addCircleCollider() {
  2988. let colli = xGame.common.getCollider("circle");
  2989. colli.radius = this.ui.width / 2;
  2990. this.addComponentIntance(colli);
  2991. this.d2Src.outColli = colli;
  2992. colli.label = "ball";
  2993. }
  2994. addInnerCircleCollider() {
  2995. let colli = xGame.common.getCollider("circle");
  2996. colli.radius = this.ui.inner.width / 2;
  2997. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  2998. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  2999. this.addComponentIntance(colli);
  3000. this.d2Src.innerColli = colli;
  3001. colli.label = "inner";
  3002. }
  3003. addRigyBody() {
  3004. let rigy = xGame.common.getRigbody();
  3005. rigy.type = "dynamic";
  3006. this.addComponentIntance(rigy);
  3007. this.d2Src.rigy = rigy;
  3008. }
  3009. disposeSelf() {
  3010. if (!this.ui.isDisposed) {
  3011. this.ui.dispose();
  3012. this.ui.removeFromParent();
  3013. this.ui = null;
  3014. }
  3015. }
  3016. }
  3017. class ui_D2Gan extends fgui.GComponent {
  3018. static createInstance() {
  3019. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3020. }
  3021. onConstruct() {
  3022. this.myIcon = (this.getChild("myIcon"));
  3023. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3024. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3025. this.self = (this.getChild("self"));
  3026. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3027. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3028. this.ai = (this.getChild("ai"));
  3029. }
  3030. }
  3031. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3032. class D2Gan {
  3033. constructor() {
  3034. this.offset = 0.15;
  3035. this.cell = 1.5;
  3036. this.onBallCell = 0.4;
  3037. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3038. this.moveNum = 70;
  3039. this.rulerRate = 0.1;
  3040. this.ui = ui_D2Gan.createInstance();
  3041. this.changeSelfRod();
  3042. this.changeAIRod();
  3043. }
  3044. changeSelfRod() {
  3045. let index = DataMgr.getCurBallRod();
  3046. let data = cfgTable.ballrodData[index + 1];
  3047. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3048. this.selfMySpine && this.selfMySpine.dispose();
  3049. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3050. if (data.spine) {
  3051. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3052. this.selfMySpine = new SpineMgr(data.spine, () => {
  3053. let xx = this.ui.selfEftRoot.width / 2;
  3054. let yy = this.ui.selfEftRoot.height / 2;
  3055. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3056. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3057. outSpine.rotation = -90;
  3058. });
  3059. }
  3060. }
  3061. changeAIRod() {
  3062. let length = Object.keys(cfgTable.ballrodData).length;
  3063. let rand = Math.floor(length * Math.random()) + 1;
  3064. let data = cfgTable.ballrodData[rand];
  3065. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3066. this.aiMySpine && this.aiMySpine.dispose();
  3067. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3068. if (data.spine) {
  3069. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3070. this.aiMySpine = new SpineMgr(data.spine, () => {
  3071. let xx = this.ui.aiEftRoot.width / 2;
  3072. let yy = this.ui.aiEftRoot.height / 2;
  3073. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3074. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3075. outSpine.rotation = -90;
  3076. });
  3077. }
  3078. }
  3079. setGanLastInfo() {
  3080. this.lastInfo.rotation = this.ui.rotation;
  3081. this.lastInfo.x = this.ui.x;
  3082. this.lastInfo.y = this.ui.y;
  3083. }
  3084. rotateSelf(flag, isRuler = false) {
  3085. let angle;
  3086. flag = flag * this.offset;
  3087. if (xGame.common.d2World.isHelpLineOnBall) {
  3088. angle = flag * this.onBallCell;
  3089. }
  3090. else {
  3091. angle = flag * this.cell;
  3092. }
  3093. if (isRuler) {
  3094. angle *= this.rulerRate;
  3095. }
  3096. this.ui.rotation += angle;
  3097. xGame.common.d2World.getHelpLine();
  3098. }
  3099. checkDistance() {
  3100. let target = xGame.common.d2World.targetBall;
  3101. let root = xGame.common.d2World.rootBall;
  3102. if (target == null) {
  3103. return 1;
  3104. }
  3105. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3106. if (dis <= 2500) {
  3107. return 5;
  3108. }
  3109. return 1;
  3110. }
  3111. rotDest(rot) {
  3112. this.ui.rotation = rot;
  3113. xGame.common.d2World.getHelpLine();
  3114. }
  3115. storagePower(powerNum) {
  3116. let pos = (powerNum / 100) * this.moveNum;
  3117. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3118. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3119. this.ui.x = this.lastInfo.x + xx;
  3120. this.ui.y = this.lastInfo.y + yy;
  3121. }
  3122. shoot() {
  3123. this.storagePower(0);
  3124. this.ui.visible = false;
  3125. }
  3126. destroySelf() {
  3127. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3128. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3129. this.selfMySpine && this.selfMySpine.dispose();
  3130. this.aiMySpine && this.aiMySpine.dispose();
  3131. this.lastInfo = null;
  3132. if (!this.ui.isDisposed) {
  3133. this.ui.removeFromParent();
  3134. this.ui.dispose();
  3135. }
  3136. }
  3137. }
  3138. class ui_HelpLine extends fgui.GComponent {
  3139. static createInstance() {
  3140. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3141. }
  3142. onConstruct() {
  3143. this.n10 = (this.getChild("n10"));
  3144. this.rect = (this.getChild("rect"));
  3145. this.dir11 = (this.getChild("dir11"));
  3146. this.dir = (this.getChild("dir"));
  3147. this.rootDir = (this.getChild("rootDir"));
  3148. this.dirDot = (this.getChild("dirDot"));
  3149. }
  3150. }
  3151. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3152. class D2HelpLine {
  3153. constructor() {
  3154. this.starX = 0;
  3155. this.starY = 0;
  3156. this.ui = ui_HelpLine.createInstance();
  3157. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3158. this.starX = this.ui.rect.x;
  3159. this.starY = this.ui.rect.y;
  3160. }
  3161. shoot() {
  3162. this.ui.visible = false;
  3163. }
  3164. destroySelf() {
  3165. if (this.ui.isDisposed) {
  3166. this.ui.removeFromParent();
  3167. this.ui.dispose();
  3168. }
  3169. }
  3170. }
  3171. class D2World extends Laya.Script {
  3172. constructor() {
  3173. super();
  3174. this.ballArr = [];
  3175. this.openCheckStill = false;
  3176. this.checkArr = [];
  3177. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3178. this.isHelpLineOnBall = false;
  3179. this.isOnSameLine = false;
  3180. this.reflectAngle = 0;
  3181. this.powerPercent = 0;
  3182. this.inHolesSpeed = [];
  3183. this.outDir = new Laya.Vector2();
  3184. this.rootDir = new Laya.Vector2();
  3185. this.aiLv = 0;
  3186. this.rootPos = new Laya.Vector2();
  3187. this.tempDir1 = new Laya.Vector2();
  3188. this.tempDir2 = new Laya.Vector2();
  3189. this.tempDir3 = new Laya.Vector2();
  3190. this.ballSize = 33;
  3191. this.destRot = 0;
  3192. }
  3193. initSelf() {
  3194. this.createBalls();
  3195. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3196. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3197. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3198. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3199. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3200. }
  3201. setBorderRect() {
  3202. let ui = xGame.common.gameUI.ui;
  3203. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3204. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3205. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3206. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3207. this.borderRect.x = starX;
  3208. this.borderRect.y = starY;
  3209. this.borderRect.width = width;
  3210. this.borderRect.height = height;
  3211. }
  3212. resetGame() {
  3213. this.openCheckStill = false;
  3214. let temp;
  3215. for (let index = 0; index < this.ballArr.length; index++) {
  3216. temp = this.ballArr[index];
  3217. temp.destroySelf();
  3218. }
  3219. xGame.common.d3World.ballRoot.destroyChildren();
  3220. xGame.common.gameUI.ui.ballNode.removeChildren();
  3221. console.log("进入摧毁逻辑");
  3222. this.d2Gan.destroySelf();
  3223. this.d2HelpLine.destroySelf();
  3224. this.ballArr = [];
  3225. }
  3226. setD2Gan() {
  3227. let ballNode = this.rootBall.ui;
  3228. let d2Gan = new D2Gan();
  3229. this.d2Gan = d2Gan;
  3230. let ganNode = d2Gan.ui;
  3231. ballNode.addChild(ganNode);
  3232. ganNode.pivotX = ganNode.pivotX;
  3233. ganNode.pivotY = ganNode.pivotY;
  3234. ganNode.x = ganNode.myIcon.width / 2;
  3235. ganNode.y = this.rootBall.gameObj.width;
  3236. d2Gan.setGanLastInfo();
  3237. }
  3238. setHelpLine() {
  3239. let d2Help = new D2HelpLine();
  3240. this.d2HelpLine = d2Help;
  3241. }
  3242. createBalls() {
  3243. let cfg;
  3244. switch (xGame.common.gameMode) {
  3245. case GameMode.classic:
  3246. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3247. break;
  3248. case GameMode.bigMove:
  3249. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3250. break;
  3251. case GameMode.placeBall:
  3252. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3253. break;
  3254. default:
  3255. break;
  3256. }
  3257. cfg = JSON.parse(JSON.stringify(cfg));
  3258. for (const key in cfg) {
  3259. if (cfg[key].value == 0) {
  3260. this.createRootBall(cfg[key]);
  3261. delete cfg[key];
  3262. break;
  3263. }
  3264. }
  3265. this.createOtherBalls(cfg);
  3266. }
  3267. createRootBall(data) {
  3268. let root = new D2Ball(true);
  3269. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3270. this.rootBall = root.d2Src;
  3271. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3272. let d3BallSrc = d3Ball.getComponent(Ball);
  3273. xGame.common.d3World.rootBall = d3Ball;
  3274. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3275. let xx = data.x;
  3276. let yy = data.y;
  3277. let numer = data.value;
  3278. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3279. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3280. this.ballArr.push(this.rootBall);
  3281. this.setD2Gan();
  3282. this.setHelpLine();
  3283. }
  3284. createOtherBalls(cfg) {
  3285. let temp;
  3286. let src;
  3287. let data;
  3288. for (const key in cfg) {
  3289. data = cfg[key];
  3290. temp = new D2Ball();
  3291. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3292. src = temp.d2Src;
  3293. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3294. src.initSelf(data.value, data.x, data.y, d3Ball);
  3295. this.ballArr.push(src);
  3296. }
  3297. }
  3298. shoot(percent) {
  3299. this.powerPercent = percent;
  3300. this.openCheckStill = true;
  3301. let d2Angle = this.d2Gan.ui.rotation;
  3302. this.rootBall.setSpeed(percent, d2Angle);
  3303. this.clearBallAllEft();
  3304. this.changePlayerView();
  3305. }
  3306. onUpdate() {
  3307. if (!this.openCheckStill)
  3308. return;
  3309. this.checkStill();
  3310. }
  3311. checkStill() {
  3312. for (let index = 0; index < this.ballArr.length; index++) {
  3313. if (!this.ballArr[index].isStill()) {
  3314. return;
  3315. }
  3316. }
  3317. xGame.eventMgr.event(ALL_BALL_STOP);
  3318. }
  3319. allBallStop() {
  3320. this.openCheckStill = false;
  3321. xGame.common.recoverCameraView();
  3322. }
  3323. waitShoot() {
  3324. if (!this.d2Gan.ui.isDisposed) {
  3325. this.d2Gan.ui.visible = true;
  3326. }
  3327. if (!this.d2HelpLine.ui.isDisposed) {
  3328. this.d2HelpLine.ui.visible = true;
  3329. }
  3330. this.clearBallAllEft();
  3331. this.showBallRightEft();
  3332. this.getHelpLine();
  3333. this.inHolesSpeed = [];
  3334. this.selectOneBall();
  3335. }
  3336. _getAllBallArr() {
  3337. let arr = this.ballArr;
  3338. let outArr = [];
  3339. for (let index = 0; index < arr.length; index++) {
  3340. if (arr[index] instanceof D2RootBallSrc)
  3341. continue;
  3342. if (arr[index].ballFunc == "ice")
  3343. continue;
  3344. if (arr[index].destroyed)
  3345. continue;
  3346. outArr.push(arr[index]);
  3347. }
  3348. return outArr;
  3349. }
  3350. _getBlackObj() {
  3351. let arr = this.ballArr;
  3352. for (let index = 0; index < arr.length; index++) {
  3353. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3354. return arr[index];
  3355. }
  3356. }
  3357. }
  3358. selectOneBall() {
  3359. let all = this._getAllBallArr();
  3360. let target;
  3361. switch (xGame.common.gameMode) {
  3362. case GameMode.classic:
  3363. if (xGame.common.gameMgr.selfTurn) {
  3364. let self = xGame.common.gameMgr.selfBallArr;
  3365. let black = this._getBlackObj();
  3366. if (xGame.common.gameMgr.ensureBallType) {
  3367. if (self.length > 0) {
  3368. let out = [];
  3369. for (let j = 0; j < all.length; j++) {
  3370. if (self.indexOf(all[j].number) > -1) {
  3371. out.push(all[j]);
  3372. }
  3373. }
  3374. target = this.selectBestEnterOne(out);
  3375. }
  3376. else {
  3377. target = this.selectBestEnterOne([black]);
  3378. }
  3379. }
  3380. else {
  3381. target = this.selectBestEnterOne(all);
  3382. }
  3383. }
  3384. else {
  3385. target = this.selectBestEnterOne(all);
  3386. }
  3387. break;
  3388. case GameMode.bigMove:
  3389. target = this.selectBestEnterOne(all);
  3390. break;
  3391. case GameMode.placeBall:
  3392. if (all.length > 0) {
  3393. target = this.selectBestEnterOne(all);
  3394. }
  3395. break;
  3396. default:
  3397. break;
  3398. }
  3399. if (target && !target.destroyed && target.onClick) {
  3400. target.onClick(0, true);
  3401. let num = -200 + xGame.common.randomNum(0, 400);
  3402. num /= 150;
  3403. if (xGame.common.longHelpLine) {
  3404. num = 0;
  3405. }
  3406. this.destRot += num;
  3407. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3408. }
  3409. }
  3410. removeOneBall(ball) {
  3411. for (let index = 0; index < this.ballArr.length; index++) {
  3412. if (this.ballArr[index].id == ball.id) {
  3413. this.ballArr.splice(index, 1);
  3414. break;
  3415. }
  3416. }
  3417. }
  3418. getHelpLine() {
  3419. this.d2HelpLine.ui.dirDot.visible = false;
  3420. this.isOnSameLine = false;
  3421. let startX = this.rootBall.gameObj.x;
  3422. let startY = this.rootBall.gameObj.y;
  3423. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3424. if (dis == null) {
  3425. this.d2HelpLine.ui.visible = false;
  3426. console.error("辅助线异常");
  3427. return;
  3428. }
  3429. this.d2HelpLine.ui.visible = true;
  3430. let angle = this.d2Gan.ui.rotation;
  3431. let radius = 16.5;
  3432. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3433. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3434. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3435. if (colliObj == null) {
  3436. this.getColliPos(disX, disY, radius, angle);
  3437. xGame.common.d2World.isHelpLineOnBall = false;
  3438. this.targetBall = null;
  3439. this.reflectAngle = 0;
  3440. this.showBallWrongEft();
  3441. }
  3442. else {
  3443. let target = colliObj.src;
  3444. let radius = 16.5;
  3445. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3446. dis1 = Math.sqrt(dis1);
  3447. let realDis = colliObj.disHon - dis1;
  3448. let dir = colliObj.dir;
  3449. let xx = startX + dir.x * realDis;
  3450. let yy = startY + dir.y * realDis;
  3451. this.getColliPos(xx, yy, radius, angle);
  3452. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3453. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3454. let offset = xGame.common.rodOffest;
  3455. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3456. this.isOnSameLine = true;
  3457. }
  3458. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3459. xGame.common.d2World.isHelpLineOnBall = true;
  3460. this.targetBall = target;
  3461. this.reflectAngle = reflectAngle;
  3462. this.showBallWrongEft();
  3463. if (xGame.common.longHelpLine) {
  3464. this.delayReflectLine(target, reflectAngle);
  3465. }
  3466. }
  3467. }
  3468. getBorderDot(startX, startY, angle) {
  3469. let radius = 17;
  3470. let distance;
  3471. let isDone;
  3472. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3473. isDone = this.judgeUpDown(distance, angle, startX);
  3474. if (isDone != null) {
  3475. return isDone;
  3476. }
  3477. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3478. isDone = this.judgeUpDown(distance, angle, startX);
  3479. if (isDone != null) {
  3480. return isDone;
  3481. }
  3482. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3483. isDone = this.judgeLeftRight(distance, angle, startY);
  3484. if (isDone != null) {
  3485. return isDone;
  3486. }
  3487. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3488. isDone = this.judgeLeftRight(distance, angle, startY);
  3489. if (isDone != null) {
  3490. return isDone;
  3491. }
  3492. }
  3493. judgeUpDown(distance, angle, startX) {
  3494. let flag = Math.sin(angle * Math.PI / 180);
  3495. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3496. if (distance >= 0) {
  3497. if (flag > 0) {
  3498. if (temp < this.borderRect.x + this.borderRect.width) {
  3499. return distance;
  3500. }
  3501. }
  3502. else {
  3503. if (temp > this.borderRect.x) {
  3504. return distance;
  3505. }
  3506. }
  3507. }
  3508. }
  3509. judgeLeftRight(distance, angle, starY) {
  3510. let flag = -Math.cos(angle * Math.PI / 180);
  3511. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3512. if (distance >= 0) {
  3513. if (flag > 0) {
  3514. if (temp < this.borderRect.y + this.borderRect.height) {
  3515. return distance;
  3516. }
  3517. }
  3518. else {
  3519. if (temp > this.borderRect.y) {
  3520. return distance;
  3521. }
  3522. }
  3523. }
  3524. }
  3525. clearBallAllEft() {
  3526. let temp;
  3527. for (let index = 0; index < this.ballArr.length; index++) {
  3528. temp = this.ballArr[index];
  3529. temp.clearBallEft();
  3530. }
  3531. }
  3532. showBallRightEft() {
  3533. let gameMgr = xGame.common.gameMgr;
  3534. let temp;
  3535. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3536. if (targetArr.length <= 0)
  3537. return;
  3538. for (let index = 0; index < this.ballArr.length; index++) {
  3539. temp = this.ballArr[index];
  3540. if (targetArr.indexOf(temp.number) > -1) {
  3541. temp.showRightEft();
  3542. }
  3543. }
  3544. }
  3545. showBallWrongEft() {
  3546. let gameMgr = xGame.common.gameMgr;
  3547. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3548. if (targetArr.length <= 0)
  3549. return;
  3550. let temp;
  3551. for (let index = 0; index < this.ballArr.length; index++) {
  3552. temp = this.ballArr[index];
  3553. if (this.targetBall && this.targetBall.number == temp.number) {
  3554. if (targetArr.indexOf(temp.number) <= -1) {
  3555. temp.showWrongEft();
  3556. }
  3557. else {
  3558. temp.clearBallWrongEft();
  3559. }
  3560. }
  3561. else {
  3562. temp.clearBallWrongEft();
  3563. }
  3564. }
  3565. }
  3566. getColliPos(x, y, radius, angle) {
  3567. this.d2HelpLine.ui.x = x;
  3568. this.d2HelpLine.ui.y = y;
  3569. let dirX = x - this.rootBall.gameObj.x;
  3570. let dirY = y - this.rootBall.gameObj.y;
  3571. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3572. if (rectH <= 0)
  3573. rectH = 0;
  3574. this.d2HelpLine.ui.rect.height = 0;
  3575. this.d2HelpLine.ui.rect.height = rectH;
  3576. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3577. if (rectH < this.rootBall.gameObj.width) {
  3578. this.d2HelpLine.ui.rect.visible = false;
  3579. }
  3580. else {
  3581. this.d2HelpLine.ui.rect.visible = true;
  3582. }
  3583. this.d2HelpLine.ui.dir.visible = false;
  3584. this.d2HelpLine.ui.rootDir.visible = false;
  3585. }
  3586. getReflectLine(x, y, radius, target) {
  3587. this.d2HelpLine.ui.dir.visible = true;
  3588. let dirX = target.x - x;
  3589. let dirY = target.y - y;
  3590. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3591. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3592. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3593. this.d2HelpLine.ui.dir.height = 48;
  3594. this.d2HelpLine.ui.dir.rotation = angle;
  3595. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3596. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3597. return angle;
  3598. }
  3599. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3600. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3601. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3602. let targetX = target.gameObj.x;
  3603. let targetY = target.gameObj.y;
  3604. this.outDir.setValue(targetX - xx, targetY - yy);
  3605. this.rootDir.setValue(rtX - xx, rtY - yy);
  3606. let ver = Math.PI / 2;
  3607. let sin = Math.sin(ver);
  3608. let cos = Math.cos(ver);
  3609. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3610. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3611. this.outDir.setValue(outX, outY);
  3612. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3613. Laya.Vector2.normalize(this.outDir, this.outDir);
  3614. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3615. if (Math.abs(result) <= 0.08) {
  3616. this.d2HelpLine.ui.rootDir.visible = false;
  3617. return;
  3618. }
  3619. if (result > 0) {
  3620. angle += 90;
  3621. }
  3622. else if (result < 0) {
  3623. angle -= 90;
  3624. }
  3625. this.d2HelpLine.ui.rootDir.visible = true;
  3626. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3627. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3628. this.d2HelpLine.ui.rootDir.rotation = angle;
  3629. }
  3630. delayReflectLine(obj, angle) {
  3631. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3632. return;
  3633. }
  3634. this.isOnSameLine = false;
  3635. let startX = obj.gameObj.x;
  3636. let startY = obj.gameObj.y;
  3637. let dis = this.getBorderDot(startX, startY, angle);
  3638. if (dis == null) {
  3639. this.d2HelpLine.ui.dirDot.visible = false;
  3640. return;
  3641. }
  3642. this.d2HelpLine.ui.visible = true;
  3643. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3644. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3645. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3646. if (colliObj == null) {
  3647. this.setDelayLine(disX, disY, obj, angle);
  3648. }
  3649. else {
  3650. let radius = 16;
  3651. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3652. dis1 = Math.sqrt(dis1);
  3653. let realDis = colliObj.disHon - dis1;
  3654. let dir = colliObj.dir;
  3655. let xx = startX + dir.x * realDis;
  3656. let yy = startY + dir.y * realDis;
  3657. this.setDelayLine(xx, yy, obj, angle);
  3658. }
  3659. }
  3660. setDelayLine(x, y, obj, angle) {
  3661. let dirX = x - obj.gameObj.x;
  3662. let dirY = y - obj.gameObj.y;
  3663. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3664. if (rectH <= 0)
  3665. rectH = 0;
  3666. this.d2HelpLine.ui.dir.height = rectH;
  3667. this.d2HelpLine.ui.dirDot.visible = true;
  3668. this.d2HelpLine.ui.dirDot.x = 17;
  3669. this.d2HelpLine.ui.dirDot.y = 17;
  3670. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3671. ;
  3672. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3673. }
  3674. changePlayerView() {
  3675. if (Math.random() >= 0.7)
  3676. return;
  3677. if (!this.targetBall) {
  3678. return;
  3679. }
  3680. if (!xGame.common.gameMgr.selfTurn)
  3681. return;
  3682. switch (xGame.common.gameMode) {
  3683. case GameMode.classic:
  3684. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3685. if (this.targetBall.number != 8) {
  3686. return;
  3687. }
  3688. }
  3689. break;
  3690. case GameMode.bigMove:
  3691. return;
  3692. case GameMode.placeBall:
  3693. break;
  3694. default:
  3695. break;
  3696. }
  3697. let startX = this.targetBall.gameObj.x;
  3698. let startY = this.targetBall.gameObj.y;
  3699. let angle = this.reflectAngle;
  3700. let dis = this.getBorderDot(startX, startY, angle);
  3701. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3702. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3703. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3704. if (colliObj) {
  3705. return;
  3706. }
  3707. let offset = 40;
  3708. let posObj = xGame.common.gameMgr.posObj;
  3709. let temp;
  3710. let radius;
  3711. let tarX, tarY;
  3712. for (const key in posObj) {
  3713. temp = posObj[key];
  3714. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3715. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3716. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3717. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3718. xGame.common.showOneCamera("angle" + key);
  3719. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3720. Laya.physicsTimer.scale = 0.7;
  3721. break;
  3722. }
  3723. }
  3724. }
  3725. selectBestEnterOne(arr) {
  3726. this.aiLv = xGame.tools.random(1, 11);
  3727. this.aiLv = 10;
  3728. this.wBall = xGame.common.d2World.rootBall;
  3729. this.rootPos.x = this.wBall.gameObj.x;
  3730. this.rootPos.y = this.wBall.gameObj.y;
  3731. this.initHoleBall(arr);
  3732. return this.selectBall();
  3733. }
  3734. selectBall() {
  3735. let ball = null;
  3736. this.destRot = 0;
  3737. let ai = 110 - this.aiLv * 10;
  3738. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3739. let score = false;
  3740. if (this.scoreBall.length < 1) {
  3741. if (this.lineBall.length < 1) {
  3742. for (let i = 0; i < this.kickBall.length; i++) {
  3743. let list = [];
  3744. let bo = this.kickBall[i];
  3745. let bobj = bo.gameObj;
  3746. let rect = xGame.common.d2World.borderRect;
  3747. let mobj = this.wBall.gameObj;
  3748. let minb = bobj.y - rect.y - 20;
  3749. let minw = mobj.y - rect.y - 50;
  3750. if (minb > 0 && minw > 0) {
  3751. let dlenx = 0;
  3752. let dleny = mobj.y - rect.y;
  3753. let spx = mobj.x;
  3754. let spy = rect.y - dleny;
  3755. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3756. }
  3757. minb = rect.y + rect.height - bobj.y - 20;
  3758. minw = rect.y + rect.height - mobj.y - 50;
  3759. if (minb > 0 && minw > 0) {
  3760. let dlenx = 0;
  3761. let dleny = rect.y + rect.height - mobj.y;
  3762. let spx = mobj.x;
  3763. let spy = rect.y + rect.height + dleny;
  3764. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3765. }
  3766. minb = bobj.x - rect.x - 20;
  3767. minw = mobj.x - rect.x - 50;
  3768. if (minb > 0 && minw > 0) {
  3769. let dlenx = mobj.x - rect.x;
  3770. let dleny = 0;
  3771. let spx = rect.x - dlenx;
  3772. let spy = mobj.y;
  3773. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3774. }
  3775. minb = rect.x + rect.width - bobj.x - 20;
  3776. minw = rect.x + rect.width - mobj.x - 50;
  3777. if (minb > 0 && minw > 0) {
  3778. let dlenx = rect.x + rect.width - mobj.x;
  3779. let dleny = 0;
  3780. let spx = rect.x + rect.width + dlenx;
  3781. let spy = mobj.y;
  3782. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3783. }
  3784. list.sort(function (a, b) {
  3785. return a.order - b.order;
  3786. });
  3787. for (let i = 0; i < list.length; i++) {
  3788. let data = list[i];
  3789. let mx = mobj.x - bobj.x;
  3790. let my = mobj.y - bobj.y;
  3791. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3792. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3793. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3794. if (num > 1)
  3795. num = 1;
  3796. let cos = Math.acos(num);
  3797. if (cos > 1.57)
  3798. cos = 1.57;
  3799. else if (cos < 0.01)
  3800. cos = 0.01;
  3801. let tan = Math.tan(cos);
  3802. let dx = tan * data.dleny;
  3803. let dy = tan * data.dlenx;
  3804. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3805. if (Math.abs(bx - 667) < 40)
  3806. continue;
  3807. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3808. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3809. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3810. this.forceMax = dis * 0.08;
  3811. this.destRot += mis * 0.1;
  3812. this.setKick(bx, by);
  3813. return true;
  3814. }
  3815. }
  3816. }
  3817. }
  3818. else {
  3819. ball = xGame.common.getRandArrEle(this.lineBall);
  3820. }
  3821. }
  3822. else {
  3823. for (let i = 0; i < this.scoreBall.length; i++) {
  3824. if (i < this.scoreBall.length - 1) {
  3825. let rand = 70 + this.aiLv * 10 + i * 10;
  3826. if (xGame.tools.random(0, 100) < rand) {
  3827. ball = this.scoreBall[i];
  3828. break;
  3829. }
  3830. }
  3831. else {
  3832. ball = this.scoreBall[i];
  3833. break;
  3834. }
  3835. }
  3836. score = true;
  3837. this.selectNum++;
  3838. }
  3839. if (!ball)
  3840. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3841. let dx = ball.gameObj.x;
  3842. let dy = ball.gameObj.y;
  3843. let kickAngle = 0;
  3844. if (score) {
  3845. dx = ball.kickPos.x;
  3846. dy = ball.kickPos.y;
  3847. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3848. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3849. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3850. if (adot > 1)
  3851. adot = 1;
  3852. kickAngle = Math.acos(adot) * 57.3;
  3853. if (kickAngle > 45) {
  3854. let kdx = ball.kickPos.x - ball.gameObj.x;
  3855. let kdy = ball.kickPos.y - ball.gameObj.y;
  3856. dx = ball.kickPos.x - kdx * mis * 0.3;
  3857. dy = ball.kickPos.y - kdy * mis * 0.3;
  3858. }
  3859. else
  3860. this.destRot += mis;
  3861. }
  3862. else if (ball.poleAngle != 0) {
  3863. this.destRot += ball.poleAngle;
  3864. }
  3865. if (xGame.common.gameMode == 0) {
  3866. let af = kickAngle * 0.08;
  3867. this.forceMax = ball.hard * 0.1 + af * af;
  3868. }
  3869. this.setKick(dx, dy);
  3870. return ball;
  3871. }
  3872. initHoleBall(arr) {
  3873. this.kickBall = [];
  3874. this.lineBall = [];
  3875. this.scoreBall = [];
  3876. this.holeBall = [];
  3877. this.selectNum = 0;
  3878. this.forceNum = 0;
  3879. this.forceMax = 0;
  3880. this.turnNum = 0;
  3881. let list = arr;
  3882. let holes = xGame.common.gameMgr.holePosList;
  3883. let self = xGame.common.aiPlayer;
  3884. for (let i = 0; i < list.length; i++) {
  3885. let obj = list[i];
  3886. if (!obj)
  3887. continue;
  3888. obj.kickPos.x = 0;
  3889. obj.kickPos.y = 0;
  3890. obj.poleAngle = 0;
  3891. obj.hard = 0;
  3892. obj.borderDis = 0;
  3893. obj.kickAngle = 180;
  3894. let b = obj.gameObj;
  3895. let wbp = this.rootPos;
  3896. let bx = wbp.x - b.x;
  3897. let by = wbp.y - b.y;
  3898. obj.borderDis = xGame.tools.random(0, 100);
  3899. this.kickBall.push(obj);
  3900. if (!this.isLine(wbp, obj))
  3901. continue;
  3902. obj.kickAngle = xGame.tools.random(90, 180);
  3903. obj.kickPos.x = b.x;
  3904. obj.kickPos.y = b.y;
  3905. this.lineBall.push(obj);
  3906. let minDis = 999999;
  3907. let hole = false;
  3908. for (let j = 0; j < holes.length; j++) {
  3909. let hp = holes[j];
  3910. if (bx >= 0 && hp.x > b.x + 100)
  3911. continue;
  3912. if (bx <= 0 && hp.x < b.x - 100)
  3913. continue;
  3914. if (by < -10 && hp.y < wbp.y)
  3915. continue;
  3916. if (by > 10 && hp.y > wbp.y)
  3917. continue;
  3918. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3919. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3920. if (dis < minDis) {
  3921. let dx = b.x - this.tempDir1.x * this.ballSize;
  3922. let dy = b.y - this.tempDir1.y * this.ballSize;
  3923. this.tempDir3.x = this.tempDir1.x;
  3924. this.tempDir3.y = this.tempDir1.y;
  3925. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3926. obj.kickPos.x = dx;
  3927. obj.kickPos.y = dy;
  3928. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3929. if (num > 1)
  3930. num = 1;
  3931. obj.kickAngle = Math.acos(num) * 57.3;
  3932. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3933. dis = dis * 2;
  3934. if (Math.abs(hp.x - 600) < 100)
  3935. dis += 50;
  3936. obj.hard = dis + obj.kickAngle * 3;
  3937. hole = true;
  3938. }
  3939. }
  3940. }
  3941. }
  3942. if (hole) {
  3943. this.scoreBall.push(obj);
  3944. this.holeBall.push(obj);
  3945. }
  3946. }
  3947. this.scoreBall.sort(function (a, b) {
  3948. return a.hard - b.hard;
  3949. });
  3950. this.holeBall.sort(function (a, b) {
  3951. return a.kickAngle - b.kickAngle;
  3952. });
  3953. this.kickBall.sort(function (a, b) {
  3954. return a.borderDis - b.borderDis;
  3955. });
  3956. }
  3957. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3958. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3959. let balls = xGame.common.d2World.ballArr;
  3960. let max = xGame.tools.getDis(hx, hy, bx, by);
  3961. for (let index = 0; index < balls.length; index++) {
  3962. let obj = balls[index];
  3963. if (obj.number == 0)
  3964. continue;
  3965. if (obj.number == bn || obj.number == dn)
  3966. continue;
  3967. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  3968. if (dis * dis > max)
  3969. continue;
  3970. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  3971. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3972. if (num > 1)
  3973. num = 1;
  3974. if (num < 0)
  3975. continue;
  3976. let gap = Math.sin(Math.acos(num)) * dis;
  3977. if (gap < this.ballSize)
  3978. return true;
  3979. }
  3980. return false;
  3981. }
  3982. isLine(xy, ball) {
  3983. let bx = xy.x;
  3984. let by = xy.y;
  3985. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  3986. let dis = ball.getDestDis(xy);
  3987. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  3988. let sin = Math.sin(angle);
  3989. let cos = Math.cos(angle);
  3990. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3991. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3992. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3993. let dx = bx + this.tempDir2.x * dis;
  3994. let dy = by + this.tempDir2.y * dis;
  3995. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  3996. sin = Math.sin(-angle);
  3997. cos = Math.cos(-angle);
  3998. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3999. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4000. dx = bx + this.tempDir2.x * dis;
  4001. dy = by + this.tempDir2.y * dis;
  4002. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4003. if (isr && isl)
  4004. return false;
  4005. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4006. }
  4007. return true;
  4008. }
  4009. setKick(dx, dy) {
  4010. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4011. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4012. this.tempDir1.x = 0;
  4013. this.tempDir1.y = 1;
  4014. this.tempDir2.y = -this.tempDir2.y;
  4015. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4016. if (num > 1)
  4017. num = 1;
  4018. let rot = Math.acos(num) * 57.3;
  4019. if (this.tempDir2.x < 0)
  4020. rot = 360 - rot;
  4021. this.destRot += rot;
  4022. }
  4023. }
  4024. class ui_UIGame extends fgui.GComponent {
  4025. static createInstance() {
  4026. return (fgui.UIPackage.createObject("game", "UIGame"));
  4027. }
  4028. onConstruct() {
  4029. this.c1 = this.getController("c1");
  4030. this.d3Root = (this.getChild("d3Root"));
  4031. this.clickNode = (this.getChild("clickNode"));
  4032. this.d2Root = (this.getChild("d2Root"));
  4033. this.topNode = (this.getChild("topNode"));
  4034. this.n72 = (this.getChild("n72"));
  4035. this.n40 = (this.getChild("n40"));
  4036. this.rulerNode = (this.getChild("rulerNode"));
  4037. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4038. this.n50 = (this.getChild("n50"));
  4039. this.keduNode = (this.getChild("keduNode"));
  4040. this.powerTxt = (this.getChild("powerTxt"));
  4041. this.powerNode = (this.getChild("powerNode"));
  4042. this.colorNode = (this.getChild("colorNode"));
  4043. this.powerEft = (this.getChild("powerEft"));
  4044. this.myPowerNode = (this.getChild("myPowerNode"));
  4045. this.ganNode = (this.getChild("ganNode"));
  4046. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4047. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4048. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4049. this.skillRod = (this.getChild("skillRod"));
  4050. this.border = (this.getChild("border"));
  4051. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4052. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4053. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4054. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4055. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4056. this.guanyuNode = (this.getChild("guanyuNode"));
  4057. this.helpBtn = (this.getChild("helpBtn"));
  4058. this.wordsBtn = (this.getChild("wordsBtn"));
  4059. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4060. this.returnBtn = (this.getChild("returnBtn"));
  4061. this.ballNode = (this.getChild("ballNode"));
  4062. this.whiteAni = (this.getChild("whiteAni"));
  4063. this.blackAni = (this.getChild("blackAni"));
  4064. this.selfTurn = (this.getChild("selfTurn"));
  4065. this.aiTurn = (this.getChild("aiTurn"));
  4066. this.deskNode = (this.getChild("deskNode"));
  4067. this.moveNode = (this.getChild("moveNode"));
  4068. this.selfTalk = (this.getChild("selfTalk"));
  4069. this.aiTalk = (this.getChild("aiTalk"));
  4070. this.d2Node = (this.getChild("d2Node"));
  4071. this.snowNode = (this.getChild("snowNode"));
  4072. this.guide2 = (this.getChild("guide2"));
  4073. this.guide1 = (this.getChild("guide1"));
  4074. this.guide3 = (this.getChild("guide3"));
  4075. this.guideNode = (this.getChild("guideNode"));
  4076. }
  4077. }
  4078. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4079. class ui_UIGameEnd extends fgui.GComponent {
  4080. static createInstance() {
  4081. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4082. }
  4083. onConstruct() {
  4084. this.c1 = this.getController("c1");
  4085. this.n22 = (this.getChild("n22"));
  4086. this.n2 = (this.getChild("n2"));
  4087. this.n52 = (this.getChild("n52"));
  4088. this.n53 = (this.getChild("n53"));
  4089. this.coinNode = (this.getChild("coinNode"));
  4090. this.closeNode = (this.getChild("closeNode"));
  4091. this.moneyNode = (this.getChild("moneyNode"));
  4092. this.secretary = (this.getChild("secretary"));
  4093. this.n27 = (this.getChild("n27"));
  4094. this.n29 = (this.getChild("n29"));
  4095. this.talkNode = (this.getChild("talkNode"));
  4096. this.n38 = (this.getChild("n38"));
  4097. this.n39 = (this.getChild("n39"));
  4098. this.n40 = (this.getChild("n40"));
  4099. this.awardNode = (this.getChild("awardNode"));
  4100. this.starNumNode = (this.getChild("starNumNode"));
  4101. this.n47 = (this.getChild("n47"));
  4102. this.conditionNode = (this.getChild("conditionNode"));
  4103. this.isGetAward = (this.getChild("isGetAward"));
  4104. this.leftBtn = (this.getChild("leftBtn"));
  4105. this.rightBtn = (this.getChild("rightBtn"));
  4106. this.btnNode = (this.getChild("btnNode"));
  4107. }
  4108. }
  4109. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4110. class ui_UIAddCoin extends fgui.GComponent {
  4111. static createInstance() {
  4112. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4113. }
  4114. onConstruct() {
  4115. this.n11 = (this.getChild("n11"));
  4116. this.myNode = (this.getChild("myNode"));
  4117. this.t0 = this.getTransition("t0");
  4118. }
  4119. }
  4120. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4121. class UIAddCoin extends UIBase {
  4122. constructor() {
  4123. super();
  4124. this.coinNum = 2000;
  4125. }
  4126. onConstructor() {
  4127. this.ui = ui_UIAddCoin.createInstance();
  4128. this.contentPane = this.ui;
  4129. this.isEject = false;
  4130. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4131. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4132. }
  4133. show() {
  4134. super.show();
  4135. this.ui.t0.play();
  4136. }
  4137. videoAddCoin() {
  4138. console.log('zh:qjff_AD_for_UIAddCoin');
  4139. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4140. }
  4141. else {
  4142. console.log('zh:AD 失败,直接发放奖励');
  4143. this.qjff_AD_for_UIAddCoin();
  4144. }
  4145. }
  4146. qjff_AD_for_UIAddCoin() {
  4147. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4148. this.hide();
  4149. }
  4150. }
  4151. UIAddCoin.uiName = "UIAddCoin";
  4152. class ui_UIInvitation extends fgui.GComponent {
  4153. static createInstance() {
  4154. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4155. }
  4156. onConstruct() {
  4157. this.n14 = (this.getChild("n14"));
  4158. this.myNode = (this.getChild("myNode"));
  4159. this.t0 = this.getTransition("t0");
  4160. }
  4161. }
  4162. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4163. class UIInvitation extends UIBase {
  4164. constructor() {
  4165. super();
  4166. }
  4167. onConstructor() {
  4168. this.ui = ui_UIInvitation.createInstance();
  4169. this.contentPane = this.ui;
  4170. this.isEject = false;
  4171. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4172. }
  4173. show() {
  4174. super.show();
  4175. }
  4176. enterGame() {
  4177. xGame.common.gameMode = GameMode.classic;
  4178. DataMgr.setChallengeTimes(1);
  4179. xGame.common.passAwardCoin = 2000;
  4180. let need = xGame.common.classicNiceNeddCoin;
  4181. if (DataMgr.coinEnough(need)) {
  4182. DataMgr.setCoin(-need);
  4183. xGame.eventMgr.event(RESTART_GAME, true);
  4184. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4185. }
  4186. else {
  4187. xGame.eventMgr.event(RESTART_GAME, true);
  4188. }
  4189. this.hide();
  4190. }
  4191. hide() {
  4192. super.hide();
  4193. }
  4194. }
  4195. UIInvitation.uiName = "UIInvitation";
  4196. class ui_UIMain extends fgui.GComponent {
  4197. static createInstance() {
  4198. return (fgui.UIPackage.createObject("game", "UIMain"));
  4199. }
  4200. onConstruct() {
  4201. this.n47 = (this.getChild("n47"));
  4202. this.n10 = (this.getChild("n10"));
  4203. this.secretary = (this.getChild("secretary"));
  4204. this.shopBtn = (this.getChild("shopBtn"));
  4205. this.moneyNode = (this.getChild("moneyNode"));
  4206. this.headNode = (this.getChild("headNode"));
  4207. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4208. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4209. this.classicBtn = (this.getChild("classicBtn"));
  4210. this.globalBtn = (this.getChild("globalBtn"));
  4211. this.n44 = (this.getChild("n44"));
  4212. this.signBtn = (this.getChild("signBtn"));
  4213. this.drawBtn = (this.getChild("drawBtn"));
  4214. this.settingNode = (this.getChild("settingNode"));
  4215. this.n45 = (this.getChild("n45"));
  4216. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4217. this.n46 = (this.getChild("n46"));
  4218. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4219. this.liucheng1 = (this.getChild("liucheng1"));
  4220. this.rightBtn = (this.getChild("rightBtn"));
  4221. this.n75 = (this.getChild("n75"));
  4222. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4223. this.liucheng2 = (this.getChild("liucheng2"));
  4224. this.guideBtn = (this.getChild("guideBtn"));
  4225. this.n73 = (this.getChild("n73"));
  4226. this.wordsNode = (this.getChild("wordsNode"));
  4227. this.enterGuide = (this.getChild("enterGuide"));
  4228. this.talkNode = (this.getChild("talkNode"));
  4229. this.n83 = (this.getChild("n83"));
  4230. this.n84 = (this.getChild("n84"));
  4231. }
  4232. }
  4233. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4234. class ui_UIMoyu extends fgui.GComponent {
  4235. static createInstance() {
  4236. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4237. }
  4238. onConstruct() {
  4239. this.ageTip = (this.getChild("ageTip"));
  4240. this.mainBg = (this.getChild("mainBg"));
  4241. this.xyNode = (this.getChild("xyNode"));
  4242. this.rnNode = (this.getChild("rnNode"));
  4243. this.fcmNode = (this.getChild("fcmNode"));
  4244. this.ageNode = (this.getChild("ageNode"));
  4245. this.tipNode = (this.getChild("tipNode"));
  4246. this.msgNode = (this.getChild("msgNode"));
  4247. }
  4248. }
  4249. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4250. class MoyuMgr {
  4251. static initMoyu() {
  4252. this.moyuView = new MoyuView();
  4253. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4254. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4255. this.moyuView.ui.displayObject.zOrder = 1000;
  4256. this.moyuView.init();
  4257. this.moyuView.showTip(true);
  4258. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4259. window['XApk'] = this;
  4260. }
  4261. static showAge(show) {
  4262. if (this.moyuView)
  4263. this.moyuView.showAge(show);
  4264. }
  4265. static onPlatMsg(idx) {
  4266. if (!MoyuMgr.moyuView)
  4267. return;
  4268. if (idx == '0') {
  4269. MoyuMgr.moyuView.showTip(false);
  4270. }
  4271. }
  4272. static showAgree(call) {
  4273. if (this.moyuView)
  4274. this.moyuView.showAgree(call);
  4275. else
  4276. call && call();
  4277. }
  4278. static showXy(type = 1) {
  4279. if (this.moyuView)
  4280. this.moyuView.showXy(type);
  4281. }
  4282. }
  4283. MoyuMgr.isAdvise = false;
  4284. class MoyuView {
  4285. constructor() {
  4286. this.ysxyNum = 1;
  4287. this.ysJson = null;
  4288. this.ui = ui_UIMoyu.createInstance();
  4289. }
  4290. init() {
  4291. this.ui.mainBg.visible = false;
  4292. this.ui.xyNode.visible = false;
  4293. this.ui.ageNode.visible = false;
  4294. this.ui.tipNode.visible = false;
  4295. this.ui.rnNode.visible = false;
  4296. this.ui.fcmNode.visible = false;
  4297. this.ui.ageTip.visible = false;
  4298. this.ui.msgNode.visible = false;
  4299. this.ui.visible = false;
  4300. this.ui.xyNode.xyList.setVirtual();
  4301. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4302. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4303. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4304. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4305. this.ui.xyNode.btnKnown.visible = false;
  4306. this.ui.xyNode.xy1.visible = false;
  4307. this.ui.xyNode.xy2.visible = false;
  4308. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4309. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4310. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4311. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4312. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4313. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4314. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4315. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4316. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4317. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4318. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4319. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4320. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4321. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4322. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4323. this.ysxyNum = 2;
  4324. }
  4325. }
  4326. onClick(obj) {
  4327. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4328. switch (obj) {
  4329. case this.ui.ageTip:
  4330. if (Moyu.isTTApk) {
  4331. this.ui.ageNode.visible = true;
  4332. this.ui.mainBg.visible = true;
  4333. }
  4334. break;
  4335. case this.ui.tipNode:
  4336. this.showTip(false);
  4337. break;
  4338. case this.ui.ageNode.btnAge:
  4339. this.ui.ageNode.visible = false;
  4340. this.ui.mainBg.visible = false;
  4341. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4342. this.ui.visible = false;
  4343. break;
  4344. case this.ui.xyNode.btnXy3:
  4345. case this.ui.xyNode.btnXy1:
  4346. this.loadXy(1);
  4347. break;
  4348. case this.ui.xyNode.btnXy2:
  4349. this.loadXy(2);
  4350. break;
  4351. case this.ui.xyNode.btnBack:
  4352. this.ui.xyNode.xy1.visible = true;
  4353. this.ui.xyNode.xy2.visible = false;
  4354. break;
  4355. case this.ui.xyNode.btnKnown:
  4356. this.ui.xyNode.visible = false;
  4357. this.ui.mainBg.visible = false;
  4358. this.ui.visible = false;
  4359. break;
  4360. case this.ui.rnNode.btnCheck:
  4361. this.check();
  4362. break;
  4363. case this.ui.rnNode.btnExit:
  4364. case this.ui.xyNode.btnNo:
  4365. this.ysxyNum--;
  4366. if (this.ysxyNum > 0)
  4367. this.showMsg("Refuse to quit the game once again");
  4368. else {
  4369. Moyu.userAgree(false);
  4370. Moyu.exit();
  4371. }
  4372. break;
  4373. case this.ui.xyNode.btnSure:
  4374. case this.ui.xyNode.btnYes:
  4375. DataMgr.userData.isAgree = true;
  4376. DataMgr.saveUserData();
  4377. this.onAgree();
  4378. break;
  4379. case this.ui.rnNode.btnDone:
  4380. this.ui.rnNode.visible = false;
  4381. this.ui.visible = false;
  4382. break;
  4383. case this.ui.fcmNode.btnRn:
  4384. this.showRn();
  4385. break;
  4386. }
  4387. }
  4388. showTip(show) {
  4389. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4390. return;
  4391. if (show) {
  4392. MoyuMgr.isAdvise = true;
  4393. this.ui.visible = true;
  4394. this.ui.tipNode.visible = true;
  4395. this.ui.tipNode.alpha = 1;
  4396. Laya.timer.once(1000, this, this.showTip, [false]);
  4397. }
  4398. else {
  4399. this.ui.tipNode.alpha = 1;
  4400. this.ui.tipNode.visible = true;
  4401. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4402. this.ui.tipNode.visible = false;
  4403. MoyuMgr.isAdvise = false;
  4404. }), 1000);
  4405. }
  4406. }
  4407. showAge(show, px = 0, py = 0) {
  4408. if (Moyu.platType > 10 && !Moyu.isIos) {
  4409. this.ui.ageTip.x = px;
  4410. this.ui.ageTip.y = py;
  4411. this.ui.ageTip.visible = show;
  4412. if (show)
  4413. this.ui.visible = true;
  4414. }
  4415. }
  4416. showAgree(call) {
  4417. this.agreeCall = call;
  4418. this.onAgree();
  4419. return;
  4420. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4421. this.showXy(0);
  4422. }
  4423. else
  4424. this.onAgree();
  4425. }
  4426. onAgree() {
  4427. if (!this.ui.ageNode.visible)
  4428. this.ui.visible = false;
  4429. this.ui.xyNode.visible = false;
  4430. Moyu.userAgree(true);
  4431. this.showAge(false);
  4432. this.agreeCall && this.agreeCall();
  4433. this.showRn();
  4434. }
  4435. showMsg(txt) {
  4436. this.ui.msgNode.txtMsg.text = txt;
  4437. this.ui.msgNode.visible = true;
  4438. this.ui.msgNode.alpha = 1;
  4439. this.ui.visible = true;
  4440. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4441. this.ui.msgNode.visible = false;
  4442. }), 2500, true);
  4443. }
  4444. showRn() {
  4445. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4446. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4447. this.ui.rnNode.rn1.visible = true;
  4448. this.ui.rnNode.rn2.visible = false;
  4449. this.ui.rnNode.rn3.visible = false;
  4450. this.ui.rnNode.rn4.visible = false;
  4451. this.ui.rnNode.visible = true;
  4452. this.ui.mainBg.visible = true;
  4453. this.ui.rnNode.btnDone.visible = false;
  4454. this.ui.rnNode.btnExit.visible = true;
  4455. this.ui.rnNode.btnCheck.visible = true;
  4456. this.ui.fcmNode.visible = false;
  4457. this.ui.visible = true;
  4458. return;
  4459. }
  4460. }
  4461. this.showFcm();
  4462. }
  4463. showFcm() {
  4464. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4465. Moyu.initFCM(true);
  4466. if (Moyu.gameTime < 1)
  4467. this.fcmLoop();
  4468. else if (Moyu.gameTime < 999)
  4469. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4470. }
  4471. }
  4472. fcmLoop() {
  4473. if (Moyu.gameTime < 1) {
  4474. this.ui.rnNode.visible = false;
  4475. this.ui.fcmNode.visible = true;
  4476. this.ui.mainBg.visible = true;
  4477. this.ui.visible = true;
  4478. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4479. Laya.timer.clear(this.ui, this.fcmLoop);
  4480. }
  4481. }
  4482. check() {
  4483. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4484. this.ui.rnNode.rn1.visible = false;
  4485. this.ui.rnNode.rn2.visible = false;
  4486. this.ui.rnNode.rn4.visible = true;
  4487. }
  4488. else if (this.ui.rnNode.rn4.visible) {
  4489. let name = this.ui.rnNode.inputName.text;
  4490. let code = this.ui.rnNode.inputCode.text;
  4491. if (code && code.length == 18) {
  4492. this.ui.rnNode.rn1.visible = false;
  4493. this.ui.rnNode.rn4.visible = false;
  4494. Moyu.authenticate(name, code, (res) => {
  4495. this.ui.rnNode.rn2.visible = !res;
  4496. this.ui.rnNode.rn3.visible = res;
  4497. this.ui.rnNode.btnDone.visible = res;
  4498. this.ui.rnNode.btnExit.visible = !res;
  4499. this.ui.rnNode.btnCheck.visible = !res;
  4500. if (res)
  4501. this.showFcm();
  4502. });
  4503. }
  4504. else
  4505. this.showMsg("信息填写不完整");
  4506. }
  4507. }
  4508. loadXy(type = 0) {
  4509. this.ui.xyNode.xy1.visible = false;
  4510. this.ui.xyNode.xy2.visible = true;
  4511. this.ui.xyNode.xyList.scrollToView(0);
  4512. if (type == 1) {
  4513. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4514. }
  4515. else if (type == 2) {
  4516. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4517. }
  4518. }
  4519. showXy(type = 0) {
  4520. this.xyBtn();
  4521. if (type == 0) {
  4522. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4523. this.ui.xyNode.btnSure.visible = true;
  4524. }
  4525. else {
  4526. this.ui.xyNode.btnYes.visible = true;
  4527. this.ui.xyNode.btnNo.visible = true;
  4528. }
  4529. }
  4530. else {
  4531. this.ui.xyNode.btnKnown.visible = true;
  4532. this.ui.mainBg.visible = true;
  4533. }
  4534. this.ui.xyNode.xy1.visible = true;
  4535. this.ui.xyNode.xy2.visible = false;
  4536. this.ui.xyNode.visible = true;
  4537. this.ui.visible = true;
  4538. }
  4539. xyBtn() {
  4540. this.ui.xyNode.btnSure.visible = false;
  4541. this.ui.xyNode.btnYes.visible = false;
  4542. this.ui.xyNode.btnNo.visible = false;
  4543. this.ui.xyNode.btnKnown.visible = false;
  4544. {
  4545. this.ui.xyNode.btnXy3.visible = false;
  4546. this.ui.xyNode.btnXy2.visible = true;
  4547. this.ui.xyNode.btnXy1.visible = true;
  4548. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4549. }
  4550. }
  4551. createXY(json) {
  4552. this.ysJson = json.content;
  4553. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4554. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4555. this.ui.xyNode.xy2.visible = true;
  4556. }
  4557. renderListItem(idx, cell) {
  4558. let xy = this.ysJson[idx];
  4559. cell.height = xy.line * 30;
  4560. cell.xyItem.text = xy.text;
  4561. }
  4562. onDestroy() {
  4563. this.agreeCall = null;
  4564. }
  4565. }
  4566. class SettingNode {
  4567. constructor(ui) {
  4568. this.showSetting = false;
  4569. this.openSound = true;
  4570. this.openShake = true;
  4571. this.ui = ui;
  4572. this.ui.soundBtn.onClick(this, this.switchSound);
  4573. this.ui.shakeBtn.onClick(this, this.switchShake);
  4574. this.ui.xyBtn.onClick(this, this.onXy);
  4575. this.ui.clickNode.onClick(this, this.changeSetting);
  4576. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4577. this.ui.xyBtn.visible = false;
  4578. this.ui.shakeBtn.visible = false;
  4579. }
  4580. changeSetting() {
  4581. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4582. this.showSetting = !this.showSetting;
  4583. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4584. }
  4585. switchSound() {
  4586. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4587. this.openSound = !this.openSound;
  4588. Moyu.onSetting(this.openSound, this.openShake);
  4589. xGame.soundMgr.onSetting(this.openSound);
  4590. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4591. }
  4592. switchShake() {
  4593. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4594. this.openShake = !this.openShake;
  4595. Moyu.onSetting(this.openSound, this.openShake);
  4596. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4597. }
  4598. onXy() {
  4599. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4600. MoyuMgr.showXy(1);
  4601. }
  4602. }
  4603. class ui_UILevelDisplay extends fgui.GComponent {
  4604. static createInstance() {
  4605. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4606. }
  4607. onConstruct() {
  4608. this.n9 = (this.getChild("n9"));
  4609. this.myNode = (this.getChild("myNode"));
  4610. this.closeNode = (this.getChild("closeNode"));
  4611. }
  4612. }
  4613. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4614. class ui_UILevelProp extends fgui.GComponent {
  4615. static createInstance() {
  4616. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4617. }
  4618. onConstruct() {
  4619. this.n16 = (this.getChild("n16"));
  4620. this.myNode = (this.getChild("myNode"));
  4621. this.closeBtn = (this.getChild("closeBtn"));
  4622. this.moneyNode = (this.getChild("moneyNode"));
  4623. this.t1 = this.getTransition("t1");
  4624. }
  4625. }
  4626. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4627. class ui_ShowItem extends fgui.GComponent {
  4628. static createInstance() {
  4629. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4630. }
  4631. onConstruct() {
  4632. this.myImg = (this.getChild("myImg"));
  4633. }
  4634. }
  4635. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4636. class ShowItem {
  4637. constructor() {
  4638. this.ui = ui_ShowItem.createInstance();
  4639. }
  4640. destroySelf() {
  4641. if (!this.ui.isDisposed) {
  4642. this.ui.removeFromParent();
  4643. this.ui.dispose();
  4644. }
  4645. }
  4646. setParent(parent) {
  4647. parent.addChild(this.ui);
  4648. }
  4649. setPos(x, y) {
  4650. this.ui.x = x;
  4651. this.ui.y = y;
  4652. }
  4653. setUrl(index) {
  4654. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4655. }
  4656. }
  4657. class ui_UIPower extends fgui.GComponent {
  4658. static createInstance() {
  4659. return (fgui.UIPackage.createObject("game", "UIPower"));
  4660. }
  4661. onConstruct() {
  4662. this.n11 = (this.getChild("n11"));
  4663. this.myNode = (this.getChild("myNode"));
  4664. this.t0 = this.getTransition("t0");
  4665. }
  4666. }
  4667. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4668. class UIPower extends UIBase {
  4669. constructor() {
  4670. super();
  4671. }
  4672. onConstructor() {
  4673. this.ui = ui_UIPower.createInstance();
  4674. this.contentPane = this.ui;
  4675. this.isEject = false;
  4676. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4677. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4678. }
  4679. show() {
  4680. super.show();
  4681. this.ui.t0.play();
  4682. }
  4683. videoGetPower() {
  4684. console.log('zh:qjff_AD_for_uipower');
  4685. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4686. }
  4687. else {
  4688. console.log('zh:AD 失败,直接发放奖励');
  4689. this.qjff_AD_for_uipower();
  4690. }
  4691. }
  4692. qjff_AD_for_uipower() {
  4693. DataMgr.setPower(xGame.common.videoPower, true);
  4694. xGame.eventMgr.event(POWER_TIME);
  4695. this.hide();
  4696. }
  4697. }
  4698. UIPower.uiName = "UIPower";
  4699. class UILevelProp extends UIBase {
  4700. constructor() {
  4701. super();
  4702. this.firstPos = 385;
  4703. this.secondPos = 467;
  4704. this.showItemArr = [];
  4705. }
  4706. onFontLoaded() {
  4707. try {
  4708. this.ui.myNode.conditionTxt.font = "arial";
  4709. console.log("zh: onFontLoaded 设置arial字体成功");
  4710. }
  4711. catch (error) {
  4712. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4713. }
  4714. }
  4715. onConstructor() {
  4716. this.ui = ui_UILevelProp.createInstance();
  4717. this.contentPane = this.ui;
  4718. this.isEject = false;
  4719. this.addUIClick(this.ui.closeBtn, this.hide);
  4720. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4721. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4722. }
  4723. show(level) {
  4724. super.show();
  4725. this.ui.t1.play();
  4726. this.level = level;
  4727. this.data = cfgTable.placeballData[this.level];
  4728. this.updateSelf();
  4729. this.showPreView();
  4730. this.moneyNode.ui.c1.selectedIndex = 2;
  4731. this.moneyNode.checkPowerTime();
  4732. this.moneyNode.powerChange();
  4733. }
  4734. showPreView() {
  4735. let item;
  4736. let data;
  4737. for (let index = 0; index < this.showItemArr.length; index++) {
  4738. item = this.showItemArr[index];
  4739. item.destroySelf();
  4740. }
  4741. this.showItemArr = [];
  4742. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4743. for (const key in cfgData) {
  4744. data = cfgData[key];
  4745. item = new ShowItem();
  4746. item.setParent(this.ui.myNode.displayRoot);
  4747. item.setPos(data.x, data.y);
  4748. item.setUrl(data.value);
  4749. this.showItemArr.push(item);
  4750. }
  4751. }
  4752. updateSelf() {
  4753. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4754. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4755. if (this.data.ball == -1) {
  4756. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4757. }
  4758. else {
  4759. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4760. }
  4761. let localData = DataMgr.getPlaceBallLevel(this.level);
  4762. let getAward = localData.getAward;
  4763. let cfg = cfgTable.placeballData[this.level];
  4764. let coin = this.data.award[0];
  4765. let diamond = this.data.award[1];
  4766. if (cfg.type == PlaceBallType.challenge) {
  4767. diamond = 0;
  4768. coin = 100;
  4769. }
  4770. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4771. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4772. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4773. if (cfg.type == PlaceBallType.challenge) {
  4774. this.ui.myNode.coinNode.numTxt.text = "";
  4775. }
  4776. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4777. if (coin > 0 && diamond > 0) {
  4778. this.ui.myNode.diamondNode.x = 385;
  4779. this.ui.myNode.coinNode.x = 467;
  4780. }
  4781. else {
  4782. this.ui.myNode.diamondNode.x = 385;
  4783. this.ui.myNode.coinNode.x = 385;
  4784. }
  4785. if (!getAward) {
  4786. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4787. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4788. }
  4789. else {
  4790. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4791. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4792. }
  4793. }
  4794. startGame() {
  4795. if (DataMgr.powerEnough()) {
  4796. this.ui.myNode.startBtn.touchable = false;
  4797. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4798. console.log('zh:startGame ');
  4799. this.ui.myNode.startBtn.touchable = true;
  4800. DataMgr.setPower(-1);
  4801. xGame.eventMgr.event(POWER_TIME);
  4802. xGame.common.gameMode = GameMode.placeBall;
  4803. xGame.common.placeBallCurLevel = this.level;
  4804. xGame.uiMgr.Show(UIGame);
  4805. xGame.uiMgr.Hide(UILevelDisplay);
  4806. xGame.uiMgr.Hide(UIMain);
  4807. this.hide();
  4808. }));
  4809. }
  4810. else {
  4811. console.log('zh:startGame no power');
  4812. xGame.uiMgr.Show(UIPower);
  4813. }
  4814. }
  4815. hide() {
  4816. super.hide();
  4817. }
  4818. }
  4819. UILevelProp.uiName = "UILevelProp";
  4820. class PutBallLevelDisplay {
  4821. constructor(ui, index) {
  4822. this.index = 0;
  4823. this.ui = ui;
  4824. this.index = index;
  4825. this.ui.onClick(this, this.clickSelf);
  4826. this.updateSelf();
  4827. this.ui.levelTxt.text = (this.index + 1) + "";
  4828. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4829. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4830. }
  4831. updateSelf() {
  4832. let level = this.index + 1;
  4833. this.data = DataMgr.getPlaceBallLevel(level);
  4834. this.ui.starNode.c1.selectedIndex = this.data.star;
  4835. let isChallenge = cfgTable.placeballData[level].type;
  4836. if (this.data.isCur) {
  4837. if (isChallenge) {
  4838. this.ui.c1.selectedIndex = 5;
  4839. }
  4840. else {
  4841. this.ui.c1.selectedIndex = 2;
  4842. }
  4843. }
  4844. else {
  4845. if (this.data.play) {
  4846. if (this.data.star == 3) {
  4847. this.ui.c1.selectedIndex = 0;
  4848. }
  4849. else {
  4850. this.ui.c1.selectedIndex = 1;
  4851. }
  4852. }
  4853. else {
  4854. if (isChallenge) {
  4855. this.ui.c1.selectedIndex = 4;
  4856. }
  4857. else {
  4858. this.ui.c1.selectedIndex = 3;
  4859. }
  4860. }
  4861. }
  4862. }
  4863. clickSelf() {
  4864. if (!this.data.play)
  4865. return;
  4866. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4867. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4868. }
  4869. }
  4870. class UILevelDisplay extends UIBase {
  4871. constructor() {
  4872. super();
  4873. }
  4874. onConstructor() {
  4875. this.ui = ui_UILevelDisplay.createInstance();
  4876. this.contentPane = this.ui;
  4877. this.isEject = false;
  4878. this.myList = this.ui.myNode.myList;
  4879. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4880. this.levelItemArr = [];
  4881. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4882. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4883. this.myList.numItems = levelNum;
  4884. if (Moyu.isKs)
  4885. this.ui.closeNode.closeBtn.x += 100;
  4886. }
  4887. levelItemRender(index, target) {
  4888. let item = new PutBallLevelDisplay(target, index);
  4889. this.levelItemArr.push(item);
  4890. }
  4891. show() {
  4892. super.show();
  4893. this.updateLevel();
  4894. this.scrollToPlace();
  4895. }
  4896. updateLevel() {
  4897. let temp;
  4898. for (let index = 0; index < this.levelItemArr.length; index++) {
  4899. temp = this.levelItemArr[index];
  4900. temp.updateSelf();
  4901. }
  4902. }
  4903. scrollToPlace() {
  4904. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4905. let passArr = DataMgr.getPlaceBallLevelList();
  4906. let offest = passArr.length;
  4907. if (offest >= maxNum - 1)
  4908. offest = maxNum - 1;
  4909. this.myList.scrollToView(offest, true, true);
  4910. }
  4911. hide() {
  4912. super.hide();
  4913. }
  4914. }
  4915. UILevelDisplay.uiName = "UILevelDisplay";
  4916. class ui_UIMatching extends fgui.GComponent {
  4917. static createInstance() {
  4918. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4919. }
  4920. onConstruct() {
  4921. this.n5 = (this.getChild("n5"));
  4922. this.n49 = (this.getChild("n49"));
  4923. this.n51 = (this.getChild("n51"));
  4924. this.n64 = (this.getChild("n64"));
  4925. this.n2 = (this.getChild("n2"));
  4926. this.n53 = (this.getChild("n53"));
  4927. this.n54 = (this.getChild("n54"));
  4928. this.n56 = (this.getChild("n56"));
  4929. this.n58 = (this.getChild("n58"));
  4930. this.n59 = (this.getChild("n59"));
  4931. this.n57 = (this.getChild("n57"));
  4932. this.n60 = (this.getChild("n60"));
  4933. this.n62 = (this.getChild("n62"));
  4934. this.awardTxt = (this.getChild("awardTxt"));
  4935. this.n61 = (this.getChild("n61"));
  4936. this.selfHead = (this.getChild("selfHead"));
  4937. this.aiHead = (this.getChild("aiHead"));
  4938. this.n82 = (this.getChild("n82"));
  4939. this.n84 = (this.getChild("n84"));
  4940. this.n83 = (this.getChild("n83"));
  4941. this.t1 = this.getTransition("t1");
  4942. this.t2 = this.getTransition("t2");
  4943. this.t3 = this.getTransition("t3");
  4944. this.t4 = this.getTransition("t4");
  4945. }
  4946. }
  4947. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4948. class UIMatching extends UIBase {
  4949. constructor() {
  4950. super();
  4951. }
  4952. onConstructor() {
  4953. this.ui = ui_UIMatching.createInstance();
  4954. this.contentPane = this.ui;
  4955. this.isEject = false;
  4956. }
  4957. show(callback) {
  4958. super.show();
  4959. PlatMgr.showBanner(true);
  4960. this.callback = callback;
  4961. let user = Moyu.getUserInfo();
  4962. if (!this.selfPot) {
  4963. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4964. }
  4965. if (!this.aiPot) {
  4966. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4967. }
  4968. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4969. this.ui.selfHead.nameTxt.text = user.nickName;
  4970. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4971. this.ui.aiHead.nameTxt.text = "???";
  4972. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4973. this.ui.selfHead.c1.selectedIndex = 0;
  4974. this.ui.aiHead.c1.selectedIndex = 0;
  4975. this.ui.selfHead.x = this.selfPot.x;
  4976. this.ui.selfHead.y = this.selfPot.y;
  4977. this.ui.aiHead.x = this.aiPot.x;
  4978. this.ui.aiHead.y = this.aiPot.y;
  4979. switch (xGame.common.gameMode) {
  4980. case GameMode.classic:
  4981. break;
  4982. case GameMode.bigMove:
  4983. this.initSkillData();
  4984. break;
  4985. default:
  4986. break;
  4987. }
  4988. this.ui.t1.play(Laya.Handler.create(this, () => {
  4989. this.ui.t2.play(Laya.Handler.create(this, () => {
  4990. switch (xGame.common.gameMode) {
  4991. case GameMode.classic:
  4992. this.waitingPeople();
  4993. break;
  4994. case GameMode.bigMove:
  4995. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4996. break;
  4997. default:
  4998. break;
  4999. }
  5000. }));
  5001. }));
  5002. }
  5003. initSkillData() {
  5004. this.skillSelectData = [];
  5005. let skillUrl = xGame.common.skillIconList;
  5006. let skillName = xGame.common.skillNameList;
  5007. let skillLevel = DataMgr.getBigSkillList();
  5008. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5009. for (let index = 0; index < 5; index++) {
  5010. let obj = {};
  5011. obj.skillImg = skillUrl[index];
  5012. obj.skillName = skillName[index];
  5013. obj.skillType = skillType[index];
  5014. obj.skillLevel = skillLevel[index];
  5015. this.skillSelectData.push(obj);
  5016. }
  5017. }
  5018. getAISkillLevel(myLevel) {
  5019. let video = xGame.common.upSkillLevel;
  5020. let aiLevel;
  5021. let temp;
  5022. if (video) {
  5023. temp = xGame.common.randomNum(-2, -1);
  5024. }
  5025. else {
  5026. if (myLevel <= 5) {
  5027. temp = xGame.common.randomNum(1, 3);
  5028. }
  5029. else if (myLevel <= 9) {
  5030. temp = xGame.common.randomNum(-2, 1);
  5031. }
  5032. else {
  5033. temp = xGame.common.randomNum(-4, 0);
  5034. }
  5035. }
  5036. aiLevel = temp + myLevel;
  5037. if (aiLevel <= 1)
  5038. aiLevel = 1;
  5039. if (aiLevel >= 10)
  5040. aiLevel = 10;
  5041. return aiLevel;
  5042. }
  5043. getAISkillType() {
  5044. return xGame.common.randomNum(1, 4);
  5045. let successTimes = DataMgr.getSkillSuccessTimes();
  5046. let info = cfgTable.aiskillData[successTimes];
  5047. if (!info) {
  5048. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5049. info = cfgTable.aiskillData[max];
  5050. }
  5051. let dataArr = info.skillselect;
  5052. let myCfg = {};
  5053. for (let index = 0; index < dataArr.length; index++) {
  5054. let temp = dataArr[index].split('-');
  5055. myCfg[temp[0]] = {};
  5056. myCfg[temp[0]].id = parseInt(temp[0]);
  5057. myCfg[temp[0]].weight = parseInt(temp[1]);
  5058. }
  5059. let aiCfg = xGame.common.initWeight(myCfg);
  5060. let curData = xGame.common.getRandomWeightData(aiCfg);
  5061. return parseInt(curData.id);
  5062. }
  5063. getAISkillData(index) {
  5064. let myLevel = this.skillSelectData[index].skillLevel;
  5065. let aiLevel = this.getAISkillLevel(myLevel);
  5066. let aiType = this.getAISkillType() - 1;
  5067. return { aiLevel, aiType } = { aiLevel, aiType };
  5068. }
  5069. skillSelectFinish(index) {
  5070. let aiInfo = this.getAISkillData(index);
  5071. xGame.common.gameMgr.selfCurSkill = index;
  5072. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5073. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5074. this.ui.selfHead.c1.selectedIndex = 1;
  5075. this.ui.aiHead.c1.selectedIndex = 1;
  5076. let myData = this.skillSelectData[index];
  5077. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5078. let guide = DataMgr.getSkillGuide();
  5079. if (guide == 0) {
  5080. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5081. }
  5082. else {
  5083. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5084. }
  5085. let aiData = this.skillSelectData[aiInfo.aiType];
  5086. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5087. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5088. this.waitingPeople();
  5089. }
  5090. waitingPeople() {
  5091. let time = xGame.common.randomNum(1000, 3000);
  5092. time += 1000;
  5093. Laya.timer.once(time, this, () => {
  5094. this.matchingSuccess();
  5095. });
  5096. }
  5097. matchingSuccess() {
  5098. let gameUI = xGame.common.gameUI;
  5099. let name = gameUI.ui.topNode.aiNameTxt.text;
  5100. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5101. this.ui.aiHead.nameTxt.text = name;
  5102. this.ui.aiHead.headImg.url = url;
  5103. name = gameUI.ui.topNode.selfNameTxt.text;
  5104. url = gameUI.ui.topNode.selfHeadLoader.url;
  5105. this.ui.selfHead.nameTxt.text = name;
  5106. this.ui.selfHead.headImg.url = url;
  5107. this.ui.t3.play(Laya.Handler.create(this, () => {
  5108. this.callback && this.callback();
  5109. this.ui.t4.play(Laya.Handler.create(this, () => {
  5110. this.destroySelf();
  5111. }));
  5112. }));
  5113. }
  5114. destroySelf() {
  5115. this.callback = null;
  5116. this.skillSelectData = null;
  5117. this.selfPot = null;
  5118. this.aiPot = null;
  5119. if (!this.ui.isDisposed) {
  5120. this.ui.removeFromParent();
  5121. this.ui.dispose();
  5122. }
  5123. xGame.uiMgr.destroyUI(this);
  5124. }
  5125. }
  5126. UIMatching.uiName = "UIMatching";
  5127. class ui_UIRanking extends fgui.GComponent {
  5128. static createInstance() {
  5129. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5130. }
  5131. onConstruct() {
  5132. this.n26 = (this.getChild("n26"));
  5133. this.myNode = (this.getChild("myNode"));
  5134. }
  5135. }
  5136. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5137. class UIRanking extends UIBase {
  5138. constructor() {
  5139. super();
  5140. this.showSelf = true;
  5141. this.rankType = 1;
  5142. this.rankList = [];
  5143. this.myIndex = 0;
  5144. this.myStar = 0;
  5145. }
  5146. onConstructor() {
  5147. this.ui = ui_UIRanking.createInstance();
  5148. this.contentPane = this.ui;
  5149. this.isEject = false;
  5150. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5151. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5152. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5153. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5154. this.ui.myNode.myList.setVirtual();
  5155. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5156. }
  5157. show() {
  5158. super.show();
  5159. this.myIndex = 51;
  5160. Moyu.getRankList({
  5161. rankId: xGame.common.curRankID,
  5162. type: MoyuRankType.total,
  5163. page: 1,
  5164. pageSize: 50,
  5165. }, this, this.updateItemData);
  5166. this.updateSelf();
  5167. let self = Moyu.getUserInfo();
  5168. if (!self.isAuth) {
  5169. Moyu.initUser(this, () => {
  5170. DataMgr.upRankData();
  5171. });
  5172. }
  5173. }
  5174. updateSelfItem() {
  5175. let self = Moyu.getUserInfo();
  5176. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5177. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  5178. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5179. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  5180. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5181. }
  5182. updateItemData(data) {
  5183. this.myStar = xGame.common.getAllStarNum();
  5184. if (this.rankList.length < 2) {
  5185. this.rankList = data;
  5186. let self = Moyu.getUserInfo();
  5187. for (let i = 0; i < data.length; i++) {
  5188. let data = this.rankList[i];
  5189. if (data.userId == self.userId) {
  5190. this.rankList.splice(i, 1);
  5191. break;
  5192. }
  5193. }
  5194. for (let i = 0; i < data.length; i++) {
  5195. let data = this.rankList[i];
  5196. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5197. this.myIndex = i + 1;
  5198. let user = { headIcon: self.headIcon, nickName: "myself" };
  5199. let ud = { user: user, data: {} };
  5200. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5201. if (Moyu.platType < 11) {
  5202. user.headIcon = self.headIcon;
  5203. user.nickName = self.nickName;
  5204. }
  5205. this.rankList.splice(i, 0, md);
  5206. break;
  5207. }
  5208. }
  5209. }
  5210. this.updateSelfItem();
  5211. this.ui.myNode.myList.numItems = this.rankList.length;
  5212. }
  5213. updateItemUI(index, obj) {
  5214. let data = this.rankList[index];
  5215. let userData = JSON.parse(data.userData).user;
  5216. obj.nameTxt.text = userData.nickName.toString();
  5217. obj.valueTxt.text = data.rankScore;
  5218. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5219. obj.rankTxt.text = index + 1;
  5220. switch (index) {
  5221. case 0:
  5222. this.setImg(obj, 1, 0, 0);
  5223. obj.rankTxt.color = "#FFC047";
  5224. break;
  5225. case 1:
  5226. this.setImg(obj, 0, 1, 0);
  5227. obj.rankTxt.color = "#ACACAC";
  5228. break;
  5229. case 2:
  5230. this.setImg(obj, 0, 0, 1);
  5231. obj.rankTxt.color = "#D09672";
  5232. break;
  5233. default:
  5234. this.setImg(obj, 0, 0, 0);
  5235. obj.rankTxt.color = "#496FAB";
  5236. break;
  5237. }
  5238. }
  5239. setImg(obj, a, b, c) {
  5240. obj.img1.visible = a ? true : false;
  5241. obj.img2.visible = b ? true : false;
  5242. obj.img3.visible = c ? true : false;
  5243. }
  5244. changeList(type) {
  5245. this.rankType = type;
  5246. this.updateSelf();
  5247. }
  5248. changeSelfNode() {
  5249. this.showSelf = !this.showSelf;
  5250. this.updateSelf();
  5251. }
  5252. updateSelf() {
  5253. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5254. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5255. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5256. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5257. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5258. }
  5259. }
  5260. UIRanking.uiName = "UIRanking";
  5261. class ui_UISecretary extends fgui.GComponent {
  5262. static createInstance() {
  5263. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5264. }
  5265. onConstruct() {
  5266. this.n0 = (this.getChild("n0"));
  5267. this.myNode = (this.getChild("myNode"));
  5268. this.closeBtn = (this.getChild("closeBtn"));
  5269. this.t0 = this.getTransition("t0");
  5270. }
  5271. }
  5272. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5273. class UISecretary extends UIBase {
  5274. constructor() {
  5275. super();
  5276. this.curIndex = 1;
  5277. }
  5278. onConstructor() {
  5279. this.ui = ui_UISecretary.createInstance();
  5280. this.contentPane = this.ui;
  5281. this.isEject = false;
  5282. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5283. this.nodeObj = { left: null, right: null, cur: null };
  5284. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5285. }
  5286. show() {
  5287. super.show();
  5288. this.ui.t0.play();
  5289. this.updateData();
  5290. }
  5291. addSecretarySpine(node, spineName) {
  5292. if (spineName == "mishu") {
  5293. if (this.secretarySpine1) {
  5294. node.displayObject.destroyChildren();
  5295. this.playWoman(this.secretarySpine1, node.displayObject);
  5296. }
  5297. else {
  5298. let spine1 = new SpineMgr("mishu", () => {
  5299. this.secretarySpine1 = spine1;
  5300. this.playWoman(this.secretarySpine1, node.displayObject);
  5301. });
  5302. }
  5303. }
  5304. else {
  5305. if (this.secretarySpine2) {
  5306. node.displayObject.destroyChildren();
  5307. this.playWoman(this.secretarySpine2, node.displayObject);
  5308. }
  5309. else {
  5310. let spine2 = new SpineMgr("xiaomishu2", () => {
  5311. this.secretarySpine2 = spine2;
  5312. this.playWoman(this.secretarySpine2, node.displayObject);
  5313. });
  5314. }
  5315. }
  5316. }
  5317. playWoman(node, parent) {
  5318. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5319. let yy = this.ui.myNode.gameNode3.secretary.height;
  5320. let scale = 1.5;
  5321. if (node == this.secretarySpine2) {
  5322. scale = 1.2;
  5323. }
  5324. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5325. node.play(data, 0, true, parent);
  5326. }
  5327. turnLeft() {
  5328. this.curIndex--;
  5329. if (this.curIndex < 1) {
  5330. this.curIndex = 2;
  5331. }
  5332. let left = this.nodeObj.left;
  5333. let right = this.nodeObj.right;
  5334. let cur = this.nodeObj.cur;
  5335. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5336. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5337. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5338. this.updateData();
  5339. }));
  5340. this.ui.myNode.setChildIndex(right, 2);
  5341. this.nodeObj.left = cur;
  5342. this.nodeObj.right = left;
  5343. this.nodeObj.cur = right;
  5344. }
  5345. turnRight() {
  5346. this.curIndex++;
  5347. if (this.curIndex > 2) {
  5348. this.curIndex = 1;
  5349. }
  5350. let left = this.nodeObj.left;
  5351. let right = this.nodeObj.right;
  5352. let cur = this.nodeObj.cur;
  5353. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5354. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5355. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5356. this.updateData();
  5357. }));
  5358. this.ui.myNode.setChildIndex(left, 2);
  5359. this.nodeObj.left = right;
  5360. this.nodeObj.right = cur;
  5361. this.nodeObj.cur = left;
  5362. }
  5363. updateData() {
  5364. console.log('zh: updateData FFFFFFFFFF');
  5365. let data = cfgTable.secretaryshopData;
  5366. let children = this.ui.myNode._children;
  5367. let temp;
  5368. let curData;
  5369. for (let index = 0; index < children.length; index++) {
  5370. temp = children[index];
  5371. curData = data[1];
  5372. temp.heightTxt.text = curData.height;
  5373. temp.foodTxt.text = curData.food;
  5374. temp.historyTxt.text = curData.history;
  5375. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5376. this.addSecretarySpine(temp.secretary, curData.spine);
  5377. let womanIndex = curData.id - 1;
  5378. let getWoman = DataMgr.getSecretary(womanIndex);
  5379. let curUse = DataMgr.getCurSecretary();
  5380. if (getWoman) {
  5381. if (curUse == womanIndex) {
  5382. temp.purchaseBtn.c1.selectedIndex = 1;
  5383. }
  5384. else {
  5385. temp.purchaseBtn.c1.selectedIndex = 2;
  5386. }
  5387. }
  5388. else {
  5389. temp.purchaseBtn.c1.selectedIndex = 0;
  5390. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5391. }
  5392. temp.purchaseBtn.visible = false;
  5393. }
  5394. }
  5395. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5396. console.log('zh: 点击了clickSecretary ');
  5397. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5398. if (getWoman) {
  5399. if (curUse != womanIndex) {
  5400. console.log();
  5401. DataMgr.setCurSecretary(womanIndex);
  5402. this.updateData();
  5403. }
  5404. }
  5405. else {
  5406. console.log('zh:点击购买了');
  5407. let need = needDiamond;
  5408. if (DataMgr.diamondEnough(need)) {
  5409. DataMgr.setDiamond(-need);
  5410. DataMgr.setSecretary(womanIndex, 1);
  5411. DataMgr.setCurSecretary(womanIndex);
  5412. this.updateData();
  5413. }
  5414. else {
  5415. xGame.uiMgr.Show(UIAddProp, 1);
  5416. }
  5417. }
  5418. }
  5419. closeSelf() {
  5420. this.hide();
  5421. }
  5422. }
  5423. UISecretary.uiName = "UISecretary";
  5424. class ui_UIShop extends fgui.GComponent {
  5425. static createInstance() {
  5426. return (fgui.UIPackage.createObject("game", "UIShop"));
  5427. }
  5428. onConstruct() {
  5429. this.n48 = (this.getChild("n48"));
  5430. this.n0 = (this.getChild("n0"));
  5431. this.secretary = (this.getChild("secretary"));
  5432. this.talkNode = (this.getChild("talkNode"));
  5433. this.closeNode = (this.getChild("closeNode"));
  5434. this.moneyNode = (this.getChild("moneyNode"));
  5435. this.myNode = (this.getChild("myNode"));
  5436. }
  5437. }
  5438. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5439. class BallRodDisplay {
  5440. constructor(ui, index) {
  5441. this.index = 0;
  5442. this.uiIndex = 0;
  5443. this.ui = ui;
  5444. this.index = index;
  5445. this.initData();
  5446. }
  5447. initData() {
  5448. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5449. let data = cfgTable.ballrodData[this.index + 1];
  5450. this.ui.nameTxt.text = data.name;
  5451. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5452. this.ui.levelNode.c1.selectedIndex = data.quality;
  5453. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5454. if (data.spine) {
  5455. this.mySpine = new SpineMgr(data.spine, () => {
  5456. let xx = 150;
  5457. let yy = 70;
  5458. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5459. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5460. });
  5461. }
  5462. }
  5463. updateSelf() {
  5464. console.log('zh:updateSelf -------------- ');
  5465. let get = DataMgr.getBallRod(this.index);
  5466. if (get == null)
  5467. get = 1;
  5468. let curUse = DataMgr.getCurBallRod();
  5469. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5470. if (get) {
  5471. if (curUse == this.index) {
  5472. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5473. }
  5474. else {
  5475. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5476. }
  5477. }
  5478. else {
  5479. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5480. }
  5481. }
  5482. buyBallRod() {
  5483. console.log('zh:buyBallRod eeeeee');
  5484. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5485. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5486. switch (selectedIndex) {
  5487. case 0:
  5488. break;
  5489. case 1:
  5490. console.log('zh:点击了 USE THIS');
  5491. DataMgr.setCurBallRod(this.index);
  5492. let curUse = DataMgr.getCurBallRod();
  5493. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5494. let ui = xGame.uiMgr.getUI(UIShop);
  5495. ui.updateBallRod();
  5496. break;
  5497. case 2:
  5498. let data = cfgTable.ballrodData[this.index + 1];
  5499. let need = data.price;
  5500. if (DataMgr.diamondEnough(need)) {
  5501. DataMgr.setDiamond(-need);
  5502. DataMgr.setBallRod(this.index, 1);
  5503. DataMgr.setCurBallRod(this.index);
  5504. let ui = xGame.uiMgr.getUI(UIShop);
  5505. ui.updateBallRod();
  5506. }
  5507. else {
  5508. xGame.uiMgr.Show(UIAddProp, 1);
  5509. }
  5510. break;
  5511. default:
  5512. break;
  5513. }
  5514. }
  5515. }
  5516. class UIShop extends UIBase {
  5517. constructor() {
  5518. super();
  5519. this.itemNums = 0;
  5520. }
  5521. onConstructor() {
  5522. this.ui = ui_UIShop.createInstance();
  5523. this.contentPane = this.ui;
  5524. this.isEject = false;
  5525. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5526. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5527. this.addUIClick(this.ui, this.interuptSecretary);
  5528. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5529. this.ballRodArr = [];
  5530. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5531. this.ui.myNode.myList.numItems = this.itemNums;
  5532. if (Moyu.isKs)
  5533. this.ui.closeNode.closeBtn.x += 100;
  5534. }
  5535. show() {
  5536. super.show();
  5537. this.playSecretaryIdle();
  5538. this.updateBallRod();
  5539. }
  5540. updateBallRod() {
  5541. for (let index = 0; index < this.ballRodArr.length; index++) {
  5542. this.ballRodArr[index].updateSelf();
  5543. }
  5544. }
  5545. renderBallRod(sort, obj) {
  5546. let index = this.getIndexBySort(sort + 1) - 1;
  5547. let ballRod = new BallRodDisplay(obj, index);
  5548. this.ballRodArr.push(ballRod);
  5549. }
  5550. getIndexBySort(sort) {
  5551. let object = cfgTable.ballrodData;
  5552. for (const key in object) {
  5553. if (object[key].sort == sort) {
  5554. return parseInt(key);
  5555. }
  5556. }
  5557. }
  5558. playSecretaryIdle() {
  5559. let parent = this.ui.secretary.displayObject;
  5560. parent.destroyChildren();
  5561. let xx = this.ui.secretary.width / 2;
  5562. let yy = this.ui.secretary.height;
  5563. let scale = xGame.common.getSecretaryScale();
  5564. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5565. xGame.common.secretary.play(data, 0, true, parent);
  5566. }
  5567. interuptSecretary() {
  5568. Laya.timer.clearAll(this);
  5569. this.playSecretaryRandomSound();
  5570. }
  5571. playSecretaryRandomSound() {
  5572. if (this.isHide)
  5573. return;
  5574. let time = xGame.common.randomNum(45000, 60000);
  5575. Laya.timer.once(time, this, () => {
  5576. if (this.isHide)
  5577. return;
  5578. let index = xGame.common.randomNum(4, 7);
  5579. xGame.soundMgr.playSound("s_main0" + index);
  5580. let words = 1;
  5581. switch (index) {
  5582. case 4:
  5583. words = 5;
  5584. break;
  5585. case 5:
  5586. words = 3;
  5587. break;
  5588. case 6:
  5589. words = 6;
  5590. break;
  5591. case 7:
  5592. words = 7;
  5593. break;
  5594. default:
  5595. break;
  5596. }
  5597. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5598. this.playSecretaryRandomSound();
  5599. });
  5600. }
  5601. closeSelf() {
  5602. this.hide();
  5603. }
  5604. }
  5605. UIShop.uiName = "UIShop";
  5606. class ui_UISign extends fgui.GComponent {
  5607. static createInstance() {
  5608. return (fgui.UIPackage.createObject("game", "UISign"));
  5609. }
  5610. onConstruct() {
  5611. this.n6 = (this.getChild("n6"));
  5612. this.closeNode = (this.getChild("closeNode"));
  5613. this.myNode = (this.getChild("myNode"));
  5614. this.moneyNode = (this.getChild("moneyNode"));
  5615. this.secretary = (this.getChild("secretary"));
  5616. this.talkNode = (this.getChild("talkNode"));
  5617. this.tripleBtn = (this.getChild("tripleBtn"));
  5618. this.normalBtn = (this.getChild("normalBtn"));
  5619. this.tipsNode = (this.getChild("tipsNode"));
  5620. this.againBtn = (this.getChild("againBtn"));
  5621. this.t0 = this.getTransition("t0");
  5622. }
  5623. }
  5624. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5625. class SignMax {
  5626. constructor(ui) {
  5627. this.ui = ui;
  5628. }
  5629. updateSelf(index, sameDay, curDayIndex) {
  5630. let data = cfgTable.signData[index + 1];
  5631. this.ui.titleTxt.text = data.title;
  5632. let arr1 = data.award[0].split('-');
  5633. let arr2 = data.award[1].split('-');
  5634. let num1 = parseInt(arr1[1]);
  5635. let num2 = parseInt(arr2[1]);
  5636. this.ui.numTxt1.text = num1 + "";
  5637. this.ui.numTxt2.text = num2 + "";
  5638. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5639. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5640. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5641. this.ui.numTxt1.visible = false;
  5642. }
  5643. else {
  5644. this.ui.numTxt1.visible = true;
  5645. }
  5646. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5647. this.ui.numTxt2.visible = false;
  5648. }
  5649. else {
  5650. this.ui.numTxt2.visible = true;
  5651. }
  5652. if (index < curDayIndex) {
  5653. this.ui.c1.selectedIndex = 1;
  5654. }
  5655. else if (index == curDayIndex) {
  5656. if (sameDay) {
  5657. this.ui.c1.selectedIndex = 2;
  5658. }
  5659. else {
  5660. this.ui.c1.selectedIndex = 2;
  5661. }
  5662. }
  5663. else {
  5664. this.ui.c1.selectedIndex = 0;
  5665. }
  5666. }
  5667. }
  5668. class SignNormal {
  5669. constructor(ui) {
  5670. this.ui = ui;
  5671. }
  5672. updateSelf(index, sameDay, curDayIndex) {
  5673. let data = cfgTable.signData[index + 1];
  5674. this.ui.titleTxt.text = data.title;
  5675. let arr = data.award[0].split('-');
  5676. let type = parseInt(arr[0]);
  5677. let num = parseInt(arr[1]);
  5678. this.ui.numTxt.text = num + "";
  5679. if (type > 2) {
  5680. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5681. this.ui.myIcon.rotation = 0;
  5682. }
  5683. else {
  5684. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5685. this.ui.myIcon.rotation = 0;
  5686. }
  5687. if (xGame.common.signAwardContainsRod(data.award)) {
  5688. this.ui.numTxt.visible = false;
  5689. }
  5690. else {
  5691. this.ui.numTxt.visible = true;
  5692. }
  5693. if (index < curDayIndex) {
  5694. this.ui.c1.selectedIndex = 1;
  5695. }
  5696. else if (index == curDayIndex) {
  5697. if (sameDay) {
  5698. this.ui.c1.selectedIndex = 2;
  5699. }
  5700. else {
  5701. this.ui.c1.selectedIndex = 2;
  5702. }
  5703. }
  5704. else {
  5705. this.ui.c1.selectedIndex = 0;
  5706. }
  5707. }
  5708. }
  5709. class UISign extends UIBase {
  5710. constructor() {
  5711. super();
  5712. this.curDayIndex = 0;
  5713. this.starX = 0;
  5714. }
  5715. onConstructor() {
  5716. this.ui = ui_UISign.createInstance();
  5717. this.contentPane = this.ui;
  5718. this.isEject = false;
  5719. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5720. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5721. this.initSignItem();
  5722. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5723. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5724. }
  5725. show() {
  5726. super.show();
  5727. this.ui.t0.play();
  5728. this.playSecretaryIdle();
  5729. this.updateSign();
  5730. }
  5731. initSignItem() {
  5732. this.signArr = [];
  5733. for (let index = 0; index < 6; index++) {
  5734. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5735. this.signArr.push(temp);
  5736. }
  5737. this.signMax = new SignMax(this.ui.myNode.day7);
  5738. if (Moyu.isKs)
  5739. this.ui.closeNode.closeBtn.x += 100;
  5740. }
  5741. updateSign() {
  5742. let sameDay = xGame.common.judgeSameDay();
  5743. let max = 7;
  5744. this.curDayIndex = DataMgr.getSignData();
  5745. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5746. this.curDayIndex = 0;
  5747. if (!sameDay) {
  5748. this.ui.normalBtn.visible = true;
  5749. this.ui.tipsNode.visible = false;
  5750. this.ui.againBtn.visible = false;
  5751. }
  5752. else {
  5753. this.ui.normalBtn.visible = false;
  5754. let again = DataMgr.getExtraSign();
  5755. let isCurrency = false;
  5756. let index = this.curDayIndex;
  5757. if (index == 0)
  5758. index = 7;
  5759. let award = cfgTable.signData[index].award;
  5760. let num = award[0].split("-")[0];
  5761. if (num == "1" || num == "2")
  5762. isCurrency = true;
  5763. let showAgain = again == 0 && isCurrency;
  5764. this.ui.againBtn.visible = showAgain;
  5765. this.ui.tipsNode.visible = !showAgain;
  5766. }
  5767. for (let index = 0; index < this.signArr.length; index++) {
  5768. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5769. }
  5770. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5771. }
  5772. playSecretaryIdle() {
  5773. let parent = this.ui.secretary.displayObject;
  5774. parent.destroyChildren();
  5775. let xx = this.ui.secretary.width / 2;
  5776. let yy = this.ui.secretary.height;
  5777. let scale = xGame.common.getSecretaryScale();
  5778. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5779. xGame.common.secretary.play(data, 0, true, parent);
  5780. }
  5781. closeSelf() {
  5782. this.hide();
  5783. }
  5784. normalGetAward() {
  5785. let sameDay = xGame.common.judgeSameDay();
  5786. if (!sameDay) {
  5787. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5788. let temp;
  5789. let type;
  5790. let num;
  5791. let arr = [];
  5792. for (let index = 0; index < award.length; index++) {
  5793. temp = award[index].split("-");
  5794. type = parseInt(temp[0]);
  5795. num = parseInt(temp[1]);
  5796. let awardType = new AwardType();
  5797. awardType.num = num;
  5798. awardType.type = type;
  5799. arr.push(awardType);
  5800. }
  5801. xGame.common.getAward(arr, (watchVideo) => {
  5802. this.curDayIndex++;
  5803. if (this.curDayIndex > 7)
  5804. this.curDayIndex = 0;
  5805. DataMgr.setSignData(this.curDayIndex);
  5806. DataMgr.setSignTime(new Date().getTime());
  5807. if (watchVideo) {
  5808. DataMgr.setExtraSign(1);
  5809. Moyu.sendDataEvent("signIn1");
  5810. }
  5811. this.updateSign();
  5812. });
  5813. }
  5814. }
  5815. againGetAward() {
  5816. Moyu.sendDataEvent("signIn2");
  5817. console.log('zh:qjff_AD_for_uisign');
  5818. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  5819. }
  5820. else {
  5821. console.log('zh:AD 失败,直接发放奖励');
  5822. this.qjff_AD_for_uisign();
  5823. }
  5824. }
  5825. qjff_AD_for_uisign() {
  5826. let index = this.curDayIndex;
  5827. if (index == 0)
  5828. index = 7;
  5829. let award = cfgTable.signData[index].award;
  5830. let temp;
  5831. let type;
  5832. let num;
  5833. for (let index = 0; index < award.length; index++) {
  5834. temp = award[index].split("-");
  5835. type = parseInt(temp[0]);
  5836. num = parseInt(temp[1]) * 3;
  5837. xGame.common.playObjFlyAnim(num, type);
  5838. }
  5839. DataMgr.setExtraSign(1);
  5840. this.updateSign();
  5841. }
  5842. }
  5843. UISign.uiName = "UISign";
  5844. class ui_UISkill extends fgui.GComponent {
  5845. static createInstance() {
  5846. return (fgui.UIPackage.createObject("game", "UISkill"));
  5847. }
  5848. onConstruct() {
  5849. this.n48 = (this.getChild("n48"));
  5850. this.n0 = (this.getChild("n0"));
  5851. this.secretary = (this.getChild("secretary"));
  5852. this.talkNode = (this.getChild("talkNode"));
  5853. this.closeNode = (this.getChild("closeNode"));
  5854. this.moneyNode = (this.getChild("moneyNode"));
  5855. this.skillNode = (this.getChild("skillNode"));
  5856. this.guideNode = (this.getChild("guideNode"));
  5857. }
  5858. }
  5859. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5860. class SkillDisplay {
  5861. constructor(ui, data, uiIndex) {
  5862. this.starX = 0;
  5863. this.starY = 0;
  5864. this.index = 0;
  5865. this.ui = ui;
  5866. this.data = data;
  5867. this.index = uiIndex;
  5868. this.initSelf();
  5869. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5870. }
  5871. initSelf() {
  5872. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5873. this.ui.nameTxt.text = this.data.name;
  5874. this.ui.describeTxt.text = this.data.describe;
  5875. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5876. this.ui.startBtn.onClick(this, this.startGame);
  5877. this.updateSelf();
  5878. }
  5879. updateSelf() {
  5880. this.checkTry();
  5881. let level = DataMgr.getBigSkillByIndex(this.index);
  5882. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5883. }
  5884. checkTry() {
  5885. let index = this.index;
  5886. let level = DataMgr.getBigSkillByIndex(index);
  5887. if (level == null) {
  5888. DataMgr.setBigSkill(index, 1, false);
  5889. level = 1;
  5890. }
  5891. this.ui.levelTxt.text = "LV." + level;
  5892. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5893. this.ui.tryNode.visible = true;
  5894. else
  5895. this.ui.tryNode.visible = false;
  5896. }
  5897. clickAddLevel() {
  5898. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5899. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5900. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  5901. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  5902. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5903. }
  5904. else {
  5905. console.log('zh:AD 失败,直接发放奖励');
  5906. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5907. }
  5908. }
  5909. qjff_AD_for_skilldisplay_clickAddLevel() {
  5910. DataMgr.setBigSkill(this.data.index, 1);
  5911. this.updateSelf();
  5912. xGame.common.upSkillLevel = true;
  5913. }
  5914. startGame() {
  5915. if (this.data.index == 3) {
  5916. alert('Coming soon!');
  5917. return;
  5918. }
  5919. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5920. let needCoin = xGame.common.bigMoveNeedCoin;
  5921. xGame.common.passAwardCoin = 2000;
  5922. let guide = DataMgr.getSkillGuide();
  5923. console.log('zh:startGame guide=' + guide);
  5924. xGame.common.temSelfLevel = 0;
  5925. if (guide == 0) {
  5926. needCoin = 0;
  5927. xGame.common.temSelfLevel = 100;
  5928. }
  5929. if (DataMgr.coinEnough(needCoin)) {
  5930. DataMgr.setCoin(-needCoin);
  5931. xGame.common.curPlayerSkillType = this.index;
  5932. if (guide == 0)
  5933. xGame.common.curPlayerSkillType = 0;
  5934. xGame.uiMgr.Show(UIGame);
  5935. xGame.uiMgr.Hide(UIMain);
  5936. xGame.uiMgr.Show(UIMatching, () => {
  5937. xGame.common.gameUI.ui.alpha = 1;
  5938. xGame.common.gameUI.startGame();
  5939. xGame.uiMgr.Hide(UISkill);
  5940. });
  5941. }
  5942. else {
  5943. xGame.uiMgr.Show(UIAddProp, 0);
  5944. Moyu.sendDataEvent("AddCoinVideo");
  5945. }
  5946. }
  5947. }
  5948. class UISkill extends UIBase {
  5949. constructor() {
  5950. super();
  5951. this.skillData = [];
  5952. }
  5953. onConstructor() {
  5954. this.ui = ui_UISkill.createInstance();
  5955. this.contentPane = this.ui;
  5956. this.isEject = false;
  5957. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5958. this.initSkillData();
  5959. console.log('zh:aaaaaa1111111111');
  5960. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5961. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5962. console.log('zh:aaaaaa22222222');
  5963. this.displayList = [];
  5964. this.ui.skillNode.skillList.numItems = 3;
  5965. this.addUIClick(this.ui, this.interuptSecretary);
  5966. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5967. this.ui.talkNode.visible = false;
  5968. if (Moyu.isKs)
  5969. this.ui.closeNode.closeBtn.x += 100;
  5970. }
  5971. show() {
  5972. super.show();
  5973. this.playSecretaryIdle();
  5974. this.moneyNode.ui.c1.selectedIndex = 1;
  5975. Laya.timer.clearAll(this);
  5976. xGame.soundMgr.playSound("s_start");
  5977. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5978. let guide = DataMgr.getSkillGuide();
  5979. this.ui.guideNode.visible = guide == 0;
  5980. let item = this.getSkillItemByUIIndex(0);
  5981. if (guide == 0) {
  5982. item.ui.c1.selectedIndex = 1;
  5983. }
  5984. else {
  5985. item.ui.c1.selectedIndex = 0;
  5986. }
  5987. this.ui.guideNode.guideBtn.visible = guide == 0;
  5988. for (let index = 0; index < this.displayList.length; index++) {
  5989. this.displayList[index].checkTry();
  5990. }
  5991. }
  5992. getSkillItemByUIIndex(cur) {
  5993. for (let index = 0; index < this.displayList.length; index++) {
  5994. if (this.displayList[index].index == cur) {
  5995. return this.displayList[index];
  5996. }
  5997. }
  5998. }
  5999. enterGuideLevel() {
  6000. let item = this.getSkillItemByUIIndex(0);
  6001. item.startGame();
  6002. if (DataMgr.getNewUser())
  6003. Moyu.sendDataEvent("gameStart1");
  6004. }
  6005. initSkillData() {
  6006. this.skillData = [];
  6007. let nameList = xGame.common.skillNameList;
  6008. let iconList = xGame.common.skillIconList;
  6009. let describeList = [
  6010. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6011. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  6012. "The power of frost descends—freezing the flow and taking full control of the game!"
  6013. ];
  6014. console.log('zh:initSkillData 111111111');
  6015. let data;
  6016. for (let index = 0; index < nameList.length; index++) {
  6017. data = {};
  6018. data.name = nameList[index];
  6019. data.icon = iconList[index];
  6020. data.describe = describeList[index];
  6021. data.index = index;
  6022. this.skillData.push(data);
  6023. }
  6024. }
  6025. updateSkillItem(index, target) {
  6026. if (this.displayList[index] == null) {
  6027. let uiIndex;
  6028. switch (index) {
  6029. case 0:
  6030. uiIndex = 1;
  6031. break;
  6032. case 1:
  6033. uiIndex = 0;
  6034. break;
  6035. case 2:
  6036. uiIndex = 2;
  6037. break;
  6038. case 3:
  6039. uiIndex = 3;
  6040. break;
  6041. default:
  6042. break;
  6043. }
  6044. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6045. this.displayList.push(temp);
  6046. }
  6047. }
  6048. playSecretaryIdle() {
  6049. let parent = this.ui.secretary.displayObject;
  6050. parent.destroyChildren();
  6051. let xx = this.ui.secretary.width / 2;
  6052. let yy = this.ui.secretary.height;
  6053. let scale = xGame.common.getSecretaryScale();
  6054. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6055. xGame.common.secretary.play(data, 0, true, parent);
  6056. }
  6057. returnUIMain() {
  6058. this.hide();
  6059. xGame.common.stopGirlPop(this.ui.talkNode);
  6060. xGame.uiMgr.Show(UIMain);
  6061. }
  6062. interuptSecretary() {
  6063. Laya.timer.clearAll(this);
  6064. this.playSecretaryRandomSound();
  6065. }
  6066. playSecretaryRandomSound() {
  6067. if (this.isHide)
  6068. return;
  6069. let time = xGame.common.randomNum(45000, 60000);
  6070. Laya.timer.once(time, this, () => {
  6071. if (this.isHide)
  6072. return;
  6073. let index = xGame.common.randomNum(4, 7);
  6074. xGame.soundMgr.playSound("s_main0" + index);
  6075. let words = 1;
  6076. switch (index) {
  6077. case 4:
  6078. words = 5;
  6079. break;
  6080. case 5:
  6081. words = 3;
  6082. break;
  6083. case 6:
  6084. words = 6;
  6085. break;
  6086. case 7:
  6087. words = 7;
  6088. break;
  6089. default:
  6090. break;
  6091. }
  6092. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6093. this.playSecretaryRandomSound();
  6094. });
  6095. }
  6096. }
  6097. UISkill.uiName = "UISkill";
  6098. class ui_UIMsg extends fgui.GComponent {
  6099. static createInstance() {
  6100. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6101. }
  6102. onConstruct() {
  6103. this.tipsNode = (this.getChild("tipsNode"));
  6104. }
  6105. }
  6106. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6107. class UIMsg extends UIBase {
  6108. constructor() {
  6109. super();
  6110. }
  6111. onConstructor() {
  6112. this.ui = ui_UIMsg.createInstance();
  6113. this.contentPane = this.ui;
  6114. this.isEject = false;
  6115. this.isMuti = true;
  6116. }
  6117. show(msg, callback) {
  6118. super.show();
  6119. this.ui.tipsNode.msgTxt.text = msg;
  6120. this.ui.alpha = 1;
  6121. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6122. this.hide();
  6123. callback && callback();
  6124. }), 1000);
  6125. }
  6126. }
  6127. UIMsg.uiName = "UIMsg";
  6128. class ui_UIModeSelection extends fgui.GComponent {
  6129. static createInstance() {
  6130. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6131. }
  6132. onConstruct() {
  6133. this.n19 = (this.getChild("n19"));
  6134. this.closeBtn = (this.getChild("closeBtn"));
  6135. this.myNode = (this.getChild("myNode"));
  6136. this.t0 = this.getTransition("t0");
  6137. }
  6138. }
  6139. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6140. class UIModeSelection extends UIBase {
  6141. constructor() {
  6142. super();
  6143. }
  6144. onConstructor() {
  6145. this.ui = ui_UIModeSelection.createInstance();
  6146. this.contentPane = this.ui;
  6147. this.isEject = false;
  6148. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6149. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6150. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6151. this.addUIClick(this.ui.closeBtn, this.hide);
  6152. this.peopleArr = [650, 6900, 3800];
  6153. this.peopleOffest = [50, 500, 200];
  6154. this.updateSelf();
  6155. }
  6156. show(callback) {
  6157. super.show();
  6158. this.ui.t0.play();
  6159. this.callback = callback;
  6160. }
  6161. updateSelf() {
  6162. let cfg = cfgTable.modeselectData;
  6163. for (let index = 1; index <= 3; index++) {
  6164. let node = this.ui.myNode["type" + index];
  6165. node.need.text = cfg[index].need;
  6166. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6167. node.peopleTxt.text = this.getRandPeople(index - 1);
  6168. }
  6169. }
  6170. enterGame(type) {
  6171. xGame.common.classicRoomType = type;
  6172. let cfg = cfgTable.modeselectData[type];
  6173. let need = cfg.need;
  6174. xGame.common.passAwardCoin = cfg.award;
  6175. if (DataMgr.coinEnough(need)) {
  6176. DataMgr.setCoin(-need);
  6177. this.ui.myNode["type" + type].t0.play();
  6178. Laya.timer.once(200, this, () => {
  6179. this.callback && this.callback();
  6180. });
  6181. }
  6182. else {
  6183. Moyu.sendDataEvent("AddCoinVideo");
  6184. xGame.uiMgr.Show(UIAddProp, 0);
  6185. }
  6186. }
  6187. getRandPeople(index) {
  6188. let rand = this.peopleOffest[index];
  6189. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6190. }
  6191. }
  6192. UIModeSelection.uiName = "UIModeSelection";
  6193. class ui_UIGetAward extends fgui.GComponent {
  6194. static createInstance() {
  6195. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6196. }
  6197. onConstruct() {
  6198. this.n4 = (this.getChild("n4"));
  6199. this.n0 = (this.getChild("n0"));
  6200. this.myList = (this.getChild("myList"));
  6201. this.n1 = (this.getChild("n1"));
  6202. this.eftNode = (this.getChild("eftNode"));
  6203. this.btnNode = (this.getChild("btnNode"));
  6204. this.t0 = this.getTransition("t0");
  6205. }
  6206. }
  6207. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6208. class UIGetAward extends UIBase {
  6209. constructor() {
  6210. super();
  6211. this.showTriple = true;
  6212. }
  6213. onConstructor() {
  6214. this.ui = ui_UIGetAward.createInstance();
  6215. this.contentPane = this.ui;
  6216. this.isEject = false;
  6217. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6218. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6219. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6220. }
  6221. show(arr, showTriple, callback) {
  6222. super.show();
  6223. this.ui.t0.play();
  6224. this.ui.eftNode.visible = true;
  6225. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6226. this.ui.eftNode.visible = false;
  6227. }), 1, 0, 0, 0.9);
  6228. this.awardArr = arr;
  6229. this.showTriple = showTriple;
  6230. this.callback = callback;
  6231. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6232. this.ui.myList.numItems = arr.length;
  6233. xGame.soundMgr.playSound("getaward");
  6234. }
  6235. updateSelf(index, obj) {
  6236. let temp = this.awardArr[index];
  6237. let icon = this.getIcon(temp.type);
  6238. let str = icon;
  6239. if (temp.type > 2) {
  6240. str = "s" + icon;
  6241. }
  6242. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6243. obj.myIcon.rotation = 0;
  6244. obj.numTxt.text = temp.num + "";
  6245. obj.numTxt.visible = temp.type > 2 ? false : true;
  6246. obj.nameTxt.text = this.getNameStr(temp.type);
  6247. }
  6248. renderItem(index, obj) {
  6249. this.updateSelf(index, obj);
  6250. }
  6251. tripleGetAward() {
  6252. console.log('zh:qjff_AD_for_uigetAward');
  6253. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6254. }
  6255. else {
  6256. console.log('zh:AD 失败,直接发放奖励');
  6257. this.qjff_AD_for_uigetAward();
  6258. }
  6259. }
  6260. qjff_AD_for_uigetAward() {
  6261. this.getAward(3);
  6262. }
  6263. normalGetAward() {
  6264. if (PlatMgr.isMisVideo())
  6265. this.tripleGetAward();
  6266. else
  6267. this.getAward();
  6268. }
  6269. getAward(times = 1) {
  6270. this.hide();
  6271. for (let index = 0; index < this.awardArr.length; index++) {
  6272. this.awardArr[index].num *= times;
  6273. }
  6274. this.callback && this.callback(times != 1);
  6275. }
  6276. getIcon(type) {
  6277. switch (type) {
  6278. case Prop.diamond:
  6279. return "ty_zs";
  6280. case Prop.coin:
  6281. return "ty_jb";
  6282. case Prop.gan1:
  6283. return "qg1";
  6284. case Prop.gan2:
  6285. return "qg2";
  6286. case Prop.gan3:
  6287. return "qg3";
  6288. case Prop.gan4:
  6289. return "qg4";
  6290. default:
  6291. break;
  6292. }
  6293. }
  6294. getNameStr(type) {
  6295. switch (type) {
  6296. case Prop.diamond:
  6297. return "Diamond";
  6298. case Prop.coin:
  6299. return "Coins";
  6300. case Prop.gan1:
  6301. case Prop.gan2:
  6302. case Prop.gan3:
  6303. case Prop.gan4:
  6304. return cfgTable.ballrodData[type - 1].name;
  6305. default:
  6306. break;
  6307. }
  6308. }
  6309. }
  6310. UIGetAward.uiName = "UIGetAward";
  6311. class ui_UIRepentProp extends fgui.GComponent {
  6312. static createInstance() {
  6313. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6314. }
  6315. onConstruct() {
  6316. this.c1 = this.getController("c1");
  6317. this.n11 = (this.getChild("n11"));
  6318. this.regretNode = (this.getChild("regretNode"));
  6319. this.helpLineNode = (this.getChild("helpLineNode"));
  6320. this.t0 = this.getTransition("t0");
  6321. }
  6322. }
  6323. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6324. class UIRepentProp extends UIBase {
  6325. constructor() {
  6326. super();
  6327. this.viewType = 0;
  6328. this.regretType = 0;
  6329. }
  6330. onConstructor() {
  6331. this.ui = ui_UIRepentProp.createInstance();
  6332. this.contentPane = this.ui;
  6333. this.isEject = false;
  6334. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6335. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6336. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6337. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6338. }
  6339. show(viewType, regretType, callback) {
  6340. PlatMgr.showInsert(true);
  6341. this.viewType = viewType;
  6342. this.regretType = regretType;
  6343. this.callback = callback;
  6344. super.show();
  6345. this.ui.t0.play();
  6346. this.ui.c1.selectedIndex = this.viewType;
  6347. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6348. if (this.viewType == 0) {
  6349. let guide = DataMgr.getGuideHelpLine();
  6350. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6351. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6352. }
  6353. xGame.common.gameMgr.gamePause = true;
  6354. }
  6355. hideSelf() {
  6356. xGame.common.gameMgr.gamePause = false;
  6357. this.callback && this.callback(false);
  6358. this.hide();
  6359. }
  6360. videoRegret() {
  6361. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6362. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6363. }
  6364. else {
  6365. console.log('zh:AD 失败,直接发放奖励');
  6366. this.qjff_AD_for_UIrepentProp_videoRegret();
  6367. }
  6368. }
  6369. qjff_AD_for_UIrepentProp_videoRegret() {
  6370. this.callback && this.callback(true);
  6371. this.hideSelf();
  6372. }
  6373. videoAddHelpLine() {
  6374. let guide = DataMgr.getGuideHelpLine();
  6375. if (guide == 0) {
  6376. this.callback && this.callback(true);
  6377. this.hideSelf();
  6378. DataMgr.setGuideHelpLine();
  6379. xGame.common.gameUI.ui.guideNode.visible = false;
  6380. }
  6381. else {
  6382. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6383. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6384. }
  6385. else {
  6386. console.log('zh:AD 失败,直接发放奖励');
  6387. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6388. }
  6389. }
  6390. }
  6391. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6392. this.callback && this.callback(true);
  6393. this.hideSelf();
  6394. }
  6395. }
  6396. UIRepentProp.uiName = "UIRepentProp";
  6397. class UIMain extends UIBase {
  6398. constructor() {
  6399. super();
  6400. this.firstEnter = true;
  6401. }
  6402. nativeCallJs(msg) {
  6403. let t = msg;
  6404. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6405. switch (t) {
  6406. case 'qjff_chouJiang':
  6407. let dui = xGame.uiMgr.getUI(UIDraw);
  6408. dui.qjff_chouJiang();
  6409. break;
  6410. case 'qjff_AD_for_uisign':
  6411. let dui2 = xGame.uiMgr.getUI(UISign);
  6412. dui2.qjff_AD_for_uisign();
  6413. break;
  6414. case 'qjff_AD_for_uitry':
  6415. let dui3 = xGame.uiMgr.getUI(UITry);
  6416. dui3.qjff_AD_for_uitry();
  6417. break;
  6418. case 'qjff_AD_for_uipower':
  6419. let dui4 = xGame.uiMgr.getUI(UIPower);
  6420. dui4.qjff_AD_for_uipower();
  6421. break;
  6422. case 'qjff_AD_for_uigetAward':
  6423. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6424. dui5.qjff_AD_for_uigetAward();
  6425. break;
  6426. case 'qjff_AD_for_uiGameEnd':
  6427. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6428. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6429. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6430. break;
  6431. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6432. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6433. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6434. break;
  6435. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6436. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6437. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6438. break;
  6439. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6440. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6441. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6442. break;
  6443. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6444. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6445. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6446. break;
  6447. case 'qjff_AD_for_UIBOX_onOpenBox':
  6448. let dui11 = xGame.uiMgr.getUI(UIBox);
  6449. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6450. break;
  6451. case 'qjff_AD_for_UIAddCoin':
  6452. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6453. dui12.qjff_AD_for_UIAddCoin();
  6454. break;
  6455. case '111a':
  6456. let dui14 = xGame.uiMgr.getUI(UISign);
  6457. dui14.qjff_AD_for_uisign();
  6458. break;
  6459. case '222a':
  6460. let dui15 = xGame.uiMgr.getUI(UISign);
  6461. dui15.qjff_AD_for_uisign();
  6462. break;
  6463. case '333a':
  6464. let dui16 = xGame.uiMgr.getUI(UISign);
  6465. dui16.qjff_AD_for_uisign();
  6466. break;
  6467. default:
  6468. console.log('zh:未知的方法名字' + t);
  6469. break;
  6470. }
  6471. }
  6472. onConstructor() {
  6473. console.log('zh: UIMain onConstructor');
  6474. this.ui = ui_UIMain.createInstance();
  6475. this.contentPane = this.ui;
  6476. this.isEject = false;
  6477. this.addEvent();
  6478. this.addClickSpine();
  6479. this.settingNode = new SettingNode(this.ui.settingNode);
  6480. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6481. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6482. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6483. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6484. let curUse = DataMgr.getCurSecretary();
  6485. this.changeSecretary(curUse);
  6486. this.ui.talkNode.visible = false;
  6487. let guide = DataMgr.getSkillGuide();
  6488. if (xGame.common.isNewDay && guide == 1) {
  6489. xGame.common.isNewDay = false;
  6490. xGame.soundMgr.playSound("s_main01");
  6491. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6492. console.log("zh:播放小秘书每天语音");
  6493. }
  6494. this.ui.n83.visible = false;
  6495. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6496. }
  6497. changeSecretary(curUse) {
  6498. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6499. xGame.common.secretary && xGame.common.secretary.dispose();
  6500. this.addSecretarySpine(name);
  6501. }
  6502. addSecretarySpine(name) {
  6503. let spine = new SpineMgr(name, () => {
  6504. this.playSecretaryIdle();
  6505. });
  6506. xGame.common.secretary = spine;
  6507. }
  6508. addClickSpine() {
  6509. let clickSpine = new SpineMgr("dianji", () => {
  6510. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6511. let parent = Laya.stage;
  6512. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6513. clickSpine.play(data, 0, false, parent, (spine) => {
  6514. spine.destroy(true);
  6515. });
  6516. });
  6517. });
  6518. }
  6519. addEvent() {
  6520. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6521. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6522. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6523. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6524. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6525. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6526. this.addUIClick(this.ui, this.interuptSecretary);
  6527. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6528. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6529. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6530. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6531. this.addUIClick(this.ui.signBtn, this.openSignView);
  6532. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6533. }
  6534. show(showFailWords) {
  6535. super.show();
  6536. this.moneyNode.ui.c1.selectedIndex = 1;
  6537. this.playSecretaryIdle();
  6538. xGame.soundMgr.playMusic("caromhall01", 0);
  6539. Laya.timer.clearAll(this);
  6540. this.playSecretaryRandomSound();
  6541. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  6542. if (showFailWords) {
  6543. console.log('zh:uimain.ts ');
  6544. setTimeout(() => {
  6545. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6546. let words = -1;
  6547. if (str == "s_main02") {
  6548. words = 2;
  6549. }
  6550. else {
  6551. words = 3;
  6552. }
  6553. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6554. xGame.soundMgr.playSound(str);
  6555. }, 300);
  6556. }
  6557. this.showGuide();
  6558. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6559. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6560. let guide = DataMgr.getSkillGuide();
  6561. if (guide == 1) {
  6562. let randTime = xGame.common.randomNum(300, 800);
  6563. if (this.firstEnter) {
  6564. this.firstEnter = false;
  6565. randTime += 900;
  6566. }
  6567. Laya.timer.once(randTime, this, () => {
  6568. xGame.common.autoPopUIView();
  6569. });
  6570. }
  6571. }
  6572. checkActive(show) {
  6573. }
  6574. showGuide() {
  6575. let guide = DataMgr.getSkillGuide();
  6576. this.ui.guideBtn.visible = guide == 0;
  6577. this.ui.enterGuide.visible = false;
  6578. this.ui.secretaryGuide.visible = guide == 0;
  6579. if (guide == 0) {
  6580. xGame.soundMgr.playSound("s_guide");
  6581. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6582. }
  6583. }
  6584. ensureSecretary() {
  6585. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6586. this.ui.secretaryGuide.visible = false;
  6587. this.ui.enterGuide.visible = true;
  6588. this.ui.wordsNode.t0.play();
  6589. if (DataMgr.getNewUser())
  6590. Moyu.sendDataEvent("gameReady");
  6591. }
  6592. playSecretaryIdle() {
  6593. let parent = this.ui.secretary.displayObject;
  6594. parent.destroyChildren();
  6595. let xx = this.ui.secretary.width / 2;
  6596. let yy = this.ui.secretary.height;
  6597. let scale = xGame.common.getSecretaryScale();
  6598. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6599. console.log("zh:playSecretaryIdle", data);
  6600. xGame.common.secretary.play(data, 0, true, parent);
  6601. }
  6602. startGame(type) {
  6603. xGame.common.gameMode = type;
  6604. Moyu.sendDataEvent("PlayGame", { type: type });
  6605. switch (xGame.common.gameMode) {
  6606. case GameMode.classic:
  6607. let challengeTimes = DataMgr.getChallengeTimes();
  6608. if (challengeTimes == 0) {
  6609. xGame.uiMgr.Show(UIInvitation);
  6610. }
  6611. else {
  6612. this.beginGame();
  6613. }
  6614. break;
  6615. case GameMode.bigMove:
  6616. this.beginGame();
  6617. if (DataMgr.getNewUser())
  6618. Moyu.sendDataEvent("gameStart0");
  6619. break;
  6620. default:
  6621. break;
  6622. }
  6623. }
  6624. beginGame(isNice = false) {
  6625. console.log('zh:beginGame beginGame beginGame');
  6626. if (xGame.common.gameMode == GameMode.classic) {
  6627. if (isNice) {
  6628. this.enterClassic();
  6629. }
  6630. else {
  6631. xGame.uiMgr.Show(UIModeSelection, () => {
  6632. this.enterClassic();
  6633. });
  6634. }
  6635. }
  6636. else if (xGame.common.gameMode == GameMode.bigMove) {
  6637. this.ui.enterGuide.visible = false;
  6638. xGame.uiMgr.Show(UISkill);
  6639. }
  6640. }
  6641. enterClassic() {
  6642. xGame.uiMgr.Show(UIGame);
  6643. xGame.uiMgr.Show(UIMatching, () => {
  6644. if (!this.isHide)
  6645. this.hide();
  6646. xGame.common.gameUI.ui.alpha = 1;
  6647. xGame.common.gameUI.startGame();
  6648. xGame.uiMgr.Hide(UIGameEnd);
  6649. });
  6650. }
  6651. startGlobal() {
  6652. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6653. }
  6654. startWeekly() {
  6655. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6656. }
  6657. zhouSaiMonth() {
  6658. console.log('zh: zhouSaiMonth 被调用');
  6659. }
  6660. startPlaceBall() {
  6661. xGame.uiMgr.Show(UILevelDisplay);
  6662. }
  6663. hide() {
  6664. console.log('zh:uimain hide ...');
  6665. super.hide();
  6666. xGame.common.stopGirlPop(this.ui.talkNode);
  6667. }
  6668. onGetUserInfo(force = false) {
  6669. if (Moyu.isWx) {
  6670. let info = Moyu.getSystemInfo();
  6671. if (info)
  6672. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6673. }
  6674. else {
  6675. Moyu.initUser(this, this.freshUser, force);
  6676. }
  6677. if (!Moyu.hasUserInfo) {
  6678. let user = Moyu.getUserInfo();
  6679. user.headIcon = 'res/ty_touxiang.png';
  6680. }
  6681. this.freshUser();
  6682. }
  6683. freshUser() {
  6684. let user = Moyu.getUserInfo();
  6685. if (!user.isAuth) {
  6686. user.headIcon = 'res/ty_touxiang.png';
  6687. }
  6688. else
  6689. DataMgr.upRankData();
  6690. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6691. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6692. }
  6693. interuptSecretary() {
  6694. Laya.timer.clearAll(this);
  6695. this.playSecretaryRandomSound();
  6696. }
  6697. playSecretaryRandomSound() {
  6698. if (this.isHide)
  6699. return;
  6700. let time = xGame.common.randomNum(45000, 60000);
  6701. Laya.timer.once(time, this, () => {
  6702. if (this.isHide)
  6703. return;
  6704. let index = xGame.common.randomNum(4, 7);
  6705. xGame.soundMgr.playSound("s_main0" + index);
  6706. let words = 1;
  6707. switch (index) {
  6708. case 4:
  6709. words = 5;
  6710. break;
  6711. case 5:
  6712. words = 3;
  6713. break;
  6714. case 6:
  6715. words = 6;
  6716. break;
  6717. case 7:
  6718. words = 7;
  6719. break;
  6720. default:
  6721. break;
  6722. }
  6723. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6724. this.playSecretaryRandomSound();
  6725. });
  6726. }
  6727. openSecretaryView() {
  6728. xGame.uiMgr.Show(UISecretary);
  6729. Moyu.sendDataEvent("secretary");
  6730. }
  6731. openShopView() {
  6732. xGame.uiMgr.Show(UIShop);
  6733. }
  6734. openSignView() {
  6735. xGame.uiMgr.Show(UISign);
  6736. }
  6737. openDrawView() {
  6738. xGame.uiMgr.Show(UIDraw);
  6739. }
  6740. openRanking() {
  6741. xGame.uiMgr.Show(UIRanking);
  6742. Moyu.sendDataEvent("rankingList");
  6743. }
  6744. }
  6745. UIMain.uiName = "UIMain";
  6746. class UIGameEnd extends UIBase {
  6747. constructor() {
  6748. super();
  6749. this.success = false;
  6750. this.awardCoinNum = 1000;
  6751. this.awardDiamondNum = 10;
  6752. }
  6753. onConstructor() {
  6754. this.ui = ui_UIGameEnd.createInstance();
  6755. this.contentPane = this.ui;
  6756. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6757. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6758. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6759. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6760. this.ui.talkNode.visible = false;
  6761. if (Moyu.isKs)
  6762. this.ui.closeNode.closeBtn.x += 100;
  6763. }
  6764. updateType() {
  6765. switch (xGame.common.gameMode) {
  6766. case GameMode.classic:
  6767. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6768. this.ui.coinNode.visible = this.success;
  6769. if (!this.success) {
  6770. Laya.timer.once(500, this, () => {
  6771. xGame.uiMgr.Show(UIAddCoin);
  6772. });
  6773. }
  6774. this.ui.isGetAward.visible = false;
  6775. this.ui.leftBtn.c1.selectedIndex = 3;
  6776. this.ui.rightBtn.c1.selectedIndex = 0;
  6777. this.moneyNode.ui.c1.selectedIndex = 1;
  6778. break;
  6779. case GameMode.bigMove:
  6780. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6781. this.ui.coinNode.visible = this.success;
  6782. if (xGame.common.gameMode == GameMode.bigMove) {
  6783. if (this.success) {
  6784. DataMgr.setSkillSuccessTimes(1, true);
  6785. DataMgr.setSkillAccTimes(1);
  6786. }
  6787. else {
  6788. DataMgr.setSkillSuccessTimes(0, false);
  6789. }
  6790. }
  6791. if (!this.success) {
  6792. Laya.timer.once(500, this, () => {
  6793. xGame.uiMgr.Show(UIAddCoin);
  6794. });
  6795. }
  6796. this.ui.isGetAward.visible = false;
  6797. this.ui.leftBtn.c1.selectedIndex = 3;
  6798. this.ui.rightBtn.c1.selectedIndex = 0;
  6799. this.moneyNode.ui.c1.selectedIndex = 1;
  6800. break;
  6801. case GameMode.placeBall:
  6802. this.ui.coinNode.visible = false;
  6803. if (this.success) {
  6804. if (xGame.common.placeBallStarNum == 3) {
  6805. this.ui.c1.selectedIndex = 2;
  6806. }
  6807. else {
  6808. this.ui.c1.selectedIndex = 3;
  6809. }
  6810. }
  6811. else {
  6812. this.ui.c1.selectedIndex = 4;
  6813. }
  6814. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6815. if (cfg.type == PlaceBallType.challenge) {
  6816. this.ui.c1.selectedIndex = 2;
  6817. }
  6818. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6819. this.updatePlaceBallBtn();
  6820. this.updatePlaceBallStarNum();
  6821. this.updatePlaceBallAwardState();
  6822. this.moneyNode.ui.c1.selectedIndex = 2;
  6823. this.moneyNode.checkPowerTime();
  6824. this.moneyNode.powerChange();
  6825. DataMgr.upRankData();
  6826. break;
  6827. default:
  6828. break;
  6829. }
  6830. }
  6831. updatePlaceBallBtn() {
  6832. this.ui.leftBtn.c1.selectedIndex = 5;
  6833. if (this.success) {
  6834. this.ui.rightBtn.c1.selectedIndex = 14;
  6835. }
  6836. else {
  6837. if (xGame.common.placeBallStarNum == 3) {
  6838. this.ui.rightBtn.c1.selectedIndex = 14;
  6839. }
  6840. else {
  6841. this.ui.rightBtn.c1.selectedIndex = 1;
  6842. }
  6843. }
  6844. }
  6845. updatePlaceBallStarNum() {
  6846. let starNum = xGame.common.placeBallStarNum;
  6847. if (starNum == 0)
  6848. this.ui.starNumNode.c1.selectedIndex = 3;
  6849. else {
  6850. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6851. }
  6852. }
  6853. updatePlaceBallAwardState() {
  6854. let level = xGame.common.placeBallCurLevel;
  6855. let starNum = xGame.common.placeBallStarNum;
  6856. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6857. let data = cfgTable.placeballData[level].award;
  6858. let cfg = cfgTable.placeballData[level];
  6859. this.awardDiamondNum = data[1];
  6860. this.awardCoinNum = data[0];
  6861. if (cfg.type == PlaceBallType.challenge) {
  6862. this.awardDiamondNum = 0;
  6863. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6864. }
  6865. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6866. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6867. if (cfg.type == PlaceBallType.challenge) {
  6868. this.ui.awardNode.coinNode.visible = true;
  6869. }
  6870. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6871. this.ui.awardNode.diamondNode.x = 265;
  6872. this.ui.awardNode.coinNode.x = 354;
  6873. }
  6874. else {
  6875. this.ui.awardNode.diamondNode.x = 291;
  6876. this.ui.awardNode.coinNode.x = 291;
  6877. }
  6878. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6879. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6880. if (this.awardCoinNum == 0) {
  6881. this.ui.awardNode.coinNode.numTxt.text = "";
  6882. }
  6883. if (getAward) {
  6884. this.ui.isGetAward.visible = true;
  6885. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6886. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6887. }
  6888. else {
  6889. this.ui.isGetAward.visible = false;
  6890. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6891. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6892. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6893. }
  6894. else {
  6895. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6896. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6897. }
  6898. }
  6899. }
  6900. show(success) {
  6901. super.show();
  6902. xGame.eventMgr.event(RESET_GAME);
  6903. this.success = success;
  6904. Laya.timer.clearAll(this);
  6905. this.playSecretaryAni();
  6906. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6907. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6908. offsetTime = Math.floor(offsetTime / 1000);
  6909. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6910. this.updateType();
  6911. Laya.timer.once(200, this, () => {
  6912. this.addAward(() => {
  6913. this.updateType();
  6914. Laya.timer.once(500, this, () => {
  6915. this.showChallengeLevel();
  6916. });
  6917. });
  6918. });
  6919. if (this.success) {
  6920. xGame.soundMgr.playSound('slots_roll01');
  6921. xGame.soundMgr.playSound("s_win");
  6922. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6923. }
  6924. else {
  6925. xGame.soundMgr.playSound('matchwin01');
  6926. xGame.soundMgr.playSound("s_lose");
  6927. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6928. }
  6929. if (!Moyu.isLegal)
  6930. PlatMgr.showBanner(true);
  6931. let challengeNum = DataMgr.getChallengeTimes();
  6932. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6933. DataMgr.setChallengeTimes(1);
  6934. }
  6935. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6936. DataMgr.setClassicTimes();
  6937. }
  6938. }
  6939. showChallengeLevel() {
  6940. if (DataMgr.getChallengeTimes() != 0)
  6941. return;
  6942. let skill = DataMgr.getSkillAccTimes();
  6943. let put = DataMgr.getPlaceBallLevelList().length;
  6944. if (skill >= 3 || put >= 5) {
  6945. xGame.uiMgr.Show(UIInvitation);
  6946. this.hide();
  6947. }
  6948. }
  6949. addAward(callback) {
  6950. if (!this.success) {
  6951. callback && callback();
  6952. return;
  6953. }
  6954. switch (xGame.common.gameMode) {
  6955. case GameMode.classic:
  6956. this.awardCoinNum = xGame.common.passAwardCoin;
  6957. this.awardDiamondNum = 0;
  6958. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6959. break;
  6960. case GameMode.bigMove:
  6961. this.awardCoinNum = xGame.common.passAwardCoin;
  6962. this.awardDiamondNum = 0;
  6963. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6964. callback && callback();
  6965. break;
  6966. case GameMode.placeBall:
  6967. let level = xGame.common.placeBallCurLevel;
  6968. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6969. if (xGame.common.placeBallStarNum != 3) {
  6970. callback && callback();
  6971. return;
  6972. }
  6973. else {
  6974. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6975. if (getAward) {
  6976. callback && callback();
  6977. return;
  6978. }
  6979. }
  6980. let cfg = cfgTable.placeballData[level];
  6981. let data = cfgTable.placeballData[level].award;
  6982. this.awardCoinNum = data[0];
  6983. this.awardDiamondNum = data[1];
  6984. if (cfg.type == PlaceBallType.challenge) {
  6985. this.awardDiamondNum = 0;
  6986. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6987. }
  6988. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6989. let diamondAward;
  6990. if (this.awardDiamondNum > 0) {
  6991. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6992. xGame.common.getAward([diamondAward, coinAward], callback);
  6993. }
  6994. else {
  6995. xGame.common.getAward([coinAward], callback);
  6996. }
  6997. if (cfg.type == PlaceBallType.normal) {
  6998. DataMgr.setPlaceBallAward(level);
  6999. }
  7000. break;
  7001. default:
  7002. break;
  7003. }
  7004. }
  7005. playSecretaryAni_old() {
  7006. let parent = this.ui.secretary.displayObject;
  7007. parent.destroyChildren();
  7008. let xx = this.ui.secretary.width / 2;
  7009. let yy = this.ui.secretary.height;
  7010. let scale = xGame.common.getSecretaryScale();
  7011. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7012. if (this.success) {
  7013. let rand = Math.random() <= 0.5 ? 2 : 3;
  7014. xGame.common.secretary.play(data, rand, false, parent, () => {
  7015. xGame.common.secretary.play(data, 1, true, parent);
  7016. });
  7017. }
  7018. else {
  7019. xGame.common.secretary.play(data, 0, true, parent);
  7020. }
  7021. }
  7022. playSecretaryAni() {
  7023. let parent = this.ui.secretary.displayObject;
  7024. parent.destroyChildren();
  7025. let xx = this.ui.secretary.width / 2;
  7026. let yy = this.ui.secretary.height;
  7027. let scale = xGame.common.getSecretaryScale();
  7028. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7029. if (this.success) {
  7030. let rand = 0;
  7031. xGame.common.secretary.play(data, 0, true, parent);
  7032. }
  7033. else {
  7034. xGame.common.secretary.play(data, 0, true, parent);
  7035. }
  7036. }
  7037. restartGame() {
  7038. switch (xGame.common.gameMode) {
  7039. case GameMode.classic:
  7040. xGame.eventMgr.event(RESTART_GAME);
  7041. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7042. break;
  7043. case GameMode.bigMove:
  7044. this.hide();
  7045. xGame.eventMgr.event(RESTART_GAME);
  7046. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7047. break;
  7048. default:
  7049. break;
  7050. }
  7051. }
  7052. hide() {
  7053. super.hide();
  7054. xGame.common.stopGirlPop(this.ui.talkNode);
  7055. PlatMgr.showBanner(false);
  7056. }
  7057. returnHome() {
  7058. this.hide();
  7059. let showFailWords = !this.success;
  7060. xGame.uiMgr.Show(UIMain, showFailWords);
  7061. }
  7062. clickLeftBtn() {
  7063. switch (xGame.common.gameMode) {
  7064. case GameMode.classic:
  7065. case GameMode.bigMove:
  7066. this.returnHome();
  7067. break;
  7068. case GameMode.placeBall:
  7069. let level = xGame.common.placeBallCurLevel;
  7070. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7071. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7072. break;
  7073. default:
  7074. break;
  7075. }
  7076. }
  7077. powerStartPlaceBallLevel(level, btn) {
  7078. if (DataMgr.powerEnough()) {
  7079. btn.touchable = false;
  7080. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7081. btn.touchable = true;
  7082. DataMgr.setPower(-1);
  7083. xGame.eventMgr.event(POWER_TIME);
  7084. this.startPlaceBallLevel(level);
  7085. }));
  7086. }
  7087. else {
  7088. xGame.uiMgr.Show(UIPower, 0);
  7089. }
  7090. }
  7091. clickRightBtn() {
  7092. switch (xGame.common.gameMode) {
  7093. case GameMode.classic:
  7094. console.log('zh:clickRightBtn 111');
  7095. case GameMode.bigMove:
  7096. console.log('zh:clickRightBtn 222');
  7097. this.restartGame();
  7098. break;
  7099. case GameMode.placeBall:
  7100. console.log('zh:clickRightBtn 333');
  7101. let level = xGame.common.placeBallCurLevel;
  7102. let data = DataMgr.getPlaceBallLevel(level);
  7103. let curPss = data.play && !data.isCur;
  7104. if (curPss) {
  7105. console.log('zh:clickRightBtn 333-111');
  7106. console.log('zh:当前LV=' + level);
  7107. if (level == 60) {
  7108. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7109. Laya.timer.once(3000, this, () => {
  7110. this.returnHome();
  7111. });
  7112. }
  7113. else {
  7114. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  7115. }
  7116. }
  7117. else {
  7118. console.log('zh:clickRightBtn 333-000');
  7119. Moyu.sendDataEvent("placeBallNextLevel");
  7120. console.log('zh:qjff_AD_for_uiGameEnd');
  7121. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7122. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7123. }
  7124. else {
  7125. console.log('zh:AD 失败,直接发放奖励');
  7126. this.qjff_AD_for_uiGameEnd(level);
  7127. }
  7128. }
  7129. break;
  7130. default:
  7131. console.log('zh:clickRightBtn 444');
  7132. break;
  7133. }
  7134. }
  7135. qjff_AD_for_uiGameEnd(level) {
  7136. DataMgr.setPlaceBallLevel(level, 1);
  7137. this.startPlaceBallLevel(level + 1);
  7138. }
  7139. startPlaceBallLevel(level) {
  7140. xGame.common.gameMode = GameMode.placeBall;
  7141. xGame.common.placeBallCurLevel = level;
  7142. xGame.uiMgr.Show(UIGame);
  7143. this.hide();
  7144. }
  7145. }
  7146. UIGameEnd.uiName = "UIGameEnd";
  7147. class ui_UIVideoShare extends fgui.GComponent {
  7148. static createInstance() {
  7149. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7150. }
  7151. onConstruct() {
  7152. this.n10 = (this.getChild("n10"));
  7153. this.myNode = (this.getChild("myNode"));
  7154. this.t0 = this.getTransition("t0");
  7155. }
  7156. }
  7157. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7158. class UIVideoShare extends UIBase {
  7159. constructor() {
  7160. super();
  7161. this.success = false;
  7162. this.awardNum = 0;
  7163. this.isShared = true;
  7164. }
  7165. onConstructor() {
  7166. this.ui = ui_UIVideoShare.createInstance();
  7167. this.contentPane = this.ui;
  7168. this.isEject = false;
  7169. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7170. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7171. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7172. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7173. }
  7174. show(success) {
  7175. super.show();
  7176. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7177. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7178. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7179. this.success = success;
  7180. let time = xGame.common.randomNum(600, 1500);
  7181. Moyu.showInsertAd(time, 60000);
  7182. if (success)
  7183. xGame.soundMgr.playSound("applause");
  7184. this.ui.t0.play();
  7185. this.checkShareState();
  7186. let times = DataMgr.getDailyVideoShareTimes();
  7187. this.awardNum = times == 0 ? 2000 : 200;
  7188. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7189. }
  7190. checkShareState() {
  7191. if (PlatMgr.forceShare == 0) {
  7192. this.ui.myNode.closeBtn.visible = true;
  7193. this.ui.myNode.tipsNode.visible = false;
  7194. this.ui.myNode.closeBtn.x = 90;
  7195. this.ui.myNode.shareBtn.x = 342;
  7196. }
  7197. else if (PlatMgr.forceShare == 1) {
  7198. this.ui.myNode.closeBtn.visible = false;
  7199. this.ui.myNode.tipsNode.visible = true;
  7200. this.ui.myNode.shareBtn.x = 218;
  7201. this.isShared = true;
  7202. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7203. }
  7204. }
  7205. checkForceShare() {
  7206. this.isShared = !this.isShared;
  7207. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7208. }
  7209. videoShare() {
  7210. if (PlatMgr.forceShare == 1) {
  7211. if (this.isShared) {
  7212. this.shareGame();
  7213. }
  7214. else {
  7215. this.hideSelf();
  7216. }
  7217. }
  7218. else {
  7219. this.shareGame();
  7220. }
  7221. }
  7222. shareGame() {
  7223. Moyu.sendDataEvent("VideoShare");
  7224. if (Moyu.canShare() > 100) {
  7225. Moyu.shareGame((success) => {
  7226. if (success) {
  7227. DataMgr.setDailyVideoShareTimes(1);
  7228. DataMgr.setCoin(this.awardNum);
  7229. }
  7230. this.hideSelf();
  7231. }, this);
  7232. }
  7233. else {
  7234. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7235. this.hideSelf();
  7236. }
  7237. }
  7238. hideSelf() {
  7239. this.hide();
  7240. xGame.uiMgr.Show(UIGameEnd, this.success);
  7241. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7242. xGame.common.screenImg.destroy();
  7243. xGame.common.screenImg = null;
  7244. }
  7245. }
  7246. }
  7247. UIVideoShare.uiName = "UIVideoShare";
  7248. class ui_UITips extends fgui.GComponent {
  7249. static createInstance() {
  7250. return (fgui.UIPackage.createObject("game", "UITips"));
  7251. }
  7252. onConstruct() {
  7253. this.n0 = (this.getChild("n0"));
  7254. this.myNode = (this.getChild("myNode"));
  7255. this.t0 = this.getTransition("t0");
  7256. }
  7257. }
  7258. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7259. class UITips extends UIBase {
  7260. constructor() {
  7261. super();
  7262. this.type = 0;
  7263. }
  7264. onConstructor() {
  7265. this.ui = ui_UITips.createInstance();
  7266. this.contentPane = this.ui;
  7267. this.isEject = false;
  7268. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7269. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7270. }
  7271. show(tipsTxt, womanTxt, type) {
  7272. super.show();
  7273. this.ui.t0.play();
  7274. this.ui.myNode.tipsTxt.text = tipsTxt;
  7275. this.ui.myNode.womanTxt.text = womanTxt;
  7276. PlatMgr.showInsert(true);
  7277. this.ui.myNode.c1.selectedIndex = type;
  7278. this.type = type;
  7279. switch (this.type) {
  7280. case TipsType.exitGame:
  7281. xGame.common.gameMgr.gamePause = true;
  7282. break;
  7283. case TipsType.foul:
  7284. Laya.timer.once(200, this, () => {
  7285. xGame.common.gameMgr.gamePause = true;
  7286. });
  7287. break;
  7288. default:
  7289. break;
  7290. }
  7291. }
  7292. clickLeftBtn() {
  7293. this.hide();
  7294. xGame.common.gameMgr.gamePause = false;
  7295. switch (this.type) {
  7296. case TipsType.exitGame:
  7297. break;
  7298. case TipsType.foul:
  7299. break;
  7300. default:
  7301. break;
  7302. }
  7303. }
  7304. clickRightBtn() {
  7305. this.hide();
  7306. switch (this.type) {
  7307. case TipsType.exitGame:
  7308. xGame.eventMgr.event(RESET_GAME);
  7309. xGame.uiMgr.Show(UIMain);
  7310. Moyu.recordEnd(this, null);
  7311. xGame.common.longHelpLine = false;
  7312. break;
  7313. case TipsType.foul:
  7314. xGame.common.gameMgr.gamePause = false;
  7315. Laya.timer.clearAll(this);
  7316. break;
  7317. default:
  7318. break;
  7319. }
  7320. }
  7321. }
  7322. UITips.uiName = "UITips";
  7323. class GameMgr {
  7324. constructor() {
  7325. this.selfCamp = "";
  7326. this.selfFoulNum = 0;
  7327. this.selfBallArr = [];
  7328. this.selfTimer = 0;
  7329. this.selfScore = 0;
  7330. this.aiCamp = "";
  7331. this.aiFoulNum = 0;
  7332. this.aiBallArr = [];
  7333. this.aiTimer = 0;
  7334. this.aiScore = 0;
  7335. this.aiSkillLevelNum = 1;
  7336. this.targertScore = 0;
  7337. this.setTime = 30;
  7338. this.selfTurnRate = 0.5;
  7339. this.accTime = 0;
  7340. this.curFoul = "";
  7341. this.maxFoulTimes = 3;
  7342. this.isFirstInGame = true;
  7343. this.firstColliObj = null;
  7344. this.inHoleBalls = [];
  7345. this.blackNum = 8;
  7346. this.success = false;
  7347. this.holePosList = [];
  7348. this.posObj = {};
  7349. this._selfTurn = false;
  7350. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7351. this.ensureBallType = false;
  7352. this.isOpenBall = true;
  7353. this.finishOneShoot = true;
  7354. this.isEnd = false;
  7355. this.isChangeTurn = false;
  7356. this.isInterrupt = false;
  7357. this.aiPlayedBreakArmy = false;
  7358. this.isTouchedBall = false;
  7359. this.finishBalls = 0;
  7360. this.needBalls = 0;
  7361. this.allBallNum = 0;
  7362. this.placeBallPosData = {};
  7363. this.curHP = 0;
  7364. this.showLongView = false;
  7365. this.firstShoot = true;
  7366. this._gamePause = false;
  7367. this.trunCount = 0;
  7368. this.isBlackInHole = false;
  7369. this.isEnter = true;
  7370. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7371. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7372. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7373. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7374. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7375. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7376. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7377. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7378. }
  7379. get gamePause() {
  7380. return this._gamePause;
  7381. }
  7382. set gamePause(v) {
  7383. if (v) {
  7384. Laya.physicsTimer.pause();
  7385. }
  7386. else {
  7387. Laya.physicsTimer.resume();
  7388. }
  7389. this._gamePause = v;
  7390. }
  7391. get selfTurn() {
  7392. return this._selfTurn;
  7393. }
  7394. set selfTurn(val) {
  7395. this.trunCount++;
  7396. this._selfTurn = val;
  7397. if (val) {
  7398. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7399. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7400. }
  7401. else {
  7402. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7403. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7404. if (this.trunCount > 1)
  7405. PlatMgr.openBox();
  7406. }
  7407. }
  7408. resetGame() {
  7409. this.inHoleBalls = [];
  7410. this.isFirstInGame = true;
  7411. this.firstColliObj = null;
  7412. this.aiCamp = "";
  7413. this.selfCamp = "";
  7414. this.aiFoulNum = 0;
  7415. this.selfFoulNum = 0;
  7416. this.selfBallArr = [];
  7417. this.aiBallArr = [];
  7418. this.gamePause = false;
  7419. this.ensureBallType = false;
  7420. this.isInterrupt = false;
  7421. this.updateLeftBall();
  7422. this.clearTime();
  7423. this.aiPlayedBreakArmy = false;
  7424. this.isBlackInHole = false;
  7425. this.placeBallPosData = {};
  7426. if (xGame.common.d3World.knifeRoot) {
  7427. xGame.common.d3World.knifeRoot.destroyChildren();
  7428. }
  7429. }
  7430. gameReady() {
  7431. this.trunCount = 0;
  7432. this.firstColliObj = null;
  7433. this.isFirstInGame = true;
  7434. this.selfTurn = Math.random() <= this.selfTurnRate;
  7435. let challengeNum = DataMgr.getChallengeTimes();
  7436. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7437. this.selfTurn = true;
  7438. }
  7439. if (xGame.common.gameMode == GameMode.placeBall)
  7440. this.selfTurn = true;
  7441. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7442. this.selfTurn = true;
  7443. }
  7444. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7445. this.checkGuide();
  7446. if (xGame.common.uiRodMethod)
  7447. xGame.common.uiRodMethod.resetRod();
  7448. xGame.common.d2World.getHelpLine();
  7449. this.isOpenBall = true;
  7450. this.isTouchedBall = false;
  7451. xGame.common.aiPlayer.stopRun();
  7452. this.setTime = 30;
  7453. let ui = xGame.common.gameUI.ui;
  7454. switch (xGame.common.gameMode) {
  7455. case GameMode.classic:
  7456. xGame.common.aiPlayer.init();
  7457. this.blackNum = 8;
  7458. this.placeRootBall();
  7459. this.peoplePlay(9, 10);
  7460. ui.wordsBtn.visible = true;
  7461. ui.aiWordsBtn.visible = true;
  7462. xGame.common.talkMgr.changeAIState(true);
  7463. DataMgr.gameData.gameCount++;
  7464. DataMgr.saveGameData();
  7465. break;
  7466. case GameMode.bigMove:
  7467. this.blackNum = -1;
  7468. this.selfScore = 0;
  7469. this.aiScore = 0;
  7470. xGame.common.aiPlayer.init();
  7471. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7472. this.updateSelfScore();
  7473. this.updateAIScore();
  7474. this.updateTargetSroce();
  7475. this.placeRootBall();
  7476. this.peoplePlay(9, 10);
  7477. ui.wordsBtn.visible = true;
  7478. ui.aiWordsBtn.visible = true;
  7479. xGame.common.talkMgr.changeAIState(true);
  7480. if (DataMgr.getSkillGuide() < 1)
  7481. DataMgr.gameData.gameCount = 0;
  7482. else {
  7483. DataMgr.gameData.gameCount++;
  7484. DataMgr.saveGameData();
  7485. PlatMgr.openTry();
  7486. }
  7487. if (xGame.common.d3World.knifeRoot) {
  7488. xGame.common.d3World.knifeRoot.destroyChildren();
  7489. }
  7490. break;
  7491. case GameMode.placeBall:
  7492. this.blackNum = -1;
  7493. this.selfTurn = true;
  7494. this.setTime = 10000;
  7495. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7496. this.curHP = this.placeBallData.hp;
  7497. if (this.placeBallData.ball == -1)
  7498. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7499. else
  7500. this.needBalls = this.placeBallData.ball;
  7501. console.log("需要的进球数目", this.needBalls);
  7502. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7503. this.finishBalls = 0;
  7504. this.placeBallPosData = {};
  7505. this.updatePlaceBallPos();
  7506. this.updatePlaceBallState();
  7507. this.finishOneShoot = true;
  7508. xGame.common.gameUI.ui.moveNode.visible = false;
  7509. this.isOpenBall = false;
  7510. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7511. ui.wordsBtn.visible = false;
  7512. ui.aiWordsBtn.visible = false;
  7513. xGame.common.talkMgr.changeAIState(false);
  7514. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7515. PlatMgr.openBox();
  7516. });
  7517. break;
  7518. default:
  7519. break;
  7520. }
  7521. this.showLongView = false;
  7522. xGame.common.wordsMgr.comboTimes = 1;
  7523. let guide = DataMgr.getSkillGuide();
  7524. if (guide)
  7525. xGame.eventMgr.event(WAIT_SHOOT);
  7526. xGame.common.upSkillLevel = false;
  7527. xGame.common.gameStartTime = new Date().getTime();
  7528. this.firstShoot = true;
  7529. }
  7530. checkGuide() {
  7531. let guide = DataMgr.getSkillGuide();
  7532. let gameUI = xGame.common.gameUI.ui;
  7533. gameUI.guide1.visible = false;
  7534. gameUI.guide2.visible = false;
  7535. gameUI.guide3.visible = false;
  7536. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7537. this.selfTurn = true;
  7538. }
  7539. else {
  7540. return;
  7541. }
  7542. let oneBall = this.getOneBall();
  7543. gameUI.guide1.visible = true;
  7544. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7545. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7546. }
  7547. getOneBall() {
  7548. let arr = xGame.common.d2World.ballArr;
  7549. for (let index = 0; index < arr.length; index++) {
  7550. if (arr[index].number == 0)
  7551. continue;
  7552. return arr[index];
  7553. }
  7554. }
  7555. updateSelfScore() {
  7556. let ui = xGame.common.gameUI.ui.topNode;
  7557. ui.selfScoreTxt.text = this.selfScore + "";
  7558. }
  7559. updateAIScore() {
  7560. let ui = xGame.common.gameUI.ui.topNode;
  7561. ui.aiScoreTxt.text = this.aiScore + "";
  7562. }
  7563. updateTargetSroce() {
  7564. let ui = xGame.common.gameUI.ui.topNode;
  7565. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7566. }
  7567. updateLeftBall() {
  7568. let topUI = xGame.common.gameUI.ui.topNode;
  7569. topUI.selfBallList.numItems = this.selfBallArr.length;
  7570. topUI.aiBallList.numItems = this.aiBallArr.length;
  7571. }
  7572. ballShoot() {
  7573. this.clearTime();
  7574. this.finishOneShoot = false;
  7575. xGame.common.gameUI.ui.moveNode.visible = false;
  7576. if (xGame.common.gameUI.ui.guideNode.visible) {
  7577. xGame.common.gameUI.ui.guideNode.visible = false;
  7578. }
  7579. if (this.firstShoot) {
  7580. this.firstShoot = false;
  7581. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7582. }
  7583. }
  7584. ensureCamp(number) {
  7585. this.ensureBallType = true;
  7586. this.isOpenBall = false;
  7587. if (xGame.common.gameMode != GameMode.classic)
  7588. return;
  7589. let full = [1, 2, 3, 4, 5, 6, 7];
  7590. let flower = [9, 10, 11, 12, 13, 14, 15];
  7591. let sayWords = "";
  7592. if (this.selfTurn) {
  7593. if (number <= 7) {
  7594. this.selfCamp = ballCamp.full;
  7595. this.selfBallArr = full;
  7596. this.aiCamp = ballCamp.flower;
  7597. this.aiBallArr = flower;
  7598. sayWords = cfgTable.wordsData[3].msg;
  7599. }
  7600. else {
  7601. this.selfCamp = ballCamp.flower;
  7602. this.selfBallArr = flower;
  7603. this.aiCamp = ballCamp.full;
  7604. this.aiBallArr = full;
  7605. sayWords = cfgTable.wordsData[4].msg;
  7606. }
  7607. }
  7608. else {
  7609. if (number <= 7) {
  7610. this.selfCamp = ballCamp.flower;
  7611. this.selfBallArr = flower;
  7612. this.aiCamp = ballCamp.full;
  7613. this.aiBallArr = full;
  7614. sayWords = cfgTable.wordsData[2].msg;
  7615. }
  7616. else {
  7617. this.selfCamp = ballCamp.full;
  7618. this.selfBallArr = full;
  7619. this.aiCamp = ballCamp.flower;
  7620. this.aiBallArr = flower;
  7621. sayWords = cfgTable.wordsData[1].msg;
  7622. }
  7623. }
  7624. this.updateLeftBall();
  7625. xGame.uiMgr.Show(UIMsg, sayWords);
  7626. }
  7627. updatePlaceBallState() {
  7628. let ui = xGame.common.gameUI.ui;
  7629. switch (this.placeBallData.type) {
  7630. case PlaceBallType.normal:
  7631. let normal = ui.placeNormalNode;
  7632. normal.hpTxt.text = this.curHP + "";
  7633. this.updatePlaceBallStar(normal);
  7634. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7635. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7636. break;
  7637. case PlaceBallType.challenge:
  7638. let challenge = ui.placeChallengeNode;
  7639. challenge.hpTxt.text = "Shots:" + this.curHP;
  7640. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7641. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7642. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7643. break;
  7644. default:
  7645. break;
  7646. }
  7647. }
  7648. playSubHpAni() {
  7649. let ui = xGame.common.gameUI.ui;
  7650. switch (this.placeBallData.type) {
  7651. case PlaceBallType.normal:
  7652. let normal = ui.placeNormalNode;
  7653. normal.hpTxt.visible = false;
  7654. normal.starAni.c1.selectedIndex = 1;
  7655. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7656. normal.hpTxt.visible = true;
  7657. normal.starAni.c1.selectedIndex = 0;
  7658. }));
  7659. break;
  7660. default:
  7661. break;
  7662. }
  7663. }
  7664. getEndStarNum() {
  7665. let num;
  7666. let level = xGame.common.placeBallCurLevel;
  7667. if (this.curHP == this.placeBallData.hp) {
  7668. num = 3;
  7669. }
  7670. else if (this.curHP <= 1) {
  7671. num = 1;
  7672. }
  7673. else {
  7674. num = 2;
  7675. }
  7676. if (!this.success) {
  7677. num = 0;
  7678. }
  7679. else {
  7680. DataMgr.setPlaceBallLevel(level, num);
  7681. }
  7682. let myType = cfgTable.placeballData[level].type;
  7683. if (this.success && myType == 1) {
  7684. num = 3;
  7685. }
  7686. xGame.common.placeBallStarNum = num;
  7687. }
  7688. updatePlaceBallStar(node) {
  7689. let star = 0;
  7690. if (this.curHP == this.placeBallData.hp) {
  7691. star = 3;
  7692. }
  7693. else if (this.curHP >= 2) {
  7694. star = 2;
  7695. }
  7696. else if (this.curHP == 1) {
  7697. star = 1;
  7698. }
  7699. else {
  7700. star = 0;
  7701. }
  7702. let temp;
  7703. for (let index = 1; index <= 3; index++) {
  7704. temp = node["star" + index];
  7705. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7706. }
  7707. node.myProgress.value = (star / 3) * 100;
  7708. }
  7709. openRegretView(isFoul, GoalNum, challenge = false) {
  7710. let regretType = -1;
  7711. if (isFoul) {
  7712. regretType = 1;
  7713. }
  7714. else {
  7715. if (GoalNum <= 0) {
  7716. regretType = 0;
  7717. }
  7718. }
  7719. if (challenge) {
  7720. regretType = 1;
  7721. }
  7722. if (regretType != -1) {
  7723. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7724. if (success) {
  7725. this.curHP++;
  7726. this.updatePlaceBallState();
  7727. this.setPlaceBallAllPos();
  7728. xGame.common.gameUI.ui.moveNode.visible = false;
  7729. }
  7730. else {
  7731. if (this.curHP <= 0) {
  7732. this.success = false;
  7733. this.gameEnd();
  7734. }
  7735. this.playSubHpAni();
  7736. }
  7737. this.updatePlaceBallState();
  7738. this.updatePlaceBallPos();
  7739. });
  7740. }
  7741. }
  7742. setPlaceBallAllPos() {
  7743. let allBall = xGame.common.d2World.ballArr;
  7744. let cfgArr = this.placeBallPosData;
  7745. let temp;
  7746. let obj;
  7747. for (let index = 0; index < allBall.length; index++) {
  7748. temp = allBall[index];
  7749. if (temp.destroyed)
  7750. continue;
  7751. obj = cfgArr[temp.myUNID];
  7752. if (obj && obj.src && !obj.src.destroyed) {
  7753. temp.gameObj.x = obj.posX;
  7754. temp.gameObj.y = obj.posY;
  7755. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7756. }
  7757. }
  7758. xGame.common.d2World.getHelpLine();
  7759. }
  7760. updatePlaceBallPos() {
  7761. let arr = xGame.common.d2World.ballArr;
  7762. let temp;
  7763. for (let index = 0; index < arr.length; index++) {
  7764. temp = arr[index];
  7765. if (!this.placeBallPosData[temp.myUNID]) {
  7766. this.placeBallPosData[temp.myUNID] = {
  7767. src: temp,
  7768. posX: temp.gameObj.x,
  7769. posY: temp.gameObj.y
  7770. };
  7771. }
  7772. else {
  7773. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7774. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7775. }
  7776. }
  7777. let check;
  7778. for (const key in this.placeBallPosData) {
  7779. check = this.placeBallPosData[key];
  7780. if (check.src.destroyed) {
  7781. delete this.placeBallPosData[key];
  7782. }
  7783. }
  7784. }
  7785. gameRun(type) {
  7786. if (this.gamePause)
  7787. return;
  7788. this.curFoul = this.getFoulType();
  7789. if (type) {
  7790. xGame.common.d2World.d2Gan.shoot();
  7791. xGame.common.gameUI.forceCancel();
  7792. this.curFoul = type;
  7793. }
  7794. this.isEnd = false;
  7795. this.isChangeTurn = true;
  7796. if (xGame.common.gameMode == GameMode.classic) {
  7797. this.judgeClassic(this.curFoul);
  7798. this.checkClassicWords(() => {
  7799. xGame.common.destroyClassicEmotion();
  7800. if (this.isEnd) {
  7801. if (this.isBlackInHole) {
  7802. xGame.common.gameUI.ui.blackAni.visible = true;
  7803. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7804. xGame.common.gameUI.ui.blackAni.visible = false;
  7805. this.gameEnd();
  7806. }));
  7807. }
  7808. else {
  7809. this.gameEnd();
  7810. }
  7811. }
  7812. else {
  7813. this.waitShoot();
  7814. xGame.eventMgr.event(WAIT_SHOOT);
  7815. }
  7816. });
  7817. }
  7818. else if (xGame.common.gameMode == GameMode.bigMove) {
  7819. xGame.common.aiPlayer.stopRun();
  7820. let scoreArr = this.getScore(this.curFoul);
  7821. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7822. this.isEnd = true;
  7823. }
  7824. this.checkBigSkillWords(() => {
  7825. if (this.isEnd) {
  7826. this.gameEnd();
  7827. }
  7828. else {
  7829. this.waitShoot();
  7830. xGame.eventMgr.event(WAIT_SHOOT);
  7831. }
  7832. });
  7833. }
  7834. else if (xGame.common.gameMode == GameMode.placeBall) {
  7835. xGame.common.destroyAwardSpine();
  7836. let isFoul = this.curFoul == FoulType.rootHole;
  7837. let GoalNum = this.inHoleBalls.length;
  7838. if (this.inHoleBalls.indexOf(0) > -1)
  7839. GoalNum -= 1;
  7840. if (isFoul) {
  7841. this.placeRootBall();
  7842. }
  7843. console.log("neeballs", this.needBalls);
  7844. console.log("当前完成的goalNum", GoalNum);
  7845. this.finishBalls += GoalNum;
  7846. console.log("当前完成的finishballs", this.finishBalls);
  7847. let need = this.needBalls;
  7848. if (this.placeBallData.type == PlaceBallType.challenge) {
  7849. need += 100;
  7850. }
  7851. if (this.finishBalls >= need) {
  7852. this.success = true;
  7853. this.gameEnd();
  7854. }
  7855. else {
  7856. switch (this.placeBallData.type) {
  7857. case PlaceBallType.normal:
  7858. if (!isFoul && GoalNum > 0) {
  7859. this.updatePlaceBallPos();
  7860. this.updatePlaceBallState();
  7861. }
  7862. else {
  7863. this.curHP--;
  7864. this.openRegretView(isFoul, GoalNum);
  7865. }
  7866. this.waitShoot();
  7867. xGame.eventMgr.event(WAIT_SHOOT);
  7868. break;
  7869. case PlaceBallType.challenge:
  7870. this.curHP--;
  7871. this.updatePlaceBallState();
  7872. if (isFoul) {
  7873. this.openRegretView(isFoul, GoalNum, true);
  7874. }
  7875. else {
  7876. this.updatePlaceBallPos();
  7877. if (this.curHP <= 0) {
  7878. this.success = true;
  7879. this.gameEnd();
  7880. }
  7881. }
  7882. this.waitShoot();
  7883. xGame.eventMgr.event(WAIT_SHOOT);
  7884. break;
  7885. default:
  7886. break;
  7887. }
  7888. }
  7889. }
  7890. }
  7891. checkClassicWords(callback) {
  7892. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7893. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7894. let type = this.getClassicWordsType();
  7895. if (condition && type != -1) {
  7896. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7897. xGame.soundMgr.playSound(str);
  7898. xGame.common.wordsMgr.playClassicWords(type, callback);
  7899. }
  7900. else {
  7901. Laya.timer.once(300, this, () => {
  7902. callback && callback();
  7903. });
  7904. }
  7905. }
  7906. getClassicWordsType() {
  7907. let d2world = xGame.common.d2World;
  7908. let type = -1;
  7909. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7910. type = ClassicWordsType.perfectShow;
  7911. return type;
  7912. }
  7913. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7914. type = ClassicWordsType.directShoot;
  7915. return type;
  7916. }
  7917. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7918. type = ClassicWordsType.anotherShoot;
  7919. return type;
  7920. }
  7921. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7922. type = ClassicWordsType.bigPower;
  7923. return type;
  7924. }
  7925. let minSpeed = 1;
  7926. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7927. type = ClassicWordsType.hardShoot;
  7928. return type;
  7929. }
  7930. if (this.inHoleBalls.length > 0) {
  7931. type = ClassicWordsType.directShoot;
  7932. return type;
  7933. }
  7934. return type;
  7935. }
  7936. checkBigSkillWords(callback) {
  7937. if (this.curFoul == FoulType.timeOut) {
  7938. callback && callback();
  7939. }
  7940. else {
  7941. let playSkill = false;
  7942. if (this.selfTurn) {
  7943. playSkill = true;
  7944. }
  7945. else {
  7946. if (!this.aiPlayedBreakArmy) {
  7947. this.aiPlayedBreakArmy = true;
  7948. playSkill = true;
  7949. }
  7950. if (this.aiCurSkill != SkillType.breakArmy) {
  7951. playSkill = true;
  7952. }
  7953. }
  7954. if (xGame.common.skillMgr.playedLastSkill) {
  7955. xGame.common.skillMgr.playedLastSkill = false;
  7956. playSkill = false;
  7957. }
  7958. if (playSkill) {
  7959. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7960. let selfExtra = 0;
  7961. let aiExtra = 0;
  7962. if (this.selfTurn)
  7963. selfExtra += extraScore;
  7964. else
  7965. aiExtra += extraScore;
  7966. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7967. this.isEnd = true;
  7968. }
  7969. this.playBigSkillTimes(callback);
  7970. });
  7971. }
  7972. else {
  7973. this.playBigSkillTimes(callback);
  7974. }
  7975. }
  7976. }
  7977. playBigSkillTimes(callback) {
  7978. let length = this.inHoleBalls.length;
  7979. if (this.inHoleBalls.indexOf(0) > -1) {
  7980. length = this.inHoleBalls.length - 1;
  7981. }
  7982. if (length <= 0) {
  7983. callback && callback();
  7984. return;
  7985. }
  7986. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7987. callback && callback();
  7988. });
  7989. }
  7990. playSkillTips() {
  7991. let levelNum = 0;
  7992. let curType;
  7993. if (this.selfTurn) {
  7994. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7995. curType = this.selfCurSkill;
  7996. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7997. levelNum += 5;
  7998. }
  7999. }
  8000. else {
  8001. levelNum = this.aiSkillLevelNum;
  8002. curType = this.aiCurSkill;
  8003. }
  8004. let str = ``;
  8005. switch (curType) {
  8006. case SkillType.highSpace:
  8007. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8008. break;
  8009. case SkillType.breakArmy:
  8010. str = `You pocketed ${levelNum} extra balls`;
  8011. break;
  8012. case SkillType.ice:
  8013. str = `${levelNum * 2} extra balls were frozen`;
  8014. break;
  8015. case SkillType.fireworks:
  8016. str = `${levelNum} extra balls exploded `;
  8017. break;
  8018. case SkillType.GuanYu:
  8019. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8020. break;
  8021. default:
  8022. break;
  8023. }
  8024. xGame.uiMgr.Show(UIMsg, str);
  8025. }
  8026. getFoulType() {
  8027. let foulType = "";
  8028. if (this.firstColliObj == null) {
  8029. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8030. return FoulType.rootHole;
  8031. }
  8032. return FoulType.notTouch;
  8033. }
  8034. else {
  8035. if (this.selfTurn) {
  8036. if (this.selfBallArr.length > 0) {
  8037. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8038. foulType = FoulType.wrongTouch;
  8039. }
  8040. }
  8041. else {
  8042. if (this.ensureBallType) {
  8043. }
  8044. else {
  8045. if (this.firstColliObj == this.blackNum) {
  8046. foulType = FoulType.wrongTouch;
  8047. }
  8048. }
  8049. }
  8050. }
  8051. else {
  8052. if (this.aiBallArr.length > 0) {
  8053. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8054. foulType = FoulType.wrongTouch;
  8055. }
  8056. }
  8057. else {
  8058. if (this.ensureBallType) {
  8059. }
  8060. else {
  8061. if (this.firstColliObj == this.blackNum) {
  8062. foulType = FoulType.wrongTouch;
  8063. }
  8064. }
  8065. }
  8066. }
  8067. if (this.inHoleBalls.length <= 0) {
  8068. return foulType;
  8069. }
  8070. let temp;
  8071. if (this.inHoleBalls.indexOf(0) > -1) {
  8072. foulType = FoulType.rootHole;
  8073. }
  8074. else {
  8075. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8076. temp = this.inHoleBalls[index];
  8077. if (this.selfTurn) {
  8078. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8079. foulType = FoulType.wrongHole;
  8080. break;
  8081. }
  8082. }
  8083. else {
  8084. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8085. foulType = FoulType.wrongHole;
  8086. break;
  8087. }
  8088. }
  8089. }
  8090. }
  8091. let foo;
  8092. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8093. temp = this.inHoleBalls[index];
  8094. foo = this.selfBallArr.indexOf(temp);
  8095. if (foo > -1) {
  8096. this.selfBallArr.splice(foo, 1);
  8097. }
  8098. foo = this.aiBallArr.indexOf(temp);
  8099. if (foo > -1) {
  8100. this.aiBallArr.splice(foo, 1);
  8101. }
  8102. }
  8103. this.updateLeftBall();
  8104. }
  8105. return foulType;
  8106. }
  8107. judgeGameEndByBlack(arr) {
  8108. if (this.selfTurn) {
  8109. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8110. this.selfFoulNum = this.maxFoulTimes;
  8111. return true;
  8112. }
  8113. }
  8114. else {
  8115. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8116. this.aiFoulNum = this.maxFoulTimes;
  8117. return true;
  8118. }
  8119. }
  8120. }
  8121. judgeClassic(type) {
  8122. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8123. xGame.common.aiPlayer.stopRun();
  8124. if (this.judgeNormalSuccess()) {
  8125. this.isEnd = true;
  8126. return;
  8127. }
  8128. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8129. if (this.selfTurn) {
  8130. if (isFoul) {
  8131. this.selfFoulNum++;
  8132. }
  8133. if (this.selfFoulNum >= this.maxFoulTimes) {
  8134. this.success = false;
  8135. this.isEnd = true;
  8136. return;
  8137. }
  8138. }
  8139. else {
  8140. if (isFoul)
  8141. this.aiFoulNum++;
  8142. if (this.aiFoulNum >= this.maxFoulTimes) {
  8143. this.success = true;
  8144. this.isEnd = true;
  8145. return;
  8146. }
  8147. }
  8148. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8149. this.isChangeTurn = false;
  8150. }
  8151. else {
  8152. this.isInterrupt = true;
  8153. }
  8154. }
  8155. waitShoot() {
  8156. if (xGame.common.gameMode == GameMode.classic) {
  8157. switch (this.curFoul) {
  8158. case FoulType.timeOut:
  8159. case FoulType.rootHole:
  8160. this.selfTurn = !this.selfTurn;
  8161. this.peoplePlay(5, 6, true);
  8162. break;
  8163. case FoulType.notTouch:
  8164. this.selfTurn = !this.selfTurn;
  8165. this.peoplePlay(7, 7);
  8166. break;
  8167. case FoulType.wrongHole:
  8168. this.selfTurn = !this.selfTurn;
  8169. this.peoplePlay(11, 11);
  8170. break;
  8171. default:
  8172. if (this.inHoleBalls.length > 0) {
  8173. this.peoplePlay(0, 0, false, false);
  8174. }
  8175. else {
  8176. this.selfTurn = !this.selfTurn;
  8177. this.peoplePlay(7, 7);
  8178. }
  8179. break;
  8180. }
  8181. }
  8182. else if (xGame.common.gameMode == GameMode.bigMove) {
  8183. if (this.curFoul == FoulType.timeOut) {
  8184. this.selfTurn = !this.selfTurn;
  8185. this.peoplePlay(14, 15);
  8186. this.placeRootBall();
  8187. }
  8188. else {
  8189. this.selfTurn = !this.selfTurn;
  8190. if (this.curFoul == FoulType.rootHole) {
  8191. this.peoplePlay(12, 13);
  8192. this.placeRootBall();
  8193. }
  8194. else {
  8195. this.peoplePlay(0, 0, false, false);
  8196. }
  8197. }
  8198. }
  8199. else if (xGame.common.gameMode == GameMode.placeBall) {
  8200. this.finishOneShoot = true;
  8201. }
  8202. this.gameResult();
  8203. }
  8204. gameResult() {
  8205. this.firstColliObj = null;
  8206. this.inHoleBalls = [];
  8207. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8208. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8209. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8210. if (xGame.common.uiRodMethod)
  8211. xGame.common.uiRodMethod.resetRod();
  8212. xGame.common.d2World.rootBall.showSelf();
  8213. this.clearIceSkill();
  8214. if (this.selfTurn) {
  8215. console.log("gameResult");
  8216. PlatMgr.gameInsert();
  8217. }
  8218. xGame.common.d3World.knifeRoot.destroyChildren();
  8219. if (this.selfTurn) {
  8220. xGame.common.gameUI.showHelpLineGuide();
  8221. xGame.common.gameUI.setTurnAlpha(true);
  8222. }
  8223. else {
  8224. xGame.common.gameUI.setTurnAlpha(false);
  8225. }
  8226. }
  8227. getScore(type) {
  8228. let selfAdd = 0;
  8229. let aiAdd = 0;
  8230. if (type == FoulType.timeOut) {
  8231. if (this.selfTurn)
  8232. aiAdd += 3;
  8233. else
  8234. selfAdd += 3;
  8235. }
  8236. else {
  8237. if (this.inHoleBalls.length > 0) {
  8238. if (this.selfTurn) {
  8239. if (type == FoulType.rootHole) {
  8240. aiAdd += 3;
  8241. if (this.inHoleBalls.length - 1 > 0) {
  8242. selfAdd += this.inHoleBalls.length - 1;
  8243. }
  8244. }
  8245. else {
  8246. selfAdd += this.inHoleBalls.length;
  8247. }
  8248. }
  8249. else {
  8250. if (type == FoulType.rootHole) {
  8251. selfAdd += 3;
  8252. if (this.inHoleBalls.length - 1 > 0) {
  8253. aiAdd += this.inHoleBalls.length - 1;
  8254. }
  8255. }
  8256. else {
  8257. aiAdd += this.inHoleBalls.length;
  8258. }
  8259. }
  8260. }
  8261. }
  8262. return [selfAdd, aiAdd];
  8263. }
  8264. judgeScoreEnd(selfAdd, aiAdd) {
  8265. this.selfScore += selfAdd;
  8266. this.aiScore += aiAdd;
  8267. this.updateAIScore();
  8268. this.updateSelfScore();
  8269. if (this.selfScore >= this.targertScore) {
  8270. this.success = true;
  8271. return true;
  8272. }
  8273. if (this.aiScore >= this.targertScore) {
  8274. this.success = false;
  8275. return true;
  8276. }
  8277. let ballArr = xGame.common.d2World.ballArr;
  8278. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8279. if (this.selfScore > this.aiScore) {
  8280. this.success = true;
  8281. return true;
  8282. }
  8283. else if (this.selfScore < this.aiScore) {
  8284. this.success = false;
  8285. return true;
  8286. }
  8287. else {
  8288. if (this.selfTurn) {
  8289. this.success = false;
  8290. }
  8291. else {
  8292. this.success = true;
  8293. }
  8294. return true;
  8295. }
  8296. }
  8297. }
  8298. clearIceSkill() {
  8299. let arr = xGame.common.d2World.ballArr;
  8300. let temp;
  8301. if (this.selfTurn) {
  8302. if (this.selfCurSkill == SkillType.ice) {
  8303. for (let index = 0; index < arr.length; index++) {
  8304. temp = arr[index];
  8305. if (temp.ballFunc == "ice") {
  8306. temp.setBallFunc("normal", "self");
  8307. }
  8308. }
  8309. }
  8310. }
  8311. else {
  8312. if (this.aiCurSkill == SkillType.ice) {
  8313. for (let index = 0; index < arr.length; index++) {
  8314. temp = arr[index];
  8315. if (temp.ballFunc == "ice") {
  8316. temp.setBallFunc("normal", "ai");
  8317. }
  8318. }
  8319. }
  8320. }
  8321. }
  8322. judgeNormalSuccess() {
  8323. if (this.selfTurn) {
  8324. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8325. this.success = true;
  8326. return true;
  8327. }
  8328. }
  8329. else {
  8330. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8331. this.success = false;
  8332. return true;
  8333. }
  8334. }
  8335. }
  8336. gameEnd() {
  8337. if (Moyu.isTT) {
  8338. xGame.common.screenImg = getScreenImg();
  8339. }
  8340. console.log("游戏结束", this.success);
  8341. xGame.common.aiPlayer.stopRun();
  8342. if (xGame.common.gameMode == GameMode.placeBall) {
  8343. this.getEndStarNum();
  8344. this.updatePlaceBallState();
  8345. }
  8346. this.isEnter = false;
  8347. Moyu.recordEnd(this, () => {
  8348. if (this.isEnter)
  8349. return;
  8350. this.isEnter = true;
  8351. console.log("进入录结束回调");
  8352. this.enterNext();
  8353. });
  8354. Laya.timer.once(1000, this, () => {
  8355. if (this.isEnter)
  8356. return;
  8357. this.isEnter = true;
  8358. this.enterNext();
  8359. });
  8360. xGame.common.longHelpLine = false;
  8361. }
  8362. enterNext() {
  8363. Laya.timer.clearAll(this);
  8364. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8365. xGame.uiMgr.Show(UIVideoShare, this.success);
  8366. }
  8367. else {
  8368. xGame.uiMgr.Show(UIGameEnd, this.success);
  8369. }
  8370. }
  8371. aiLeave() {
  8372. let ui = xGame.common.gameUI.ui;
  8373. ui.topNode.aiNameTxt.text = "offline";
  8374. }
  8375. aiGameEnd(suc) {
  8376. this.success = suc;
  8377. xGame.common.aiPlayer.stopRun();
  8378. if (this.success) {
  8379. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8380. Laya.timer.once(1000, this, () => {
  8381. this.clearTime();
  8382. this.gameEnd();
  8383. });
  8384. }
  8385. }
  8386. openTimer() {
  8387. let src = xGame.common.gameUI;
  8388. if (this.selfTurn) {
  8389. src.ui.topNode.selfProgress.visible = true;
  8390. src.ui.topNode.aiProgress.visible = false;
  8391. this.curTimer = src.ui.topNode.selfProgress;
  8392. }
  8393. else {
  8394. src.ui.topNode.selfProgress.visible = false;
  8395. src.ui.topNode.aiProgress.visible = true;
  8396. this.curTimer = src.ui.topNode.aiProgress;
  8397. }
  8398. this.accTime = 0;
  8399. Laya.timer.clearAll(this);
  8400. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8401. this.curTimer.value = 100;
  8402. }
  8403. updateTime(dt) {
  8404. if (this.gamePause)
  8405. return;
  8406. this.accTime += dt;
  8407. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8408. if (this.accTime >= this.setTime) {
  8409. this.clearTime();
  8410. console.log("时钟进入了gameRun");
  8411. this.gameRun(FoulType.timeOut);
  8412. }
  8413. }
  8414. clearTime() {
  8415. let src = xGame.common.gameUI;
  8416. src.ui.topNode.selfProgress.visible = false;
  8417. src.ui.topNode.aiProgress.visible = false;
  8418. Laya.timer.clearAll(this);
  8419. }
  8420. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8421. let ui = xGame.common.gameUI.ui;
  8422. let selfMsg, aiMsg;
  8423. if (sayWords) {
  8424. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8425. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8426. if (Foul) {
  8427. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8428. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8429. this.placeRootBall();
  8430. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8431. if (this.curFoul == FoulType.rootHole) {
  8432. if (!DataMgr.getRootBallFoul()) {
  8433. DataMgr.setRootBallFoul();
  8434. aiMsg = "";
  8435. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8436. let woman = "Boss, pay attention next time~";
  8437. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8438. }
  8439. }
  8440. else if (this.curFoul == FoulType.timeOut) {
  8441. if (!DataMgr.getTimeoutFoul()) {
  8442. DataMgr.setTimeoutFoul();
  8443. aiMsg = "";
  8444. let tips = "Game timeout, 3 fouls, this game failed.";
  8445. let woman = "Boss, pay attention to the timeline~";
  8446. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8447. }
  8448. }
  8449. }
  8450. }
  8451. }
  8452. if (this.selfTurn) {
  8453. if (sayWords) {
  8454. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8455. ui.selfTurn.visible = true;
  8456. ui.aiTurn.visible = false;
  8457. ui.selfTurn.t0.play();
  8458. Moyu.vibration();
  8459. });
  8460. }
  8461. }
  8462. else {
  8463. let aiNum = xGame.tools.random(1, 11);
  8464. let challengeNum = DataMgr.getChallengeTimes();
  8465. let delay = false;
  8466. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8467. aiNum = 9;
  8468. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8469. aiNum = 3;
  8470. if (challengeNum == 3) {
  8471. if (!this.showLongView) {
  8472. this.showLongView = true;
  8473. delay = true;
  8474. }
  8475. }
  8476. }
  8477. }
  8478. if (delay) {
  8479. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8480. if (success) {
  8481. xGame.common.longHelpLine = true;
  8482. xGame.common.d2World.getHelpLine();
  8483. }
  8484. else {
  8485. aiNum = 10;
  8486. }
  8487. xGame.common.aiPlayer.setAiLevel(aiNum);
  8488. if (sayWords) {
  8489. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8490. xGame.common.aiPlayer.runAI();
  8491. ui.selfTurn.visible = false;
  8492. ui.aiTurn.visible = true;
  8493. ui.aiTurn.t0.play();
  8494. });
  8495. }
  8496. else {
  8497. xGame.common.aiPlayer.runAI();
  8498. }
  8499. this.openTimer();
  8500. this.finishOneShoot = true;
  8501. if (this.selfTurn) {
  8502. ui.topNode.selfKuang.visible = true;
  8503. ui.topNode.aiKuang.visible = false;
  8504. ui.topNode.selfTips.visible = true;
  8505. ui.topNode.aiTips.visible = false;
  8506. }
  8507. else {
  8508. ui.topNode.selfKuang.visible = false;
  8509. ui.topNode.aiKuang.visible = true;
  8510. ui.topNode.selfTips.visible = false;
  8511. ui.topNode.aiTips.visible = true;
  8512. }
  8513. });
  8514. return;
  8515. }
  8516. if (xGame.common.gameMode == GameMode.classic) {
  8517. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8518. if (cfg) {
  8519. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8520. aiNum = aiLevel;
  8521. }
  8522. }
  8523. xGame.common.aiPlayer.setAiLevel(aiNum);
  8524. if (sayWords) {
  8525. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8526. xGame.common.aiPlayer.runAI();
  8527. ui.selfTurn.visible = false;
  8528. ui.aiTurn.visible = true;
  8529. ui.aiTurn.t0.play();
  8530. });
  8531. }
  8532. else {
  8533. xGame.common.aiPlayer.runAI();
  8534. }
  8535. }
  8536. this.openTimer();
  8537. this.finishOneShoot = true;
  8538. if (this.selfTurn) {
  8539. ui.topNode.selfKuang.visible = true;
  8540. ui.topNode.aiKuang.visible = false;
  8541. ui.topNode.selfTips.visible = true;
  8542. ui.topNode.aiTips.visible = false;
  8543. }
  8544. else {
  8545. ui.topNode.selfKuang.visible = false;
  8546. ui.topNode.aiKuang.visible = true;
  8547. ui.topNode.selfTips.visible = false;
  8548. ui.topNode.aiTips.visible = true;
  8549. }
  8550. }
  8551. placeRootBall() {
  8552. let rootBall = xGame.common.d2World.rootBall;
  8553. if (!rootBall)
  8554. return;
  8555. rootBall.gameObj.x = this.lastRootBallPos.x;
  8556. rootBall.gameObj.y = this.lastRootBallPos.y;
  8557. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8558. let moveNode = xGame.common.gameUI.ui.moveNode;
  8559. moveNode.visible = true;
  8560. moveNode.x = this.lastRootBallPos.x;
  8561. moveNode.y = this.lastRootBallPos.y;
  8562. if (!this.selfTurn) {
  8563. xGame.common.aiPlayer.resetRoot();
  8564. }
  8565. }
  8566. }
  8567. class ui_guanyuAni extends fgui.GComponent {
  8568. static createInstance() {
  8569. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8570. }
  8571. onConstruct() {
  8572. this.n0 = (this.getChild("n0"));
  8573. }
  8574. }
  8575. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8576. class UIFireworks extends UIBase {
  8577. constructor() {
  8578. super();
  8579. }
  8580. onConstructor() {
  8581. this.isEject = false;
  8582. }
  8583. show(callback) {
  8584. super.show();
  8585. }
  8586. }
  8587. UIFireworks.uiName = "UIFireworks";
  8588. class ui_UIGuanYu extends fgui.GComponent {
  8589. static createInstance() {
  8590. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8591. }
  8592. onConstruct() {
  8593. this.n2 = (this.getChild("n2"));
  8594. this.n1 = (this.getChild("n1"));
  8595. this.n3 = (this.getChild("n3"));
  8596. this.n4 = (this.getChild("n4"));
  8597. this.n5 = (this.getChild("n5"));
  8598. this.n6 = (this.getChild("n6"));
  8599. this.n8 = (this.getChild("n8"));
  8600. this.n7 = (this.getChild("n7"));
  8601. this.t0 = this.getTransition("t0");
  8602. }
  8603. }
  8604. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8605. class UIGuanYu extends UIBase {
  8606. constructor() {
  8607. super();
  8608. }
  8609. onConstructor() {
  8610. this.ui = ui_UIGuanYu.createInstance();
  8611. this.contentPane = this.ui;
  8612. this.isEject = false;
  8613. }
  8614. show(callback) {
  8615. super.show();
  8616. this.ui.t0.play(Laya.Handler.create(this, () => {
  8617. callback && callback();
  8618. this.hide();
  8619. }));
  8620. }
  8621. }
  8622. UIGuanYu.uiName = "UIGuanYu";
  8623. class SkillMgr {
  8624. constructor() {
  8625. this.leveNum = 0;
  8626. this.extraScore = 0;
  8627. this.selfTurn = false;
  8628. this.playedLastSkill = false;
  8629. this.tweenArr = [];
  8630. this._finishNum = 0;
  8631. this._curFinish = 0;
  8632. this._rootX = 0;
  8633. this._rootY = 0;
  8634. this.knifeTimes = 0;
  8635. this.knifeV2 = new Laya.Vector2();
  8636. this.knifeV3 = new Laya.Vector3();
  8637. this.rtStarX = 0;
  8638. this.rtStarY = 0;
  8639. this.addBigSkillSpine();
  8640. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8641. }
  8642. addBigSkillSpine() {
  8643. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8644. console.log("extra2 success");
  8645. });
  8646. }
  8647. runBigSkill(callback) {
  8648. this.tweenArr = [];
  8649. this.callback = callback;
  8650. this.judgeSkill();
  8651. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8652. let guide = DataMgr.getSkillGuide();
  8653. if (!xGame.common.gameMgr.selfTurn) {
  8654. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8655. }
  8656. else {
  8657. if (xGame.common.temSelfLevel != 0) {
  8658. this.leveNum = xGame.common.temSelfLevel;
  8659. }
  8660. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8661. this.leveNum += 5;
  8662. }
  8663. }
  8664. if (guide == 0) {
  8665. DataMgr.setSkillGuide(1);
  8666. if (DataMgr.getNewUser()) {
  8667. Moyu.sendDataEvent("gameFirstPlay");
  8668. DataMgr.setNewUser();
  8669. }
  8670. }
  8671. this.playSpineAni(() => {
  8672. switch (this.curSkill) {
  8673. case SkillType.highSpace:
  8674. this.runHighSpace();
  8675. break;
  8676. case SkillType.breakArmy:
  8677. this.runBreakArmy();
  8678. break;
  8679. case SkillType.ice:
  8680. this.runIce();
  8681. break;
  8682. case SkillType.fireworks:
  8683. this.runFireworks();
  8684. break;
  8685. case SkillType.GuanYu:
  8686. this.runGuanYu();
  8687. break;
  8688. default:
  8689. break;
  8690. }
  8691. });
  8692. }
  8693. judgeSkill() {
  8694. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8695. let gameMgr = xGame.common.gameMgr;
  8696. let type;
  8697. for (let index = 0; index < typeArr.length; index++) {
  8698. type = typeArr[index];
  8699. if (gameMgr.selfTurn) {
  8700. if (gameMgr.selfCurSkill == type) {
  8701. this.selfTurn = true;
  8702. this.curSkill = type;
  8703. return;
  8704. }
  8705. }
  8706. else {
  8707. if (gameMgr.aiCurSkill == type) {
  8708. this.selfTurn = false;
  8709. this.curSkill = type;
  8710. return;
  8711. }
  8712. }
  8713. }
  8714. }
  8715. playSpineAni(callback) {
  8716. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8717. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8718. parent.destroyChildren();
  8719. let aniIndex = 0;
  8720. let skillSpine;
  8721. switch (this.curSkill) {
  8722. case SkillType.highSpace:
  8723. aniIndex = 1;
  8724. xGame.soundMgr.playSound("skill01");
  8725. skillSpine = this.skillSpine2;
  8726. data.scaleX = 0.5;
  8727. data.scaleY = 0.5;
  8728. skillSpine.play(data, 1, false, parent, () => {
  8729. callback && callback();
  8730. });
  8731. break;
  8732. case SkillType.breakArmy:
  8733. aniIndex = 2;
  8734. xGame.soundMgr.playSound("skill02");
  8735. skillSpine = this.skillSpine2;
  8736. data.scaleX = 0.5;
  8737. data.scaleY = 0.5;
  8738. skillSpine.play(data, 2, false, parent, () => {
  8739. callback && callback();
  8740. });
  8741. break;
  8742. case SkillType.ice:
  8743. aniIndex = 0;
  8744. xGame.soundMgr.playSound("skill03");
  8745. skillSpine = this.skillSpine2;
  8746. data.scaleX = 0.5;
  8747. data.scaleY = 0.5;
  8748. skillSpine.play(data, 0, false, parent, () => {
  8749. callback && callback();
  8750. });
  8751. break;
  8752. case SkillType.fireworks:
  8753. xGame.soundMgr.playSound("skill_04_01");
  8754. xGame.soundMgr.playSound("skill04");
  8755. xGame.uiMgr.Show(UIFireworks, callback);
  8756. break;
  8757. case SkillType.GuanYu:
  8758. xGame.soundMgr.playSound("skill05_1");
  8759. xGame.soundMgr.playSound("skill05");
  8760. xGame.uiMgr.Show(UIGuanYu, callback);
  8761. break;
  8762. default:
  8763. break;
  8764. }
  8765. }
  8766. getAllBallArr() {
  8767. let arr = xGame.common.d2World.ballArr;
  8768. let outArr = [];
  8769. for (let index = 0; index < arr.length; index++) {
  8770. if (arr[index] instanceof D2RootBallSrc)
  8771. continue;
  8772. if (arr[index].ballFunc == "ice")
  8773. continue;
  8774. if (arr[index].destroyed)
  8775. continue;
  8776. outArr.push(arr[index]);
  8777. }
  8778. return outArr;
  8779. }
  8780. getOneArr(deletObj) {
  8781. let allArr = this.getAllBallArr();
  8782. let temp;
  8783. for (let index = 0; index < allArr.length; index++) {
  8784. temp = allArr[index];
  8785. if (temp.id == deletObj.id) {
  8786. allArr.splice(index, 1);
  8787. break;
  8788. }
  8789. }
  8790. return allArr;
  8791. }
  8792. getNearBallBag(ball) {
  8793. let ui = xGame.common.gameUI.ui;
  8794. let circleArr = [];
  8795. for (let index = 1; index <= 6; index++) {
  8796. circleArr.push(ui.border["circle" + index]);
  8797. }
  8798. let outIndex = 0;
  8799. let temp;
  8800. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8801. ;
  8802. let dis = 0;
  8803. for (let index = 1; index < circleArr.length; index++) {
  8804. temp = circleArr[index];
  8805. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8806. if (dis < min) {
  8807. min = dis;
  8808. outIndex = index;
  8809. }
  8810. }
  8811. return [circleArr[outIndex], outIndex];
  8812. }
  8813. ballFlyToBag(ballArr, time = 300) {
  8814. let temp;
  8815. let hole;
  8816. this._finishNum = ballArr.length;
  8817. this._curFinish = 0;
  8818. let holeObj = {};
  8819. let holeCfg = {
  8820. "1": 0,
  8821. "2": 0,
  8822. "3": 0,
  8823. "4": 0,
  8824. "5": 0,
  8825. "6": 0
  8826. };
  8827. for (let index = 0; index < ballArr.length; index++) {
  8828. temp = ballArr[index];
  8829. temp.outColli.isSensor = true;
  8830. temp.innerColli.isSensor = true;
  8831. temp.isRunSkillAni = true;
  8832. let holeArr = this.getNearBallBag(temp);
  8833. hole = holeArr[0];
  8834. holeObj[index] = holeArr[1];
  8835. temp.d3BallSrc.scaleXYZ = 0.5;
  8836. this.tweenArr.push(temp.d3BallSrc, temp);
  8837. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8838. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8839. }));
  8840. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8841. let mIndex = holeObj[this._curFinish];
  8842. let isDone = holeCfg[mIndex];
  8843. if (isDone) {
  8844. ballArr[this._curFinish].checkWrongBall(false);
  8845. }
  8846. else {
  8847. holeCfg[mIndex] = 1;
  8848. ballArr[this._curFinish].checkWrongBall();
  8849. }
  8850. this._curFinish++;
  8851. if (this._curFinish >= this._finishNum) {
  8852. if (this.curSkill == SkillType.highSpace) {
  8853. }
  8854. else if (this.curSkill == SkillType.breakArmy) {
  8855. let rootBall = xGame.common.d2World.rootBall;
  8856. rootBall.gameObj.x = this._rootX;
  8857. rootBall.gameObj.y = this._rootY;
  8858. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8859. xGame.common.d2World.d2Gan.ui.visible = true;
  8860. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8861. xGame.common.d2World.getHelpLine();
  8862. this.callback && this.callback(this.extraScore);
  8863. }
  8864. }
  8865. }));
  8866. }
  8867. }
  8868. runHighSpace() {
  8869. let rootBall = xGame.common.d2World.rootBall;
  8870. rootBall.showSelf();
  8871. let d3Src = rootBall.d3BallSrc;
  8872. let allArr = this.getAllBallArr();
  8873. if (allArr.length <= 0) {
  8874. this.callback && this.callback(0);
  8875. return;
  8876. }
  8877. let selectBall = xGame.common.d2World.targetBall;
  8878. let wrong = selectBall && selectBall.destroyed;
  8879. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8880. selectBall = xGame.common.getRandArrEle(allArr);
  8881. }
  8882. let targetD3Src = selectBall.d3BallSrc;
  8883. xGame.common.d2World.d2Gan.ui.visible = false;
  8884. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8885. d3Src.scaleXYZ = 0.5;
  8886. this.tweenArr.push(d3Src);
  8887. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8888. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8889. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8890. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8891. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8892. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8893. let outArr = [selectBall];
  8894. let other = this.leveNum - 1;
  8895. if (other > 0) {
  8896. let nearArr = this.getOneArr(selectBall);
  8897. if (nearArr.length > 0) {
  8898. xGame.common.botherArr(nearArr);
  8899. if (other >= nearArr.length)
  8900. other = nearArr.length;
  8901. for (let index = 0; index < other; index++) {
  8902. outArr.push(nearArr[index]);
  8903. }
  8904. }
  8905. }
  8906. xGame.common.extraMoveNum = other + 1;
  8907. this.extraScore = other + 1;
  8908. this._rootX = selectBall.gameObj.x;
  8909. this._rootY = selectBall.gameObj.y;
  8910. rootBall.gameObj.x = this._rootX;
  8911. rootBall.gameObj.y = this._rootY;
  8912. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8913. Laya.Tween.clearAll(d3Src);
  8914. this.addRandomForce(outArr);
  8915. }));
  8916. }));
  8917. }
  8918. addRandomForce(outArr) {
  8919. if (outArr.length > 0) {
  8920. xGame.common.d2World.openCheckStill = true;
  8921. this.playedLastSkill = true;
  8922. }
  8923. let temp;
  8924. for (let index = 0; index < outArr.length; index++) {
  8925. let angle = xGame.common.randomNum(0, 360);
  8926. let linearPercent = xGame.common.randomNum(65, 100);
  8927. temp = outArr[index];
  8928. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8929. }
  8930. }
  8931. setLinearSpeed(angle, rigy, linearPercent) {
  8932. let sin = Math.sin(angle * Math.PI / 180);
  8933. let cos = Math.cos(angle * Math.PI / 180);
  8934. let maxSpeed = 4;
  8935. let speed = new Laya.Vector2();
  8936. speed.x = maxSpeed * linearPercent * sin;
  8937. speed.y = -maxSpeed * linearPercent * cos;
  8938. rigy.applyLinearImpulseToCenter(speed);
  8939. }
  8940. runBreakArmy() {
  8941. xGame.common.d2World.d2Gan.ui.visible = false;
  8942. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8943. let gameUI = xGame.common.gameUI.ui;
  8944. gameUI.skillRod.visible = true;
  8945. gameUI.skillRod.rotation = 110;
  8946. let outArr = this.getAllBallArr();
  8947. if (outArr.length <= 0) {
  8948. gameUI.skillRod.visible = false;
  8949. this.callback && this.callback(0);
  8950. return;
  8951. }
  8952. xGame.common.botherArr(outArr);
  8953. if (this.leveNum >= outArr.length)
  8954. this.leveNum = outArr.length;
  8955. let deleteNum = outArr.length - this.leveNum;
  8956. outArr.splice(0, deleteNum);
  8957. this.extraScore = this.leveNum;
  8958. let potX = gameUI.skillRod.x;
  8959. let potY = gameUI.skillRod.y;
  8960. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8961. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8962. let disArr = [];
  8963. for (let index = 0; index < outArr.length; index++) {
  8964. let obj = outArr[index];
  8965. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8966. dis = Math.pow(dis, 0.5);
  8967. disArr.push(dis);
  8968. }
  8969. this.tweenArr.push(gameUI.skillRod);
  8970. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8971. })).update = Laya.Handler.create(this, (e, t, c) => {
  8972. let angle = gameUI.skillRod.rotation;
  8973. let xx;
  8974. let yy;
  8975. let temp;
  8976. for (let index = 0; index < outArr.length; index++) {
  8977. temp = outArr[index];
  8978. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8979. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8980. yy -= 20;
  8981. temp.gameObj.x = xx;
  8982. temp.gameObj.y = yy;
  8983. temp.d3BallSrc.setTransPos(xx, yy);
  8984. }
  8985. if (angle <= 60) {
  8986. Laya.Tween.clearAll(gameUI.skillRod);
  8987. this.ballFlyToBag(outArr, 150);
  8988. gameUI.skillRod.visible = false;
  8989. }
  8990. }, null, false);
  8991. }
  8992. runIce() {
  8993. let ballArr = xGame.common.d2World.ballArr;
  8994. this.leveNum *= 2;
  8995. if (this.leveNum >= ballArr.length - 1)
  8996. this.leveNum = ballArr.length - 1;
  8997. let tempArr = [];
  8998. let outArr = [];
  8999. for (let index = 0; index < ballArr.length; index++) {
  9000. if (ballArr[index] instanceof D2RootBallSrc)
  9001. continue;
  9002. tempArr.push(ballArr[index]);
  9003. }
  9004. if (tempArr.length <= 0) {
  9005. this.callback && this.callback(0);
  9006. return;
  9007. }
  9008. xGame.common.botherArr(tempArr);
  9009. for (let index = 0; index < this.leveNum; index++) {
  9010. outArr.push(tempArr[index]);
  9011. }
  9012. this.extraScore = this.leveNum;
  9013. let temp;
  9014. for (let index = 0; index < outArr.length; index++) {
  9015. temp = outArr[index];
  9016. temp.d3BallSrc.playIceEft();
  9017. }
  9018. Laya.timer.once(2000, this, () => {
  9019. for (let index = 0; index < outArr.length; index++) {
  9020. temp = outArr[index];
  9021. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9022. temp.setBallFunc("ice", str);
  9023. }
  9024. this.callback && this.callback(0);
  9025. });
  9026. }
  9027. runFireworks() {
  9028. let allArr = this.getAllBallArr();
  9029. if (allArr.length <= 0) {
  9030. this.callback && this.callback(0);
  9031. return;
  9032. }
  9033. xGame.common.d2World.d2Gan.ui.visible = false;
  9034. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9035. let outArr = [];
  9036. let other = this.leveNum;
  9037. if (other > 0) {
  9038. if (allArr.length > 0) {
  9039. xGame.common.botherArr(allArr);
  9040. if (other >= allArr.length)
  9041. other = allArr.length;
  9042. for (let index = 0; index < other; index++) {
  9043. outArr.push(allArr[index]);
  9044. }
  9045. }
  9046. }
  9047. xGame.common.extraMoveNum = other;
  9048. this.extraScore = other;
  9049. this.addRandmomFireworks(outArr);
  9050. }
  9051. addRandmomFireworks(outArr) {
  9052. Laya.timer.once(1100, this, () => {
  9053. if (outArr.length > 0) {
  9054. xGame.common.d2World.openCheckStill = true;
  9055. this.playedLastSkill = true;
  9056. }
  9057. });
  9058. xGame.soundMgr.playSound("skill_04_02");
  9059. let temp;
  9060. let delay = -200;
  9061. for (let index = 0; index < outArr.length; index++) {
  9062. temp = outArr[index];
  9063. delay += 200;
  9064. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9065. let angle = xGame.common.randomNum(0, 360);
  9066. angle = this.getFireworksAngle(obj);
  9067. let linearPercent = xGame.common.randomNum(45, 80);
  9068. if (!obj.destroyed)
  9069. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9070. });
  9071. }
  9072. }
  9073. getFireworksAngle(obj) {
  9074. let rootBall = xGame.common.d2World.rootBall;
  9075. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9076. }
  9077. resetGame() {
  9078. Laya.timer.clearAll(this);
  9079. if (this.tweenArr) {
  9080. for (let index = 0; index < this.tweenArr.length; index++) {
  9081. Laya.Tween.clearAll(this.tweenArr[index]);
  9082. }
  9083. }
  9084. this.tweenArr = null;
  9085. }
  9086. runGuanYu() {
  9087. xGame.common.d2World.d2Gan.ui.visible = false;
  9088. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9089. let rootBall = xGame.common.d2World.rootBall;
  9090. if (rootBall.isInHole) {
  9091. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9092. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9093. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9094. rootBall.showSelf();
  9095. }
  9096. this.rtStarX = rootBall.gameObj.x;
  9097. this.rtStarY = rootBall.gameObj.y;
  9098. this.knifeTimes = 0;
  9099. this.playedLastSkill = true;
  9100. rootBall.forceRun = true;
  9101. rootBall.rigy.type = "static";
  9102. xGame.common.d2World.openCheckStill = true;
  9103. this.guanyuRandomKnife();
  9104. }
  9105. guanyuRandomKnife() {
  9106. let rootBall = xGame.common.d2World.rootBall;
  9107. let dir = this.getRandDir();
  9108. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9109. console.log("当前angle", angle);
  9110. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9111. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9112. let dis = 324;
  9113. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9114. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9115. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9116. this.rtStarX = rootBall.gameObj.x;
  9117. this.rtStarY = rootBall.gameObj.y;
  9118. this.knifeTimes++;
  9119. let skillLevel;
  9120. if (xGame.common.gameMgr.selfTurn) {
  9121. skillLevel = DataMgr.getBigSkillByIndex(4);
  9122. }
  9123. else {
  9124. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9125. }
  9126. if (!skillLevel)
  9127. skillLevel = 1;
  9128. skillLevel += 2;
  9129. if (this.knifeTimes < skillLevel) {
  9130. Laya.timer.once(400, this, () => {
  9131. this.guanyuRandomKnife();
  9132. });
  9133. }
  9134. else {
  9135. rootBall.forceRun = false;
  9136. rootBall.rigy.type = "dynamic";
  9137. xGame.common.extraMoveNum = skillLevel;
  9138. }
  9139. }));
  9140. }
  9141. getRandDir() {
  9142. let rootBall = xGame.common.d2World.rootBall;
  9143. let allBall = this.getAllBallArr();
  9144. let target = xGame.common.getRandArrEle(allBall);
  9145. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9146. return this.knifeV2;
  9147. }
  9148. cloneKnife(x, y, rotation) {
  9149. let parent = xGame.common.d3World.knifeRoot;
  9150. let prefab = xGame.common.d3World.knife;
  9151. let clone = prefab.clone();
  9152. parent.addChild(clone);
  9153. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9154. clone.transform.localPositionX = this.knifeV3.x;
  9155. clone.transform.localPositionY = 0;
  9156. clone.transform.localPositionZ = this.knifeV3.z;
  9157. clone.transform.localRotationEulerX = 0;
  9158. clone.transform.localRotationEulerY = rotation;
  9159. clone.transform.localRotationEulerZ = 0;
  9160. clone.active = true;
  9161. return clone;
  9162. }
  9163. cloneGuanYuEft(x, y, angle) {
  9164. return;
  9165. let parent = xGame.common.gameUI.ui.guanyuNode;
  9166. let eft = new ui_guanyuAni();
  9167. eft.parent = parent;
  9168. eft.x = x;
  9169. eft.y = y;
  9170. eft.rotation = angle;
  9171. }
  9172. }
  9173. class ui_UIWordsList extends fgui.GComponent {
  9174. static createInstance() {
  9175. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9176. }
  9177. onConstruct() {
  9178. this.c1 = this.getController("c1");
  9179. this.n74 = (this.getChild("n74"));
  9180. this.clickNode = (this.getChild("clickNode"));
  9181. this.myNode = (this.getChild("myNode"));
  9182. this.n68 = (this.getChild("n68"));
  9183. this.n66 = (this.getChild("n66"));
  9184. this.n55 = (this.getChild("n55"));
  9185. this.wordsBtn = (this.getChild("wordsBtn"));
  9186. this.emotionBtn = (this.getChild("emotionBtn"));
  9187. this.mybggg = (this.getChild("mybggg"));
  9188. this.wordsList = (this.getChild("wordsList"));
  9189. this.emotionList = (this.getChild("emotionList"));
  9190. this.myRoot = (this.getChild("myRoot"));
  9191. }
  9192. }
  9193. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9194. class EmotionDisplay {
  9195. constructor(index, ui) {
  9196. this.ui = ui;
  9197. this.index = index;
  9198. this.ui.onClick(this, this.clickSelf);
  9199. this.updateSelf();
  9200. }
  9201. updateSelf() {
  9202. let data = cfgTable.emotionData[this.index + 1];
  9203. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9204. }
  9205. clickSelf() {
  9206. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9207. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9208. xGame.common.talkMgr.closeTalkView();
  9209. }
  9210. }
  9211. class WordsDisplay {
  9212. constructor(index, ui) {
  9213. this.ui = ui;
  9214. this.index = index;
  9215. this.ui.onClick(this, this.clickSelf);
  9216. this.updateSelf();
  9217. }
  9218. updateSelf() {
  9219. let data = cfgTable.talkwordsData[this.index + 1];
  9220. this.ui.txt.text = data.msg;
  9221. }
  9222. clickSelf() {
  9223. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9224. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9225. xGame.common.talkMgr.closeTalkView();
  9226. }
  9227. }
  9228. class UIWordsList extends UIBase {
  9229. constructor() {
  9230. super();
  9231. }
  9232. onConstructor() {
  9233. this.ui = ui_UIWordsList.createInstance();
  9234. this.contentPane = this.ui;
  9235. this.isEject = false;
  9236. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9237. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9238. this.addUIClick(this.ui.clickNode, this.hide);
  9239. this.initTalkList();
  9240. this.initEmotionList();
  9241. }
  9242. show() {
  9243. super.show();
  9244. }
  9245. initTalkList() {
  9246. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9247. let data = cfgTable.talkwordsData;
  9248. let length = Object.keys(data).length;
  9249. this.ui.wordsList.numItems = length;
  9250. }
  9251. initEmotionList() {
  9252. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9253. let data = cfgTable.emotionData;
  9254. let length = Object.keys(data).length;
  9255. this.ui.emotionList.numItems = length;
  9256. }
  9257. renderTalkItem(index, obj) {
  9258. let temp = new WordsDisplay(index, obj);
  9259. }
  9260. renderEmotionItem(index, obj) {
  9261. let temp = new EmotionDisplay(index, obj);
  9262. }
  9263. openTalkList() {
  9264. this.ui.c1.selectedIndex = 0;
  9265. }
  9266. openEmotionList() {
  9267. this.ui.c1.selectedIndex = 1;
  9268. }
  9269. }
  9270. UIWordsList.uiName = "UIWordsList";
  9271. class TalkMgr {
  9272. constructor() {
  9273. this.aiSpeak = true;
  9274. this.emotionList = [];
  9275. this.talkList = [];
  9276. this.addEvent();
  9277. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9278. this.emotionList = [];
  9279. this.talkList = [];
  9280. for (let k in cfgTable.emotionData) {
  9281. this.emotionList.push(cfgTable.emotionData[k].id);
  9282. }
  9283. for (let k in cfgTable.talkwordsData) {
  9284. this.talkList.push(cfgTable.talkwordsData[k].id);
  9285. }
  9286. }
  9287. addEvent() {
  9288. let ui = xGame.common.gameUI.ui;
  9289. ui.wordsBtn.visible = true;
  9290. ui.wordsBtn.onClick(this, this.openTalkView);
  9291. ui.aiWordsBtn.visible = true;
  9292. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9293. }
  9294. openTalkView() {
  9295. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9296. xGame.uiMgr.Show(UIWordsList);
  9297. }
  9298. closeTalkView() {
  9299. xGame.uiMgr.Hide(UIWordsList);
  9300. }
  9301. clickAIState() {
  9302. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9303. this.aiSpeak = !this.aiSpeak;
  9304. this.changeAIState(this.aiSpeak);
  9305. }
  9306. changeAIState(speak) {
  9307. this.aiSpeak = speak;
  9308. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9309. if (speak) {
  9310. btn.c1.selectedIndex = 0;
  9311. }
  9312. else {
  9313. btn.c1.selectedIndex = 1;
  9314. }
  9315. }
  9316. showSelfTalk(wordsId) {
  9317. let ui = xGame.common.gameUI.ui;
  9318. ui.selfTalk.visible = true;
  9319. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9320. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9321. ui.selfTalk.t0.play();
  9322. }
  9323. showSelfEmotion(emotionId) {
  9324. let ui = xGame.common.gameUI.ui;
  9325. ui.selfTalk.visible = true;
  9326. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9327. this.selfSpine && this.selfSpine.dispose();
  9328. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9329. let spineData = cfgTable.emotionData[emotionId].spine;
  9330. this.selfSpine = new SpineMgr(spineData, () => {
  9331. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9332. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9333. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9334. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9335. });
  9336. ui.selfTalk.t0.play();
  9337. }
  9338. showAITalk(wordsId) {
  9339. if (!this.aiSpeak)
  9340. return;
  9341. if (DataMgr.gameData.gameCount < 2)
  9342. return;
  9343. if (wordsId < 1)
  9344. wordsId = this.getRandTalk();
  9345. let ui = xGame.common.gameUI.ui;
  9346. ui.aiTalk.visible = true;
  9347. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9348. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9349. ui.aiTalk.t0.play();
  9350. }
  9351. getRandTalk() {
  9352. let rand = xGame.tools.random(0, this.talkList.length);
  9353. return this.emotionList[rand];
  9354. }
  9355. getRandEmotion() {
  9356. let rand = xGame.tools.random(0, this.emotionList.length);
  9357. return this.emotionList[rand];
  9358. }
  9359. showAIEmotion(emotionId) {
  9360. if (!this.aiSpeak)
  9361. return;
  9362. if (DataMgr.gameData.gameCount < 2)
  9363. return;
  9364. if (emotionId < 1)
  9365. emotionId = this.getRandEmotion();
  9366. let ui = xGame.common.gameUI.ui;
  9367. ui.aiTalk.visible = true;
  9368. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9369. this.aiSpine && this.aiSpine.dispose();
  9370. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9371. let spineData = cfgTable.emotionData[emotionId].spine;
  9372. this.aiSpine = new SpineMgr(spineData, () => {
  9373. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9374. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9375. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9376. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9377. });
  9378. ui.aiTalk.t0.play();
  9379. }
  9380. resetGame() {
  9381. let ui = xGame.common.gameUI.ui;
  9382. ui.aiTalk.visible = false;
  9383. ui.selfTalk.visible = false;
  9384. this.aiSpine && this.aiSpine.dispose();
  9385. this.selfSpine && this.selfSpine.dispose();
  9386. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9387. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9388. this.closeTalkView();
  9389. }
  9390. }
  9391. class WordsMgr {
  9392. constructor() {
  9393. this.comboTimes = 1;
  9394. this.skillTimes = 0;
  9395. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9396. this.comboSpine = new SpineMgr("yxz_liangan");
  9397. this.skillSpine = new SpineMgr("yiganxqiu");
  9398. this.scoreSpine = new SpineMgr("defen");
  9399. }
  9400. setClassicCombo(isInterrupt) {
  9401. if (isInterrupt) {
  9402. this.comboTimes = 0;
  9403. }
  9404. }
  9405. playClassicWords(type, callback) {
  9406. this.callback = callback;
  9407. let aniIndex = type;
  9408. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9409. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9410. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9411. mySpine.destroy(true);
  9412. this.playClassicTimes();
  9413. });
  9414. }
  9415. playClassicTimes() {
  9416. this.comboTimes++;
  9417. if (this.comboTimes <= 1) {
  9418. this.callback && this.callback();
  9419. }
  9420. else {
  9421. let aniIndex = this.comboTimes - 1;
  9422. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9423. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9424. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9425. mySpine.destroy(true);
  9426. this.callback && this.callback();
  9427. });
  9428. }
  9429. }
  9430. playBigSkillTimes(times, callback) {
  9431. if (times <= 0) {
  9432. callback && callback();
  9433. return;
  9434. }
  9435. this.callback = callback;
  9436. let pre = "sz_0";
  9437. let aniIndex = 0;
  9438. this.getWordsImg(times, pre, () => {
  9439. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9440. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9441. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9442. let r1 = ``;
  9443. let r2 = ``;
  9444. if (times <= 9) {
  9445. r1 = `res/d2Res/${pre}${times}.png`;
  9446. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9447. aniIndex = 0;
  9448. }
  9449. else {
  9450. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9451. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9452. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9453. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9454. aniIndex = 1;
  9455. }
  9456. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9457. mySpine.destroy(true);
  9458. xGame.common.gameMgr.playSkillTips();
  9459. this.playScore(times);
  9460. xGame.common.playRandomMutiBallBigSkillSound();
  9461. }, mySpine);
  9462. });
  9463. }
  9464. playScore(score) {
  9465. let pre = "sz_";
  9466. let aniIndex = 0;
  9467. this.getWordsImg(score, pre, () => {
  9468. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9469. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9470. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9471. let r1 = ``;
  9472. let r2 = ``;
  9473. if (score <= 9) {
  9474. r1 = `res/d2Res/${pre}${score}.png`;
  9475. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9476. aniIndex = 0;
  9477. }
  9478. else {
  9479. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9480. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9481. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9482. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9483. aniIndex = 1;
  9484. }
  9485. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9486. mySpine.destroy(true);
  9487. this.callback && this.callback();
  9488. }, mySpine);
  9489. });
  9490. }
  9491. getWordsImg(number, pre = "", callback) {
  9492. let arr = [];
  9493. if (number <= 9) {
  9494. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9495. }
  9496. else {
  9497. 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 });
  9498. }
  9499. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9500. callback && callback();
  9501. }));
  9502. }
  9503. }
  9504. class ui_UIRodMethod extends fgui.GComponent {
  9505. static createInstance() {
  9506. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9507. }
  9508. onConstruct() {
  9509. this.n24 = (this.getChild("n24"));
  9510. this.white = (this.getChild("white"));
  9511. this.dot = (this.getChild("dot"));
  9512. this.sureBtn = (this.getChild("sureBtn"));
  9513. this.n20 = (this.getChild("n20"));
  9514. this.n21 = (this.getChild("n21"));
  9515. this.n22 = (this.getChild("n22"));
  9516. this.n23 = (this.getChild("n23"));
  9517. this.n5 = (this.getChild("n5"));
  9518. this.n14 = (this.getChild("n14"));
  9519. this.t0 = this.getTransition("t0");
  9520. }
  9521. }
  9522. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9523. class UIRodMethod extends UIBase {
  9524. constructor() {
  9525. super();
  9526. this.isPressd = false;
  9527. }
  9528. onConstructor() {
  9529. this.ui = ui_UIRodMethod.createInstance();
  9530. this.contentPane = this.ui;
  9531. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9532. this.moveDir = new Laya.Vector2();
  9533. this.moveDest = new Laya.Vector2();
  9534. this.centerPos = new Laya.Vector2();
  9535. xGame.common.uiRodMethod = this;
  9536. }
  9537. show() {
  9538. super.show();
  9539. xGame.common.gameMgr.gamePause = true;
  9540. this.openPressDotEvent();
  9541. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9542. this.centerPos.x = this.ui.white.x;
  9543. this.centerPos.y = this.ui.white.y;
  9544. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9545. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9546. this.setDot();
  9547. }
  9548. setDot() {
  9549. this.ui.dot.x = this.moveDest.x;
  9550. this.ui.dot.y = this.moveDest.y;
  9551. }
  9552. closeSelf() {
  9553. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9554. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9555. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9556. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9557. xGame.common.gameMgr.gamePause = false;
  9558. this.hide();
  9559. }
  9560. openPressDotEvent() {
  9561. this.closePressDotEvent();
  9562. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9563. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9564. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9565. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9566. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9567. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9568. }
  9569. closePressDotEvent() {
  9570. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9571. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9572. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9573. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9574. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9575. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9576. }
  9577. onDown(e) {
  9578. if (e.type == Laya.Event.MOUSE_DOWN)
  9579. this.isPressd = true;
  9580. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9581. this.isPressd = false;
  9582. if (!this.isPressd)
  9583. return;
  9584. this.moveDest.x = e.stageX;
  9585. this.moveDest.y = e.stageY;
  9586. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9587. if (dis > 6724) {
  9588. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9589. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9590. }
  9591. this.setDot();
  9592. }
  9593. resetRod() {
  9594. this.ui.dot.x = this.ui.white.x;
  9595. this.ui.dot.y = this.ui.white.y;
  9596. this.gameRod.dot.x = this.gameRod.bg.x;
  9597. this.gameRod.dot.y = this.gameRod.bg.y;
  9598. xGame.common.rodOffest.x = 0;
  9599. xGame.common.rodOffest.y = 0;
  9600. }
  9601. }
  9602. UIRodMethod.uiName = "UIRodMethod";
  9603. class UIGame extends UIBase {
  9604. constructor() {
  9605. super();
  9606. this.powerNum = 0;
  9607. this.isD3Inited = false;
  9608. this.isPrePlay = false;
  9609. this.isMoveRod = false;
  9610. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9611. this.rulerDis = 20;
  9612. this.rulerOffset = 0;
  9613. }
  9614. onConstructor() {
  9615. this.ui = ui_UIGame.createInstance();
  9616. this.contentPane = this.ui;
  9617. this.ui.x += xGame.common.sysOffestNum;
  9618. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9619. this.isEject = false;
  9620. xGame.common.gameUI = this;
  9621. this.initSelf();
  9622. }
  9623. isTurnSelf() {
  9624. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9625. return true;
  9626. }
  9627. }
  9628. initSelf() {
  9629. let topUI = this.ui.topNode;
  9630. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9631. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9632. this.barInfo = {};
  9633. this.barInfo.curY = 0;
  9634. this.barInfo.height = this.ui.powerNode.height;
  9635. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9636. this.barInfo.powerStartY = this.ui.powerNode.y;
  9637. xGame.common.aiPlayer = new AIPlayer();
  9638. xGame.common.gameMgr = new GameMgr();
  9639. xGame.common.skillMgr = new SkillMgr();
  9640. xGame.common.wordsMgr = new WordsMgr();
  9641. xGame.common.talkMgr = new TalkMgr();
  9642. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9643. console.log("加载经典模式表情文件chenggon !");
  9644. });
  9645. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9646. console.log("挑战模式奖励模式spine加载成功!");
  9647. });
  9648. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9649. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9650. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9651. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9652. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9653. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9654. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9655. }
  9656. getGanZiImg() {
  9657. let index = DataMgr.getCurBallRod();
  9658. let data = cfgTable.ballrodData[index + 1];
  9659. let gan_url = xGame.common.getGameIconUrl(data.img);
  9660. console.log('zh:getGanZiImg gan_url==' + gan_url);
  9661. this.ui.powerNode.showImg.url = gan_url;
  9662. console.log('zh:修改杆子图标O K');
  9663. }
  9664. returnHome() {
  9665. let tips = "Are you sure to exit the game?";
  9666. let woman = "Boss, why don't you play for a while longer?";
  9667. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9668. }
  9669. addRodMethodClick() {
  9670. if (this.isTurnSelf()) {
  9671. xGame.uiMgr.Show(UIRodMethod);
  9672. }
  9673. }
  9674. clickHelpLineBtn(force = false) {
  9675. if (!this.isTurnSelf())
  9676. return;
  9677. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9678. if (success) {
  9679. xGame.common.longHelpLine = true;
  9680. xGame.common.d2World.getHelpLine();
  9681. Moyu.sendDataEvent("guideNum");
  9682. }
  9683. else {
  9684. }
  9685. });
  9686. }
  9687. renderSelfDisplayBalls(index, target) {
  9688. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9689. target.myImg.url = xGame.common.getGameIconUrl(str);
  9690. }
  9691. renderAIDisplayBalls(index, target) {
  9692. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9693. target.myImg.url = xGame.common.getGameIconUrl(str);
  9694. ;
  9695. }
  9696. updateMode() {
  9697. if (xGame.common.gameMode == GameMode.classic) {
  9698. this.ui.topNode.scoreNode.visible = false;
  9699. }
  9700. else if (xGame.common.gameMode == GameMode.bigMove) {
  9701. this.ui.topNode.scoreNode.visible = true;
  9702. }
  9703. }
  9704. show() {
  9705. super.show();
  9706. console.log("zh:uigame show AADD");
  9707. this.ui.alpha = 0;
  9708. this.updateSelf();
  9709. xGame.common.gameMgr.gamePause = false;
  9710. xGame.common.gameUI.ui.blackAni.visible = false;
  9711. xGame.common.gameUI.ui.whiteAni.visible = false;
  9712. this.ui.powerEft.visible = false;
  9713. this.ui.colorNode.visible = false;
  9714. this.updateHead();
  9715. let curUse = DataMgr.getCurBallRod();
  9716. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  9717. this.getGanZiImg();
  9718. }
  9719. updateSelf() {
  9720. if (xGame.common.gameMode == GameMode.classic) {
  9721. this.ui.c1.selectedIndex = 0;
  9722. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9723. this.ui.topNode.middleNode.visible = true;
  9724. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9725. }
  9726. else if (xGame.common.gameMode == GameMode.bigMove) {
  9727. this.ui.c1.selectedIndex = 0;
  9728. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9729. this.ui.topNode.middleNode.visible = false;
  9730. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9731. let rand = xGame.common.randomNum(1, max);
  9732. let guide = DataMgr.getSkillGuide();
  9733. if (guide == 0)
  9734. rand = 1;
  9735. xGame.common.bigMoveLevelIndex = rand;
  9736. }
  9737. else if (xGame.common.gameMode == GameMode.placeBall) {
  9738. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9739. this.ui.c1.selectedIndex = 1 + data.type;
  9740. this.ui.alpha = 1;
  9741. this.startGame();
  9742. }
  9743. this.updateMode();
  9744. this.initD3world();
  9745. this.initD2world();
  9746. }
  9747. startGame() {
  9748. this.ui.snowNode.visible = Math.random() <= 0.1;
  9749. this.ui.d2Node.visible = false;
  9750. xGame.common.d3World.d3Hand.gameObj.active = false;
  9751. xGame.common.d3World.tableSrc.init();
  9752. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9753. this.cameraViewChange(() => {
  9754. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9755. switch (xGame.common.gameMode) {
  9756. case GameMode.classic:
  9757. xGame.common.d3World.d3Hand.gameObj.active = true;
  9758. this.playPutBallD3Ani();
  9759. break;
  9760. case GameMode.bigMove:
  9761. this.enterGame();
  9762. Laya.timer.once(500, this, () => {
  9763. this.ui.topNode.middleNode.visible = true;
  9764. this.ui.topNode.middleNode.t0.play();
  9765. });
  9766. break;
  9767. case GameMode.placeBall:
  9768. this.enterGame();
  9769. break;
  9770. default:
  9771. break;
  9772. }
  9773. });
  9774. PlatMgr.showBanner(false);
  9775. }
  9776. enterGame() {
  9777. this.ui.d2Node.visible = true;
  9778. xGame.common.d3World.d3Hand.gameObj.active = false;
  9779. xGame.common.showOneCamera("mainCamera");
  9780. Moyu.recordGame(30, true);
  9781. if (!this.isPrePlay) {
  9782. this.isPrePlay = true;
  9783. xGame.common.d3World.prePlayEft();
  9784. }
  9785. xGame.common.gameMgr.gameReady();
  9786. this.openAllEvent();
  9787. this.ui.snowNode.visible = false;
  9788. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9789. this.ui.helpBtn.visible = condition;
  9790. }
  9791. showHelpLineGuide() {
  9792. let longGuide = DataMgr.getGuideHelpLine();
  9793. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9794. this.ui.helpBtn.visible = true;
  9795. this.ui.guideNode.visible = true;
  9796. }
  9797. }
  9798. setTurnAlpha(alpha) {
  9799. this.ui.keduNode.alpha = alpha;
  9800. this.ui.ganNode.alpha = alpha;
  9801. this.ui.rodMethodNode.alpha = alpha;
  9802. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9803. }
  9804. cameraViewChange(callback) {
  9805. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9806. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9807. xGame.common.showOneCamera("visitAngle");
  9808. cameraSrc.localRotationEulerY = 180;
  9809. cameraSrc.localRotationEulerZ = 0;
  9810. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9811. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9812. callback && callback();
  9813. }));
  9814. }));
  9815. }
  9816. playPutBallD3Ani() {
  9817. xGame.common.showOneCamera("mainCamera");
  9818. let handSrc = xGame.common.d3World.d3Hand;
  9819. handSrc.gameObj.active = true;
  9820. handSrc.transform.localPositionZ = 3;
  9821. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9822. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9823. handSrc.gameObj.active = false;
  9824. this.enterGame();
  9825. }), 400);
  9826. }));
  9827. }
  9828. updateHead() {
  9829. let user = Moyu.getUserInfo();
  9830. this.ui.topNode.selfNameTxt.text = user.nickName;
  9831. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9832. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9833. if (DataMgr.getSkillGuide() < 1) {
  9834. this.ui.topNode.aiNameTxt.text = 'billiards';
  9835. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9836. }
  9837. else {
  9838. this.ui.topNode.aiNameTxt.text = aiData.name;
  9839. let randNo = Math.floor(Math.random() * 10) + 1;
  9840. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9841. }
  9842. }
  9843. initD2world() {
  9844. let node = this.ui.d2Root.displayObject;
  9845. let src = node.getComponent(D2World);
  9846. if (!src) {
  9847. xGame.common.d2World = node.addComponent(D2World);
  9848. }
  9849. xGame.common.d2World.initSelf();
  9850. }
  9851. initD3world() {
  9852. if (this.isD3Inited)
  9853. return;
  9854. this.isD3Inited = true;
  9855. let scene3D = xGame.common.d3Scene;
  9856. this.ui.d3Root.displayObject.addChild(scene3D);
  9857. scene3D.active = true;
  9858. xGame.common.d3World.tableSrc.setBorderPos();
  9859. }
  9860. onRootMove(e) {
  9861. let rootBall = xGame.common.d2World.rootBall;
  9862. this.ui.moveNode.x = e.x;
  9863. this.ui.moveNode.y = e.y;
  9864. rootBall.gameObj.x = e.x;
  9865. rootBall.gameObj.y = e.y;
  9866. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9867. }
  9868. aiRootMove(move) {
  9869. if (move)
  9870. this.hideBallUI();
  9871. else {
  9872. this.showBallUI();
  9873. xGame.common.d2World.getHelpLine();
  9874. }
  9875. }
  9876. aiForce(type, force = 0) {
  9877. this.pressTarget = PressType.powerNode;
  9878. if (type == 1)
  9879. this.onEventUp({ force: true });
  9880. else if (type == 2)
  9881. this.onEventMove({ stageY: force, force: true });
  9882. }
  9883. onEventPress(e) {
  9884. if (e.stopPropagation)
  9885. e.stopPropagation();
  9886. if (!this.isTurnSelf())
  9887. return;
  9888. let target = e.target;
  9889. switch (target) {
  9890. case this.ui.myPowerNode.displayObject:
  9891. this.pressTarget = PressType.powerNode;
  9892. this.barInfo.curY = e.stageY;
  9893. this.updateBarInfo();
  9894. break;
  9895. case this.ui.moveNode.displayObject:
  9896. this.pressTarget = PressType.moveNode;
  9897. this.hideBallUI();
  9898. this.eventObj.curX = this.ui.moveNode.x;
  9899. this.eventObj.curY = this.ui.moveNode.y;
  9900. this.ui.moveNode.finger.visible = false;
  9901. this.eventObj.lastX = e.stageX;
  9902. this.eventObj.lastY = e.stageY;
  9903. break;
  9904. case this.ui.rulerClickNode.displayObject:
  9905. this.pressTarget = PressType.rulerNode;
  9906. this.eventObj.lastY = e.stageY;
  9907. break;
  9908. case this.ui.d2Root.displayObject:
  9909. this.pressTarget = PressType.d2Root;
  9910. this.eventObj.lastX = e.stageX;
  9911. this.eventObj.lastY = e.stageY;
  9912. this.eventObj.starX = e.stageX;
  9913. this.eventObj.starY = e.stageY;
  9914. this.eventObj.curX = 0;
  9915. this.eventObj.curY = 0;
  9916. xGame.common.d2World.d2Gan.setGanLastInfo();
  9917. this.rulerOffset = 0;
  9918. break;
  9919. default:
  9920. break;
  9921. }
  9922. }
  9923. onEventMove(e) {
  9924. if (e.stopPropagation)
  9925. e.stopPropagation();
  9926. if (e && e.force) {
  9927. }
  9928. else {
  9929. if (!this.isTurnSelf())
  9930. return;
  9931. }
  9932. switch (this.pressTarget) {
  9933. case PressType.powerNode:
  9934. this.barInfo.curY = e.stageY;
  9935. this.updateBarInfo();
  9936. this.isMoveRod = true;
  9937. break;
  9938. case PressType.moveNode:
  9939. let rootBall = xGame.common.d2World.rootBall;
  9940. let radius = rootBall.gameObj.width / 2;
  9941. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9942. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9943. let border = xGame.common.d2World.borderRect;
  9944. if (curX <= border.x + radius)
  9945. curX = border.x + radius;
  9946. else if (curX >= border.x + border.width - radius)
  9947. curX = border.x + border.width - radius;
  9948. if (curY <= border.y + radius)
  9949. curY = border.y + radius;
  9950. else if (curY >= border.y + border.height - radius)
  9951. curY = border.y + border.height - radius;
  9952. if (xGame.common.gameMgr.isOpenBall) {
  9953. if (curX >= border.x + border.openBallW - radius)
  9954. curX = border.x + border.openBallW - radius;
  9955. }
  9956. this.ui.moveNode.x = curX;
  9957. this.ui.moveNode.y = curY;
  9958. rootBall.gameObj.x = curX;
  9959. rootBall.gameObj.y = curY;
  9960. rootBall.d3BallSrc.setTransPos(curX, curY);
  9961. this.isMoveRod = true;
  9962. break;
  9963. case PressType.rulerNode:
  9964. let yy = e.stageY - this.eventObj.lastY;
  9965. this.eventObj.lastY = e.stageY;
  9966. let ruler1 = this.ui.rulerNode.img1;
  9967. let ruler2 = this.ui.rulerNode.img2;
  9968. ruler1.y += yy;
  9969. ruler2.y += yy;
  9970. this.rulerOffset += yy;
  9971. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9972. this.rulerOffset = 0;
  9973. xGame.soundMgr.playSound("inch", 1, 10);
  9974. }
  9975. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9976. let h = ruler1.height;
  9977. this.checkGuide();
  9978. this.isMoveRod = true;
  9979. if (ruler1.y >= h) {
  9980. ruler1.y = -h;
  9981. ruler2.y = 0;
  9982. return;
  9983. }
  9984. else if (ruler1.y <= -h) {
  9985. ruler1.y = h;
  9986. ruler2.y = 0;
  9987. return;
  9988. }
  9989. if (ruler2.y >= h) {
  9990. ruler2.y = -h;
  9991. ruler1.y = 0;
  9992. return;
  9993. }
  9994. else if (ruler2.y <= -h) {
  9995. ruler2.y = h;
  9996. ruler1.y = 0;
  9997. return;
  9998. }
  9999. break;
  10000. case PressType.d2Root:
  10001. this.eventObj.curX = e.stageX;
  10002. this.eventObj.curY = e.stageY;
  10003. let offset = this.checkRodMoveDir();
  10004. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10005. this.eventObj.lastX = e.stageX;
  10006. this.eventObj.lastY = e.stageY;
  10007. break;
  10008. default:
  10009. break;
  10010. }
  10011. }
  10012. onEventUp(e) {
  10013. if (e.stopPropagation)
  10014. e.stopPropagation();
  10015. if (e && e.force) {
  10016. }
  10017. else {
  10018. if (!this.isTurnSelf())
  10019. return;
  10020. }
  10021. switch (this.pressTarget) {
  10022. case PressType.powerNode:
  10023. this.ui.powerNode.value = 0;
  10024. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10025. this.ui.powerTxt.text = "";
  10026. if (this.powerNum > 0) {
  10027. xGame.eventMgr.event(BALL_SHOOT);
  10028. xGame.common.d2World.shoot(this.powerNum);
  10029. xGame.common.d2World.d2Gan.shoot();
  10030. xGame.common.d2World.d2HelpLine.shoot();
  10031. this.finishGuide();
  10032. this.ui.powerEft.visible = false;
  10033. this.ui.colorNode.visible = false;
  10034. let ganStr = "";
  10035. if (this.powerNum <= 30) {
  10036. ganStr = "gan_30";
  10037. }
  10038. else if (this.powerNum <= 60) {
  10039. ganStr = "gan_50";
  10040. }
  10041. else {
  10042. ganStr = "gan_80";
  10043. }
  10044. xGame.soundMgr.playSound(ganStr);
  10045. }
  10046. break;
  10047. case PressType.moveNode:
  10048. let rootBall = xGame.common.d2World.rootBall;
  10049. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10050. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10051. let isIntersect = this.judgeBallIntersect();
  10052. if (isIntersect) {
  10053. this.ui.moveNode.x = lastX;
  10054. this.ui.moveNode.y = lastY;
  10055. rootBall.gameObj.x = lastX;
  10056. rootBall.gameObj.y = lastY;
  10057. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10058. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10059. }
  10060. else {
  10061. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10062. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10063. }
  10064. this.showBallUI();
  10065. this.ui.moveNode.finger.visible = true;
  10066. xGame.common.d2World.getHelpLine();
  10067. break;
  10068. case PressType.rulerNode:
  10069. break;
  10070. case PressType.d2Root:
  10071. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10072. if (dis <= 25) {
  10073. this.moveToClickDot(e);
  10074. }
  10075. break;
  10076. default:
  10077. break;
  10078. }
  10079. this.pressTarget = -1;
  10080. }
  10081. checkGuide() {
  10082. let guide = DataMgr.getSkillGuide();
  10083. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10084. xGame.common.guideStep++;
  10085. xGame.common.gameUI.ui.guide2.visible = false;
  10086. xGame.common.gameUI.ui.guide3.visible = true;
  10087. }
  10088. }
  10089. finishGuide() {
  10090. let guide = DataMgr.getSkillGuide();
  10091. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10092. xGame.common.guideStep = 10;
  10093. this.closeAllGuide();
  10094. }
  10095. }
  10096. closeAllGuide() {
  10097. xGame.common.gameUI.ui.guide1.visible = false;
  10098. xGame.common.gameUI.ui.guide2.visible = false;
  10099. xGame.common.gameUI.ui.guide3.visible = false;
  10100. }
  10101. updateBarInfo() {
  10102. let star = this.ui.powerNode.y;
  10103. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10104. if (rate >= 1)
  10105. rate = 1;
  10106. if (rate <= 0)
  10107. rate = 0;
  10108. this.powerNum = Math.ceil(rate * 100);
  10109. this.ui.powerNode.value = this.powerNum;
  10110. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10111. this.ui.colorNode.value = this.powerNum;
  10112. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10113. this.ui.powerEft.visible = this.powerNum != 0;
  10114. this.ui.colorNode.visible = this.powerNum != 0;
  10115. this.ui.powerTxt.text = this.powerNum + "";
  10116. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10117. }
  10118. forceCancel() {
  10119. this.ui.powerNode.value = 0;
  10120. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10121. this.ui.powerTxt.text = "";
  10122. }
  10123. checkRodMoveDir() {
  10124. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10125. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10126. if (tempX >= 0 && tempY <= 0) {
  10127. return this.checkDir();
  10128. }
  10129. else if (tempX < 0 && tempY < 0) {
  10130. return this.checkDir(1, -1);
  10131. }
  10132. else if (tempX < 0 && tempY > 0) {
  10133. return this.checkDir(-1, -1);
  10134. }
  10135. else {
  10136. return this.checkDir(-1, 1);
  10137. }
  10138. }
  10139. checkDir(flagX = 1, flagY = 1) {
  10140. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10141. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10142. if (offsetY == 0) {
  10143. return offsetX * flagX;
  10144. }
  10145. if (offsetX == 0) {
  10146. return offsetY * flagY;
  10147. }
  10148. let angle = offsetY / offsetX;
  10149. if (Math.abs(angle) >= 1) {
  10150. return offsetY * flagY;
  10151. }
  10152. else {
  10153. return offsetX * flagX;
  10154. }
  10155. }
  10156. judgeBallIntersect() {
  10157. let rootBall = xGame.common.d2World.rootBall;
  10158. let ballArr = xGame.common.d2World.ballArr;
  10159. let radius = rootBall.gameObj.width / 2;
  10160. let temp;
  10161. let isIntersect = false;
  10162. for (let index = 0; index < ballArr.length; index++) {
  10163. temp = ballArr[index];
  10164. if (temp.number == rootBall.number)
  10165. continue;
  10166. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10167. if (isIntersect) {
  10168. break;
  10169. }
  10170. }
  10171. return isIntersect;
  10172. }
  10173. hideBallUI() {
  10174. let d2Gan = xGame.common.d2World.d2Gan;
  10175. if (!d2Gan.ui.isDisposed)
  10176. d2Gan.ui.visible = false;
  10177. let d2Help = xGame.common.d2World.d2HelpLine;
  10178. if (!d2Help.ui.isDisposed)
  10179. d2Help.ui.visible = false;
  10180. let rootBall = xGame.common.d2World.rootBall;
  10181. if (!rootBall.destroyed) {
  10182. rootBall.gameObj.active = false;
  10183. }
  10184. }
  10185. showBallUI() {
  10186. let d2Gan = xGame.common.d2World.d2Gan;
  10187. if (!d2Gan.ui.isDisposed)
  10188. d2Gan.ui.visible = true;
  10189. let d2Help = xGame.common.d2World.d2HelpLine;
  10190. if (!d2Help.ui.isDisposed)
  10191. d2Help.ui.visible = true;
  10192. let rootBall = xGame.common.d2World.rootBall;
  10193. if (!rootBall.destroyed) {
  10194. rootBall.gameObj.active = true;
  10195. }
  10196. }
  10197. moveToClickDot(e) {
  10198. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10199. let root = xGame.common.d2World.rootBall.gameObj;
  10200. let xx = e.stageX - xGame.common.sysOffestNum;
  10201. let yy = e.stageY;
  10202. let x = xx - root.x;
  10203. let y = yy - root.y;
  10204. let angle = xGame.common.getfguiRotation(x, y);
  10205. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10206. xGame.common.d2World.getHelpLine();
  10207. }
  10208. this.isMoveRod = false;
  10209. xGame.common.clickedBall = false;
  10210. }
  10211. openAllEvent() {
  10212. this.closeAllEvent();
  10213. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10214. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10215. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10216. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10217. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10218. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10219. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10220. }
  10221. closeAllEvent() {
  10222. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10223. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10224. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10225. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10226. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10227. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10228. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10229. }
  10230. resetGame() {
  10231. this.closeAllEvent();
  10232. this.hideBallUI();
  10233. xGame.common.gameMgr.gamePause = true;
  10234. }
  10235. }
  10236. UIGame.uiName = "UIGame";
  10237. class UIAddProp extends UIBase {
  10238. constructor() {
  10239. super();
  10240. this.curType = "";
  10241. }
  10242. onConstructor() {
  10243. this.ui = ui_UIAddProp.createInstance();
  10244. this.contentPane = this.ui;
  10245. this.isEject = false;
  10246. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10247. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10248. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10249. this.updateUI();
  10250. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10251. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10252. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10253. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10254. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10255. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10256. }
  10257. show(type) {
  10258. super.show();
  10259. this.curType = type == 0 ? "coin" : "diamond";
  10260. this.switchBtn("");
  10261. this.ui.t0.play();
  10262. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10263. PlatMgr.showInsert(true);
  10264. }
  10265. closeSelf() {
  10266. this.hide();
  10267. }
  10268. updateUI() {
  10269. let data = cfgTable.moneyData;
  10270. let temp;
  10271. let obj;
  10272. for (const key in data) {
  10273. temp = data[key];
  10274. obj = this.ui.myNode["node" + key];
  10275. if (parseInt(key) <= 2) {
  10276. obj.diamondTxt.text = "+" + temp.num;
  10277. }
  10278. else {
  10279. obj.coinTxt.text = temp.num;
  10280. obj.diamondTxt.text = temp.get.split('_')[1];
  10281. }
  10282. }
  10283. this.updateDiamondShare();
  10284. }
  10285. updateDiamondShare() {
  10286. let data = DataMgr.getShareDiamondTimes();
  10287. if (data >= xGame.common.maxShareDiamondTimes) {
  10288. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10289. this.ui.myNode.node1.touchable = false;
  10290. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10291. }
  10292. else {
  10293. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10294. this.ui.myNode.node1.touchable = true;
  10295. }
  10296. }
  10297. switchBtn(type) {
  10298. if (type == "")
  10299. type = this.curType;
  10300. else {
  10301. if (this.curType == type) {
  10302. return;
  10303. }
  10304. else {
  10305. this.curType = type;
  10306. }
  10307. }
  10308. if (type == "coin") {
  10309. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10310. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10311. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10312. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10313. this.ui.myNode.c1.selectedIndex = 0;
  10314. }
  10315. else {
  10316. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10317. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10318. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10319. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10320. this.ui.myNode.c1.selectedIndex = 1;
  10321. }
  10322. }
  10323. convertCoin(index) {
  10324. let data = cfgTable.moneyData[index];
  10325. let coinNum = data.num;
  10326. let str = data.get.split('_')[1];
  10327. let needDiamond = parseInt(str);
  10328. if (DataMgr.diamondEnough(needDiamond)) {
  10329. DataMgr.setDiamond(-needDiamond);
  10330. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10331. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10332. }
  10333. else {
  10334. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10335. this.switchBtn("diamond");
  10336. }
  10337. }
  10338. videoGetDiamond() {
  10339. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10340. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10341. }
  10342. else {
  10343. console.log('zh:AD 失败,直接发放奖励');
  10344. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10345. }
  10346. }
  10347. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10348. let num = cfgTable.moneyData[2].num;
  10349. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10350. this.closeSelf();
  10351. }
  10352. videoGetCoin() {
  10353. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10354. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10355. }
  10356. else {
  10357. console.log('zh:AD 失败,直接发放奖励');
  10358. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10359. }
  10360. }
  10361. qjff_AD_for_uiAddProp_videoGetCoin() {
  10362. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10363. this.closeSelf();
  10364. }
  10365. shareGetDiamond() {
  10366. let times = DataMgr.getShareDiamondTimes();
  10367. if (times >= xGame.common.maxShareDiamondTimes) {
  10368. console.log('zh: 233333333333 maxShareDiamondTimes');
  10369. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10370. }
  10371. else {
  10372. console.log('zh:33333333333333ad');
  10373. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  10374. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  10375. }
  10376. else {
  10377. console.log('zh:AD 失败,直接发放奖励');
  10378. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  10379. }
  10380. }
  10381. }
  10382. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10383. let diamond = xGame.common.randomNum(50, 100);
  10384. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10385. DataMgr.setShareDiamondTimes(1);
  10386. this.updateDiamondShare();
  10387. }
  10388. openPutBallView() {
  10389. let end = xGame.uiMgr.getUI(UIGameEnd);
  10390. let skill = xGame.uiMgr.getUI(UISkill);
  10391. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10392. let uigame = xGame.uiMgr.getUI(UIGame);
  10393. if (end && !end.isHide) {
  10394. xGame.uiMgr.Hide(UIGameEnd);
  10395. xGame.uiMgr.Show(UIMain);
  10396. }
  10397. if (skill && !skill.isHide)
  10398. xGame.uiMgr.Hide(UISkill);
  10399. if (uigame && !uigame.isHide)
  10400. xGame.uiMgr.Hide(UIGame);
  10401. if (level && !level.isHide) {
  10402. }
  10403. else {
  10404. xGame.uiMgr.Show(UILevelDisplay);
  10405. }
  10406. this.closeSelf();
  10407. }
  10408. }
  10409. UIAddProp.uiName = "UIAddProp";
  10410. class MoneyNode {
  10411. constructor(ui) {
  10412. this.leftTime = 0;
  10413. this.ui = ui;
  10414. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10415. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10416. this.ui.addPowerBtn.onClick(this, this.addPower);
  10417. this.ui.c1.selectedIndex = 1;
  10418. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10419. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10420. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10421. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10422. this.coinChange();
  10423. this.diamondChange();
  10424. this.powerChange();
  10425. }
  10426. addPower() {
  10427. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10428. xGame.uiMgr.Show(UIPower);
  10429. }
  10430. powerChange() {
  10431. let powerNum = DataMgr.getPower();
  10432. this.ui.powerTxt.text = powerNum + "";
  10433. }
  10434. checkPowerTime() {
  10435. let cur = new Date().getTime();
  10436. let last = DataMgr.getPowerTime();
  10437. if (last == 0) {
  10438. last = cur;
  10439. DataMgr.setPowerTime(cur);
  10440. }
  10441. let power = DataMgr.getPower();
  10442. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10443. Laya.timer.clearAll(this);
  10444. if (power >= xGame.common.natureMaxPower) {
  10445. this.ui.powerTimeTxt.text = "";
  10446. DataMgr.setPowerTime(cur);
  10447. return;
  10448. }
  10449. if (power + offset >= xGame.common.natureMaxPower) {
  10450. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10451. this.ui.powerTimeTxt.text = "";
  10452. DataMgr.setPowerTime(cur);
  10453. }
  10454. else {
  10455. if (offset > 0) {
  10456. DataMgr.setPower(offset);
  10457. DataMgr.setPowerTime(cur);
  10458. }
  10459. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10460. this.leftTime = xGame.common.powerRecoverNum - time;
  10461. if (this.leftTime <= 0)
  10462. this.leftTime = 0;
  10463. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10464. Laya.timer.loop(1000, this, this.updatePowerTime);
  10465. }
  10466. }
  10467. updatePowerTime() {
  10468. this.leftTime -= 1;
  10469. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10470. if (this.leftTime <= 0) {
  10471. this.checkPowerTime();
  10472. }
  10473. }
  10474. coinChange() {
  10475. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10476. }
  10477. diamondChange() {
  10478. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10479. }
  10480. addCoin() {
  10481. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10482. Moyu.sendDataEvent("AddCoinBtn");
  10483. xGame.uiMgr.Show(UIAddProp, 0);
  10484. }
  10485. addDiamond() {
  10486. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10487. Moyu.sendDataEvent("AddDiamondBtn");
  10488. xGame.uiMgr.Show(UIAddProp, 1);
  10489. }
  10490. }
  10491. class UIDraw extends UIBase {
  10492. constructor() {
  10493. super();
  10494. this.curKey = 0;
  10495. }
  10496. onConstructor() {
  10497. this.ui = ui_UIDraw.createInstance();
  10498. this.contentPane = this.ui;
  10499. this.isEject = false;
  10500. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10501. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10502. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10503. this.initDraw();
  10504. this.initUI();
  10505. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10506. if (Moyu.isKs)
  10507. this.ui.closeNode.closeBtn.x += 100;
  10508. }
  10509. show() {
  10510. super.show();
  10511. this.ui.t0.play();
  10512. this.playSecretaryIdle();
  10513. this.updateDraw();
  10514. this.checkFree();
  10515. if (PlatMgr.bannerDelay > 0) {
  10516. this.ui.closeNode.closeBtn.visible = false;
  10517. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10518. this.ui.closeNode.closeBtn.visible = true;
  10519. });
  10520. }
  10521. PlatMgr.showRateBanner();
  10522. }
  10523. hide() {
  10524. Laya.timer.clearAll(this);
  10525. super.hide();
  10526. }
  10527. checkFree() {
  10528. let isFree = DataMgr.getDailyfreeDrawTimes();
  10529. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10530. }
  10531. initDraw() {
  10532. this.drawObj = [];
  10533. let data = cfgTable.drawData;
  10534. let temp;
  10535. let weight = 0;
  10536. for (const key in data) {
  10537. temp = data[key];
  10538. weight += temp.weight;
  10539. this.drawObj.push(weight);
  10540. }
  10541. this.allWeight = weight;
  10542. }
  10543. initUI() {
  10544. let data = cfgTable.drawData;
  10545. let temp;
  10546. let img;
  10547. let txt;
  10548. for (const key in data) {
  10549. temp = data[key];
  10550. img = this.ui.myNode.rotNode["img" + key];
  10551. txt = this.ui.myNode.rotNode["txt" + key];
  10552. img.url = xGame.common.getGameIconUrl(temp.icon);
  10553. txt.visible = true;
  10554. if (temp.award > 2) {
  10555. img.rotation = 0;
  10556. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10557. }
  10558. else {
  10559. img.rotation = temp.rotation;
  10560. txt.text = temp.num;
  10561. }
  10562. }
  10563. }
  10564. getCurkey() {
  10565. let rand = Math.random() * this.allWeight;
  10566. let temp;
  10567. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10568. temp = this.drawObj[index];
  10569. if (index == 0) {
  10570. if (rand < temp) {
  10571. return index + 1;
  10572. }
  10573. }
  10574. else {
  10575. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10576. return index + 1;
  10577. }
  10578. }
  10579. }
  10580. return 2;
  10581. }
  10582. startDraw() {
  10583. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10584. if (freeTimes > 0) {
  10585. this.beginDraw();
  10586. DataMgr.setDailyfreeDrawTimes(0);
  10587. this.checkFree();
  10588. }
  10589. else {
  10590. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  10591. }
  10592. else {
  10593. console.log('zh:AD 失败,直接发放奖励');
  10594. this.qjff_chouJiang();
  10595. }
  10596. }
  10597. }
  10598. qjff_chouJiang() {
  10599. this.beginDraw();
  10600. }
  10601. beginDraw() {
  10602. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10603. this.ui.drawBtn.touchable = false;
  10604. this.curKey = this.getCurkey();
  10605. console.log("当前key", this.curKey);
  10606. let cell = 60;
  10607. let lap = 3;
  10608. let angle = cell * (this.curKey - 1) + lap * 360;
  10609. let target = this.ui.myNode.rotNode;
  10610. target.rotation = 0;
  10611. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10612. console.log("旋转完成");
  10613. this.ui.drawBtn.touchable = true;
  10614. this.getAward();
  10615. }));
  10616. }
  10617. getAward() {
  10618. let data = cfgTable.drawData[this.curKey];
  10619. let temp = new AwardType();
  10620. temp.type = data.award;
  10621. temp.num = data.num;
  10622. xGame.common.getAward([temp], () => {
  10623. DataMgr.setDrawTimes(1);
  10624. this.updateDraw();
  10625. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10626. });
  10627. }
  10628. updateDraw() {
  10629. let drawTimes = DataMgr.getDrawTimes();
  10630. let awardTimes = DataMgr.getDrawAwardTimes();
  10631. if (Math.floor(drawTimes / 3) > awardTimes) {
  10632. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10633. this.ui.extraNode.boxBtn.touchable = true;
  10634. this.ui.extraNode.tipsTxt.text = "3/3";
  10635. this.ui.extraNode.barNode.width = 265;
  10636. this.getExtraAward();
  10637. }
  10638. else {
  10639. this.ui.extraNode.boxBtn.t0.stop();
  10640. this.ui.extraNode.boxBtn.touchable = false;
  10641. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10642. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10643. }
  10644. let data = cfgTable.drawData[1];
  10645. if (awardTimes == 0) {
  10646. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10647. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10648. this.ui.myNode.rotNode.img1.rotation = 0;
  10649. }
  10650. else {
  10651. let award = data.nextid;
  10652. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10653. this.ui.myNode.rotNode.txt1.text = award[1];
  10654. this.ui.myNode.rotNode.img1.rotation = 0;
  10655. }
  10656. }
  10657. getExtraAward() {
  10658. let drawTimes = DataMgr.getDrawTimes();
  10659. let awardTimes = DataMgr.getDrawAwardTimes();
  10660. let data = cfgTable.drawData[1];
  10661. let award = new AwardType();
  10662. if (awardTimes == 0) {
  10663. award.num = data.num;
  10664. award.type = data.award;
  10665. xGame.common.getAward([award], () => {
  10666. let all = Math.floor(drawTimes / 3);
  10667. DataMgr.setDrawAwardTimes(all);
  10668. this.updateDraw();
  10669. });
  10670. }
  10671. else {
  10672. award.num = parseInt(data.nextid[1]);
  10673. award.type = parseInt(data.nextid[0]);
  10674. xGame.common.getAward([award], () => {
  10675. let all = Math.floor(drawTimes / 3);
  10676. DataMgr.setDrawAwardTimes(all);
  10677. this.updateDraw();
  10678. });
  10679. }
  10680. }
  10681. closeSelf() {
  10682. this.hide();
  10683. }
  10684. playSecretaryIdle() {
  10685. let parent = this.ui.secretary.displayObject;
  10686. parent.destroyChildren();
  10687. let xx = this.ui.secretary.width / 2;
  10688. let yy = this.ui.secretary.height;
  10689. let scale = xGame.common.getSecretaryScale();
  10690. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10691. xGame.common.secretary.play(data, 0, true, parent);
  10692. }
  10693. }
  10694. UIDraw.uiName = "UIDraw";
  10695. class ui_UIFlyEft extends fgui.GComponent {
  10696. static createInstance() {
  10697. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10698. }
  10699. onConstruct() {
  10700. this.n0 = (this.getChild("n0"));
  10701. this.n1 = (this.getChild("n1"));
  10702. this.n2 = (this.getChild("n2"));
  10703. this.n3 = (this.getChild("n3"));
  10704. this.n4 = (this.getChild("n4"));
  10705. this.n5 = (this.getChild("n5"));
  10706. this.n6 = (this.getChild("n6"));
  10707. this.n7 = (this.getChild("n7"));
  10708. this.iconNode = (this.getChild("iconNode"));
  10709. this.txt = (this.getChild("txt"));
  10710. this.txtNode = (this.getChild("txtNode"));
  10711. }
  10712. }
  10713. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10714. class UIFlyEft extends UIBase {
  10715. constructor() {
  10716. super();
  10717. this.max = 8;
  10718. this.delay = 0;
  10719. }
  10720. onConstructor() {
  10721. this.ui = ui_UIFlyEft.createInstance();
  10722. this.contentPane = this.ui;
  10723. this.isEject = false;
  10724. this.isMuti = true;
  10725. this.ui.x += xGame.common.sysOffestNum;
  10726. }
  10727. getArrPos() {
  10728. if (this.iconPos && this.iconPos.length > 0)
  10729. return;
  10730. this.iconPos = [];
  10731. let temp;
  10732. for (let index = 0; index < this.max; index++) {
  10733. temp = this.ui["n" + index];
  10734. this.iconPos.push([temp.x, temp.y]);
  10735. }
  10736. }
  10737. show(stPos, edPos, num, type, callback) {
  10738. super.show();
  10739. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10740. this.getArrPos();
  10741. this.updateUI(type);
  10742. this.updatePos();
  10743. this.runFly(edPos, callback);
  10744. this.runWorlds(stPos, num);
  10745. }
  10746. updateUI(type) {
  10747. let temp;
  10748. let str;
  10749. for (let index = 0; index < this.max; index++) {
  10750. temp = this.ui["n" + index];
  10751. str = this.getIconStr(type);
  10752. temp.url = xGame.common.getGameIconUrl(str);
  10753. }
  10754. }
  10755. getIconStr(type) {
  10756. switch (type) {
  10757. case Prop.diamond:
  10758. return "ty_zs";
  10759. case Prop.coin:
  10760. return "ty_jb";
  10761. default:
  10762. break;
  10763. }
  10764. }
  10765. updatePos() {
  10766. let temp;
  10767. for (let index = 0; index < this.max; index++) {
  10768. temp = this.ui["n" + index];
  10769. temp.x = this.iconPos[index][0];
  10770. temp.y = this.iconPos[index][1];
  10771. }
  10772. }
  10773. runFly(endPos, callback) {
  10774. let all = 0;
  10775. let temp;
  10776. for (let index = 0; index < this.max; index++) {
  10777. temp = this.ui["n" + index];
  10778. temp.visible = true;
  10779. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10780. temp.visible = false;
  10781. all++;
  10782. if (all >= this.max) {
  10783. callback && callback();
  10784. }
  10785. }), 20 * index);
  10786. }
  10787. }
  10788. runWorlds(stPos, num) {
  10789. let str = "+" + num;
  10790. this.ui.txt.text = str;
  10791. let starX = stPos.x;
  10792. let starY = stPos.y + 50;
  10793. this.ui.txt.x = starX;
  10794. this.ui.txt.y = starY;
  10795. this.ui.txt.visible = true;
  10796. this.ui.txt.alpha = 1;
  10797. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10798. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10799. this.ui.txt.visible = false;
  10800. this.hide();
  10801. }));
  10802. }));
  10803. }
  10804. }
  10805. UIFlyEft.uiName = "UIFlyEft";
  10806. class Common {
  10807. constructor() {
  10808. this.convertNum = 0.025;
  10809. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10810. this.scaleV3One = new Laya.Vector3();
  10811. this.scaleV3Two = new Laya.Vector3();
  10812. this.posV4 = new Laya.Vector4();
  10813. this.showDebug = false;
  10814. this.openGuide = true;
  10815. this.rodOffest = new Laya.Vector2(0, 0);
  10816. this.rodAngle = 0;
  10817. this.gameMode = GameMode.classic;
  10818. this.bigMoveLevelIndex = 1;
  10819. this.bigMoveNeedCoin = 1000;
  10820. this.classicNiceNeddCoin = 1000;
  10821. this.passAwardCoin = 2000;
  10822. this.classicRoomType = 1;
  10823. this.maxPower = 20;
  10824. this.natureMaxPower = 5;
  10825. this.videoPower = 2;
  10826. this.powerRecoverNum = 900;
  10827. this.curPlayerSkillType = 0;
  10828. this.isNewDay = false;
  10829. this.clickedBall = false;
  10830. this.placeBallCurLevel = 0;
  10831. this.placeBallStarNum = 0;
  10832. this.longHelpLine = false;
  10833. this.maxShareDiamondTimes = 3;
  10834. this.guideStep = 0;
  10835. this.temSelfLevel = 0;
  10836. this.extraMoveNum = 0;
  10837. this.curRankID = 0;
  10838. this.rankID = {
  10839. normalStar: 12000,
  10840. wxStar: 12001
  10841. };
  10842. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  10843. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10844. this.btnClickStr = "buttonclick";
  10845. this.maxSkillLevel = 10;
  10846. this.upSkillLevel = false;
  10847. this.gameStartTime = 0;
  10848. this._sysOffestNum = 0;
  10849. this.angleV2 = new Laya.Vector2();
  10850. this.rootV = new Laya.Vector2(0, 1);
  10851. this.tempDir1 = new Laya.Vector2();
  10852. this.tempDir2 = new Laya.Vector2();
  10853. this.ballSize = 33;
  10854. this.stPos = new Laya.Point();
  10855. this.edPos = new Laya.Point();
  10856. Common._instance = this;
  10857. window["common"] = this;
  10858. }
  10859. static getInstance() {
  10860. if (!this._instance) {
  10861. this._instance = new Common();
  10862. }
  10863. return this._instance;
  10864. }
  10865. get sysOffestNum() {
  10866. if (this._sysOffestNum == 0) {
  10867. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10868. }
  10869. return this._sysOffestNum;
  10870. }
  10871. testShader() {
  10872. let test = new LightShader();
  10873. test.texture = "res/d3Res/ballTexture/ball1.png";
  10874. Laya.stage.addChild(test);
  10875. }
  10876. playScale(node) {
  10877. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10878. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10879. }));
  10880. }));
  10881. }
  10882. setGroup(colli, ...group) {
  10883. let out = 0;
  10884. for (let index = 0; index < group.length; index++) {
  10885. if (index == 0) {
  10886. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10887. }
  10888. else {
  10889. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10890. }
  10891. }
  10892. colli.collisionGroup = out;
  10893. }
  10894. setCanGroupWith(colli, ...group) {
  10895. let out = 0;
  10896. for (let index = 0; index < group.length; index++) {
  10897. if (index == 0) {
  10898. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10899. }
  10900. else {
  10901. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10902. }
  10903. }
  10904. colli.canCollideWith = out;
  10905. }
  10906. loadPrefab(name, callback) {
  10907. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10908. let prefab = new Laya.Prefab();
  10909. prefab.json = obj;
  10910. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10911. callback && callback(img);
  10912. }));
  10913. }
  10914. pos2to3Convert(x, y, d3Pos) {
  10915. x = x + this.sysOffestNum;
  10916. d3Pos.setValue(x, y, 0);
  10917. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10918. if (success) {
  10919. }
  10920. else {
  10921. console.error("转换出错了。。。。。。。。");
  10922. }
  10923. }
  10924. scale2to3Convert(num) {
  10925. this.scaleV3One.setValue(0, 0, 0);
  10926. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10927. this.scaleV3Two.setValue(0, num, 0);
  10928. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10929. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10930. return outNum;
  10931. }
  10932. pos3to2Convert(d3Pos) {
  10933. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10934. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10935. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10936. d3Pos.x -= this.sysOffestNum;
  10937. }
  10938. scale3to2Convert(num) {
  10939. let scale = this.scale2to3Convert(1);
  10940. let d2Out = num / scale;
  10941. return d2Out;
  10942. }
  10943. getCollider(type, restitution = 0.9, density = 10) {
  10944. let colli;
  10945. if (type == "box")
  10946. colli = new Laya.BoxCollider();
  10947. else
  10948. colli = new Laya.CircleCollider();
  10949. colli.friction = 0;
  10950. colli.restitution = restitution;
  10951. colli.density = density;
  10952. return colli;
  10953. }
  10954. getRigbody() {
  10955. let rigy = new Laya.RigidBody();
  10956. rigy.bullet = true;
  10957. rigy.allowRotation = false;
  10958. rigy.allowSleep = false;
  10959. rigy.gravityScale = 0;
  10960. return rigy;
  10961. }
  10962. getfguiRotation(x, y) {
  10963. this.angleV2.setValue(x, y);
  10964. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10965. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10966. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10967. angle = -angle;
  10968. }
  10969. return 180 + angle;
  10970. }
  10971. getAngle(x, y) {
  10972. this.angleV2.setValue(x, y);
  10973. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10974. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10975. return angle;
  10976. }
  10977. randomNum(a, b) {
  10978. return a + Math.floor((b - a + 1) * Math.random());
  10979. }
  10980. getRandArrEle(arr) {
  10981. return arr[Math.floor(arr.length * Math.random())];
  10982. }
  10983. getSign(val) {
  10984. return val >= 0 ? 1 : -1;
  10985. }
  10986. botherArr(arr) {
  10987. let times = arr.length + 2;
  10988. let length = arr.length;
  10989. let a;
  10990. let b;
  10991. let temp;
  10992. for (let index = 0; index < times; index++) {
  10993. a = Math.floor(Math.random() * length);
  10994. b = Math.floor(Math.random() * length);
  10995. temp = arr[a];
  10996. arr[a] = arr[b];
  10997. arr[b] = temp;
  10998. }
  10999. }
  11000. getGameIconUrl(id) {
  11001. return "ui://game/" + id;
  11002. }
  11003. getComponentUrl(id) {
  11004. return "ui://game/" + id;
  11005. }
  11006. getAnimation() {
  11007. }
  11008. judgeSkillType(type = SkillType.highSpace) {
  11009. if (this.gameMode == GameMode.classic)
  11010. return;
  11011. let gameMgr = this.gameMgr;
  11012. if (gameMgr.selfTurn) {
  11013. if (gameMgr.selfCurSkill == type) {
  11014. return true;
  11015. }
  11016. }
  11017. else {
  11018. if (gameMgr.aiCurSkill == type) {
  11019. return true;
  11020. }
  11021. }
  11022. }
  11023. ballColliHole(collider) {
  11024. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11025. xGame.common.gameMgr.isFirstInGame = false;
  11026. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11027. }
  11028. collider.owner.mySrc.checkWrongBall();
  11029. }
  11030. getArrMaxEle(arr) {
  11031. let max = -Infinity;
  11032. for (let index = 0; index < arr.length; index++) {
  11033. max = Math.max(arr[index], max);
  11034. }
  11035. return max;
  11036. }
  11037. getArrMinEle(arr) {
  11038. let min = Infinity;
  11039. for (let index = 0; index < arr.length; index++) {
  11040. min = Math.min(arr[index], min);
  11041. }
  11042. return min;
  11043. }
  11044. playRandomMutiBallBigSkillSound() {
  11045. if (Math.random() <= 0.5)
  11046. return;
  11047. let rand = this.randomNum(1, 6);
  11048. let str = "ganfa0" + rand;
  11049. xGame.soundMgr.playSound(str);
  11050. }
  11051. showOneCamera(type) {
  11052. let object = xGame.common.d3World.cameraObj;
  11053. for (const key in object) {
  11054. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11055. object[key].init();
  11056. object[key].owner.active = key == type;
  11057. }
  11058. }
  11059. }
  11060. checkBallOverBorder(x, y) {
  11061. let radius = 17;
  11062. let condition = this._checkBorder(x + radius, y) ||
  11063. this._checkBorder(x - radius, y) ||
  11064. this._checkBorder(x, y + radius) ||
  11065. this._checkBorder(x, y - radius);
  11066. if (condition) {
  11067. return true;
  11068. }
  11069. }
  11070. _checkBorder(x, y) {
  11071. let borderRect = this.d2World.borderRect;
  11072. let xOffest = 20;
  11073. let yOffest = 20;
  11074. if (y <= borderRect.y - yOffest) {
  11075. return true;
  11076. }
  11077. if (y >= borderRect.y + borderRect.height + yOffest) {
  11078. return true;
  11079. }
  11080. if (x <= borderRect.x - xOffest) {
  11081. return true;
  11082. }
  11083. if (x >= borderRect.x + borderRect.width + xOffest) {
  11084. return true;
  11085. }
  11086. }
  11087. initWeight(cfg) {
  11088. let allCfgData = { data: {}, allWeightNum: 0 };
  11089. let weightCfg = allCfgData.data;
  11090. let weight = 0;
  11091. for (const key in cfg) {
  11092. weightCfg[key] = {};
  11093. weightCfg[key].id = cfg[key].id;
  11094. weightCfg[key].minWeight = weight;
  11095. weight += cfg[key].weight;
  11096. weightCfg[key].maxWeight = weight;
  11097. }
  11098. allCfgData.allWeightNum = weight;
  11099. return allCfgData;
  11100. }
  11101. getRandomWeightData(cfg) {
  11102. let weightCfg = cfg.data;
  11103. let allWeightNum = cfg.allWeightNum;
  11104. let rand = Math.floor(Math.random() * allWeightNum);
  11105. for (const key in weightCfg) {
  11106. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11107. return weightCfg[key];
  11108. }
  11109. }
  11110. return weightCfg[1];
  11111. }
  11112. showGirlTalkPop(wordsIndex, node, msgNode) {
  11113. node.visible = true;
  11114. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11115. node.t0.play(Laya.Handler.create(this, () => {
  11116. node.visible = false;
  11117. }));
  11118. }
  11119. stopGirlPop(node) {
  11120. node.t0.stop();
  11121. node.visible = false;
  11122. }
  11123. createHead(loader, url, size = 107) {
  11124. if (Laya.Browser.name == "Browser") {
  11125. loader.url = url;
  11126. return;
  11127. }
  11128. if (Moyu.isTT) {
  11129. let localImage = new Image();
  11130. localImage.src = url;
  11131. localImage.onload = () => {
  11132. let t2d = new Laya.Texture2D();
  11133. t2d.width = size;
  11134. t2d.height = size;
  11135. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  11136. t2d.loadImageSource(localImage);
  11137. };
  11138. }
  11139. else {
  11140. console.log('zh:url=', url);
  11141. loader.url = url;
  11142. }
  11143. }
  11144. addTestCoin(num) {
  11145. DataMgr.setCoin(num);
  11146. }
  11147. addTestDiamond(num) {
  11148. DataMgr.setDiamond(num);
  11149. }
  11150. addTestSkill() {
  11151. DataMgr.setBigSkill(0, 99);
  11152. DataMgr.setBigSkill(1, 99);
  11153. DataMgr.setBigSkill(2, 99);
  11154. }
  11155. playClassicEmotion(number, x, y) {
  11156. if (this.gameMode == GameMode.bigMove)
  11157. return;
  11158. let randIndex = this.randomNum(0, 2);
  11159. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11160. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11161. if (this.gameMgr.selfTurn) {
  11162. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11163. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11164. }
  11165. else {
  11166. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11167. }
  11168. else {
  11169. if (number == this.gameMgr.blackNum) {
  11170. if (this.gameMgr.selfBallArr.length == 0) {
  11171. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11172. }
  11173. else {
  11174. }
  11175. }
  11176. else {
  11177. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11178. }
  11179. }
  11180. }
  11181. }
  11182. else {
  11183. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11184. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11185. }
  11186. else {
  11187. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11188. }
  11189. else {
  11190. if (number == this.gameMgr.blackNum) {
  11191. if (this.gameMgr.aiBallArr.length == 0) {
  11192. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11193. }
  11194. else {
  11195. }
  11196. }
  11197. else {
  11198. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11199. }
  11200. }
  11201. }
  11202. }
  11203. }
  11204. playHappySound(number) {
  11205. if (this.gameMode != GameMode.classic)
  11206. return;
  11207. if (number == 8)
  11208. return;
  11209. let play = false;
  11210. if (this.gameMgr.selfTurn) {
  11211. if (this.gameMgr.ensureBallType) {
  11212. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11213. play = true;
  11214. }
  11215. }
  11216. else {
  11217. play = true;
  11218. }
  11219. }
  11220. else {
  11221. if (this.gameMgr.ensureBallType) {
  11222. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11223. play = true;
  11224. }
  11225. }
  11226. else {
  11227. play = true;
  11228. }
  11229. }
  11230. if (play)
  11231. xGame.soundMgr.playSound("applause");
  11232. }
  11233. destroyClassicEmotion() {
  11234. if (this.gameMode == GameMode.bigMove)
  11235. return;
  11236. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11237. parent.destroyChildren();
  11238. }
  11239. playAwardSpine(x, y) {
  11240. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11241. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11242. this.awardSpine.play(data, 0, false, parent);
  11243. }
  11244. destroyAwardSpine() {
  11245. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11246. parent.destroyChildren();
  11247. }
  11248. isBlock(bx, by, hx, hy, except = null) {
  11249. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11250. let balls = xGame.common.d2World.ballArr;
  11251. let outArr = [];
  11252. for (let index = 0; index < balls.length; index++) {
  11253. let obj = balls[index];
  11254. if (obj.number == 0)
  11255. continue;
  11256. if (obj == except)
  11257. continue;
  11258. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11259. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11260. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11261. if (num >= 1)
  11262. num = 1;
  11263. if (num < 0)
  11264. continue;
  11265. let gap = Math.sin(Math.acos(num)) * dis;
  11266. if (gap < this.ballSize) {
  11267. outArr.push({
  11268. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11269. disHon: Math.cos(Math.acos(num)) * dis,
  11270. disVer: Math.sin(Math.acos(num)) * dis,
  11271. src: balls[index],
  11272. dir: this.tempDir1
  11273. });
  11274. }
  11275. }
  11276. if (outArr.length > 0) {
  11277. outArr.sort((a, b) => { return a.dis - b.dis; });
  11278. return outArr[0];
  11279. }
  11280. }
  11281. AngleBetween(vector1, vector2) {
  11282. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11283. return rad * (180 / Math.PI);
  11284. }
  11285. getSecretaryScale() {
  11286. if (this.secretary.spineName == "mishu") {
  11287. return 1.28;
  11288. }
  11289. else {
  11290. return 1.024;
  11291. }
  11292. }
  11293. signAwardContainsRod(arr) {
  11294. let temp;
  11295. for (let index = 0; index < arr.length; index++) {
  11296. temp = arr[index].split('-')[0];
  11297. if (parseInt(temp) > 2) {
  11298. return true;
  11299. }
  11300. }
  11301. }
  11302. judgeSameDay() {
  11303. let lastTime = DataMgr.getSignTime();
  11304. let curTime = new Date().getTime();
  11305. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11306. return true;
  11307. }
  11308. return false;
  11309. }
  11310. getAward(arr, callback) {
  11311. let showTriple = arr[0].type <= 2;
  11312. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11313. let temp;
  11314. for (let index = 0; index < arr.length; index++) {
  11315. temp = arr[index];
  11316. switch (temp.type) {
  11317. case 1:
  11318. this.playObjFlyAnim(temp.num, temp.type);
  11319. break;
  11320. case 2:
  11321. this.playObjFlyAnim(temp.num, temp.type);
  11322. break;
  11323. case 3:
  11324. case 4:
  11325. case 5:
  11326. case 6:
  11327. DataMgr.setBallRod(temp.type - 2, 1);
  11328. DataMgr.setCurBallRod(temp.type - 2);
  11329. break;
  11330. default:
  11331. break;
  11332. }
  11333. }
  11334. callback && callback(watchVideo);
  11335. });
  11336. }
  11337. getMoneyNode() {
  11338. let moneyNode;
  11339. let sign = xGame.uiMgr.getUI(UISign);
  11340. let draw = xGame.uiMgr.getUI(UIDraw);
  11341. let end = xGame.uiMgr.getUI(UIGameEnd);
  11342. let skill = xGame.uiMgr.getUI(UISkill);
  11343. if (sign && !sign.isHide)
  11344. moneyNode = sign.ui.moneyNode;
  11345. if (draw && !draw.isHide)
  11346. moneyNode = draw.ui.moneyNode;
  11347. if (end && !end.isHide)
  11348. moneyNode = end.ui.moneyNode;
  11349. if (skill && !skill.isHide)
  11350. moneyNode = skill.ui.moneyNode;
  11351. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11352. let main = xGame.uiMgr.getUI(UIMain);
  11353. if (condition1 && main && !main.isHide) {
  11354. moneyNode = main.ui.moneyNode;
  11355. }
  11356. return moneyNode;
  11357. }
  11358. playObjFlyAnim(num, type, callback = null) {
  11359. this.stPos.x = Laya.stage.width / 2;
  11360. this.stPos.y = Laya.stage.height / 2;
  11361. let moneyNode = this.getMoneyNode();
  11362. switch (type) {
  11363. case Prop.diamond:
  11364. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11365. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11366. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11367. this.edPos.x /= 2;
  11368. this.edPos.y /= 2;
  11369. break;
  11370. case Prop.coin:
  11371. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11372. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11373. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11374. this.edPos.x /= 2;
  11375. this.edPos.y /= 2;
  11376. break;
  11377. default:
  11378. break;
  11379. }
  11380. xGame.soundMgr.playSound("coinbag");
  11381. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11382. switch (type) {
  11383. case Prop.diamond:
  11384. DataMgr.setDiamond(num);
  11385. break;
  11386. case Prop.coin:
  11387. DataMgr.setCoin(num);
  11388. break;
  11389. default:
  11390. break;
  11391. }
  11392. callback && callback();
  11393. });
  11394. }
  11395. autoPopUIView() {
  11396. let arr = [];
  11397. let sign = this.judgeSameDay() ? false : true;
  11398. if (sign)
  11399. arr.push("sign");
  11400. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11401. if (draw)
  11402. arr.push("draw");
  11403. if (arr.length <= 0)
  11404. return;
  11405. let str = this.getRandArrEle(arr);
  11406. switch (str) {
  11407. case "sign":
  11408. xGame.uiMgr.Show(UISign);
  11409. break;
  11410. case "draw":
  11411. xGame.uiMgr.Show(UIDraw);
  11412. break;
  11413. default:
  11414. break;
  11415. }
  11416. }
  11417. getMSTime(time) {
  11418. let min = Math.floor(time / 60);
  11419. let sec = Math.floor((time - min * 60));
  11420. if (sec < 10)
  11421. sec = "0" + sec;
  11422. if (min < 10)
  11423. min = "0" + min;
  11424. return `${min}:${sec}`;
  11425. }
  11426. testPower() {
  11427. DataMgr.setPower(0, false);
  11428. }
  11429. getAllStarNum() {
  11430. let data = DataMgr.getPlaceBallLevelList();
  11431. let out = 0;
  11432. for (let index = 0; index < data.length; index++) {
  11433. out += data[index].star;
  11434. }
  11435. return out;
  11436. }
  11437. recoverCameraView() {
  11438. Laya.timer.once(900, this, () => {
  11439. xGame.common.showOneCamera("mainCamera");
  11440. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11441. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11442. xGame.common.gameUI.ui.border.alpha = 0;
  11443. if (Laya.physicsTimer.scale < 1) {
  11444. Laya.physicsTimer.scale = 1;
  11445. }
  11446. }
  11447. });
  11448. }
  11449. getClassicLevel() {
  11450. let successTimes = DataMgr.getClassicTimes();
  11451. let needKey = "";
  11452. let lastKey = "";
  11453. let cfg = cfgTable.classictimesData;
  11454. let data;
  11455. for (const key in cfg) {
  11456. data = cfg[key];
  11457. if (successTimes <= data.times) {
  11458. needKey = key;
  11459. }
  11460. lastKey = key;
  11461. }
  11462. if (needKey == "")
  11463. needKey = lastKey;
  11464. return cfg[needKey];
  11465. }
  11466. }
  11467. Common._instance = null;
  11468. class ui_Component92 extends fgui.GComponent {
  11469. static createInstance() {
  11470. return (fgui.UIPackage.createObject("game", "Component92"));
  11471. }
  11472. onConstruct() {
  11473. this.n0 = (this.getChild("n0"));
  11474. }
  11475. }
  11476. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11477. class ui_Component129 extends fgui.GProgressBar {
  11478. static createInstance() {
  11479. return (fgui.UIPackage.createObject("game", "Component129"));
  11480. }
  11481. onConstruct() {
  11482. this.bar_v = (this.getChild("bar_v"));
  11483. this.n84 = (this.getChild("n84"));
  11484. }
  11485. }
  11486. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11487. class ui_Component130 extends fgui.GComponent {
  11488. static createInstance() {
  11489. return (fgui.UIPackage.createObject("game", "Component130"));
  11490. }
  11491. onConstruct() {
  11492. this.ani = (this.getChild("ani"));
  11493. this.t0 = this.getTransition("t0");
  11494. }
  11495. }
  11496. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11497. class ui_powerEft extends fgui.GComponent {
  11498. static createInstance() {
  11499. return (fgui.UIPackage.createObject("game", "powerEft"));
  11500. }
  11501. onConstruct() {
  11502. this.ani = (this.getChild("ani"));
  11503. this.n88 = (this.getChild("n88"));
  11504. this.n89 = (this.getChild("n89"));
  11505. }
  11506. }
  11507. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11508. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11509. static createInstance() {
  11510. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11511. }
  11512. onConstruct() {
  11513. this.c1 = this.getController("c1");
  11514. this.n2 = (this.getChild("n2"));
  11515. this.n22 = (this.getChild("n22"));
  11516. this.n23 = (this.getChild("n23"));
  11517. this.n15 = (this.getChild("n15"));
  11518. this.challenge = (this.getChild("challenge"));
  11519. this.n17 = (this.getChild("n17"));
  11520. this.n3 = (this.getChild("n3"));
  11521. this.starNode = (this.getChild("starNode"));
  11522. this.levelTxt = (this.getChild("levelTxt"));
  11523. this.n14 = (this.getChild("n14"));
  11524. this.n19 = (this.getChild("n19"));
  11525. this.n20 = (this.getChild("n20"));
  11526. this.n21 = (this.getChild("n21"));
  11527. this.special = (this.getChild("special"));
  11528. }
  11529. }
  11530. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11531. class ui_Component79 extends fgui.GComponent {
  11532. static createInstance() {
  11533. return (fgui.UIPackage.createObject("game", "Component79"));
  11534. }
  11535. onConstruct() {
  11536. this.c1 = this.getController("c1");
  11537. this.n7 = (this.getChild("n7"));
  11538. this.n8 = (this.getChild("n8"));
  11539. this.n9 = (this.getChild("n9"));
  11540. this.n10 = (this.getChild("n10"));
  11541. this.n11 = (this.getChild("n11"));
  11542. this.n12 = (this.getChild("n12"));
  11543. }
  11544. }
  11545. ui_Component79.URL = "ui://isxx5ak7avag477";
  11546. class ui_Component80 extends fgui.GComponent {
  11547. static createInstance() {
  11548. return (fgui.UIPackage.createObject("game", "Component80"));
  11549. }
  11550. onConstruct() {
  11551. this.n0 = (this.getChild("n0"));
  11552. this.n1 = (this.getChild("n1"));
  11553. this.myList = (this.getChild("myList"));
  11554. this.t0 = this.getTransition("t0");
  11555. }
  11556. }
  11557. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11558. class ui_SignNormal extends fgui.GComponent {
  11559. static createInstance() {
  11560. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11561. }
  11562. onConstruct() {
  11563. this.c1 = this.getController("c1");
  11564. this.n7 = (this.getChild("n7"));
  11565. this.n15 = (this.getChild("n15"));
  11566. this.titleTxt = (this.getChild("titleTxt"));
  11567. this.n8 = (this.getChild("n8"));
  11568. this.myIcon = (this.getChild("myIcon"));
  11569. this.numTxt = (this.getChild("numTxt"));
  11570. this.n12 = (this.getChild("n12"));
  11571. this.n13 = (this.getChild("n13"));
  11572. this.n17 = (this.getChild("n17"));
  11573. this.n14 = (this.getChild("n14"));
  11574. }
  11575. }
  11576. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11577. class ui_screenNode extends fgui.GComponent {
  11578. static createInstance() {
  11579. return (fgui.UIPackage.createObject("game", "screenNode"));
  11580. }
  11581. onConstruct() {
  11582. this.n9 = (this.getChild("n9"));
  11583. this.screenImg = (this.getChild("screenImg"));
  11584. }
  11585. }
  11586. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11587. class ui_GetAwrad_com1 extends fgui.GComponent {
  11588. static createInstance() {
  11589. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11590. }
  11591. onConstruct() {
  11592. this.n38 = (this.getChild("n38"));
  11593. this.n39 = (this.getChild("n39"));
  11594. this.n40 = (this.getChild("n40"));
  11595. this.t0 = this.getTransition("t0");
  11596. this.t1 = this.getTransition("t1");
  11597. }
  11598. }
  11599. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11600. class ui_GetAwrad_com2 extends fgui.GComponent {
  11601. static createInstance() {
  11602. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11603. }
  11604. onConstruct() {
  11605. this.n39 = (this.getChild("n39"));
  11606. this.n40 = (this.getChild("n40"));
  11607. this.t0 = this.getTransition("t0");
  11608. }
  11609. }
  11610. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11611. class ui_Component128 extends fgui.GComponent {
  11612. static createInstance() {
  11613. return (fgui.UIPackage.createObject("game", "Component128"));
  11614. }
  11615. onConstruct() {
  11616. this.n38 = (this.getChild("n38"));
  11617. this.n40 = (this.getChild("n40"));
  11618. }
  11619. }
  11620. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11621. class ui_Component100_1 extends fgui.GComponent {
  11622. static createInstance() {
  11623. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11624. }
  11625. onConstruct() {
  11626. this.myNode = (this.getChild("myNode"));
  11627. this.t0 = this.getTransition("t0");
  11628. }
  11629. }
  11630. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11631. class ui_Component142 extends fgui.GComponent {
  11632. static createInstance() {
  11633. return (fgui.UIPackage.createObject("game", "Component142"));
  11634. }
  11635. onConstruct() {
  11636. this.n41 = (this.getChild("n41"));
  11637. this.n42 = (this.getChild("n42"));
  11638. }
  11639. }
  11640. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11641. class ui_main_guang extends fgui.GComponent {
  11642. static createInstance() {
  11643. return (fgui.UIPackage.createObject("game", "main_guang"));
  11644. }
  11645. onConstruct() {
  11646. this.n1 = (this.getChild("n1"));
  11647. this.n2 = (this.getChild("n2"));
  11648. this.n3 = (this.getChild("n3"));
  11649. this.n4 = (this.getChild("n4"));
  11650. this.n5 = (this.getChild("n5"));
  11651. this.n6 = (this.getChild("n6"));
  11652. this.n8 = (this.getChild("n8"));
  11653. this.t0 = this.getTransition("t0");
  11654. }
  11655. }
  11656. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11657. class ui_try_com1 extends fgui.GComponent {
  11658. static createInstance() {
  11659. return (fgui.UIPackage.createObject("game", "try_com1"));
  11660. }
  11661. onConstruct() {
  11662. this.c1 = this.getController("c1");
  11663. this.n0 = (this.getChild("n0"));
  11664. this.n2 = (this.getChild("n2"));
  11665. this.cancelBtn = (this.getChild("cancelBtn"));
  11666. this.videoBtn = (this.getChild("videoBtn"));
  11667. this.n9 = (this.getChild("n9"));
  11668. this.n24 = (this.getChild("n24"));
  11669. this.titleTxt = (this.getChild("titleTxt"));
  11670. this.n32 = (this.getChild("n32"));
  11671. this.n29 = (this.getChild("n29"));
  11672. this.n36 = (this.getChild("n36"));
  11673. this.txtTime = (this.getChild("txtTime"));
  11674. this.t0 = this.getTransition("t0");
  11675. }
  11676. }
  11677. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11678. class ui_try_com2 extends fgui.GComponent {
  11679. static createInstance() {
  11680. return (fgui.UIPackage.createObject("game", "try_com2"));
  11681. }
  11682. onConstruct() {
  11683. this.skillicon = (this.getChild("skillicon"));
  11684. this.n35 = (this.getChild("n35"));
  11685. this.n31 = (this.getChild("n31"));
  11686. this.n32 = (this.getChild("n32"));
  11687. this.n33 = (this.getChild("n33"));
  11688. this.n34 = (this.getChild("n34"));
  11689. }
  11690. }
  11691. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11692. class ui_try_com3 extends fgui.GComponent {
  11693. static createInstance() {
  11694. return (fgui.UIPackage.createObject("game", "try_com3"));
  11695. }
  11696. onConstruct() {
  11697. this.n33 = (this.getChild("n33"));
  11698. this.n34 = (this.getChild("n34"));
  11699. this.n35 = (this.getChild("n35"));
  11700. this.t0 = this.getTransition("t0");
  11701. }
  11702. }
  11703. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11704. class ui_huihe1 extends fgui.GComponent {
  11705. static createInstance() {
  11706. return (fgui.UIPackage.createObject("game", "huihe1"));
  11707. }
  11708. onConstruct() {
  11709. this.n0 = (this.getChild("n0"));
  11710. this.n1 = (this.getChild("n1"));
  11711. this.t0 = this.getTransition("t0");
  11712. }
  11713. }
  11714. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11715. class ui_huihe2 extends fgui.GComponent {
  11716. static createInstance() {
  11717. return (fgui.UIPackage.createObject("game", "huihe2"));
  11718. }
  11719. onConstruct() {
  11720. this.n0 = (this.getChild("n0"));
  11721. this.n1 = (this.getChild("n1"));
  11722. this.t0 = this.getTransition("t0");
  11723. }
  11724. }
  11725. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11726. class ui_Component143 extends fgui.GComponent {
  11727. static createInstance() {
  11728. return (fgui.UIPackage.createObject("game", "Component143"));
  11729. }
  11730. onConstruct() {
  11731. this.n3 = (this.getChild("n3"));
  11732. this.n4 = (this.getChild("n4"));
  11733. this.n5 = (this.getChild("n5"));
  11734. this.n6 = (this.getChild("n6"));
  11735. this.n7 = (this.getChild("n7"));
  11736. this.n8 = (this.getChild("n8"));
  11737. this.n9 = (this.getChild("n9"));
  11738. this.n10 = (this.getChild("n10"));
  11739. this.t0 = this.getTransition("t0");
  11740. }
  11741. }
  11742. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11743. class ui_dh_jingbi2 extends fgui.GComponent {
  11744. static createInstance() {
  11745. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11746. }
  11747. onConstruct() {
  11748. this.n0 = (this.getChild("n0"));
  11749. this.n1 = (this.getChild("n1"));
  11750. this.n2 = (this.getChild("n2"));
  11751. this.n3 = (this.getChild("n3"));
  11752. this.n4 = (this.getChild("n4"));
  11753. this.n5 = (this.getChild("n5"));
  11754. this.n6 = (this.getChild("n6"));
  11755. this.n8 = (this.getChild("n8"));
  11756. this.n10 = (this.getChild("n10"));
  11757. this.t0 = this.getTransition("t0");
  11758. }
  11759. }
  11760. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11761. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11762. static createInstance() {
  11763. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11764. }
  11765. onConstruct() {
  11766. this.n1 = (this.getChild("n1"));
  11767. this.n4 = (this.getChild("n4"));
  11768. this.t0 = this.getTransition("t0");
  11769. }
  11770. }
  11771. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11772. class ui_dh_jingbi3 extends fgui.GComponent {
  11773. static createInstance() {
  11774. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11775. }
  11776. onConstruct() {
  11777. this.n0 = (this.getChild("n0"));
  11778. this.n1 = (this.getChild("n1"));
  11779. this.n2 = (this.getChild("n2"));
  11780. this.n3 = (this.getChild("n3"));
  11781. this.n4 = (this.getChild("n4"));
  11782. this.n5 = (this.getChild("n5"));
  11783. this.n6 = (this.getChild("n6"));
  11784. this.n8 = (this.getChild("n8"));
  11785. this.n10 = (this.getChild("n10"));
  11786. this.t0 = this.getTransition("t0");
  11787. }
  11788. }
  11789. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11790. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11791. static createInstance() {
  11792. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11793. }
  11794. onConstruct() {
  11795. this.n3 = (this.getChild("n3"));
  11796. this.n1 = (this.getChild("n1"));
  11797. this.t0 = this.getTransition("t0");
  11798. }
  11799. }
  11800. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11801. class ui_hb_jinbi1 extends fgui.GButton {
  11802. static createInstance() {
  11803. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11804. }
  11805. onConstruct() {
  11806. this.n20 = (this.getChild("n20"));
  11807. this.n25 = (this.getChild("n25"));
  11808. this.coinTxt = (this.getChild("coinTxt"));
  11809. this.n28 = (this.getChild("n28"));
  11810. this.n32 = (this.getChild("n32"));
  11811. this.n38 = (this.getChild("n38"));
  11812. this.n45 = (this.getChild("n45"));
  11813. this.getTips = (this.getChild("getTips"));
  11814. this.n39 = (this.getChild("n39"));
  11815. this.diamondTxt = (this.getChild("diamondTxt"));
  11816. this.n41 = (this.getChild("n41"));
  11817. this.n42 = (this.getChild("n42"));
  11818. this.n46 = (this.getChild("n46"));
  11819. this.n47 = (this.getChild("n47"));
  11820. this.n48 = (this.getChild("n48"));
  11821. this.t0 = this.getTransition("t0");
  11822. }
  11823. }
  11824. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11825. class ui_hb_jinbi2 extends fgui.GButton {
  11826. static createInstance() {
  11827. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11828. }
  11829. onConstruct() {
  11830. this.n20 = (this.getChild("n20"));
  11831. this.n25 = (this.getChild("n25"));
  11832. this.coinTxt = (this.getChild("coinTxt"));
  11833. this.n28 = (this.getChild("n28"));
  11834. this.n32 = (this.getChild("n32"));
  11835. this.n38 = (this.getChild("n38"));
  11836. this.n39 = (this.getChild("n39"));
  11837. this.diamondTxt = (this.getChild("diamondTxt"));
  11838. this.n41 = (this.getChild("n41"));
  11839. this.n42 = (this.getChild("n42"));
  11840. this.n43 = (this.getChild("n43"));
  11841. this.n44 = (this.getChild("n44"));
  11842. this.n45 = (this.getChild("n45"));
  11843. this.t0 = this.getTransition("t0");
  11844. }
  11845. }
  11846. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11847. class ui_hb_jinbi3 extends fgui.GButton {
  11848. static createInstance() {
  11849. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11850. }
  11851. onConstruct() {
  11852. this.n20 = (this.getChild("n20"));
  11853. this.n25 = (this.getChild("n25"));
  11854. this.coinTxt = (this.getChild("coinTxt"));
  11855. this.n28 = (this.getChild("n28"));
  11856. this.n32 = (this.getChild("n32"));
  11857. this.n38 = (this.getChild("n38"));
  11858. this.n39 = (this.getChild("n39"));
  11859. this.diamondTxt = (this.getChild("diamondTxt"));
  11860. this.n41 = (this.getChild("n41"));
  11861. this.n42 = (this.getChild("n42"));
  11862. this.n43 = (this.getChild("n43"));
  11863. this.n44 = (this.getChild("n44"));
  11864. this.n45 = (this.getChild("n45"));
  11865. this.t0 = this.getTransition("t0");
  11866. }
  11867. }
  11868. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11869. class ui_Component104 extends fgui.GComponent {
  11870. static createInstance() {
  11871. return (fgui.UIPackage.createObject("game", "Component104"));
  11872. }
  11873. onConstruct() {
  11874. this.c1 = this.getController("c1");
  11875. this.n12 = (this.getChild("n12"));
  11876. this.coinBtn = (this.getChild("coinBtn"));
  11877. this.diamondBtn = (this.getChild("diamondBtn"));
  11878. this.node3 = (this.getChild("node3"));
  11879. this.node4 = (this.getChild("node4"));
  11880. this.node5 = (this.getChild("node5"));
  11881. this.node1 = (this.getChild("node1"));
  11882. this.node2 = (this.getChild("node2"));
  11883. this.node6 = (this.getChild("node6"));
  11884. this.t0 = this.getTransition("t0");
  11885. }
  11886. }
  11887. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11888. class ui_Component105 extends fgui.GButton {
  11889. static createInstance() {
  11890. return (fgui.UIPackage.createObject("game", "Component105"));
  11891. }
  11892. onConstruct() {
  11893. this.c1 = this.getController("c1");
  11894. this.n49 = (this.getChild("n49"));
  11895. this.n18 = (this.getChild("n18"));
  11896. this.n46 = (this.getChild("n46"));
  11897. this.n48 = (this.getChild("n48"));
  11898. }
  11899. }
  11900. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11901. class ui_Component106 extends fgui.GButton {
  11902. static createInstance() {
  11903. return (fgui.UIPackage.createObject("game", "Component106"));
  11904. }
  11905. onConstruct() {
  11906. this.c1 = this.getController("c1");
  11907. this.n49 = (this.getChild("n49"));
  11908. this.n18 = (this.getChild("n18"));
  11909. this.n46 = (this.getChild("n46"));
  11910. this.n48 = (this.getChild("n48"));
  11911. }
  11912. }
  11913. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11914. class ui_hb_zs1 extends fgui.GButton {
  11915. static createInstance() {
  11916. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11917. }
  11918. onConstruct() {
  11919. this.c1 = this.getController("c1");
  11920. this.n20 = (this.getChild("n20"));
  11921. this.n21 = (this.getChild("n21"));
  11922. this.n26 = (this.getChild("n26"));
  11923. this.n27 = (this.getChild("n27"));
  11924. this.shareTxt = (this.getChild("shareTxt"));
  11925. this.n32 = (this.getChild("n32"));
  11926. this.n38 = (this.getChild("n38"));
  11927. this.n39 = (this.getChild("n39"));
  11928. this.n44 = (this.getChild("n44"));
  11929. this.diamondTxt = (this.getChild("diamondTxt"));
  11930. this.n41 = (this.getChild("n41"));
  11931. this.n45 = (this.getChild("n45"));
  11932. this.n47 = (this.getChild("n47"));
  11933. this.n48 = (this.getChild("n48"));
  11934. this.randTxt = (this.getChild("randTxt"));
  11935. this.n50 = (this.getChild("n50"));
  11936. this.t0 = this.getTransition("t0");
  11937. }
  11938. }
  11939. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11940. class ui_dh_zs1 extends fgui.GComponent {
  11941. static createInstance() {
  11942. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11943. }
  11944. onConstruct() {
  11945. this.n10 = (this.getChild("n10"));
  11946. this.n9 = (this.getChild("n9"));
  11947. this.n1 = (this.getChild("n1"));
  11948. this.n2 = (this.getChild("n2"));
  11949. this.n3 = (this.getChild("n3"));
  11950. this.n4 = (this.getChild("n4"));
  11951. this.n5 = (this.getChild("n5"));
  11952. this.n6 = (this.getChild("n6"));
  11953. this.n8 = (this.getChild("n8"));
  11954. this.n11 = (this.getChild("n11"));
  11955. this.t0 = this.getTransition("t0");
  11956. }
  11957. }
  11958. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11959. class ui_dh_zs1_1 extends fgui.GComponent {
  11960. static createInstance() {
  11961. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11962. }
  11963. onConstruct() {
  11964. this.n3 = (this.getChild("n3"));
  11965. this.n1 = (this.getChild("n1"));
  11966. this.t0 = this.getTransition("t0");
  11967. }
  11968. }
  11969. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11970. class ui_hb_zs2 extends fgui.GButton {
  11971. static createInstance() {
  11972. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11973. }
  11974. onConstruct() {
  11975. this.n20 = (this.getChild("n20"));
  11976. this.n21 = (this.getChild("n21"));
  11977. this.n26 = (this.getChild("n26"));
  11978. this.n27 = (this.getChild("n27"));
  11979. this.n32 = (this.getChild("n32"));
  11980. this.n38 = (this.getChild("n38"));
  11981. this.n39 = (this.getChild("n39"));
  11982. this.n44 = (this.getChild("n44"));
  11983. this.diamondTxt = (this.getChild("diamondTxt"));
  11984. this.n41 = (this.getChild("n41"));
  11985. this.n45 = (this.getChild("n45"));
  11986. this.t0 = this.getTransition("t0");
  11987. }
  11988. }
  11989. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11990. class ui_hb_zs3 extends fgui.GButton {
  11991. static createInstance() {
  11992. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11993. }
  11994. onConstruct() {
  11995. this.n20 = (this.getChild("n20"));
  11996. this.n21 = (this.getChild("n21"));
  11997. this.n26 = (this.getChild("n26"));
  11998. this.n27 = (this.getChild("n27"));
  11999. this.n32 = (this.getChild("n32"));
  12000. this.n38 = (this.getChild("n38"));
  12001. this.n47 = (this.getChild("n47"));
  12002. this.t0 = this.getTransition("t0");
  12003. }
  12004. }
  12005. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12006. class ui_dh_zs2 extends fgui.GComponent {
  12007. static createInstance() {
  12008. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12009. }
  12010. onConstruct() {
  12011. this.n10 = (this.getChild("n10"));
  12012. this.n9 = (this.getChild("n9"));
  12013. this.n1 = (this.getChild("n1"));
  12014. this.n2 = (this.getChild("n2"));
  12015. this.n3 = (this.getChild("n3"));
  12016. this.n4 = (this.getChild("n4"));
  12017. this.n5 = (this.getChild("n5"));
  12018. this.n6 = (this.getChild("n6"));
  12019. this.n8 = (this.getChild("n8"));
  12020. this.n11 = (this.getChild("n11"));
  12021. this.t0 = this.getTransition("t0");
  12022. }
  12023. }
  12024. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12025. class ui_dh_zs2_1 extends fgui.GComponent {
  12026. static createInstance() {
  12027. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12028. }
  12029. onConstruct() {
  12030. this.n3 = (this.getChild("n3"));
  12031. this.n1 = (this.getChild("n1"));
  12032. this.t0 = this.getTransition("t0");
  12033. }
  12034. }
  12035. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12036. class ui_dh_zs3 extends fgui.GComponent {
  12037. static createInstance() {
  12038. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12039. }
  12040. onConstruct() {
  12041. this.n10 = (this.getChild("n10"));
  12042. this.n9 = (this.getChild("n9"));
  12043. this.n1 = (this.getChild("n1"));
  12044. this.n2 = (this.getChild("n2"));
  12045. this.n3 = (this.getChild("n3"));
  12046. this.n4 = (this.getChild("n4"));
  12047. this.n5 = (this.getChild("n5"));
  12048. this.n6 = (this.getChild("n6"));
  12049. this.n8 = (this.getChild("n8"));
  12050. this.n11 = (this.getChild("n11"));
  12051. this.t0 = this.getTransition("t0");
  12052. }
  12053. }
  12054. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12055. class ui_dh_zs3_1 extends fgui.GComponent {
  12056. static createInstance() {
  12057. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12058. }
  12059. onConstruct() {
  12060. this.n3 = (this.getChild("n3"));
  12061. this.n1 = (this.getChild("n1"));
  12062. this.t0 = this.getTransition("t0");
  12063. }
  12064. }
  12065. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12066. class ui_Component107 extends fgui.GComponent {
  12067. static createInstance() {
  12068. return (fgui.UIPackage.createObject("game", "Component107"));
  12069. }
  12070. onConstruct() {
  12071. this.n18 = (this.getChild("n18"));
  12072. this.n19 = (this.getChild("n19"));
  12073. this.n20 = (this.getChild("n20"));
  12074. this.n21 = (this.getChild("n21"));
  12075. this.n22 = (this.getChild("n22"));
  12076. this.levelTxt = (this.getChild("levelTxt"));
  12077. this.t0 = this.getTransition("t0");
  12078. }
  12079. }
  12080. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12081. class ui_box_com1 extends fgui.GComponent {
  12082. static createInstance() {
  12083. return (fgui.UIPackage.createObject("game", "box_com1"));
  12084. }
  12085. onConstruct() {
  12086. this.n14 = (this.getChild("n14"));
  12087. this.n6 = (this.getChild("n6"));
  12088. this.t0 = this.getTransition("t0");
  12089. }
  12090. }
  12091. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12092. class ui_box_com2 extends fgui.GProgressBar {
  12093. static createInstance() {
  12094. return (fgui.UIPackage.createObject("game", "box_com2"));
  12095. }
  12096. onConstruct() {
  12097. this.bg0 = (this.getChild("bg0"));
  12098. this.bg = (this.getChild("bg"));
  12099. this.bar = (this.getChild("bar"));
  12100. this.n7 = (this.getChild("n7"));
  12101. this.n8 = (this.getChild("n8"));
  12102. this.n10 = (this.getChild("n10"));
  12103. this.n11 = (this.getChild("n11"));
  12104. this.n12 = (this.getChild("n12"));
  12105. }
  12106. }
  12107. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12108. class ui_box_com4 extends fgui.GComponent {
  12109. static createInstance() {
  12110. return (fgui.UIPackage.createObject("game", "box_com4"));
  12111. }
  12112. onConstruct() {
  12113. this.n8 = (this.getChild("n8"));
  12114. this.t0 = this.getTransition("t0");
  12115. }
  12116. }
  12117. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12118. class ui_box_com3 extends fgui.GComponent {
  12119. static createInstance() {
  12120. return (fgui.UIPackage.createObject("game", "box_com3"));
  12121. }
  12122. onConstruct() {
  12123. this.n2 = (this.getChild("n2"));
  12124. this.n3 = (this.getChild("n3"));
  12125. this.n4 = (this.getChild("n4"));
  12126. this.n5 = (this.getChild("n5"));
  12127. this.t0 = this.getTransition("t0");
  12128. this.t1 = this.getTransition("t1");
  12129. }
  12130. }
  12131. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12132. class ui_Component97 extends fgui.GComponent {
  12133. static createInstance() {
  12134. return (fgui.UIPackage.createObject("game", "Component97"));
  12135. }
  12136. onConstruct() {
  12137. this.c1 = this.getController("c1");
  12138. this.n46 = (this.getChild("n46"));
  12139. this.diamondNode = (this.getChild("diamondNode"));
  12140. this.coinNode = (this.getChild("coinNode"));
  12141. this.t0 = this.getTransition("t0");
  12142. }
  12143. }
  12144. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12145. class ui_Component98 extends fgui.GButton {
  12146. static createInstance() {
  12147. return (fgui.UIPackage.createObject("game", "Component98"));
  12148. }
  12149. onConstruct() {
  12150. this.n8 = (this.getChild("n8"));
  12151. this.n40 = (this.getChild("n40"));
  12152. }
  12153. }
  12154. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12155. class ui_Component28_11 extends fgui.GButton {
  12156. static createInstance() {
  12157. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12158. }
  12159. onConstruct() {
  12160. this.c1 = this.getController("c1");
  12161. this.n12 = (this.getChild("n12"));
  12162. this.n17 = (this.getChild("n17"));
  12163. this.n13 = (this.getChild("n13"));
  12164. this.diamondTxt = (this.getChild("diamondTxt"));
  12165. this.n15 = (this.getChild("n15"));
  12166. this.n16 = (this.getChild("n16"));
  12167. }
  12168. }
  12169. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12170. class ui_Component58_11 extends fgui.GComponent {
  12171. static createInstance() {
  12172. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12173. }
  12174. onConstruct() {
  12175. this.n23 = (this.getChild("n23"));
  12176. this.n41 = (this.getChild("n41"));
  12177. this.myList = (this.getChild("myList"));
  12178. this.n45 = (this.getChild("n45"));
  12179. this.n44 = (this.getChild("n44"));
  12180. this.t0 = this.getTransition("t0");
  12181. }
  12182. }
  12183. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12184. class ui_Component100 extends fgui.GComponent {
  12185. static createInstance() {
  12186. return (fgui.UIPackage.createObject("game", "Component100"));
  12187. }
  12188. onConstruct() {
  12189. this.c1 = this.getController("c1");
  12190. this.n75 = (this.getChild("n75"));
  12191. this.n76 = (this.getChild("n76"));
  12192. this.n80 = (this.getChild("n80"));
  12193. this.txt = (this.getChild("txt"));
  12194. this.spineRoot = (this.getChild("spineRoot"));
  12195. }
  12196. }
  12197. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12198. class ui_Component101 extends fgui.GComponent {
  12199. static createInstance() {
  12200. return (fgui.UIPackage.createObject("game", "Component101"));
  12201. }
  12202. onConstruct() {
  12203. this.c1 = this.getController("c1");
  12204. this.n36 = (this.getChild("n36"));
  12205. this.n35 = (this.getChild("n35"));
  12206. this.n33 = (this.getChild("n33"));
  12207. this.n34 = (this.getChild("n34"));
  12208. }
  12209. }
  12210. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12211. class ui_Component53 extends fgui.GComponent {
  12212. static createInstance() {
  12213. return (fgui.UIPackage.createObject("game", "Component53"));
  12214. }
  12215. onConstruct() {
  12216. this.n0 = (this.getChild("n0"));
  12217. this.n1 = (this.getChild("n1"));
  12218. this.n2 = (this.getChild("n2"));
  12219. this.n3 = (this.getChild("n3"));
  12220. this.n4 = (this.getChild("n4"));
  12221. this.n5 = (this.getChild("n5"));
  12222. this.n6 = (this.getChild("n6"));
  12223. this.n7 = (this.getChild("n7"));
  12224. this.n8 = (this.getChild("n8"));
  12225. this.n9 = (this.getChild("n9"));
  12226. this.n10 = (this.getChild("n10"));
  12227. this.n11 = (this.getChild("n11"));
  12228. this.n12 = (this.getChild("n12"));
  12229. this.n13 = (this.getChild("n13"));
  12230. this.n14 = (this.getChild("n14"));
  12231. this.n15 = (this.getChild("n15"));
  12232. this.n16 = (this.getChild("n16"));
  12233. this.n19 = (this.getChild("n19"));
  12234. this.n20 = (this.getChild("n20"));
  12235. this.n21 = (this.getChild("n21"));
  12236. this.n22 = (this.getChild("n22"));
  12237. this.n23 = (this.getChild("n23"));
  12238. this.n24 = (this.getChild("n24"));
  12239. this.n25 = (this.getChild("n25"));
  12240. this.n26 = (this.getChild("n26"));
  12241. this.n27 = (this.getChild("n27"));
  12242. this.n28 = (this.getChild("n28"));
  12243. this.n29 = (this.getChild("n29"));
  12244. this.n30 = (this.getChild("n30"));
  12245. this.n31 = (this.getChild("n31"));
  12246. this.n32 = (this.getChild("n32"));
  12247. this.n33 = (this.getChild("n33"));
  12248. this.n34 = (this.getChild("n34"));
  12249. this.n35 = (this.getChild("n35"));
  12250. this.t0 = this.getTransition("t0");
  12251. }
  12252. }
  12253. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12254. class ui_Component58 extends fgui.GComponent {
  12255. static createInstance() {
  12256. return (fgui.UIPackage.createObject("game", "Component58"));
  12257. }
  12258. onConstruct() {
  12259. this.n23 = (this.getChild("n23"));
  12260. this.n41 = (this.getChild("n41"));
  12261. this.n8 = (this.getChild("n8"));
  12262. this.skillList = (this.getChild("skillList"));
  12263. this.t0 = this.getTransition("t0");
  12264. }
  12265. }
  12266. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12267. class ui_Component59 extends fgui.GComponent {
  12268. static createInstance() {
  12269. return (fgui.UIPackage.createObject("game", "Component59"));
  12270. }
  12271. onConstruct() {
  12272. this.n3 = (this.getChild("n3"));
  12273. this.msgTxt = (this.getChild("msgTxt"));
  12274. this.t0 = this.getTransition("t0");
  12275. }
  12276. }
  12277. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12278. class ui_RulerNode extends fgui.GComponent {
  12279. static createInstance() {
  12280. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12281. }
  12282. onConstruct() {
  12283. this.n6 = (this.getChild("n6"));
  12284. this.n4 = (this.getChild("n4"));
  12285. this.img1 = (this.getChild("img1"));
  12286. this.img2 = (this.getChild("img2"));
  12287. }
  12288. }
  12289. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12290. class ui_Component108 extends fgui.GComponent {
  12291. static createInstance() {
  12292. return (fgui.UIPackage.createObject("game", "Component108"));
  12293. }
  12294. onConstruct() {
  12295. this.n19 = (this.getChild("n19"));
  12296. this.t0 = this.getTransition("t0");
  12297. }
  12298. }
  12299. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12300. class ui_Component63 extends fgui.GComponent {
  12301. static createInstance() {
  12302. return (fgui.UIPackage.createObject("game", "Component63"));
  12303. }
  12304. onConstruct() {
  12305. this.n66 = (this.getChild("n66"));
  12306. this.n56 = (this.getChild("n56"));
  12307. this.n63 = (this.getChild("n63"));
  12308. this.n65 = (this.getChild("n65"));
  12309. this.t0 = this.getTransition("t0");
  12310. }
  12311. }
  12312. ui_Component63.URL = "ui://isxx5ak7h657452";
  12313. class ui_topNode extends fgui.GComponent {
  12314. static createInstance() {
  12315. return (fgui.UIPackage.createObject("game", "topNode"));
  12316. }
  12317. onConstruct() {
  12318. this.selfProgress = (this.getChild("selfProgress"));
  12319. this.aiProgress = (this.getChild("aiProgress"));
  12320. this.selfKuang = (this.getChild("selfKuang"));
  12321. this.aiKuang = (this.getChild("aiKuang"));
  12322. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12323. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12324. this.n33 = (this.getChild("n33"));
  12325. this.n34 = (this.getChild("n34"));
  12326. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12327. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12328. this.selfBallList = (this.getChild("selfBallList"));
  12329. this.aiBallList = (this.getChild("aiBallList"));
  12330. this.middleNode = (this.getChild("middleNode"));
  12331. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12332. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12333. this.scoreNode = (this.getChild("scoreNode"));
  12334. this.selfTips = (this.getChild("selfTips"));
  12335. this.aiTips = (this.getChild("aiTips"));
  12336. }
  12337. }
  12338. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12339. class ui_selfProgress extends fgui.GProgressBar {
  12340. static createInstance() {
  12341. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12342. }
  12343. onConstruct() {
  12344. this.n3 = (this.getChild("n3"));
  12345. this.bar = (this.getChild("bar"));
  12346. }
  12347. }
  12348. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12349. class ui_aiProgress extends fgui.GProgressBar {
  12350. static createInstance() {
  12351. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12352. }
  12353. onConstruct() {
  12354. this.n3 = (this.getChild("n3"));
  12355. this.bar = (this.getChild("bar"));
  12356. }
  12357. }
  12358. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12359. class ui_ballDisplay extends fgui.GComponent {
  12360. static createInstance() {
  12361. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12362. }
  12363. onConstruct() {
  12364. this.myImg = (this.getChild("myImg"));
  12365. }
  12366. }
  12367. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12368. class ui_moveNode extends fgui.GComponent {
  12369. static createInstance() {
  12370. return (fgui.UIPackage.createObject("game", "moveNode"));
  12371. }
  12372. onConstruct() {
  12373. this.n8 = (this.getChild("n8"));
  12374. this.finger = (this.getChild("finger"));
  12375. }
  12376. }
  12377. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12378. class ui_cancelBtn extends fgui.GButton {
  12379. static createInstance() {
  12380. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12381. }
  12382. onConstruct() {
  12383. this.c1 = this.getController("c1");
  12384. this.n0 = (this.getChild("n0"));
  12385. this.n1 = (this.getChild("n1"));
  12386. }
  12387. }
  12388. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12389. class ui_shareBtn extends fgui.GButton {
  12390. static createInstance() {
  12391. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12392. }
  12393. onConstruct() {
  12394. this.c1 = this.getController("c1");
  12395. this.n2 = (this.getChild("n2"));
  12396. this.n1 = (this.getChild("n1"));
  12397. this.n3 = (this.getChild("n3"));
  12398. this.n4 = (this.getChild("n4"));
  12399. this.n5 = (this.getChild("n5"));
  12400. this.n6 = (this.getChild("n6"));
  12401. }
  12402. }
  12403. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12404. class ui_share2Btn extends fgui.GButton {
  12405. static createInstance() {
  12406. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12407. }
  12408. onConstruct() {
  12409. this.n3 = (this.getChild("n3"));
  12410. }
  12411. }
  12412. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12413. class ui_rodMethodNode extends fgui.GComponent {
  12414. static createInstance() {
  12415. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12416. }
  12417. onConstruct() {
  12418. this.bg = (this.getChild("bg"));
  12419. this.dot = (this.getChild("dot"));
  12420. }
  12421. }
  12422. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12423. class ui_sureBtn extends fgui.GButton {
  12424. static createInstance() {
  12425. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12426. }
  12427. onConstruct() {
  12428. this.n2 = (this.getChild("n2"));
  12429. this.n1 = (this.getChild("n1"));
  12430. }
  12431. }
  12432. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12433. class ui_Component18 extends fgui.GComponent {
  12434. static createInstance() {
  12435. return (fgui.UIPackage.createObject("game", "Component18"));
  12436. }
  12437. onConstruct() {
  12438. this.c1 = this.getController("c1");
  12439. this.nameTxt = (this.getChild("nameTxt"));
  12440. this.headImg = (this.getChild("headImg"));
  12441. this.n24 = (this.getChild("n24"));
  12442. this.skillImg = (this.getChild("skillImg"));
  12443. this.skillTxt = (this.getChild("skillTxt"));
  12444. }
  12445. }
  12446. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12447. class ui_Component45 extends fgui.GComponent {
  12448. static createInstance() {
  12449. return (fgui.UIPackage.createObject("game", "Component45"));
  12450. }
  12451. onConstruct() {
  12452. this.c1 = this.getController("c1");
  12453. this.n40 = (this.getChild("n40"));
  12454. this.n41 = (this.getChild("n41"));
  12455. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12456. this.n42 = (this.getChild("n42"));
  12457. this.awardTxt = (this.getChild("awardTxt"));
  12458. this.n44 = (this.getChild("n44"));
  12459. this.t0 = this.getTransition("t0");
  12460. }
  12461. }
  12462. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12463. class ui_emotionDisplay extends fgui.GButton {
  12464. static createInstance() {
  12465. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12466. }
  12467. onConstruct() {
  12468. this.myIcon = (this.getChild("myIcon"));
  12469. }
  12470. }
  12471. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12472. class ui_Component49 extends fgui.GButton {
  12473. static createInstance() {
  12474. return (fgui.UIPackage.createObject("game", "Component49"));
  12475. }
  12476. onConstruct() {
  12477. this.n69 = (this.getChild("n69"));
  12478. this.n56 = (this.getChild("n56"));
  12479. }
  12480. }
  12481. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12482. class ui_Component50 extends fgui.GButton {
  12483. static createInstance() {
  12484. return (fgui.UIPackage.createObject("game", "Component50"));
  12485. }
  12486. onConstruct() {
  12487. this.n54 = (this.getChild("n54"));
  12488. this.n65 = (this.getChild("n65"));
  12489. }
  12490. }
  12491. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12492. class ui_Component51 extends fgui.GButton {
  12493. static createInstance() {
  12494. return (fgui.UIPackage.createObject("game", "Component51"));
  12495. }
  12496. onConstruct() {
  12497. this.c1 = this.getController("c1");
  12498. this.n51 = (this.getChild("n51"));
  12499. this.n54 = (this.getChild("n54"));
  12500. }
  12501. }
  12502. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12503. class ui_Button5 extends fgui.GButton {
  12504. static createInstance() {
  12505. return (fgui.UIPackage.createObject("game", "Button5"));
  12506. }
  12507. onConstruct() {
  12508. this.c1 = this.getController("c1");
  12509. this.n0 = (this.getChild("n0"));
  12510. this.n2 = (this.getChild("n2"));
  12511. }
  12512. }
  12513. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12514. class ui_Component124 extends fgui.GComponent {
  12515. static createInstance() {
  12516. return (fgui.UIPackage.createObject("game", "Component124"));
  12517. }
  12518. onConstruct() {
  12519. this.n22 = (this.getChild("n22"));
  12520. this.shareNode = (this.getChild("shareNode"));
  12521. }
  12522. }
  12523. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12524. class ui_Component125 extends fgui.GComponent {
  12525. static createInstance() {
  12526. return (fgui.UIPackage.createObject("game", "Component125"));
  12527. }
  12528. onConstruct() {
  12529. this.n29 = (this.getChild("n29"));
  12530. this.coinTxt = (this.getChild("coinTxt"));
  12531. }
  12532. }
  12533. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12534. class ui_Component52 extends fgui.GButton {
  12535. static createInstance() {
  12536. return (fgui.UIPackage.createObject("game", "Component52"));
  12537. }
  12538. onConstruct() {
  12539. this.n35 = (this.getChild("n35"));
  12540. this.n36 = (this.getChild("n36"));
  12541. }
  12542. }
  12543. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12544. class ui_drawBtn extends fgui.GButton {
  12545. static createInstance() {
  12546. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12547. }
  12548. onConstruct() {
  12549. this.c1 = this.getController("c1");
  12550. this.n2 = (this.getChild("n2"));
  12551. this.n1 = (this.getChild("n1"));
  12552. this.n5 = (this.getChild("n5"));
  12553. }
  12554. }
  12555. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12556. class ui_Component43 extends fgui.GButton {
  12557. static createInstance() {
  12558. return (fgui.UIPackage.createObject("game", "Component43"));
  12559. }
  12560. onConstruct() {
  12561. this.n49 = (this.getChild("n49"));
  12562. }
  12563. }
  12564. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12565. class ui_wordsDisplay extends fgui.GComponent {
  12566. static createInstance() {
  12567. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12568. }
  12569. onConstruct() {
  12570. this.txt = (this.getChild("txt"));
  12571. this.n63 = (this.getChild("n63"));
  12572. }
  12573. }
  12574. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12575. class ui_Component3 extends fgui.GComponent {
  12576. static createInstance() {
  12577. return (fgui.UIPackage.createObject("game", "Component3"));
  12578. }
  12579. onConstruct() {
  12580. this.n26 = (this.getChild("n26"));
  12581. this.n24 = (this.getChild("n24"));
  12582. this.nameTxt = (this.getChild("nameTxt"));
  12583. this.headRoot = (this.getChild("headRoot"));
  12584. }
  12585. }
  12586. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12587. class ui_Component4 extends fgui.GComponent {
  12588. static createInstance() {
  12589. return (fgui.UIPackage.createObject("game", "Component4"));
  12590. }
  12591. onConstruct() {
  12592. this.headImg = (this.getChild("headImg"));
  12593. }
  12594. }
  12595. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12596. class ui_Component7 extends fgui.GButton {
  12597. static createInstance() {
  12598. return (fgui.UIPackage.createObject("game", "Component7"));
  12599. }
  12600. onConstruct() {
  12601. this.n17 = (this.getChild("n17"));
  12602. }
  12603. }
  12604. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12605. class ui_Component8 extends fgui.GButton {
  12606. static createInstance() {
  12607. return (fgui.UIPackage.createObject("game", "Component8"));
  12608. }
  12609. onConstruct() {
  12610. this.n19 = (this.getChild("n19"));
  12611. }
  12612. }
  12613. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12614. class ui_Component10 extends fgui.GButton {
  12615. static createInstance() {
  12616. return (fgui.UIPackage.createObject("game", "Component10"));
  12617. }
  12618. onConstruct() {
  12619. this.c1 = this.getController("c1");
  12620. this.n40 = (this.getChild("n40"));
  12621. }
  12622. }
  12623. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12624. class ui_Component11 extends fgui.GButton {
  12625. static createInstance() {
  12626. return (fgui.UIPackage.createObject("game", "Component11"));
  12627. }
  12628. onConstruct() {
  12629. this.n34 = (this.getChild("n34"));
  12630. }
  12631. }
  12632. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12633. class ui_Component12 extends fgui.GButton {
  12634. static createInstance() {
  12635. return (fgui.UIPackage.createObject("game", "Component12"));
  12636. }
  12637. onConstruct() {
  12638. this.n35 = (this.getChild("n35"));
  12639. }
  12640. }
  12641. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12642. class ui_Component13 extends fgui.GButton {
  12643. static createInstance() {
  12644. return (fgui.UIPackage.createObject("game", "Component13"));
  12645. }
  12646. onConstruct() {
  12647. this.n27 = (this.getChild("n27"));
  12648. this.n36 = (this.getChild("n36"));
  12649. }
  12650. }
  12651. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12652. class ui_dh_js_tuowei extends fgui.GComponent {
  12653. static createInstance() {
  12654. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12655. }
  12656. onConstruct() {
  12657. this.n19 = (this.getChild("n19"));
  12658. this.n18 = (this.getChild("n18"));
  12659. this.n0 = (this.getChild("n0"));
  12660. this.n3 = (this.getChild("n3"));
  12661. this.n4 = (this.getChild("n4"));
  12662. this.n5 = (this.getChild("n5"));
  12663. this.n6 = (this.getChild("n6"));
  12664. this.n8 = (this.getChild("n8"));
  12665. this.n9 = (this.getChild("n9"));
  12666. this.n10 = (this.getChild("n10"));
  12667. this.n11 = (this.getChild("n11"));
  12668. this.n12 = (this.getChild("n12"));
  12669. this.n13 = (this.getChild("n13"));
  12670. this.n14 = (this.getChild("n14"));
  12671. this.n15 = (this.getChild("n15"));
  12672. this.n20 = (this.getChild("n20"));
  12673. this.t0 = this.getTransition("t0");
  12674. this.t1 = this.getTransition("t1");
  12675. }
  12676. }
  12677. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12678. class ui_dh_js_tw_g extends fgui.GComponent {
  12679. static createInstance() {
  12680. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12681. }
  12682. onConstruct() {
  12683. this.n0 = (this.getChild("n0"));
  12684. this.n1 = (this.getChild("n1"));
  12685. this.t0 = this.getTransition("t0");
  12686. }
  12687. }
  12688. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12689. class ui_dh_js_xingxing extends fgui.GComponent {
  12690. static createInstance() {
  12691. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12692. }
  12693. onConstruct() {
  12694. this.n1 = (this.getChild("n1"));
  12695. this.n2 = (this.getChild("n2"));
  12696. this.n3 = (this.getChild("n3"));
  12697. this.n4 = (this.getChild("n4"));
  12698. this.n0 = (this.getChild("n0"));
  12699. this.t2 = this.getTransition("t2");
  12700. this.t1 = this.getTransition("t1");
  12701. }
  12702. }
  12703. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12704. class ui_dh_zy_jiazai extends fgui.GComponent {
  12705. static createInstance() {
  12706. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12707. }
  12708. onConstruct() {
  12709. this.c1 = this.getController("c1");
  12710. this.n0 = (this.getChild("n0"));
  12711. this.n1 = (this.getChild("n1"));
  12712. this.n2 = (this.getChild("n2"));
  12713. this.n4 = (this.getChild("n4"));
  12714. this.n5 = (this.getChild("n5"));
  12715. this.n6 = (this.getChild("n6"));
  12716. this.n8 = (this.getChild("n8"));
  12717. this.n7 = (this.getChild("n7"));
  12718. this.t0 = this.getTransition("t0");
  12719. }
  12720. }
  12721. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12722. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12723. static createInstance() {
  12724. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12725. }
  12726. onConstruct() {
  12727. this.c1 = this.getController("c1");
  12728. this.n3 = (this.getChild("n3"));
  12729. this.n5 = (this.getChild("n5"));
  12730. this.n4 = (this.getChild("n4"));
  12731. this.n0 = (this.getChild("n0"));
  12732. this.n1 = (this.getChild("n1"));
  12733. this.n2 = (this.getChild("n2"));
  12734. }
  12735. }
  12736. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12737. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12738. static createInstance() {
  12739. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12740. }
  12741. onConstruct() {
  12742. this.n19 = (this.getChild("n19"));
  12743. this.n21 = (this.getChild("n21"));
  12744. this.n0 = (this.getChild("n0"));
  12745. this.n3 = (this.getChild("n3"));
  12746. this.n4 = (this.getChild("n4"));
  12747. this.n5 = (this.getChild("n5"));
  12748. this.n6 = (this.getChild("n6"));
  12749. this.n8 = (this.getChild("n8"));
  12750. this.n9 = (this.getChild("n9"));
  12751. this.n10 = (this.getChild("n10"));
  12752. this.n11 = (this.getChild("n11"));
  12753. this.n12 = (this.getChild("n12"));
  12754. this.n13 = (this.getChild("n13"));
  12755. this.n14 = (this.getChild("n14"));
  12756. this.n15 = (this.getChild("n15"));
  12757. this.n23 = (this.getChild("n23"));
  12758. this.t0 = this.getTransition("t0");
  12759. this.t1 = this.getTransition("t1");
  12760. }
  12761. }
  12762. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12763. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12764. static createInstance() {
  12765. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12766. }
  12767. onConstruct() {
  12768. this.n1 = (this.getChild("n1"));
  12769. this.n2 = (this.getChild("n2"));
  12770. this.t0 = this.getTransition("t0");
  12771. }
  12772. }
  12773. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12774. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12775. static createInstance() {
  12776. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12777. }
  12778. onConstruct() {
  12779. this.n4 = (this.getChild("n4"));
  12780. this.n2 = (this.getChild("n2"));
  12781. this.n3 = (this.getChild("n3"));
  12782. this.idle = this.getTransition("idle");
  12783. this.attack = this.getTransition("attack");
  12784. }
  12785. }
  12786. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12787. class ui_special extends fgui.GComponent {
  12788. static createInstance() {
  12789. return (fgui.UIPackage.createObject("game", "special"));
  12790. }
  12791. onConstruct() {
  12792. this.n18 = (this.getChild("n18"));
  12793. this.n19 = (this.getChild("n19"));
  12794. this.n20 = (this.getChild("n20"));
  12795. this.n21 = (this.getChild("n21"));
  12796. this.n22 = (this.getChild("n22"));
  12797. this.levelTxt = (this.getChild("levelTxt"));
  12798. this.n24 = (this.getChild("n24"));
  12799. this.n25 = (this.getChild("n25"));
  12800. this.t0 = this.getTransition("t0");
  12801. }
  12802. }
  12803. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12804. class ui_Component145 extends fgui.GComponent {
  12805. static createInstance() {
  12806. return (fgui.UIPackage.createObject("game", "Component145"));
  12807. }
  12808. onConstruct() {
  12809. this.guanyuNode = (this.getChild("guanyuNode"));
  12810. }
  12811. }
  12812. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12813. class ui_longBtn extends fgui.GButton {
  12814. static createInstance() {
  12815. return (fgui.UIPackage.createObject("game", "longBtn"));
  12816. }
  12817. onConstruct() {
  12818. this.c1 = this.getController("c1");
  12819. this.n2 = (this.getChild("n2"));
  12820. this.n1 = (this.getChild("n1"));
  12821. this.n4 = (this.getChild("n4"));
  12822. }
  12823. }
  12824. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12825. class ui_Component146 extends fgui.GComponent {
  12826. static createInstance() {
  12827. return (fgui.UIPackage.createObject("game", "Component146"));
  12828. }
  12829. onConstruct() {
  12830. this.n89 = (this.getChild("n89"));
  12831. this.n90 = (this.getChild("n90"));
  12832. this.guideBtn = (this.getChild("guideBtn"));
  12833. }
  12834. }
  12835. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12836. class ui_Component146_11 extends fgui.GComponent {
  12837. static createInstance() {
  12838. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12839. }
  12840. onConstruct() {
  12841. this.n89 = (this.getChild("n89"));
  12842. this.n90 = (this.getChild("n90"));
  12843. this.guideBtn = (this.getChild("guideBtn"));
  12844. }
  12845. }
  12846. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12847. class ui_Component111_1 extends fgui.GComponent {
  12848. static createInstance() {
  12849. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12850. }
  12851. onConstruct() {
  12852. this.n68 = (this.getChild("n68"));
  12853. this.myMask = (this.getChild("myMask"));
  12854. }
  12855. }
  12856. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12857. class ui_Component64_1 extends fgui.GComponent {
  12858. static createInstance() {
  12859. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12860. }
  12861. onConstruct() {
  12862. this.n57 = (this.getChild("n57"));
  12863. this.n54 = (this.getChild("n54"));
  12864. this.n55 = (this.getChild("n55"));
  12865. this.n56 = (this.getChild("n56"));
  12866. this.t1 = this.getTransition("t1");
  12867. }
  12868. }
  12869. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12870. class ui_ModeSelection_com123 extends fgui.GComponent {
  12871. static createInstance() {
  12872. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12873. }
  12874. onConstruct() {
  12875. this.type1 = (this.getChild("type1"));
  12876. this.type2 = (this.getChild("type2"));
  12877. this.type3 = (this.getChild("type3"));
  12878. this.n38 = (this.getChild("n38"));
  12879. this.t0 = this.getTransition("t0");
  12880. }
  12881. }
  12882. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12883. class ui_Component132_2 extends fgui.GComponent {
  12884. static createInstance() {
  12885. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12886. }
  12887. onConstruct() {
  12888. this.n25 = (this.getChild("n25"));
  12889. this.n26 = (this.getChild("n26"));
  12890. this.n27 = (this.getChild("n27"));
  12891. this.t0 = this.getTransition("t0");
  12892. }
  12893. }
  12894. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12895. class ui_UIPower$1 extends fgui.GComponent {
  12896. static createInstance() {
  12897. return (fgui.UIPackage.createObject("game", "UIPower"));
  12898. }
  12899. onConstruct() {
  12900. this.n11 = (this.getChild("n11"));
  12901. this.myNode = (this.getChild("myNode"));
  12902. this.t0 = this.getTransition("t0");
  12903. }
  12904. }
  12905. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12906. class ui_Component133 extends fgui.GComponent {
  12907. static createInstance() {
  12908. return (fgui.UIPackage.createObject("game", "Component133"));
  12909. }
  12910. onConstruct() {
  12911. this.n29 = (this.getChild("n29"));
  12912. this.n30 = (this.getChild("n30"));
  12913. }
  12914. }
  12915. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12916. class ui_Component134 extends fgui.GComponent {
  12917. static createInstance() {
  12918. return (fgui.UIPackage.createObject("game", "Component134"));
  12919. }
  12920. onConstruct() {
  12921. this.n30 = (this.getChild("n30"));
  12922. this.n31 = (this.getChild("n31"));
  12923. this.t0 = this.getTransition("t0");
  12924. }
  12925. }
  12926. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12927. class ui_Component135 extends fgui.GComponent {
  12928. static createInstance() {
  12929. return (fgui.UIPackage.createObject("game", "Component135"));
  12930. }
  12931. onConstruct() {
  12932. this.n30 = (this.getChild("n30"));
  12933. this.t0 = this.getTransition("t0");
  12934. }
  12935. }
  12936. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12937. class ui_Component137 extends fgui.GComponent {
  12938. static createInstance() {
  12939. return (fgui.UIPackage.createObject("game", "Component137"));
  12940. }
  12941. onConstruct() {
  12942. this.n28 = (this.getChild("n28"));
  12943. this.n29 = (this.getChild("n29"));
  12944. this.n30 = (this.getChild("n30"));
  12945. this.n32 = (this.getChild("n32"));
  12946. }
  12947. }
  12948. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12949. class ui_dh_zuanshi extends fgui.GButton {
  12950. static createInstance() {
  12951. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12952. }
  12953. onConstruct() {
  12954. this.n1 = (this.getChild("n1"));
  12955. this.n2 = (this.getChild("n2"));
  12956. this.n0 = (this.getChild("n0"));
  12957. this.n3 = (this.getChild("n3"));
  12958. this.n4 = (this.getChild("n4"));
  12959. }
  12960. }
  12961. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12962. class ui_Component138 extends fgui.GComponent {
  12963. static createInstance() {
  12964. return (fgui.UIPackage.createObject("game", "Component138"));
  12965. }
  12966. onConstruct() {
  12967. this.n1 = (this.getChild("n1"));
  12968. this.n2 = (this.getChild("n2"));
  12969. this.t0 = this.getTransition("t0");
  12970. }
  12971. }
  12972. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12973. class ui_Component139 extends fgui.GComponent {
  12974. static createInstance() {
  12975. return (fgui.UIPackage.createObject("game", "Component139"));
  12976. }
  12977. onConstruct() {
  12978. this.n0 = (this.getChild("n0"));
  12979. this.t0 = this.getTransition("t0");
  12980. }
  12981. }
  12982. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12983. class ui_Component140 extends fgui.GComponent {
  12984. static createInstance() {
  12985. return (fgui.UIPackage.createObject("game", "Component140"));
  12986. }
  12987. onConstruct() {
  12988. this.n2 = (this.getChild("n2"));
  12989. this.n3 = (this.getChild("n3"));
  12990. this.t0 = this.getTransition("t0");
  12991. }
  12992. }
  12993. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12994. class ui_Component141 extends fgui.GComponent {
  12995. static createInstance() {
  12996. return (fgui.UIPackage.createObject("game", "Component141"));
  12997. }
  12998. onConstruct() {
  12999. this.n0 = (this.getChild("n0"));
  13000. this.t0 = this.getTransition("t0");
  13001. }
  13002. }
  13003. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13004. class ui_powerNode extends fgui.GProgressBar {
  13005. static createInstance() {
  13006. return (fgui.UIPackage.createObject("game", "powerNode"));
  13007. }
  13008. onConstruct() {
  13009. this.n2 = (this.getChild("n2"));
  13010. this.bar_v = (this.getChild("bar_v"));
  13011. this.showImg = (this.getChild("showImg"));
  13012. this.n12 = (this.getChild("n12"));
  13013. }
  13014. }
  13015. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13016. class ui_dh_jingbi1 extends fgui.GComponent {
  13017. static createInstance() {
  13018. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13019. }
  13020. onConstruct() {
  13021. this.n0 = (this.getChild("n0"));
  13022. this.n1 = (this.getChild("n1"));
  13023. this.n2 = (this.getChild("n2"));
  13024. this.n3 = (this.getChild("n3"));
  13025. this.n4 = (this.getChild("n4"));
  13026. this.n5 = (this.getChild("n5"));
  13027. this.n6 = (this.getChild("n6"));
  13028. this.n8 = (this.getChild("n8"));
  13029. this.t0 = this.getTransition("t0");
  13030. }
  13031. }
  13032. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13033. class ui_Component94 extends fgui.GButton {
  13034. static createInstance() {
  13035. return (fgui.UIPackage.createObject("game", "Component94"));
  13036. }
  13037. onConstruct() {
  13038. this.n77 = (this.getChild("n77"));
  13039. }
  13040. }
  13041. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13042. class ui_Component95 extends fgui.GButton {
  13043. static createInstance() {
  13044. return (fgui.UIPackage.createObject("game", "Component95"));
  13045. }
  13046. onConstruct() {
  13047. this.n77 = (this.getChild("n77"));
  13048. }
  13049. }
  13050. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13051. class ui_Component126 extends fgui.GComponent {
  13052. static createInstance() {
  13053. return (fgui.UIPackage.createObject("game", "Component126"));
  13054. }
  13055. onConstruct() {
  13056. this.c1 = this.getController("c1");
  13057. this.normalBtn = (this.getChild("normalBtn"));
  13058. this.tripleBtn = (this.getChild("tripleBtn"));
  13059. }
  13060. }
  13061. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13062. class ui_Component60 extends fgui.GComponent {
  13063. static createInstance() {
  13064. return (fgui.UIPackage.createObject("game", "Component60"));
  13065. }
  13066. onConstruct() {
  13067. this.c1 = this.getController("c1");
  13068. this.n48 = (this.getChild("n48"));
  13069. this.womanTxt = (this.getChild("womanTxt"));
  13070. this.t0 = this.getTransition("t0");
  13071. }
  13072. }
  13073. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13074. class ui_Component98_3 extends fgui.GButton {
  13075. static createInstance() {
  13076. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13077. }
  13078. onConstruct() {
  13079. this.c1 = this.getController("c1");
  13080. this.n8 = (this.getChild("n8"));
  13081. this.n41 = (this.getChild("n41"));
  13082. this.n40 = (this.getChild("n40"));
  13083. }
  13084. }
  13085. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13086. class ui_ModeSelection_com1 extends fgui.GButton {
  13087. static createInstance() {
  13088. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13089. }
  13090. onConstruct() {
  13091. this.n34 = (this.getChild("n34"));
  13092. this.n36 = (this.getChild("n36"));
  13093. this.n22 = (this.getChild("n22"));
  13094. this.n20 = (this.getChild("n20"));
  13095. this.n23 = (this.getChild("n23"));
  13096. this.n24 = (this.getChild("n24"));
  13097. this.n26 = (this.getChild("n26"));
  13098. this.n33 = (this.getChild("n33"));
  13099. this.coinImg = (this.getChild("coinImg"));
  13100. this.need = (this.getChild("need"));
  13101. this.n35 = (this.getChild("n35"));
  13102. this.n29 = (this.getChild("n29"));
  13103. this.tipsTxt = (this.getChild("tipsTxt"));
  13104. this.n30 = (this.getChild("n30"));
  13105. this.peopleTxt = (this.getChild("peopleTxt"));
  13106. this.t0 = this.getTransition("t0");
  13107. }
  13108. }
  13109. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13110. class ui_ModeSelection_com2 extends fgui.GButton {
  13111. static createInstance() {
  13112. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13113. }
  13114. onConstruct() {
  13115. this.n36 = (this.getChild("n36"));
  13116. this.n34 = (this.getChild("n34"));
  13117. this.n22 = (this.getChild("n22"));
  13118. this.n20 = (this.getChild("n20"));
  13119. this.n23 = (this.getChild("n23"));
  13120. this.n24 = (this.getChild("n24"));
  13121. this.n26 = (this.getChild("n26"));
  13122. this.n33 = (this.getChild("n33"));
  13123. this.coinImg = (this.getChild("coinImg"));
  13124. this.need = (this.getChild("need"));
  13125. this.n35 = (this.getChild("n35"));
  13126. this.n29 = (this.getChild("n29"));
  13127. this.tipsTxt = (this.getChild("tipsTxt"));
  13128. this.n30 = (this.getChild("n30"));
  13129. this.peopleTxt = (this.getChild("peopleTxt"));
  13130. this.t0 = this.getTransition("t0");
  13131. }
  13132. }
  13133. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13134. class ui_ModeSelection_com3 extends fgui.GButton {
  13135. static createInstance() {
  13136. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13137. }
  13138. onConstruct() {
  13139. this.n34 = (this.getChild("n34"));
  13140. this.n36 = (this.getChild("n36"));
  13141. this.n22 = (this.getChild("n22"));
  13142. this.n20 = (this.getChild("n20"));
  13143. this.n23 = (this.getChild("n23"));
  13144. this.n24 = (this.getChild("n24"));
  13145. this.n26 = (this.getChild("n26"));
  13146. this.n33 = (this.getChild("n33"));
  13147. this.coinImg = (this.getChild("coinImg"));
  13148. this.need = (this.getChild("need"));
  13149. this.n35 = (this.getChild("n35"));
  13150. this.n29 = (this.getChild("n29"));
  13151. this.tipsTxt = (this.getChild("tipsTxt"));
  13152. this.n30 = (this.getChild("n30"));
  13153. this.peopleTxt = (this.getChild("peopleTxt"));
  13154. this.t0 = this.getTransition("t0");
  13155. }
  13156. }
  13157. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13158. class ui_Invitation_com1 extends fgui.GComponent {
  13159. static createInstance() {
  13160. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13161. }
  13162. onConstruct() {
  13163. this.n14 = (this.getChild("n14"));
  13164. this.n13 = (this.getChild("n13"));
  13165. this.n3 = (this.getChild("n3"));
  13166. this.n1 = (this.getChild("n1"));
  13167. this.n6 = (this.getChild("n6"));
  13168. this.n7 = (this.getChild("n7"));
  13169. this.enterBtn = (this.getChild("enterBtn"));
  13170. this.n11 = (this.getChild("n11"));
  13171. this.n12 = (this.getChild("n12"));
  13172. this.n15 = (this.getChild("n15"));
  13173. this.t0 = this.getTransition("t0");
  13174. this.t1 = this.getTransition("t1");
  13175. }
  13176. }
  13177. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13178. class ui_Component87_1 extends fgui.GComponent {
  13179. static createInstance() {
  13180. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13181. }
  13182. onConstruct() {
  13183. this.n74 = (this.getChild("n74"));
  13184. this.n73 = (this.getChild("n73"));
  13185. this.ballTxt = (this.getChild("ballTxt"));
  13186. this.n76 = (this.getChild("n76"));
  13187. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13188. this.levelTxt = (this.getChild("levelTxt"));
  13189. this.n87 = (this.getChild("n87"));
  13190. this.n84 = (this.getChild("n84"));
  13191. this.hpTxt = (this.getChild("hpTxt"));
  13192. this.n89 = (this.getChild("n89"));
  13193. this.tipsTxt = (this.getChild("tipsTxt"));
  13194. }
  13195. }
  13196. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13197. class ui_sqg1 extends fgui.GComponent {
  13198. static createInstance() {
  13199. return (fgui.UIPackage.createObject("game", "sqg1"));
  13200. }
  13201. onConstruct() {
  13202. this.n1 = (this.getChild("n1"));
  13203. this.n0 = (this.getChild("n0"));
  13204. }
  13205. }
  13206. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13207. class ui_sqg2 extends fgui.GComponent {
  13208. static createInstance() {
  13209. return (fgui.UIPackage.createObject("game", "sqg2"));
  13210. }
  13211. onConstruct() {
  13212. this.n1 = (this.getChild("n1"));
  13213. this.n0 = (this.getChild("n0"));
  13214. }
  13215. }
  13216. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13217. class ui_sqg3 extends fgui.GComponent {
  13218. static createInstance() {
  13219. return (fgui.UIPackage.createObject("game", "sqg3"));
  13220. }
  13221. onConstruct() {
  13222. this.n1 = (this.getChild("n1"));
  13223. this.n0 = (this.getChild("n0"));
  13224. }
  13225. }
  13226. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13227. class ui_sqg4 extends fgui.GComponent {
  13228. static createInstance() {
  13229. return (fgui.UIPackage.createObject("game", "sqg4"));
  13230. }
  13231. onConstruct() {
  13232. this.n1 = (this.getChild("n1"));
  13233. this.n0 = (this.getChild("n0"));
  13234. }
  13235. }
  13236. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13237. class ui_Component36 extends fgui.GButton {
  13238. static createInstance() {
  13239. return (fgui.UIPackage.createObject("game", "Component36"));
  13240. }
  13241. onConstruct() {
  13242. this.c1 = this.getController("c1");
  13243. this.n53 = (this.getChild("n53"));
  13244. this.n56 = (this.getChild("n56"));
  13245. }
  13246. }
  13247. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13248. class ui_Component37 extends fgui.GButton {
  13249. static createInstance() {
  13250. return (fgui.UIPackage.createObject("game", "Component37"));
  13251. }
  13252. onConstruct() {
  13253. this.c1 = this.getController("c1");
  13254. this.n52 = (this.getChild("n52"));
  13255. this.n54 = (this.getChild("n54"));
  13256. }
  13257. }
  13258. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13259. class ui_UISetting extends fgui.GComponent {
  13260. static createInstance() {
  13261. return (fgui.UIPackage.createObject("game", "UISetting"));
  13262. }
  13263. onConstruct() {
  13264. this.c1 = this.getController("c1");
  13265. this.n4 = (this.getChild("n4"));
  13266. this.soundBtn = (this.getChild("soundBtn"));
  13267. this.shakeBtn = (this.getChild("shakeBtn"));
  13268. this.clickNode = (this.getChild("clickNode"));
  13269. this.xyBtn = (this.getChild("xyBtn"));
  13270. }
  13271. }
  13272. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13273. class ui_Component39 extends fgui.GComponent {
  13274. static createInstance() {
  13275. return (fgui.UIPackage.createObject("game", "Component39"));
  13276. }
  13277. onConstruct() {
  13278. this.n5 = (this.getChild("n5"));
  13279. this.n6 = (this.getChild("n6"));
  13280. this.n7 = (this.getChild("n7"));
  13281. this.t0 = this.getTransition("t0");
  13282. }
  13283. }
  13284. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13285. class ui_Component40 extends fgui.GButton {
  13286. static createInstance() {
  13287. return (fgui.UIPackage.createObject("game", "Component40"));
  13288. }
  13289. onConstruct() {
  13290. this.n46 = (this.getChild("n46"));
  13291. this.n47 = (this.getChild("n47"));
  13292. }
  13293. }
  13294. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13295. class ui_Component41 extends fgui.GComponent {
  13296. static createInstance() {
  13297. return (fgui.UIPackage.createObject("game", "Component41"));
  13298. }
  13299. onConstruct() {
  13300. this.c1 = this.getController("c1");
  13301. this.n0 = (this.getChild("n0"));
  13302. this.titleTxt = (this.getChild("titleTxt"));
  13303. this.n2 = (this.getChild("n2"));
  13304. this.msgTips = (this.getChild("msgTips"));
  13305. this.numTxt = (this.getChild("numTxt"));
  13306. this.n18 = (this.getChild("n18"));
  13307. this.cancelBtn = (this.getChild("cancelBtn"));
  13308. this.videoBtn = (this.getChild("videoBtn"));
  13309. this.n10 = (this.getChild("n10"));
  13310. }
  13311. }
  13312. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13313. class ui_Component42 extends fgui.GComponent {
  13314. static createInstance() {
  13315. return (fgui.UIPackage.createObject("game", "Component42"));
  13316. }
  13317. onConstruct() {
  13318. this.c1 = this.getController("c1");
  13319. this.n1 = (this.getChild("n1"));
  13320. this.n2 = (this.getChild("n2"));
  13321. this.n3 = (this.getChild("n3"));
  13322. this.tipsTxt = (this.getChild("tipsTxt"));
  13323. this.cancelBtn = (this.getChild("cancelBtn"));
  13324. this.sureBtn = (this.getChild("sureBtn"));
  13325. this.n11 = (this.getChild("n11"));
  13326. this.n13 = (this.getChild("n13"));
  13327. this.n14 = (this.getChild("n14"));
  13328. this.womanTxt = (this.getChild("womanTxt"));
  13329. this.t0 = this.getTransition("t0");
  13330. }
  13331. }
  13332. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13333. class ui_dh_js_shengli extends fgui.GComponent {
  13334. static createInstance() {
  13335. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13336. }
  13337. onConstruct() {
  13338. this.n3 = (this.getChild("n3"));
  13339. this.n4 = (this.getChild("n4"));
  13340. this.n1 = (this.getChild("n1"));
  13341. this.n2 = (this.getChild("n2"));
  13342. this.n5 = (this.getChild("n5"));
  13343. this.n6 = (this.getChild("n6"));
  13344. this.n7 = (this.getChild("n7"));
  13345. this.n8 = (this.getChild("n8"));
  13346. this.attack = this.getTransition("attack");
  13347. this.idle = this.getTransition("idle");
  13348. }
  13349. }
  13350. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13351. class ui_dh_js_shengli_g extends fgui.GComponent {
  13352. static createInstance() {
  13353. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13354. }
  13355. onConstruct() {
  13356. this.n3 = (this.getChild("n3"));
  13357. this.n1 = (this.getChild("n1"));
  13358. this.t0 = this.getTransition("t0");
  13359. }
  13360. }
  13361. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13362. class ui_dh_js_shibai extends fgui.GComponent {
  13363. static createInstance() {
  13364. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13365. }
  13366. onConstruct() {
  13367. this.n0 = (this.getChild("n0"));
  13368. this.n1 = (this.getChild("n1"));
  13369. this.n2 = (this.getChild("n2"));
  13370. this.n3 = (this.getChild("n3"));
  13371. this.idle = this.getTransition("idle");
  13372. this.attack = this.getTransition("attack");
  13373. }
  13374. }
  13375. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13376. class ui_dh_zy_ganfa extends fgui.GButton {
  13377. static createInstance() {
  13378. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13379. }
  13380. onConstruct() {
  13381. this.n0 = (this.getChild("n0"));
  13382. }
  13383. }
  13384. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13385. class ui_dh_zy_sc_guang extends fgui.GButton {
  13386. static createInstance() {
  13387. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13388. }
  13389. onConstruct() {
  13390. this.n0 = (this.getChild("n0"));
  13391. this.n2 = (this.getChild("n2"));
  13392. }
  13393. }
  13394. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13395. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13396. static createInstance() {
  13397. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13398. }
  13399. onConstruct() {
  13400. this.n0 = (this.getChild("n0"));
  13401. this.n3 = (this.getChild("n3"));
  13402. this.t0 = this.getTransition("t0");
  13403. }
  13404. }
  13405. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13406. class ui_dh_zy_wanfa extends fgui.GButton {
  13407. static createInstance() {
  13408. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13409. }
  13410. onConstruct() {
  13411. this.n0 = (this.getChild("n0"));
  13412. }
  13413. }
  13414. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13415. class ui_Component53_1 extends fgui.GComponent {
  13416. static createInstance() {
  13417. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13418. }
  13419. onConstruct() {
  13420. this.n0 = (this.getChild("n0"));
  13421. this.n1 = (this.getChild("n1"));
  13422. this.n2 = (this.getChild("n2"));
  13423. this.n3 = (this.getChild("n3"));
  13424. this.n4 = (this.getChild("n4"));
  13425. this.n5 = (this.getChild("n5"));
  13426. this.n6 = (this.getChild("n6"));
  13427. this.n7 = (this.getChild("n7"));
  13428. this.n8 = (this.getChild("n8"));
  13429. this.n9 = (this.getChild("n9"));
  13430. this.n10 = (this.getChild("n10"));
  13431. this.n11 = (this.getChild("n11"));
  13432. this.n12 = (this.getChild("n12"));
  13433. this.n13 = (this.getChild("n13"));
  13434. this.n14 = (this.getChild("n14"));
  13435. this.n15 = (this.getChild("n15"));
  13436. this.n16 = (this.getChild("n16"));
  13437. this.n19 = (this.getChild("n19"));
  13438. this.n20 = (this.getChild("n20"));
  13439. this.n21 = (this.getChild("n21"));
  13440. this.n22 = (this.getChild("n22"));
  13441. this.n23 = (this.getChild("n23"));
  13442. this.n24 = (this.getChild("n24"));
  13443. this.n25 = (this.getChild("n25"));
  13444. this.n26 = (this.getChild("n26"));
  13445. this.n27 = (this.getChild("n27"));
  13446. this.n28 = (this.getChild("n28"));
  13447. this.n29 = (this.getChild("n29"));
  13448. this.n30 = (this.getChild("n30"));
  13449. this.n31 = (this.getChild("n31"));
  13450. this.n32 = (this.getChild("n32"));
  13451. this.n33 = (this.getChild("n33"));
  13452. this.n34 = (this.getChild("n34"));
  13453. this.n35 = (this.getChild("n35"));
  13454. this.t0 = this.getTransition("t0");
  13455. }
  13456. }
  13457. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13458. class ui_Component30 extends fgui.GComponent {
  13459. static createInstance() {
  13460. return (fgui.UIPackage.createObject("game", "Component30"));
  13461. }
  13462. onConstruct() {
  13463. this.c1 = this.getController("c1");
  13464. this.n46 = (this.getChild("n46"));
  13465. this.n47 = (this.getChild("n47"));
  13466. this.numTxt = (this.getChild("numTxt"));
  13467. this.n50 = (this.getChild("n50"));
  13468. this.n53 = (this.getChild("n53"));
  13469. this.n54 = (this.getChild("n54"));
  13470. this.n55 = (this.getChild("n55"));
  13471. this.n56 = (this.getChild("n56"));
  13472. }
  13473. }
  13474. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13475. class ui_Component30_1 extends fgui.GComponent {
  13476. static createInstance() {
  13477. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13478. }
  13479. onConstruct() {
  13480. this.c1 = this.getController("c1");
  13481. this.n46 = (this.getChild("n46"));
  13482. this.n47 = (this.getChild("n47"));
  13483. this.numTxt = (this.getChild("numTxt"));
  13484. this.n50 = (this.getChild("n50"));
  13485. this.n51 = (this.getChild("n51"));
  13486. this.n52 = (this.getChild("n52"));
  13487. this.n53 = (this.getChild("n53"));
  13488. this.n54 = (this.getChild("n54"));
  13489. }
  13490. }
  13491. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13492. class ui_Component31 extends fgui.GComponent {
  13493. static createInstance() {
  13494. return (fgui.UIPackage.createObject("game", "Component31"));
  13495. }
  13496. onConstruct() {
  13497. this.n55 = (this.getChild("n55"));
  13498. this.n54 = (this.getChild("n54"));
  13499. this.conditionTxt = (this.getChild("conditionTxt"));
  13500. this.n57 = (this.getChild("n57"));
  13501. this.t0 = this.getTransition("t0");
  13502. }
  13503. }
  13504. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13505. class ui_Component32 extends fgui.GComponent {
  13506. static createInstance() {
  13507. return (fgui.UIPackage.createObject("game", "Component32"));
  13508. }
  13509. onConstruct() {
  13510. this.n5 = (this.getChild("n5"));
  13511. this.n6 = (this.getChild("n6"));
  13512. this.n7 = (this.getChild("n7"));
  13513. this.t0 = this.getTransition("t0");
  13514. }
  13515. }
  13516. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13517. class ui_AwardItem extends fgui.GComponent {
  13518. static createInstance() {
  13519. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13520. }
  13521. onConstruct() {
  13522. this.n9 = (this.getChild("n9"));
  13523. this.myIcon = (this.getChild("myIcon"));
  13524. this.numTxt = (this.getChild("numTxt"));
  13525. this.nameTxt = (this.getChild("nameTxt"));
  13526. this.n16 = (this.getChild("n16"));
  13527. this.n17 = (this.getChild("n17"));
  13528. }
  13529. }
  13530. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13531. class ui_ranking_com1 extends fgui.GButton {
  13532. static createInstance() {
  13533. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13534. }
  13535. onConstruct() {
  13536. this.c1 = this.getController("c1");
  13537. this.n49 = (this.getChild("n49"));
  13538. this.n18 = (this.getChild("n18"));
  13539. this.n46 = (this.getChild("n46"));
  13540. this.n48 = (this.getChild("n48"));
  13541. this.n50 = (this.getChild("n50"));
  13542. }
  13543. }
  13544. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13545. class ui_ranking_com2 extends fgui.GButton {
  13546. static createInstance() {
  13547. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13548. }
  13549. onConstruct() {
  13550. this.c1 = this.getController("c1");
  13551. this.n49 = (this.getChild("n49"));
  13552. this.n18 = (this.getChild("n18"));
  13553. this.n46 = (this.getChild("n46"));
  13554. this.n48 = (this.getChild("n48"));
  13555. this.n50 = (this.getChild("n50"));
  13556. }
  13557. }
  13558. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13559. class ui_ranking_com3 extends fgui.GComponent {
  13560. static createInstance() {
  13561. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13562. }
  13563. onConstruct() {
  13564. this.n17 = (this.getChild("n17"));
  13565. this.myIcon = (this.getChild("myIcon"));
  13566. }
  13567. }
  13568. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13569. class ui_ranking_com4 extends fgui.GComponent {
  13570. static createInstance() {
  13571. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13572. }
  13573. onConstruct() {
  13574. this.n16 = (this.getChild("n16"));
  13575. this.head = (this.getChild("head"));
  13576. }
  13577. }
  13578. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13579. class ui_ranking_com5 extends fgui.GComponent {
  13580. static createInstance() {
  13581. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13582. }
  13583. onConstruct() {
  13584. this.c1 = this.getController("c1");
  13585. this.c2 = this.getController("c2");
  13586. this.n2 = (this.getChild("n2"));
  13587. this.n3 = (this.getChild("n3"));
  13588. this.levelBtn = (this.getChild("levelBtn"));
  13589. this.starBtn = (this.getChild("starBtn"));
  13590. this.n23 = (this.getChild("n23"));
  13591. this.n24 = (this.getChild("n24"));
  13592. this.n25 = (this.getChild("n25"));
  13593. this.myList = (this.getChild("myList"));
  13594. this.selfNode = (this.getChild("selfNode"));
  13595. this.n9 = (this.getChild("n9"));
  13596. this.n12 = (this.getChild("n12"));
  13597. this.n13 = (this.getChild("n13"));
  13598. this.n14 = (this.getChild("n14"));
  13599. this.n39 = (this.getChild("n39"));
  13600. this.n41 = (this.getChild("n41"));
  13601. this.n42 = (this.getChild("n42"));
  13602. this.n45 = (this.getChild("n45"));
  13603. this.changeBtn = (this.getChild("changeBtn"));
  13604. this.closeBtn = (this.getChild("closeBtn"));
  13605. this.t0 = this.getTransition("t0");
  13606. }
  13607. }
  13608. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13609. class ui_RankItem extends fgui.GComponent {
  13610. static createInstance() {
  13611. return (fgui.UIPackage.createObject("game", "RankItem"));
  13612. }
  13613. onConstruct() {
  13614. this.n10 = (this.getChild("n10"));
  13615. this.n11 = (this.getChild("n11"));
  13616. this.rankTxt = (this.getChild("rankTxt"));
  13617. this.headNode = (this.getChild("headNode"));
  13618. this.nameTxt = (this.getChild("nameTxt"));
  13619. this.n19 = (this.getChild("n19"));
  13620. this.valueTxt = (this.getChild("valueTxt"));
  13621. this.img1 = (this.getChild("img1"));
  13622. this.img2 = (this.getChild("img2"));
  13623. this.img3 = (this.getChild("img3"));
  13624. }
  13625. }
  13626. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13627. class ui_ranking_com9 extends fgui.GComponent {
  13628. static createInstance() {
  13629. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13630. }
  13631. onConstruct() {
  13632. this.c1 = this.getController("c1");
  13633. this.n27 = (this.getChild("n27"));
  13634. this.n28 = (this.getChild("n28"));
  13635. this.headNode = (this.getChild("headNode"));
  13636. this.rankTxt = (this.getChild("rankTxt"));
  13637. this.nameTxt = (this.getChild("nameTxt"));
  13638. this.n34 = (this.getChild("n34"));
  13639. this.valueTxt = (this.getChild("valueTxt"));
  13640. this.n36 = (this.getChild("n36"));
  13641. this.n37 = (this.getChild("n37"));
  13642. this.n38 = (this.getChild("n38"));
  13643. this.n39 = (this.getChild("n39"));
  13644. this.n40 = (this.getChild("n40"));
  13645. }
  13646. }
  13647. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13648. class ui_ranking_com10 extends fgui.GComponent {
  13649. static createInstance() {
  13650. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13651. }
  13652. onConstruct() {
  13653. this.n23 = (this.getChild("n23"));
  13654. this.n24 = (this.getChild("n24"));
  13655. }
  13656. }
  13657. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13658. class ui_ranking_com11 extends fgui.GComponent {
  13659. static createInstance() {
  13660. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13661. }
  13662. onConstruct() {
  13663. this.n24 = (this.getChild("n24"));
  13664. this.n25 = (this.getChild("n25"));
  13665. this.t0 = this.getTransition("t0");
  13666. }
  13667. }
  13668. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13669. class ui_ranking_com13 extends fgui.GButton {
  13670. static createInstance() {
  13671. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13672. }
  13673. onConstruct() {
  13674. this.c1 = this.getController("c1");
  13675. this.n44 = (this.getChild("n44"));
  13676. this.n45 = (this.getChild("n45"));
  13677. this.n46 = (this.getChild("n46"));
  13678. }
  13679. }
  13680. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13681. class ui_Component122 extends fgui.GComponent {
  13682. static createInstance() {
  13683. return (fgui.UIPackage.createObject("game", "Component122"));
  13684. }
  13685. onConstruct() {
  13686. this.gameNode3 = (this.getChild("gameNode3"));
  13687. }
  13688. }
  13689. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13690. class ui_skillItem extends fgui.GComponent {
  13691. static createInstance() {
  13692. return (fgui.UIPackage.createObject("game", "skillItem"));
  13693. }
  13694. onConstruct() {
  13695. this.c1 = this.getController("c1");
  13696. this.n31 = (this.getChild("n31"));
  13697. this.n6 = (this.getChild("n6"));
  13698. this.skillImg = (this.getChild("skillImg"));
  13699. this.nameTxt = (this.getChild("nameTxt"));
  13700. this.levelTxt = (this.getChild("levelTxt"));
  13701. this.n28 = (this.getChild("n28"));
  13702. this.describeTxt = (this.getChild("describeTxt"));
  13703. this.n32 = (this.getChild("n32"));
  13704. this.mutiBtn = (this.getChild("mutiBtn"));
  13705. this.tryNode = (this.getChild("tryNode"));
  13706. this.normalBtn = (this.getChild("normalBtn"));
  13707. this.startBtn = (this.getChild("startBtn"));
  13708. this.n42 = (this.getChild("n42"));
  13709. this.n43 = (this.getChild("n43"));
  13710. this.n44 = (this.getChild("n44"));
  13711. }
  13712. }
  13713. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13714. class ui_Component26 extends fgui.GButton {
  13715. static createInstance() {
  13716. return (fgui.UIPackage.createObject("game", "Component26"));
  13717. }
  13718. onConstruct() {
  13719. this.n11 = (this.getChild("n11"));
  13720. this.n30 = (this.getChild("n30"));
  13721. this.n34 = (this.getChild("n34"));
  13722. }
  13723. }
  13724. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13725. class ui_Component28 extends fgui.GButton {
  13726. static createInstance() {
  13727. return (fgui.UIPackage.createObject("game", "Component28"));
  13728. }
  13729. onConstruct() {
  13730. this.n12 = (this.getChild("n12"));
  13731. this.n31 = (this.getChild("n31"));
  13732. this.curTxt = (this.getChild("curTxt"));
  13733. this.n33 = (this.getChild("n33"));
  13734. }
  13735. }
  13736. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13737. class ui_Component1302 extends fgui.GComponent {
  13738. static createInstance() {
  13739. return (fgui.UIPackage.createObject("game", "Component1302"));
  13740. }
  13741. onConstruct() {
  13742. this.n2 = (this.getChild("n2"));
  13743. this.n3 = (this.getChild("n3"));
  13744. }
  13745. }
  13746. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13747. class ui_Component113 extends fgui.GComponent {
  13748. static createInstance() {
  13749. return (fgui.UIPackage.createObject("game", "Component113"));
  13750. }
  13751. onConstruct() {
  13752. this.n85 = (this.getChild("n85"));
  13753. this.n86 = (this.getChild("n86"));
  13754. this.n77 = (this.getChild("n77"));
  13755. this.n79 = (this.getChild("n79"));
  13756. this.n80 = (this.getChild("n80"));
  13757. this.n81 = (this.getChild("n81"));
  13758. this.n82 = (this.getChild("n82"));
  13759. this.n84 = (this.getChild("n84"));
  13760. this.n87 = (this.getChild("n87"));
  13761. this.t0 = this.getTransition("t0");
  13762. }
  13763. }
  13764. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13765. class ui_Component114 extends fgui.GComponent {
  13766. static createInstance() {
  13767. return (fgui.UIPackage.createObject("game", "Component114"));
  13768. }
  13769. onConstruct() {
  13770. this.n77 = (this.getChild("n77"));
  13771. this.t0 = this.getTransition("t0");
  13772. }
  13773. }
  13774. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13775. class ui_Component115 extends fgui.GComponent {
  13776. static createInstance() {
  13777. return (fgui.UIPackage.createObject("game", "Component115"));
  13778. }
  13779. onConstruct() {
  13780. this.n83 = (this.getChild("n83"));
  13781. this.fingerNode = (this.getChild("fingerNode"));
  13782. this.n84 = (this.getChild("n84"));
  13783. }
  13784. }
  13785. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13786. class ui_Component117 extends fgui.GComponent {
  13787. static createInstance() {
  13788. return (fgui.UIPackage.createObject("game", "Component117"));
  13789. }
  13790. onConstruct() {
  13791. this.n87 = (this.getChild("n87"));
  13792. this.n88 = (this.getChild("n88"));
  13793. this.n84 = (this.getChild("n84"));
  13794. this.n85 = (this.getChild("n85"));
  13795. this.n86 = (this.getChild("n86"));
  13796. this.t0 = this.getTransition("t0");
  13797. }
  13798. }
  13799. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13800. class ui_Component98_1 extends fgui.GButton {
  13801. static createInstance() {
  13802. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13803. }
  13804. onConstruct() {
  13805. this.c1 = this.getController("c1");
  13806. this.n8 = (this.getChild("n8"));
  13807. this.n41 = (this.getChild("n41"));
  13808. this.n40 = (this.getChild("n40"));
  13809. }
  13810. }
  13811. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13812. class ui_Component61 extends fgui.GComponent {
  13813. static createInstance() {
  13814. return (fgui.UIPackage.createObject("game", "Component61"));
  13815. }
  13816. onConstruct() {
  13817. this.n14 = (this.getChild("n14"));
  13818. this.n6 = (this.getChild("n6"));
  13819. this.t0 = this.getTransition("t0");
  13820. }
  13821. }
  13822. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13823. class ui_Component62 extends fgui.GComponent {
  13824. static createInstance() {
  13825. return (fgui.UIPackage.createObject("game", "Component62"));
  13826. }
  13827. onConstruct() {
  13828. this.n66 = (this.getChild("n66"));
  13829. this.n56 = (this.getChild("n56"));
  13830. this.n63 = (this.getChild("n63"));
  13831. this.n65 = (this.getChild("n65"));
  13832. this.t0 = this.getTransition("t0");
  13833. }
  13834. }
  13835. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13836. class ui_d3Root extends fgui.GComponent {
  13837. static createInstance() {
  13838. return (fgui.UIPackage.createObject("game", "d3Root"));
  13839. }
  13840. onConstruct() {
  13841. }
  13842. }
  13843. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13844. class ui_d2Root extends fgui.GComponent {
  13845. static createInstance() {
  13846. return (fgui.UIPackage.createObject("game", "d2Root"));
  13847. }
  13848. onConstruct() {
  13849. }
  13850. }
  13851. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13852. class ui_ballNode extends fgui.GComponent {
  13853. static createInstance() {
  13854. return (fgui.UIPackage.createObject("game", "ballNode"));
  13855. }
  13856. onConstruct() {
  13857. }
  13858. }
  13859. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13860. class ui_border extends fgui.GComponent {
  13861. static createInstance() {
  13862. return (fgui.UIPackage.createObject("game", "border"));
  13863. }
  13864. onConstruct() {
  13865. this.bar1 = (this.getChild("bar1"));
  13866. this.bar2 = (this.getChild("bar2"));
  13867. this.bar3 = (this.getChild("bar3"));
  13868. this.bar4 = (this.getChild("bar4"));
  13869. this.bar5 = (this.getChild("bar5"));
  13870. this.bar6 = (this.getChild("bar6"));
  13871. this.circle1 = (this.getChild("circle1"));
  13872. this.circle2 = (this.getChild("circle2"));
  13873. this.circle3 = (this.getChild("circle3"));
  13874. this.circle4 = (this.getChild("circle4"));
  13875. this.circle5 = (this.getChild("circle5"));
  13876. this.circle6 = (this.getChild("circle6"));
  13877. this.n28 = (this.getChild("n28"));
  13878. }
  13879. }
  13880. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13881. class ui_Component41_2 extends fgui.GComponent {
  13882. static createInstance() {
  13883. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13884. }
  13885. onConstruct() {
  13886. this.c1 = this.getController("c1");
  13887. this.n0 = (this.getChild("n0"));
  13888. this.n2 = (this.getChild("n2"));
  13889. this.n19 = (this.getChild("n19"));
  13890. this.cancelBtn = (this.getChild("cancelBtn"));
  13891. this.videoBtn = (this.getChild("videoBtn"));
  13892. this.n9 = (this.getChild("n9"));
  13893. this.n22 = (this.getChild("n22"));
  13894. this.tipsTxt = (this.getChild("tipsTxt"));
  13895. this.n23 = (this.getChild("n23"));
  13896. this.n24 = (this.getChild("n24"));
  13897. this.n26 = (this.getChild("n26"));
  13898. this.n27 = (this.getChild("n27"));
  13899. this.titleTxt = (this.getChild("titleTxt"));
  13900. }
  13901. }
  13902. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13903. class ui_Component41_1 extends fgui.GComponent {
  13904. static createInstance() {
  13905. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13906. }
  13907. onConstruct() {
  13908. this.c1 = this.getController("c1");
  13909. this.n0 = (this.getChild("n0"));
  13910. this.n2 = (this.getChild("n2"));
  13911. this.cancelBtn = (this.getChild("cancelBtn"));
  13912. this.videoBtn = (this.getChild("videoBtn"));
  13913. this.n27 = (this.getChild("n27"));
  13914. this.n30 = (this.getChild("n30"));
  13915. this.n31 = (this.getChild("n31"));
  13916. this.n32 = (this.getChild("n32"));
  13917. this.n33 = (this.getChild("n33"));
  13918. this.n34 = (this.getChild("n34"));
  13919. this.n35 = (this.getChild("n35"));
  13920. this.n36 = (this.getChild("n36"));
  13921. this.n1 = (this.getChild("n1"));
  13922. this.n37 = (this.getChild("n37"));
  13923. this.t0 = this.getTransition("t0");
  13924. this.t1 = this.getTransition("t1");
  13925. this.t2 = this.getTransition("t2");
  13926. this.t3 = this.getTransition("t3");
  13927. }
  13928. }
  13929. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13930. class ui_againBtn extends fgui.GButton {
  13931. static createInstance() {
  13932. return (fgui.UIPackage.createObject("game", "againBtn"));
  13933. }
  13934. onConstruct() {
  13935. this.n2 = (this.getChild("n2"));
  13936. this.n1 = (this.getChild("n1"));
  13937. this.n5 = (this.getChild("n5"));
  13938. }
  13939. }
  13940. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13941. class ui_Component118 extends fgui.GButton {
  13942. static createInstance() {
  13943. return (fgui.UIPackage.createObject("game", "Component118"));
  13944. }
  13945. onConstruct() {
  13946. this.c1 = this.getController("c1");
  13947. this.n14 = (this.getChild("n14"));
  13948. this.n9 = (this.getChild("n9"));
  13949. this.n10 = (this.getChild("n10"));
  13950. this.diamondTxt = (this.getChild("diamondTxt"));
  13951. this.n13 = (this.getChild("n13"));
  13952. this.n15 = (this.getChild("n15"));
  13953. }
  13954. }
  13955. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13956. class ui_Component119 extends fgui.GComponent {
  13957. static createInstance() {
  13958. return (fgui.UIPackage.createObject("game", "Component119"));
  13959. }
  13960. onConstruct() {
  13961. this.n1 = (this.getChild("n1"));
  13962. this.n2 = (this.getChild("n2"));
  13963. this.n13 = (this.getChild("n13"));
  13964. this.n6 = (this.getChild("n6"));
  13965. this.screenNode = (this.getChild("screenNode"));
  13966. this.n15 = (this.getChild("n15"));
  13967. this.closeBtn = (this.getChild("closeBtn"));
  13968. this.share2Btn = (this.getChild("share2Btn"));
  13969. this.shareBtn = (this.getChild("shareBtn"));
  13970. this.tipsNode = (this.getChild("tipsNode"));
  13971. this.awardNode = (this.getChild("awardNode"));
  13972. }
  13973. }
  13974. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13975. class ui_Component132_1 extends fgui.GComponent {
  13976. static createInstance() {
  13977. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13978. }
  13979. onConstruct() {
  13980. this.n25 = (this.getChild("n25"));
  13981. this.n26 = (this.getChild("n26"));
  13982. this.n27 = (this.getChild("n27"));
  13983. this.t0 = this.getTransition("t0");
  13984. }
  13985. }
  13986. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13987. class ui_SecretaryDisplay extends fgui.GComponent {
  13988. static createInstance() {
  13989. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13990. }
  13991. onConstruct() {
  13992. this.n2 = (this.getChild("n2"));
  13993. this.levelTxt = (this.getChild("levelTxt"));
  13994. this.n4 = (this.getChild("n4"));
  13995. this.secretary = (this.getChild("secretary"));
  13996. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13997. this.n16 = (this.getChild("n16"));
  13998. this.n37 = (this.getChild("n37"));
  13999. this.n41 = (this.getChild("n41"));
  14000. this.n14 = (this.getChild("n14"));
  14001. this.n17 = (this.getChild("n17"));
  14002. this.heightTxt = (this.getChild("heightTxt"));
  14003. this.n46 = (this.getChild("n46"));
  14004. this.n36 = (this.getChild("n36"));
  14005. this.n38 = (this.getChild("n38"));
  14006. this.foodTxt = (this.getChild("foodTxt"));
  14007. this.n47 = (this.getChild("n47"));
  14008. this.n40 = (this.getChild("n40"));
  14009. this.n42 = (this.getChild("n42"));
  14010. this.historyTxt = (this.getChild("historyTxt"));
  14011. this.n48 = (this.getChild("n48"));
  14012. this.nameImg = (this.getChild("nameImg"));
  14013. this.n12 = (this.getChild("n12"));
  14014. this.n49 = (this.getChild("n49"));
  14015. this.t0 = this.getTransition("t0");
  14016. }
  14017. }
  14018. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14019. class ui_BallRodDisplay extends fgui.GComponent {
  14020. static createInstance() {
  14021. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14022. }
  14023. onConstruct() {
  14024. this.c1 = this.getController("c1");
  14025. this.n31 = (this.getChild("n31"));
  14026. this.n6 = (this.getChild("n6"));
  14027. this.nameTxt = (this.getChild("nameTxt"));
  14028. this.rodImg = (this.getChild("rodImg"));
  14029. this.levelNode = (this.getChild("levelNode"));
  14030. this.eftRod = (this.getChild("eftRod"));
  14031. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14032. }
  14033. }
  14034. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14035. class ui_Component111_11 extends fgui.GComponent {
  14036. static createInstance() {
  14037. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14038. }
  14039. onConstruct() {
  14040. this.n68 = (this.getChild("n68"));
  14041. this.n69 = (this.getChild("n69"));
  14042. }
  14043. }
  14044. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14045. class ui_Component112 extends fgui.GComponent {
  14046. static createInstance() {
  14047. return (fgui.UIPackage.createObject("game", "Component112"));
  14048. }
  14049. onConstruct() {
  14050. this.n68 = (this.getChild("n68"));
  14051. this.n70 = (this.getChild("n70"));
  14052. this.myMask = (this.getChild("myMask"));
  14053. }
  14054. }
  14055. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14056. class ui_Component111 extends fgui.GComponent {
  14057. static createInstance() {
  14058. return (fgui.UIPackage.createObject("game", "Component111"));
  14059. }
  14060. onConstruct() {
  14061. this.n68 = (this.getChild("n68"));
  14062. this.myMask = (this.getChild("myMask"));
  14063. }
  14064. }
  14065. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14066. class ui_Component144 extends fgui.GButton {
  14067. static createInstance() {
  14068. return (fgui.UIPackage.createObject("game", "Component144"));
  14069. }
  14070. onConstruct() {
  14071. this.n8 = (this.getChild("n8"));
  14072. }
  14073. }
  14074. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14075. class ui_Sign_com2 extends fgui.GComponent {
  14076. static createInstance() {
  14077. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14078. }
  14079. onConstruct() {
  14080. this.n0 = (this.getChild("n0"));
  14081. this.n1 = (this.getChild("n1"));
  14082. this.t0 = this.getTransition("t0");
  14083. }
  14084. }
  14085. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14086. class ui_Sign_guang extends fgui.GComponent {
  14087. static createInstance() {
  14088. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14089. }
  14090. onConstruct() {
  14091. this.n1 = (this.getChild("n1"));
  14092. this.n2 = (this.getChild("n2"));
  14093. this.n3 = (this.getChild("n3"));
  14094. this.n4 = (this.getChild("n4"));
  14095. this.n5 = (this.getChild("n5"));
  14096. this.n6 = (this.getChild("n6"));
  14097. this.n8 = (this.getChild("n8"));
  14098. }
  14099. }
  14100. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14101. class ui_SignMax extends fgui.GComponent {
  14102. static createInstance() {
  14103. return (fgui.UIPackage.createObject("game", "SignMax"));
  14104. }
  14105. onConstruct() {
  14106. this.c1 = this.getController("c1");
  14107. this.n7 = (this.getChild("n7"));
  14108. this.n15 = (this.getChild("n15"));
  14109. this.n8 = (this.getChild("n8"));
  14110. this.titleTxt = (this.getChild("titleTxt"));
  14111. this.myIcon1 = (this.getChild("myIcon1"));
  14112. this.numTxt1 = (this.getChild("numTxt1"));
  14113. this.myIcon2 = (this.getChild("myIcon2"));
  14114. this.n20 = (this.getChild("n20"));
  14115. this.n17 = (this.getChild("n17"));
  14116. this.numTxt2 = (this.getChild("numTxt2"));
  14117. this.n12 = (this.getChild("n12"));
  14118. this.n13 = (this.getChild("n13"));
  14119. this.n21 = (this.getChild("n21"));
  14120. this.n14 = (this.getChild("n14"));
  14121. }
  14122. }
  14123. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14124. class ui_Sign_com2_1 extends fgui.GComponent {
  14125. static createInstance() {
  14126. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14127. }
  14128. onConstruct() {
  14129. this.n0 = (this.getChild("n0"));
  14130. this.n1 = (this.getChild("n1"));
  14131. this.t0 = this.getTransition("t0");
  14132. }
  14133. }
  14134. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14135. class ui_Sign_com5 extends fgui.GComponent {
  14136. static createInstance() {
  14137. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14138. }
  14139. onConstruct() {
  14140. this.n3 = (this.getChild("n3"));
  14141. this.n29 = (this.getChild("n29"));
  14142. this.n4 = (this.getChild("n4"));
  14143. this.day1 = (this.getChild("day1"));
  14144. this.day2 = (this.getChild("day2"));
  14145. this.day3 = (this.getChild("day3"));
  14146. this.day4 = (this.getChild("day4"));
  14147. this.day5 = (this.getChild("day5"));
  14148. this.day6 = (this.getChild("day6"));
  14149. this.day7 = (this.getChild("day7"));
  14150. this.t0 = this.getTransition("t0");
  14151. }
  14152. }
  14153. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14154. class ui_Sign_com8 extends fgui.GComponent {
  14155. static createInstance() {
  14156. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14157. }
  14158. onConstruct() {
  14159. this.n48 = (this.getChild("n48"));
  14160. this.womanTxt = (this.getChild("womanTxt"));
  14161. this.t0 = this.getTransition("t0");
  14162. }
  14163. }
  14164. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14165. class ui_Sign_com6 extends fgui.GComponent {
  14166. static createInstance() {
  14167. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14168. }
  14169. onConstruct() {
  14170. this.n2 = (this.getChild("n2"));
  14171. this.n3 = (this.getChild("n3"));
  14172. this.t0 = this.getTransition("t0");
  14173. }
  14174. }
  14175. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14176. class ui_Sign_com7 extends fgui.GComponent {
  14177. static createInstance() {
  14178. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14179. }
  14180. onConstruct() {
  14181. this.n29 = (this.getChild("n29"));
  14182. this.n2 = (this.getChild("n2"));
  14183. }
  14184. }
  14185. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14186. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14187. static createInstance() {
  14188. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14189. }
  14190. onConstruct() {
  14191. this.n5 = (this.getChild("n5"));
  14192. this.n4 = (this.getChild("n4"));
  14193. this.t0 = this.getTransition("t0");
  14194. }
  14195. }
  14196. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14197. class ui_UITurntable_com2 extends fgui.GComponent {
  14198. static createInstance() {
  14199. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14200. }
  14201. onConstruct() {
  14202. this.c1 = this.getController("c1");
  14203. this.n4 = (this.getChild("n4"));
  14204. this.n6 = (this.getChild("n6"));
  14205. this.n10 = (this.getChild("n10"));
  14206. this.n11 = (this.getChild("n11"));
  14207. this.n12 = (this.getChild("n12"));
  14208. this.n13 = (this.getChild("n13"));
  14209. this.n14 = (this.getChild("n14"));
  14210. this.n15 = (this.getChild("n15"));
  14211. this.n16 = (this.getChild("n16"));
  14212. this.n17 = (this.getChild("n17"));
  14213. this.n18 = (this.getChild("n18"));
  14214. this.n19 = (this.getChild("n19"));
  14215. this.n20 = (this.getChild("n20"));
  14216. this.n21 = (this.getChild("n21"));
  14217. this.n22 = (this.getChild("n22"));
  14218. this.n23 = (this.getChild("n23"));
  14219. this.n24 = (this.getChild("n24"));
  14220. this.n25 = (this.getChild("n25"));
  14221. this.n26 = (this.getChild("n26"));
  14222. this.n27 = (this.getChild("n27"));
  14223. this.n28 = (this.getChild("n28"));
  14224. this.n29 = (this.getChild("n29"));
  14225. this.n30 = (this.getChild("n30"));
  14226. this.n31 = (this.getChild("n31"));
  14227. this.n32 = (this.getChild("n32"));
  14228. this.n33 = (this.getChild("n33"));
  14229. }
  14230. }
  14231. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14232. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14233. static createInstance() {
  14234. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14235. }
  14236. onConstruct() {
  14237. this.n5 = (this.getChild("n5"));
  14238. this.n4 = (this.getChild("n4"));
  14239. this.t0 = this.getTransition("t0");
  14240. }
  14241. }
  14242. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14243. class ui_UITurntable_com5 extends fgui.GComponent {
  14244. static createInstance() {
  14245. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14246. }
  14247. onConstruct() {
  14248. this.flashNode = (this.getChild("flashNode"));
  14249. this.rotNode = (this.getChild("rotNode"));
  14250. this.n3 = (this.getChild("n3"));
  14251. this.n21 = (this.getChild("n21"));
  14252. this.t0 = this.getTransition("t0");
  14253. }
  14254. }
  14255. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14256. class ui_UITurntable_com7 extends fgui.GComponent {
  14257. static createInstance() {
  14258. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14259. }
  14260. onConstruct() {
  14261. this.n2 = (this.getChild("n2"));
  14262. this.n35 = (this.getChild("n35"));
  14263. this.img1 = (this.getChild("img1"));
  14264. this.img2 = (this.getChild("img2"));
  14265. this.img3 = (this.getChild("img3"));
  14266. this.img4 = (this.getChild("img4"));
  14267. this.img6 = (this.getChild("img6"));
  14268. this.img5 = (this.getChild("img5"));
  14269. this.txt1 = (this.getChild("txt1"));
  14270. this.txt2 = (this.getChild("txt2"));
  14271. this.txt3 = (this.getChild("txt3"));
  14272. this.txt4 = (this.getChild("txt4"));
  14273. this.txt5 = (this.getChild("txt5"));
  14274. this.txt6 = (this.getChild("txt6"));
  14275. }
  14276. }
  14277. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14278. class ui_UITurntable_com9 extends fgui.GComponent {
  14279. static createInstance() {
  14280. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14281. }
  14282. onConstruct() {
  14283. this.n38 = (this.getChild("n38"));
  14284. this.n39 = (this.getChild("n39"));
  14285. }
  14286. }
  14287. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14288. class ui_UITurntable_com10 extends fgui.GComponent {
  14289. static createInstance() {
  14290. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14291. }
  14292. onConstruct() {
  14293. this.n39 = (this.getChild("n39"));
  14294. this.n40 = (this.getChild("n40"));
  14295. this.t0 = this.getTransition("t0");
  14296. }
  14297. }
  14298. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14299. class ui_UITurntable_com11 extends fgui.GComponent {
  14300. static createInstance() {
  14301. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14302. }
  14303. onConstruct() {
  14304. this.n38 = (this.getChild("n38"));
  14305. this.n39 = (this.getChild("n39"));
  14306. this.n40 = (this.getChild("n40"));
  14307. this.t0 = this.getTransition("t0");
  14308. }
  14309. }
  14310. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14311. class ui_UITurntable_com12 extends fgui.GComponent {
  14312. static createInstance() {
  14313. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14314. }
  14315. onConstruct() {
  14316. this.n43 = (this.getChild("n43"));
  14317. this.barNode = (this.getChild("barNode"));
  14318. this.tipsTxt = (this.getChild("tipsTxt"));
  14319. this.n45 = (this.getChild("n45"));
  14320. this.boxBtn = (this.getChild("boxBtn"));
  14321. }
  14322. }
  14323. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14324. class ui_UITurntable_com1 extends fgui.GButton {
  14325. static createInstance() {
  14326. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14327. }
  14328. onConstruct() {
  14329. this.n41 = (this.getChild("n41"));
  14330. this.n42 = (this.getChild("n42"));
  14331. this.t0 = this.getTransition("t0");
  14332. }
  14333. }
  14334. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14335. class ui_UITurntable_com3 extends fgui.GComponent {
  14336. static createInstance() {
  14337. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14338. }
  14339. onConstruct() {
  14340. this.n48 = (this.getChild("n48"));
  14341. this.womanTxt = (this.getChild("womanTxt"));
  14342. this.t0 = this.getTransition("t0");
  14343. }
  14344. }
  14345. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14346. class ui_cancelBtn2 extends fgui.GButton {
  14347. static createInstance() {
  14348. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14349. }
  14350. onConstruct() {
  14351. this.c1 = this.getController("c1");
  14352. this.n0 = (this.getChild("n0"));
  14353. this.n1 = (this.getChild("n1"));
  14354. this.n2 = (this.getChild("n2"));
  14355. this.n3 = (this.getChild("n3"));
  14356. this.n4 = (this.getChild("n4"));
  14357. this.n5 = (this.getChild("n5"));
  14358. this.n6 = (this.getChild("n6"));
  14359. this.n7 = (this.getChild("n7"));
  14360. this.n8 = (this.getChild("n8"));
  14361. this.powerEft = (this.getChild("powerEft"));
  14362. }
  14363. }
  14364. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14365. class ui_shareBtn2 extends fgui.GButton {
  14366. static createInstance() {
  14367. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14368. }
  14369. onConstruct() {
  14370. this.c1 = this.getController("c1");
  14371. this.n2 = (this.getChild("n2"));
  14372. this.n24 = (this.getChild("n24"));
  14373. this.n1 = (this.getChild("n1"));
  14374. this.n3 = (this.getChild("n3"));
  14375. this.n23 = (this.getChild("n23"));
  14376. this.n4 = (this.getChild("n4"));
  14377. this.n5 = (this.getChild("n5"));
  14378. this.n6 = (this.getChild("n6"));
  14379. this.n20 = (this.getChild("n20"));
  14380. this.n21 = (this.getChild("n21"));
  14381. this.n22 = (this.getChild("n22"));
  14382. this.powerEft = (this.getChild("powerEft"));
  14383. }
  14384. }
  14385. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14386. class ui_UIMoney extends fgui.GComponent {
  14387. static createInstance() {
  14388. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14389. }
  14390. onConstruct() {
  14391. this.c1 = this.getController("c1");
  14392. this.n4 = (this.getChild("n4"));
  14393. this.coinImg = (this.getChild("coinImg"));
  14394. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14395. this.coinTxt = (this.getChild("coinTxt"));
  14396. this.n7 = (this.getChild("n7"));
  14397. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14398. this.diamondTxt = (this.getChild("diamondTxt"));
  14399. this.diamondImg = (this.getChild("diamondImg"));
  14400. this.n12 = (this.getChild("n12"));
  14401. this.powerImg = (this.getChild("powerImg"));
  14402. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14403. this.powerTxt = (this.getChild("powerTxt"));
  14404. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14405. }
  14406. }
  14407. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14408. class ui_backBtn extends fgui.GButton {
  14409. static createInstance() {
  14410. return (fgui.UIPackage.createObject("game", "backBtn"));
  14411. }
  14412. onConstruct() {
  14413. this.n0 = (this.getChild("n0"));
  14414. this.t0 = this.getTransition("t0");
  14415. this.t1 = this.getTransition("t1");
  14416. }
  14417. }
  14418. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14419. class ui_MoneyBtn extends fgui.GButton {
  14420. static createInstance() {
  14421. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14422. }
  14423. onConstruct() {
  14424. this.button = this.getController("button");
  14425. this.n0 = (this.getChild("n0"));
  14426. }
  14427. }
  14428. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14429. class ui_UIMoneyBtn extends fgui.GComponent {
  14430. static createInstance() {
  14431. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14432. }
  14433. onConstruct() {
  14434. this.n1 = (this.getChild("n1"));
  14435. this.closeBtn = (this.getChild("closeBtn"));
  14436. }
  14437. }
  14438. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14439. class ui_Component64 extends fgui.GComponent {
  14440. static createInstance() {
  14441. return (fgui.UIPackage.createObject("game", "Component64"));
  14442. }
  14443. onConstruct() {
  14444. this.n57 = (this.getChild("n57"));
  14445. this.n54 = (this.getChild("n54"));
  14446. this.n55 = (this.getChild("n55"));
  14447. this.n56 = (this.getChild("n56"));
  14448. this.t1 = this.getTransition("t1");
  14449. }
  14450. }
  14451. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14452. class ui_Component41_3 extends fgui.GComponent {
  14453. static createInstance() {
  14454. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14455. }
  14456. onConstruct() {
  14457. this.c1 = this.getController("c1");
  14458. this.n0 = (this.getChild("n0"));
  14459. this.n2 = (this.getChild("n2"));
  14460. this.cancelBtn = (this.getChild("cancelBtn"));
  14461. this.videoBtn = (this.getChild("videoBtn"));
  14462. this.n9 = (this.getChild("n9"));
  14463. this.n24 = (this.getChild("n24"));
  14464. this.n27 = (this.getChild("n27"));
  14465. this.titleTxt = (this.getChild("titleTxt"));
  14466. this.n28 = (this.getChild("n28"));
  14467. this.t0 = this.getTransition("t0");
  14468. }
  14469. }
  14470. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14471. class ui_dh_zs_4 extends fgui.GComponent {
  14472. static createInstance() {
  14473. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14474. }
  14475. onConstruct() {
  14476. this.n1 = (this.getChild("n1"));
  14477. this.n2 = (this.getChild("n2"));
  14478. this.n3 = (this.getChild("n3"));
  14479. this.n4 = (this.getChild("n4"));
  14480. this.n5 = (this.getChild("n5"));
  14481. this.n6 = (this.getChild("n6"));
  14482. this.n8 = (this.getChild("n8"));
  14483. this.t0 = this.getTransition("t0");
  14484. }
  14485. }
  14486. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14487. class ui_Component71_1 extends fgui.GButton {
  14488. static createInstance() {
  14489. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14490. }
  14491. onConstruct() {
  14492. this.n17 = (this.getChild("n17"));
  14493. this.t0 = this.getTransition("t0");
  14494. }
  14495. }
  14496. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14497. class ui_Component83 extends fgui.GComponent {
  14498. static createInstance() {
  14499. return (fgui.UIPackage.createObject("game", "Component83"));
  14500. }
  14501. onConstruct() {
  14502. this.c1 = this.getController("c1");
  14503. this.n17 = (this.getChild("n17"));
  14504. this.n19 = (this.getChild("n19"));
  14505. this.n20 = (this.getChild("n20"));
  14506. }
  14507. }
  14508. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14509. class ui_Component84 extends fgui.GComponent {
  14510. static createInstance() {
  14511. return (fgui.UIPackage.createObject("game", "Component84"));
  14512. }
  14513. onConstruct() {
  14514. this.c1 = this.getController("c1");
  14515. this.n4 = (this.getChild("n4"));
  14516. this.n22 = (this.getChild("n22"));
  14517. this.n23 = (this.getChild("n23"));
  14518. this.numTxt = (this.getChild("numTxt"));
  14519. this.n25 = (this.getChild("n25"));
  14520. this.n26 = (this.getChild("n26"));
  14521. }
  14522. }
  14523. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14524. class ui_Component84_1 extends fgui.GComponent {
  14525. static createInstance() {
  14526. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14527. }
  14528. onConstruct() {
  14529. this.c1 = this.getController("c1");
  14530. this.n4 = (this.getChild("n4"));
  14531. this.n22 = (this.getChild("n22"));
  14532. this.n23 = (this.getChild("n23"));
  14533. this.numTxt = (this.getChild("numTxt"));
  14534. this.n25 = (this.getChild("n25"));
  14535. this.n26 = (this.getChild("n26"));
  14536. }
  14537. }
  14538. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14539. class ui_Component85 extends fgui.GComponent {
  14540. static createInstance() {
  14541. return (fgui.UIPackage.createObject("game", "Component85"));
  14542. }
  14543. onConstruct() {
  14544. this.n1 = (this.getChild("n1"));
  14545. this.n6 = (this.getChild("n6"));
  14546. this.n2 = (this.getChild("n2"));
  14547. this.n3 = (this.getChild("n3"));
  14548. this.levelTxt = (this.getChild("levelTxt"));
  14549. this.n10 = (this.getChild("n10"));
  14550. this.n11 = (this.getChild("n11"));
  14551. this.n12 = (this.getChild("n12"));
  14552. this.n13 = (this.getChild("n13"));
  14553. this.n14 = (this.getChild("n14"));
  14554. this.modeNode = (this.getChild("modeNode"));
  14555. this.n18 = (this.getChild("n18"));
  14556. this.conditionTxt = (this.getChild("conditionTxt"));
  14557. this.diamondNode = (this.getChild("diamondNode"));
  14558. this.coinNode = (this.getChild("coinNode"));
  14559. this.startBtn = (this.getChild("startBtn"));
  14560. this.n28 = (this.getChild("n28"));
  14561. this.displayRoot = (this.getChild("displayRoot"));
  14562. this.t0 = this.getTransition("t0");
  14563. }
  14564. }
  14565. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14566. class ui_Component86 extends fgui.GButton {
  14567. static createInstance() {
  14568. return (fgui.UIPackage.createObject("game", "Component86"));
  14569. }
  14570. onConstruct() {
  14571. this.n15 = (this.getChild("n15"));
  14572. this.t0 = this.getTransition("t0");
  14573. }
  14574. }
  14575. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14576. class ui_Component87 extends fgui.GComponent {
  14577. static createInstance() {
  14578. return (fgui.UIPackage.createObject("game", "Component87"));
  14579. }
  14580. onConstruct() {
  14581. this.n66 = (this.getChild("n66"));
  14582. this.myProgress = (this.getChild("myProgress"));
  14583. this.starAni = (this.getChild("starAni"));
  14584. this.hpTxt = (this.getChild("hpTxt"));
  14585. this.n74 = (this.getChild("n74"));
  14586. this.n73 = (this.getChild("n73"));
  14587. this.ballTxt = (this.getChild("ballTxt"));
  14588. this.n76 = (this.getChild("n76"));
  14589. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14590. this.levelTxt = (this.getChild("levelTxt"));
  14591. this.star1 = (this.getChild("star1"));
  14592. this.star2 = (this.getChild("star2"));
  14593. this.star3 = (this.getChild("star3"));
  14594. }
  14595. }
  14596. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14597. class ui_Component88 extends fgui.GProgressBar {
  14598. static createInstance() {
  14599. return (fgui.UIPackage.createObject("game", "Component88"));
  14600. }
  14601. onConstruct() {
  14602. this.n68 = (this.getChild("n68"));
  14603. this.bar = (this.getChild("bar"));
  14604. }
  14605. }
  14606. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14607. class ui_Component89 extends fgui.GComponent {
  14608. static createInstance() {
  14609. return (fgui.UIPackage.createObject("game", "Component89"));
  14610. }
  14611. onConstruct() {
  14612. this.c1 = this.getController("c1");
  14613. this.n71 = (this.getChild("n71"));
  14614. this.n72 = (this.getChild("n72"));
  14615. }
  14616. }
  14617. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14618. class ui_Component90 extends fgui.GComponent {
  14619. static createInstance() {
  14620. return (fgui.UIPackage.createObject("game", "Component90"));
  14621. }
  14622. onConstruct() {
  14623. this.c1 = this.getController("c1");
  14624. this.n64 = (this.getChild("n64"));
  14625. this.n65 = (this.getChild("n65"));
  14626. this.n66 = (this.getChild("n66"));
  14627. this.t0 = this.getTransition("t0");
  14628. }
  14629. }
  14630. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14631. class ui_Component127 extends fgui.GButton {
  14632. static createInstance() {
  14633. return (fgui.UIPackage.createObject("game", "Component127"));
  14634. }
  14635. onConstruct() {
  14636. this.n5 = (this.getChild("n5"));
  14637. }
  14638. }
  14639. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14640. class gameBinder {
  14641. static bindAll() {
  14642. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14643. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14644. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14645. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14646. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14647. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14648. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14649. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14650. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14651. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14652. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14653. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14654. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14655. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14656. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14657. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14658. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14659. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14660. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14661. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14662. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14663. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14664. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14665. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14666. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14667. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14668. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14669. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14670. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14671. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14672. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14673. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14674. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14675. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14676. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14677. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14678. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14679. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14680. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14681. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14682. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14683. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14684. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14685. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14686. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14687. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14688. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14689. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14690. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14691. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14692. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14693. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14694. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14695. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14696. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14697. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14698. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14699. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14700. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14701. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14702. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14703. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14704. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14705. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14706. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14707. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14708. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14709. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14710. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14711. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14712. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14713. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14714. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14715. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14716. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14717. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14718. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14719. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14720. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14721. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14722. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14723. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14724. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14725. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14726. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14727. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14728. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14729. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14730. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14731. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14732. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14733. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14734. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14735. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14736. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14737. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14738. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14739. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14740. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14741. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14742. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14743. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14744. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14745. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14746. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14747. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14748. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14749. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14750. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14751. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14752. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14753. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14754. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14755. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14756. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14757. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14758. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14759. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14760. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14761. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14762. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14763. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14764. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14765. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14766. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14767. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14768. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14769. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14770. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14771. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14772. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14773. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14774. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14775. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14776. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14777. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14778. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14779. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14780. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14781. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14782. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14783. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14784. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14785. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14786. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14787. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14788. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14789. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14790. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14791. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14792. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14793. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14794. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14795. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14796. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14797. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14798. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14799. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14800. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14801. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14802. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14803. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14804. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14805. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14806. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14807. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14808. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14809. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14810. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14811. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14812. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14813. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14814. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14815. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14816. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14817. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14818. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14819. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14820. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14821. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14822. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14823. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14824. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14825. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14826. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14827. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14828. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14829. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14830. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14831. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14832. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14833. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14834. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14835. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14836. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14837. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14838. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14839. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14840. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14841. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14842. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14843. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14844. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14845. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14846. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14847. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14848. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14849. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14850. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14851. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14852. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14853. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14854. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14855. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14856. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14857. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14858. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14859. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14860. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14861. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14862. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14863. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14864. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14865. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14866. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14867. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14868. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14869. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14870. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14871. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14872. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14873. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14874. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14875. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14876. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14877. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14878. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14879. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14880. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14881. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14882. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14883. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14884. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14885. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14886. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14887. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14888. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14889. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14890. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14891. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14892. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14893. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14894. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14895. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14896. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14897. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14898. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14899. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14900. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14901. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14902. }
  14903. }
  14904. class ui_btn6 extends fgui.GButton {
  14905. static createInstance() {
  14906. return (fgui.UIPackage.createObject("loading", "btn6"));
  14907. }
  14908. onConstruct() {
  14909. this.n6 = (this.getChild("n6"));
  14910. this.n1 = (this.getChild("n1"));
  14911. }
  14912. }
  14913. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14914. class ui_xyItem extends fgui.GComponent {
  14915. static createInstance() {
  14916. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14917. }
  14918. onConstruct() {
  14919. this.xyItem = (this.getChild("xyItem"));
  14920. }
  14921. }
  14922. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14923. class ui_loadinfo extends fgui.GProgressBar {
  14924. static createInstance() {
  14925. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14926. }
  14927. onConstruct() {
  14928. this.bg = (this.getChild("bg"));
  14929. this.bar = (this.getChild("bar"));
  14930. this.title = (this.getChild("title"));
  14931. this.ani = (this.getChild("ani"));
  14932. }
  14933. }
  14934. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14935. class ui_xyNode extends fgui.GComponent {
  14936. static createInstance() {
  14937. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14938. }
  14939. onConstruct() {
  14940. this.n0 = (this.getChild("n0"));
  14941. this.btnYes = (this.getChild("btnYes"));
  14942. this.btnNo = (this.getChild("btnNo"));
  14943. this.btnKnown = (this.getChild("btnKnown"));
  14944. this.btnSure = (this.getChild("btnSure"));
  14945. this.txtWelcom = (this.getChild("txtWelcom"));
  14946. this.txtXy = (this.getChild("txtXy"));
  14947. this.n75 = (this.getChild("n75"));
  14948. this.btnXy1 = (this.getChild("btnXy1"));
  14949. this.btnXy3 = (this.getChild("btnXy3"));
  14950. this.btnXy2 = (this.getChild("btnXy2"));
  14951. this.n74 = (this.getChild("n74"));
  14952. this.xy1 = (this.getChild("xy1"));
  14953. this.txtTitle = (this.getChild("txtTitle"));
  14954. this.btnBack = (this.getChild("btnBack"));
  14955. this.xyList = (this.getChild("xyList"));
  14956. this.xy2 = (this.getChild("xy2"));
  14957. this.xyNode = (this.getChild("xyNode"));
  14958. }
  14959. }
  14960. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14961. class ui_ageNode extends fgui.GComponent {
  14962. static createInstance() {
  14963. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14964. }
  14965. onConstruct() {
  14966. this.n3 = (this.getChild("n3"));
  14967. this.n7 = (this.getChild("n7"));
  14968. this.n4 = (this.getChild("n4"));
  14969. this.btnAge = (this.getChild("btnAge"));
  14970. this.ageNode = (this.getChild("ageNode"));
  14971. }
  14972. }
  14973. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14974. class ui_rnNode extends fgui.GComponent {
  14975. static createInstance() {
  14976. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14977. }
  14978. onConstruct() {
  14979. this.n28 = (this.getChild("n28"));
  14980. this.n30 = (this.getChild("n30"));
  14981. this.n33 = (this.getChild("n33"));
  14982. this.rn1 = (this.getChild("rn1"));
  14983. this.n40 = (this.getChild("n40"));
  14984. this.n41 = (this.getChild("n41"));
  14985. this.rn3 = (this.getChild("rn3"));
  14986. this.n37 = (this.getChild("n37"));
  14987. this.n39 = (this.getChild("n39"));
  14988. this.rn2 = (this.getChild("rn2"));
  14989. this.n47 = (this.getChild("n47"));
  14990. this.n49 = (this.getChild("n49"));
  14991. this.n44 = (this.getChild("n44"));
  14992. this.inputCode = (this.getChild("inputCode"));
  14993. this.inputName = (this.getChild("inputName"));
  14994. this.n48 = (this.getChild("n48"));
  14995. this.n50 = (this.getChild("n50"));
  14996. this.rn4 = (this.getChild("rn4"));
  14997. this.btnCheck = (this.getChild("btnCheck"));
  14998. this.btnExit = (this.getChild("btnExit"));
  14999. this.btnDone = (this.getChild("btnDone"));
  15000. this.rnNode = (this.getChild("rnNode"));
  15001. }
  15002. }
  15003. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15004. class ui_tipNode extends fgui.GComponent {
  15005. static createInstance() {
  15006. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15007. }
  15008. onConstruct() {
  15009. this.bg = (this.getChild("bg"));
  15010. this.n55 = (this.getChild("n55"));
  15011. this.n56 = (this.getChild("n56"));
  15012. this.tipNode = (this.getChild("tipNode"));
  15013. }
  15014. }
  15015. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15016. class ui_fcmNode extends fgui.GComponent {
  15017. static createInstance() {
  15018. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15019. }
  15020. onConstruct() {
  15021. this.n63 = (this.getChild("n63"));
  15022. this.n62 = (this.getChild("n62"));
  15023. this.btnRn = (this.getChild("btnRn"));
  15024. this.n61 = (this.getChild("n61"));
  15025. this.n58 = (this.getChild("n58"));
  15026. this.fcmNode = (this.getChild("fcmNode"));
  15027. }
  15028. }
  15029. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15030. class ui_msgNode extends fgui.GComponent {
  15031. static createInstance() {
  15032. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15033. }
  15034. onConstruct() {
  15035. this.n69 = (this.getChild("n69"));
  15036. this.txtMsg = (this.getChild("txtMsg"));
  15037. this.msgNode = (this.getChild("msgNode"));
  15038. }
  15039. }
  15040. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15041. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15042. static createInstance() {
  15043. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15044. }
  15045. onConstruct() {
  15046. this.n1 = (this.getChild("n1"));
  15047. this.n13 = (this.getChild("n13"));
  15048. this.n14 = (this.getChild("n14"));
  15049. this.n15 = (this.getChild("n15"));
  15050. this.n3 = (this.getChild("n3"));
  15051. this.n4 = (this.getChild("n4"));
  15052. this.n5 = (this.getChild("n5"));
  15053. this.n6 = (this.getChild("n6"));
  15054. this.n7 = (this.getChild("n7"));
  15055. this.n8 = (this.getChild("n8"));
  15056. this.n9 = (this.getChild("n9"));
  15057. this.n10 = (this.getChild("n10"));
  15058. this.n12 = (this.getChild("n12"));
  15059. this.n11 = (this.getChild("n11"));
  15060. this.n16 = (this.getChild("n16"));
  15061. this.n17 = (this.getChild("n17"));
  15062. this.n18 = (this.getChild("n18"));
  15063. this.n20 = (this.getChild("n20"));
  15064. this.n21 = (this.getChild("n21"));
  15065. this.t0 = this.getTransition("t0");
  15066. }
  15067. }
  15068. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15069. class ui_btn5 extends fgui.GButton {
  15070. static createInstance() {
  15071. return (fgui.UIPackage.createObject("loading", "btn5"));
  15072. }
  15073. onConstruct() {
  15074. this.n9 = (this.getChild("n9"));
  15075. this.n1 = (this.getChild("n1"));
  15076. }
  15077. }
  15078. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15079. class ui_UILoading extends fgui.GComponent {
  15080. static createInstance() {
  15081. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15082. }
  15083. onConstruct() {
  15084. this.n12 = (this.getChild("n12"));
  15085. this.loadinfo = (this.getChild("loadinfo"));
  15086. this.n13 = (this.getChild("n13"));
  15087. this.txtLoad = (this.getChild("txtLoad"));
  15088. this.n18 = (this.getChild("n18"));
  15089. }
  15090. }
  15091. ui_UILoading.URL = "ui://37nctnhwphc33";
  15092. class ui_AgeItem extends fgui.GComponent {
  15093. static createInstance() {
  15094. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15095. }
  15096. onConstruct() {
  15097. this.txtAge = (this.getChild("txtAge"));
  15098. }
  15099. }
  15100. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15101. class ui_btn1 extends fgui.GButton {
  15102. static createInstance() {
  15103. return (fgui.UIPackage.createObject("loading", "btn1"));
  15104. }
  15105. onConstruct() {
  15106. this.n6 = (this.getChild("n6"));
  15107. this.n1 = (this.getChild("n1"));
  15108. }
  15109. }
  15110. ui_btn1.URL = "ui://37nctnhwxe622p";
  15111. class ui_btn3 extends fgui.GButton {
  15112. static createInstance() {
  15113. return (fgui.UIPackage.createObject("loading", "btn3"));
  15114. }
  15115. onConstruct() {
  15116. this.n9 = (this.getChild("n9"));
  15117. this.n1 = (this.getChild("n1"));
  15118. }
  15119. }
  15120. ui_btn3.URL = "ui://37nctnhwxe622s";
  15121. class ui_btn2 extends fgui.GButton {
  15122. static createInstance() {
  15123. return (fgui.UIPackage.createObject("loading", "btn2"));
  15124. }
  15125. onConstruct() {
  15126. this.n6 = (this.getChild("n6"));
  15127. this.n1 = (this.getChild("n1"));
  15128. }
  15129. }
  15130. ui_btn2.URL = "ui://37nctnhwxe622t";
  15131. class ui_btnBack extends fgui.GButton {
  15132. static createInstance() {
  15133. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15134. }
  15135. onConstruct() {
  15136. this.n6 = (this.getChild("n6"));
  15137. this.n7 = (this.getChild("n7"));
  15138. }
  15139. }
  15140. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15141. class ui_btnXy1 extends fgui.GButton {
  15142. static createInstance() {
  15143. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15144. }
  15145. onConstruct() {
  15146. this.n1 = (this.getChild("n1"));
  15147. }
  15148. }
  15149. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15150. class ui_btnXy2 extends fgui.GButton {
  15151. static createInstance() {
  15152. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15153. }
  15154. onConstruct() {
  15155. this.n1 = (this.getChild("n1"));
  15156. }
  15157. }
  15158. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15159. class ui_btnXy3 extends fgui.GButton {
  15160. static createInstance() {
  15161. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15162. }
  15163. onConstruct() {
  15164. this.n1 = (this.getChild("n1"));
  15165. }
  15166. }
  15167. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15168. class ui_btn4 extends fgui.GButton {
  15169. static createInstance() {
  15170. return (fgui.UIPackage.createObject("loading", "btn4"));
  15171. }
  15172. onConstruct() {
  15173. this.n9 = (this.getChild("n9"));
  15174. this.n1 = (this.getChild("n1"));
  15175. }
  15176. }
  15177. ui_btn4.URL = "ui://37nctnhwxe622z";
  15178. class loadingBinder {
  15179. static bindAll() {
  15180. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15181. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15182. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15183. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15184. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15185. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15186. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15187. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15188. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15189. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15190. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15191. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15192. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15193. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15194. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15195. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15196. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15197. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15198. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15199. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15200. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15201. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15202. }
  15203. }
  15204. class UIMgr {
  15205. constructor() {
  15206. this._stage = null;
  15207. this._uiList = [];
  15208. this._showList = [];
  15209. this._bindPkgList = [];
  15210. this.uiIndex = 0;
  15211. }
  15212. static get inst() {
  15213. if (UIMgr._inst == null) {
  15214. UIMgr._inst = new UIMgr();
  15215. }
  15216. return UIMgr._inst;
  15217. }
  15218. setStage(s) {
  15219. if (this._stage) {
  15220. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15221. return;
  15222. }
  15223. this._stage = s;
  15224. }
  15225. clearTempData() {
  15226. console.log('zh:clearTempData start');
  15227. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15228. console.log('zh:clearTempData end');
  15229. }
  15230. init() {
  15231. this.setStage(Laya.stage);
  15232. fairygui.UIConfig.defaultFont = "微软雅黑";
  15233. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15234. fairygui.UIConfig.packageFileExtension = "obj";
  15235. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15236. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15237. fairygui.GRoot.inst.width = Laya.stage.width;
  15238. fairygui.GRoot.inst.height = Laya.stage.height;
  15239. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15240. }
  15241. addAllUpdate() {
  15242. this.uiIndex = 0;
  15243. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15244. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15245. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15246. }
  15247. }
  15248. }
  15249. bindFUI(pkgname) {
  15250. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15251. return;
  15252. }
  15253. switch (pkgname) {
  15254. case fguiRes.loading:
  15255. fairygui.UIPackage.addPackage(pkgname);
  15256. loadingBinder.bindAll();
  15257. this._bindPkgList.push(pkgname);
  15258. break;
  15259. case fguiRes.game:
  15260. fairygui.UIPackage.addPackage(pkgname);
  15261. gameBinder.bindAll();
  15262. this._bindPkgList.push(pkgname);
  15263. break;
  15264. default:
  15265. break;
  15266. }
  15267. }
  15268. Show(cls, ...param) {
  15269. let nameStr = cls.uiName;
  15270. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15271. let temp = this._uiList[i];
  15272. let str = temp.className;
  15273. if (str == nameStr) {
  15274. if (temp.isMuti) {
  15275. if (temp.isHide) {
  15276. temp.show(...param);
  15277. this._uiList.splice(i, 1);
  15278. this._uiList.push(temp);
  15279. return temp;
  15280. }
  15281. }
  15282. else {
  15283. temp.show(...param);
  15284. this._uiList.splice(i, 1);
  15285. this._uiList.push(temp);
  15286. return temp;
  15287. }
  15288. }
  15289. }
  15290. let ui = new cls();
  15291. ui.className = nameStr;
  15292. this._showUI(ui, param);
  15293. return ui;
  15294. }
  15295. destroyUI(ui) {
  15296. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15297. let temp = this._uiList[i].className;
  15298. if (temp == ui.className) {
  15299. this._uiList.splice(i, 1);
  15300. break;
  15301. }
  15302. }
  15303. this.checkUIState();
  15304. }
  15305. _showUI(ui, param) {
  15306. this._uiList.push(ui);
  15307. ui.show(...param);
  15308. }
  15309. Hide(uiClass) {
  15310. let ui = this.getUI(uiClass);
  15311. if (ui && !ui.isHide) {
  15312. ui.hide();
  15313. }
  15314. }
  15315. getUI(ui) {
  15316. let nameStr = ui.uiName;
  15317. for (let index = 0; index < this._uiList.length; index++) {
  15318. let temp = this._uiList[index];
  15319. if (temp.className == nameStr) {
  15320. return temp;
  15321. }
  15322. }
  15323. return null;
  15324. }
  15325. isShow(cls) {
  15326. for (var i of this._uiList) {
  15327. if (i instanceof cls) {
  15328. return i.isShowing;
  15329. }
  15330. }
  15331. return false;
  15332. }
  15333. showUINum() {
  15334. let num = 0;
  15335. for (var i of this._uiList) {
  15336. if (i.isShowing) {
  15337. num++;
  15338. }
  15339. }
  15340. return num;
  15341. }
  15342. checkUIState() {
  15343. Laya.timer.clear(this, this._uiCheck);
  15344. Laya.timer.once(400, this, this._uiCheck);
  15345. }
  15346. _uiCheck() {
  15347. let showList = [];
  15348. for (var i of this._uiList) {
  15349. if (!i.isHide) {
  15350. showList.push(i);
  15351. }
  15352. }
  15353. for (let index = 0; index < showList.length; index++) {
  15354. if (index == showList.length - 1) {
  15355. showList[index].checkActive(true);
  15356. }
  15357. else {
  15358. showList[index].checkActive(false);
  15359. }
  15360. }
  15361. }
  15362. showTip(msg, time = 600, size = 30) {
  15363. }
  15364. }
  15365. class UIShowList {
  15366. }
  15367. class SoundMgr {
  15368. constructor() {
  15369. this.soundMax = 4;
  15370. this.isLoad = false;
  15371. this.soundMap = {};
  15372. this.isSound = true;
  15373. this.openShake = true;
  15374. SoundMgr._instance = this;
  15375. }
  15376. static getInstance() {
  15377. if (!this._instance) {
  15378. this._instance = new SoundMgr();
  15379. }
  15380. return this._instance;
  15381. }
  15382. init() {
  15383. console.log('zh:sm init 1');
  15384. Laya.SoundManager.autoReleaseSound = true;
  15385. Laya.SoundManager.autoStopMusic = true;
  15386. Laya.SoundManager.musicVolume = 0.3;
  15387. Laya.SoundManager.soundVolume = 0.5;
  15388. this.musicPlayed = false;
  15389. this.audioUrl = "asset/sound/ogg/";
  15390. console.log('zh:sm init 2');
  15391. console.log('zh:dev type ');
  15392. if (Laya.Browser.onAndroid) {
  15393. console.log('zh:dev type android');
  15394. this.audioUrl = "asset/sound/ogg/";
  15395. this.isLoad = true;
  15396. }
  15397. else {
  15398. console.log('zh:dev type not android');
  15399. this.audioUrl = "asset/sound/mp3/";
  15400. this.isLoad = true;
  15401. }
  15402. }
  15403. onSetting(isS) {
  15404. this.isSound = isS;
  15405. this.mute(!this.isSound);
  15406. }
  15407. clearCount() {
  15408. for (var key in this.soundMap) {
  15409. delete this.soundMap[key];
  15410. }
  15411. }
  15412. playMusic(path, loop = 0) {
  15413. console.log('zh:playMusic 1 PATH=' + path);
  15414. this.musicPath = path;
  15415. if (!this.isLoad) {
  15416. return;
  15417. }
  15418. if (!path || path == "") {
  15419. return;
  15420. }
  15421. if (!this.isSound) {
  15422. return;
  15423. }
  15424. this.musicPlayed = true;
  15425. let url = this.getUrl(path);
  15426. if (!Laya.Browser.onAndroid) {
  15427. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15428. this.play(url, loop);
  15429. }));
  15430. }
  15431. else {
  15432. this.play(url, loop);
  15433. }
  15434. }
  15435. play(url, loop) {
  15436. Laya.SoundManager.playMusic(url, loop);
  15437. }
  15438. getUrl(path) {
  15439. let url = this.audioUrl + path;
  15440. if (Laya.Browser.onAndroid) {
  15441. url += ".ogg";
  15442. }
  15443. else {
  15444. url += ".mp3";
  15445. }
  15446. return url;
  15447. }
  15448. pauseMusic(pause) {
  15449. if (pause) {
  15450. this.mute(true);
  15451. }
  15452. else if (this.isSound)
  15453. this.mute(false);
  15454. }
  15455. stopMusic() {
  15456. Laya.SoundManager.stopMusic();
  15457. if (Moyu.isNeedPlatAudio) {
  15458. Moyu.stopMusic();
  15459. }
  15460. }
  15461. mute(mute) {
  15462. if (Moyu.isNeedPlatAudio) {
  15463. Moyu.pauseMusic(mute);
  15464. }
  15465. else {
  15466. Laya.SoundManager.musicMuted = mute;
  15467. if (!mute && !this.musicPlayed && this.musicPath) {
  15468. this.playMusic(this.musicPath);
  15469. }
  15470. }
  15471. }
  15472. stopSound(path) {
  15473. let url = this.getUrl(path);
  15474. Laya.SoundManager.stopSound(url);
  15475. }
  15476. playSound(path, loop = 1, soundMax = this.soundMax) {
  15477. if (!this.isLoad)
  15478. return;
  15479. if (!this.isSound)
  15480. return;
  15481. if (!path || path == "")
  15482. return;
  15483. let url = this.getUrl(path);
  15484. if (Moyu.isNeedPlatAudio) {
  15485. Moyu.playSound(path, loop == 0);
  15486. }
  15487. else {
  15488. let count = 1;
  15489. if (this.soundMap[path])
  15490. count = this.soundMap[path] + 1;
  15491. if (count > soundMax)
  15492. return;
  15493. this.soundMap[path] = count;
  15494. Laya.SoundManager.playSound(url, loop);
  15495. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15496. }
  15497. }
  15498. removePath(path) {
  15499. if (this.soundMap[path]) {
  15500. let count = this.soundMap[path];
  15501. count--;
  15502. if (count < 1)
  15503. delete this.soundMap[path];
  15504. else
  15505. this.soundMap[path] = count;
  15506. }
  15507. }
  15508. playBtnSound() {
  15509. this.playSound("btn");
  15510. }
  15511. playGetSound() {
  15512. }
  15513. playCloseUISound() {
  15514. }
  15515. }
  15516. SoundMgr._instance = null;
  15517. var Handler$1 = Laya.Handler;
  15518. var EResType;
  15519. (function (EResType) {
  15520. EResType[EResType["none"] = 0] = "none";
  15521. EResType[EResType["nromal"] = 1] = "nromal";
  15522. EResType[EResType["td"] = 2] = "td";
  15523. EResType[EResType["sk"] = 3] = "sk";
  15524. })(EResType || (EResType = {}));
  15525. class CResLoader {
  15526. constructor(doneCall, proCall) {
  15527. this.completrCall = doneCall;
  15528. this.progressCall = proCall;
  15529. this.progressHander = new Handler$1(this, this.onProgress);
  15530. this.tdResMap = {};
  15531. }
  15532. load(resList) {
  15533. this.resCount = 0;
  15534. this.loadCount = 0;
  15535. for (let i = 0; i < resList.length; i++) {
  15536. let path = resList[i];
  15537. if (!path)
  15538. continue;
  15539. this.resCount++;
  15540. let type = this.getResType(path);
  15541. if (type == EResType.nromal)
  15542. this.loadNromal(path);
  15543. else if (type == EResType.td)
  15544. this.loadTd(path);
  15545. }
  15546. }
  15547. getRes(path) {
  15548. let type = this.getResType(path);
  15549. if (type == EResType.nromal)
  15550. return Laya.loader.getRes(path);
  15551. else if (type == EResType.td) {
  15552. let res = this.tdResMap[path];
  15553. if (res)
  15554. return res.clone();
  15555. return null;
  15556. }
  15557. }
  15558. destroy() {
  15559. this.progressHander.clear();
  15560. this.progressHander = null;
  15561. }
  15562. clearRes(path) {
  15563. let type = this.getResType(path);
  15564. if (type == EResType.nromal)
  15565. Laya.loader.clearRes(path);
  15566. else if (type == EResType.td) {
  15567. let obj = this.tdResMap[path];
  15568. if (obj)
  15569. obj.destroy();
  15570. delete this.tdResMap[path];
  15571. }
  15572. }
  15573. getResType(path) {
  15574. let exs = this.getExtension(path);
  15575. if (exs == "sk")
  15576. return EResType.sk;
  15577. if (exs == "ls" || exs == "lh" || exs == "lm")
  15578. return EResType.td;
  15579. else
  15580. return EResType.nromal;
  15581. }
  15582. getExtension(res) {
  15583. var index = res.lastIndexOf(".");
  15584. return res.substr(index + 1);
  15585. }
  15586. loadNromal(path) {
  15587. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15588. if (res) {
  15589. this.onLoad();
  15590. }
  15591. else
  15592. console.log("load res fail:" + path);
  15593. }), this.progressHander);
  15594. }
  15595. loadSk() {
  15596. }
  15597. loadTd(path) {
  15598. if (this.tdResMap[path]) {
  15599. this.onLoad();
  15600. return;
  15601. }
  15602. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15603. if (res) {
  15604. this.tdResMap[path] = res;
  15605. this.onLoad();
  15606. }
  15607. else
  15608. console.log("load res fail:" + path);
  15609. }));
  15610. }
  15611. onLoad() {
  15612. this.loadCount++;
  15613. this.onProgress(1);
  15614. if (this.loadCount >= this.resCount) {
  15615. this.completrCall.run();
  15616. }
  15617. }
  15618. onProgress(pro) {
  15619. let progress = (this.loadCount + pro) / this.resCount;
  15620. this.progressCall.runWith(progress);
  15621. }
  15622. }
  15623. var Handler$2 = Laya.Handler;
  15624. class ResInfo {
  15625. constructor() {
  15626. this.index = 0;
  15627. }
  15628. }
  15629. class ResMgr {
  15630. constructor() {
  15631. this.resList = [];
  15632. this.doneList = [];
  15633. this.resMap = {};
  15634. this.currentLoad = null;
  15635. this.completeHandler = new Handler$2(this, this.onComplete);
  15636. this.progressHandler = new Handler$2(this, this.onProgress);
  15637. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15638. }
  15639. static getInstance() {
  15640. if (ResMgr._instance == null) {
  15641. ResMgr._instance = new ResMgr();
  15642. }
  15643. return ResMgr._instance;
  15644. }
  15645. loadList(list, completeHandler, progressHandler) {
  15646. if (list.length < 1) {
  15647. completeHandler.run();
  15648. return;
  15649. }
  15650. let info = this.getResInfo();
  15651. info.resList = list;
  15652. info.completeHandler = completeHandler;
  15653. info.progressHandler = progressHandler;
  15654. this.resList.push(info);
  15655. this.startLoad();
  15656. }
  15657. loadFguiRes(list, completeHandler, progressHandler) {
  15658. Laya.loader.load(list, completeHandler, progressHandler);
  15659. }
  15660. loadAny(list, completeHandler, progressHandler) {
  15661. Laya.loader.load(list, completeHandler, progressHandler);
  15662. }
  15663. load(path, completeHandler, progressHandler) {
  15664. let count = this.resMap[path];
  15665. if (count && count > 0) {
  15666. if (completeHandler)
  15667. completeHandler.run();
  15668. }
  15669. else
  15670. this.loadList([path], completeHandler, progressHandler);
  15671. }
  15672. getRes(path) {
  15673. let res = this.resMap[path];
  15674. if (!res)
  15675. this.showLog("资源不存在:" + path);
  15676. else
  15677. return this.loader.getRes(path);
  15678. }
  15679. clearList(list, force = false) {
  15680. if (!list || list.length < 1)
  15681. return;
  15682. let cr = () => {
  15683. for (const k in list) {
  15684. let v = list[k];
  15685. if (!v)
  15686. continue;
  15687. if (force) {
  15688. this.loader.clearRes(v);
  15689. delete this.resMap[v];
  15690. }
  15691. else {
  15692. let count = this.resMap[v];
  15693. if (count && count > 1) {
  15694. count--;
  15695. this.resMap[v] = count;
  15696. }
  15697. else {
  15698. this.loader.clearRes(v);
  15699. delete this.resMap[v];
  15700. }
  15701. }
  15702. }
  15703. if (!window.hasOwnProperty("ks"))
  15704. Laya.Resource.destroyUnusedResources();
  15705. };
  15706. Laya.timer.clearAll(this);
  15707. Laya.timer.once(2000, this, cr);
  15708. }
  15709. clear3D() {
  15710. for (const k in this.loader.tdResMap) {
  15711. this.loader.clearRes(k);
  15712. if (this.resMap[k])
  15713. delete this.resMap[k];
  15714. }
  15715. if (!window.hasOwnProperty("ks"))
  15716. Laya.Resource.destroyUnusedResources();
  15717. }
  15718. clear(path, force = false) {
  15719. this.clearList([path], force);
  15720. }
  15721. getResInfo() {
  15722. if (this.doneList.length > 0)
  15723. return this.doneList.pop();
  15724. else
  15725. return new ResInfo();
  15726. }
  15727. startLoad() {
  15728. if (this.currentLoad)
  15729. return;
  15730. this.currentLoad = this.resList.pop();
  15731. if (this.currentLoad) {
  15732. this.loader.load(this.currentLoad.resList);
  15733. }
  15734. }
  15735. onComplete() {
  15736. if (!this.currentLoad)
  15737. return;
  15738. for (const k in this.currentLoad.resList) {
  15739. let v = this.currentLoad.resList[k];
  15740. let count = this.resMap[v];
  15741. if (count)
  15742. count++;
  15743. else
  15744. count = 1;
  15745. this.resMap[v] = count;
  15746. }
  15747. if (this.currentLoad.completeHandler)
  15748. this.currentLoad.completeHandler.run();
  15749. this.doneList.push(this.currentLoad);
  15750. this.currentLoad = null;
  15751. this.startLoad();
  15752. }
  15753. onProgress(pro) {
  15754. if (!this.currentLoad)
  15755. return;
  15756. if (this.currentLoad.progressHandler)
  15757. this.currentLoad.progressHandler.runWith(pro);
  15758. }
  15759. showLog(str, ...args) {
  15760. console.log("[ResLoader] " + str);
  15761. }
  15762. }
  15763. ResMgr._instance = null;
  15764. class EventMgr extends Laya.EventDispatcher {
  15765. }
  15766. let eventMgr = new EventMgr();
  15767. class ConfigMgr {
  15768. static getInstance() {
  15769. if (!this._instance) {
  15770. this._instance = new ConfigMgr();
  15771. }
  15772. return this._instance;
  15773. }
  15774. init() {
  15775. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15776. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15777. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15778. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15779. }
  15780. getUserInfoByIndex(index) {
  15781. return this.npcJson[index];
  15782. }
  15783. getRandomUserInfo() {
  15784. let index = xGame.tools.random(0, this.npcJson.length);
  15785. return this.npcJson[index];
  15786. }
  15787. getMaxBigMoveLength() {
  15788. return Object.keys(this.levelCfg).length;
  15789. }
  15790. getBigMoveLevelByIndex(index) {
  15791. let cfg = this.levelCfg;
  15792. cfg = cfg[index];
  15793. return cfg;
  15794. }
  15795. getRandomClassicLevel() {
  15796. let cfg = this.classicCfg;
  15797. let num = Object.keys(cfg).length;
  15798. let rand = xGame.common.randomNum(1, num);
  15799. return cfg[rand];
  15800. }
  15801. getPlaceBallByLevel(level) {
  15802. return this.placeBallCfg[level];
  15803. }
  15804. getMaxPlaceBall() {
  15805. return Object.keys(this.placeBallCfg).length;
  15806. }
  15807. }
  15808. class PoolD3Mgr {
  15809. constructor() {
  15810. this.pool = {};
  15811. }
  15812. static get ins() {
  15813. return this._ins || (this._ins = new PoolD3Mgr);
  15814. }
  15815. createList(key, prefab, parent) {
  15816. if (!this.pool[key]) {
  15817. this.pool[key] = {};
  15818. this.pool[key].prefab = prefab;
  15819. this.pool[key].list = [];
  15820. this.pool[key].parent = parent;
  15821. }
  15822. }
  15823. getItem(key) {
  15824. if (!this.pool[key]) {
  15825. return;
  15826. }
  15827. let temp;
  15828. if (this.pool[key].list.length > 0) {
  15829. temp = this.pool[key].list.pop();
  15830. }
  15831. else {
  15832. temp = this.pool[key].prefab.clone();
  15833. if (this.pool[key].parent) {
  15834. this.pool[key].parent.addChild(temp);
  15835. }
  15836. }
  15837. temp.active = true;
  15838. return temp;
  15839. }
  15840. putItem(key, obj) {
  15841. if (!this.pool[key]) {
  15842. return;
  15843. }
  15844. obj.active = false;
  15845. this.pool[key].list.push(obj);
  15846. }
  15847. }
  15848. let context$1 = context;
  15849. let uiMgr = UIMgr.inst;
  15850. let soundMgr = SoundMgr.getInstance();
  15851. let resMgr = ResMgr.getInstance();
  15852. let httpMgr = HttpMgr.getInstance();
  15853. let common = Common.getInstance();
  15854. let cfgMgr = ConfigMgr.getInstance();
  15855. let poolD3Mgr = PoolD3Mgr.ins;
  15856. let d3TexUrl = "res/d3Res/";
  15857. let d3ModeUrl = "res/unityRes/";
  15858. function setStageSize(view) {
  15859. if (view.width) {
  15860. view.width = Laya.stage.width;
  15861. view.height = Laya.stage.height;
  15862. }
  15863. }
  15864. function filledBg(view) {
  15865. let wh = Laya.stage.height / Laya.stage.width;
  15866. if (wh > 16 / 9) {
  15867. view.height = Laya.stage.height;
  15868. view.width = Laya.stage.height / 1334 * 750;
  15869. }
  15870. else {
  15871. view.width = Laya.stage.width;
  15872. view.height = Laya.stage.width / 750 * 1334;
  15873. }
  15874. }
  15875. function setNotch(view) {
  15876. if (view.height) {
  15877. view.y += context$1.notchHeight;
  15878. }
  15879. }
  15880. function showTip(str) {
  15881. uiMgr.Show(UIMsg, str);
  15882. }
  15883. function log(...args) {
  15884. console.log(args);
  15885. }
  15886. let xGame = {
  15887. context: context$1,
  15888. eventMgr,
  15889. resMgr,
  15890. uiMgr,
  15891. soundMgr,
  15892. define,
  15893. tools,
  15894. httpMgr,
  15895. d3TexUrl,
  15896. d3ModeUrl,
  15897. common,
  15898. cfgMgr,
  15899. poolD3Mgr,
  15900. setStageSize,
  15901. filledBg,
  15902. setNotch,
  15903. showTip,
  15904. log,
  15905. };
  15906. window["xGame"] = xGame;
  15907. let dataName = 'tBall_';
  15908. class UserData {
  15909. constructor() {
  15910. this.userId = "";
  15911. this.isAgree = false;
  15912. this.coinNum = 0;
  15913. this.gemNum = 0;
  15914. this.sound = true;
  15915. this.vibration = true;
  15916. this.currentDate = 0;
  15917. this.createTime = 0;
  15918. this.awardTime = 0;
  15919. this.roleId = 1;
  15920. this.roleList = [];
  15921. this.roleAds = [];
  15922. this.dressId = 101;
  15923. this.itemId = 201;
  15924. this.bigSkills = [1, 1, 1, 1, 1];
  15925. this.coin = 4000;
  15926. this.diamond = 0;
  15927. this.skillSuccessTimes = 0;
  15928. this.skillGuide = 0;
  15929. this.skillAccTimes = 0;
  15930. this.placeBallData = [];
  15931. this.shareDiamondTimes = 0;
  15932. this.dailyVideoShareTimes = 0;
  15933. this.secretary = [1, 0];
  15934. this.curSecretary = 0;
  15935. this.ballRod = [1, 0, 0, 0, 0, 1];
  15936. this.curBallRod = 5;
  15937. this.signData = 0;
  15938. this.signTime = 0;
  15939. this.drawTimes = 0;
  15940. this.drawAwardTimes = 0;
  15941. this.dailyfreeDrawTimes = 1;
  15942. this.power = 5;
  15943. this.powerTime = 0;
  15944. this.challengeTimes = 0;
  15945. this.extraSign = 0;
  15946. this.classicTimes = 0;
  15947. this.guideHelpLine = 0;
  15948. this.newUser = true;
  15949. this.rootBallFoul = 0;
  15950. this.timeoutFoul = 0;
  15951. this.roleList = [1];
  15952. }
  15953. saveData() {
  15954. let data = {};
  15955. for (let k in this) {
  15956. data[k.toString()] = this[k];
  15957. }
  15958. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15959. }
  15960. getData() {
  15961. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15962. if (ld) {
  15963. let localData = JSON.parse(ld);
  15964. if (localData) {
  15965. for (let k in this) {
  15966. let key = k.toString();
  15967. let data = localData[key];
  15968. if (data != undefined) {
  15969. this[k] = data;
  15970. }
  15971. }
  15972. }
  15973. }
  15974. }
  15975. }
  15976. class ItemData {
  15977. constructor() {
  15978. this.itemList = {};
  15979. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15980. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15981. }
  15982. saveData() {
  15983. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15984. }
  15985. getData() {
  15986. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15987. if (ld) {
  15988. let localData = JSON.parse(ld);
  15989. if (localData) {
  15990. this.itemList = localData;
  15991. }
  15992. }
  15993. }
  15994. }
  15995. class GameData {
  15996. constructor() {
  15997. this.curLevel = 0;
  15998. this.gameType = 1;
  15999. this.signIdx = 0;
  16000. this.signMax = 0;
  16001. this.rotaryTime = 0;
  16002. this.rotaryCount = 0;
  16003. this.rotaryList = [];
  16004. this.diyCount = 3;
  16005. this.awardIdx = 0;
  16006. this.shareNum = 2;
  16007. this.rankWeek = 0;
  16008. this.rankScore = 0;
  16009. this.gameCount = 0;
  16010. this.trySkill = -1;
  16011. this.tryTime = 0;
  16012. }
  16013. saveData() {
  16014. let data = {};
  16015. for (let k in this) {
  16016. data[k.toString()] = this[k];
  16017. }
  16018. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16019. }
  16020. getData() {
  16021. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16022. if (ld) {
  16023. let localData = JSON.parse(ld);
  16024. if (localData) {
  16025. for (let k in this) {
  16026. let key = k.toString();
  16027. let data = localData[key];
  16028. if (data != undefined) {
  16029. this[k] = data;
  16030. }
  16031. }
  16032. }
  16033. }
  16034. }
  16035. }
  16036. class DataMgr {
  16037. static Init() {
  16038. this.userData = new UserData();
  16039. this.gameData = new GameData();
  16040. this.itemData = new ItemData();
  16041. this.userData.getData();
  16042. this.gameData.getData();
  16043. this.itemData.getData();
  16044. this.roleId = this.userData.roleId;
  16045. this.resetUse();
  16046. }
  16047. static isNewDay() {
  16048. Moyu.isNewDay(this, (isnew) => {
  16049. xGame.common.isNewDay = isnew;
  16050. if (!isnew)
  16051. return;
  16052. DataMgr.setShareDiamondTimes(0, false);
  16053. DataMgr.setDailyVideoShareTimes(0, false);
  16054. DataMgr.setDailyfreeDrawTimes(1);
  16055. DataMgr.setExtraSign(0);
  16056. });
  16057. }
  16058. static deletData() {
  16059. Laya.LocalStorage.clear();
  16060. }
  16061. static upRankData() {
  16062. let num = xGame.common.getAllStarNum();
  16063. if (num > 0)
  16064. Moyu.upRankData(xGame.common.curRankID, num);
  16065. }
  16066. static addItem(id, count = 1) {
  16067. let v = this.itemData.itemList[id];
  16068. if (!v)
  16069. v = { id: id, count: count, adnum: 0, active: true };
  16070. else {
  16071. if (v.active) {
  16072. v.count += count;
  16073. }
  16074. else {
  16075. v.count = count;
  16076. v.active = true;
  16077. }
  16078. }
  16079. this.itemData.itemList[id] = v;
  16080. xGame.soundMgr.playGetSound();
  16081. this.saveItemData();
  16082. }
  16083. static hasItem(id) {
  16084. let v = this.itemData.itemList[id];
  16085. if (v && v.active)
  16086. return true;
  16087. return false;
  16088. }
  16089. static getItem(id) {
  16090. let v = this.itemData.itemList[id];
  16091. return v;
  16092. }
  16093. static getItemCount(id) {
  16094. let v = this.itemData.itemList[id];
  16095. if (v && v.active)
  16096. return v.count;
  16097. return 0;
  16098. }
  16099. static getItemAd(id) {
  16100. let v = this.itemData.itemList[id];
  16101. if (v) {
  16102. return v.adnum;
  16103. }
  16104. return 0;
  16105. }
  16106. static onItemAd(id, num = 1) {
  16107. let v = this.itemData.itemList[id];
  16108. if (!v)
  16109. v = { id: id, count: 1, adnum: num, active: false };
  16110. else
  16111. v.adnum += num;
  16112. this.itemData.itemList[id] = v;
  16113. this.saveItemData();
  16114. }
  16115. static costItem(id, count) {
  16116. let v = this.itemData.itemList[id];
  16117. if (v && v.active) {
  16118. if (v.count < count)
  16119. return false;
  16120. else {
  16121. v.count -= count;
  16122. this.itemData.itemList[id] = v;
  16123. return true;
  16124. }
  16125. }
  16126. return false;
  16127. }
  16128. static resetUse() {
  16129. this.dressId = this.userData.dressId;
  16130. this.itemId = this.userData.itemId;
  16131. }
  16132. static passLevel() {
  16133. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  16134. this.gameData.curLevel++;
  16135. this.curLevel = this.gameData.curLevel;
  16136. this.saveGameData();
  16137. }
  16138. static useRole(id) {
  16139. this.roleId = id;
  16140. if (this.hasRole(id)) {
  16141. this.userData.roleId = id;
  16142. this.saveUserData();
  16143. }
  16144. }
  16145. static addRole(id) {
  16146. if (this.hasRole(id))
  16147. return;
  16148. this.userData.roleList.push(id);
  16149. this.saveUserData();
  16150. }
  16151. static hasRole(id) {
  16152. return this.userData.roleList.indexOf(id) >= 0;
  16153. }
  16154. static gemEnough(num) {
  16155. return this.userData.gemNum >= num;
  16156. }
  16157. static roleHasAd(id) {
  16158. let count = this.userData.roleAds[id];
  16159. if (count != undefined && count >= 0)
  16160. return true;
  16161. else
  16162. return false;
  16163. }
  16164. static saveUserData(time = 500, event, arg) {
  16165. if (this.userSaving)
  16166. return;
  16167. this.userSaving = true;
  16168. Laya.timer.once(time, this, () => {
  16169. this.userSaving = false;
  16170. this.userData.saveData();
  16171. if (event)
  16172. xGame.eventMgr.event(event, arg);
  16173. });
  16174. }
  16175. static saveGameData() {
  16176. if (this.gameSaving)
  16177. return;
  16178. this.gameSaving = true;
  16179. Laya.timer.once(1000, this, () => {
  16180. this.gameSaving = false;
  16181. this.gameData.saveData();
  16182. });
  16183. }
  16184. static saveItemData() {
  16185. let fun = () => {
  16186. this.itemData.saveData();
  16187. };
  16188. Laya.timer.clear(this, fun);
  16189. Laya.timer.once(500, this, fun);
  16190. }
  16191. static saveData() {
  16192. this.saveUserData();
  16193. this.saveGameData();
  16194. }
  16195. static getBigSkillList() {
  16196. return this.userData.bigSkills;
  16197. }
  16198. static getBigSkillByIndex(index) {
  16199. return this.userData.bigSkills[index];
  16200. }
  16201. static setBigSkill(index, val, addUp = true) {
  16202. if (addUp) {
  16203. this.userData.bigSkills[index] += val;
  16204. }
  16205. else {
  16206. this.userData.bigSkills[index] = val;
  16207. }
  16208. this.saveUserData();
  16209. }
  16210. static coinEnough(need) {
  16211. if (typeof need != "number") {
  16212. console.error("金币格式错误");
  16213. return;
  16214. }
  16215. return this.userData.coin >= need;
  16216. }
  16217. static setCoin(val) {
  16218. if (typeof val != "number") {
  16219. return;
  16220. }
  16221. this.userData.coin += val;
  16222. this.saveUserData();
  16223. xGame.eventMgr.event(COIN_CHANGE);
  16224. }
  16225. static getCoin() {
  16226. return this.userData.coin;
  16227. }
  16228. static diamondEnough(need) {
  16229. if (typeof need != "number") {
  16230. console.error("金币格式错误");
  16231. return;
  16232. }
  16233. return this.userData.diamond >= need;
  16234. }
  16235. static setDiamond(val) {
  16236. if (typeof val != "number") {
  16237. return;
  16238. }
  16239. this.userData.diamond += val;
  16240. this.saveUserData();
  16241. xGame.eventMgr.event(DIAMOND_CHANGE);
  16242. }
  16243. static getDiamond() {
  16244. return this.userData.diamond;
  16245. }
  16246. static getSkillSuccessTimes() {
  16247. return this.userData.skillSuccessTimes;
  16248. }
  16249. static setSkillSuccessTimes(val, addUp = true) {
  16250. if (addUp)
  16251. this.userData.skillSuccessTimes += val;
  16252. else
  16253. this.userData.skillSuccessTimes = val;
  16254. this.saveUserData();
  16255. }
  16256. static getSkillAccTimes() {
  16257. return this.userData.skillAccTimes;
  16258. }
  16259. static setSkillAccTimes(val) {
  16260. this.userData.skillAccTimes += val;
  16261. this.saveUserData();
  16262. }
  16263. static getSkillGuide() {
  16264. if (!xGame.common.openGuide) {
  16265. return 1;
  16266. }
  16267. return this.userData.skillGuide;
  16268. }
  16269. static setSkillGuide(val) {
  16270. this.userData.skillGuide = val;
  16271. this.saveUserData();
  16272. }
  16273. static getPlaceBallLevelList() {
  16274. return this.userData.placeBallData;
  16275. }
  16276. static getPlaceBallLevel(level) {
  16277. let arr = this.userData.placeBallData;
  16278. let index = level - 1;
  16279. let out;
  16280. if (arr[index]) {
  16281. out = arr[index];
  16282. }
  16283. else {
  16284. let max = arr.length;
  16285. if (max == index) {
  16286. out = {
  16287. star: 0,
  16288. play: true,
  16289. isCur: true,
  16290. getAward: false
  16291. };
  16292. }
  16293. else {
  16294. out = {
  16295. star: 0,
  16296. play: false,
  16297. getAward: false
  16298. };
  16299. }
  16300. }
  16301. return out;
  16302. }
  16303. static setPlaceBallLevel(level, star) {
  16304. let arr = this.userData.placeBallData;
  16305. let index = level - 1;
  16306. if (arr[index]) {
  16307. arr[index].star = Math.max(arr[index].star, star);
  16308. }
  16309. else {
  16310. let max = arr.length;
  16311. if (max == index) {
  16312. arr.push({
  16313. star: star,
  16314. play: true,
  16315. getAward: false
  16316. });
  16317. }
  16318. else {
  16319. console.error("关卡存储出错");
  16320. }
  16321. }
  16322. this.saveUserData();
  16323. }
  16324. static setPlaceBallAward(level) {
  16325. let arr = this.userData.placeBallData;
  16326. let index = level - 1;
  16327. if (arr[index]) {
  16328. arr[index].getAward = true;
  16329. }
  16330. this.saveUserData();
  16331. }
  16332. static getShareDiamondTimes() {
  16333. return this.userData.shareDiamondTimes;
  16334. }
  16335. static setShareDiamondTimes(val, addUp = true) {
  16336. if (addUp) {
  16337. this.userData.shareDiamondTimes += val;
  16338. }
  16339. else {
  16340. this.userData.shareDiamondTimes = val;
  16341. }
  16342. this.saveUserData();
  16343. }
  16344. static getDailyVideoShareTimes() {
  16345. return this.userData.dailyVideoShareTimes;
  16346. }
  16347. static setDailyVideoShareTimes(val, addUp = true) {
  16348. if (addUp) {
  16349. this.userData.dailyVideoShareTimes += val;
  16350. }
  16351. else {
  16352. this.userData.dailyVideoShareTimes = val;
  16353. }
  16354. this.saveUserData();
  16355. }
  16356. static getSecretary(index) {
  16357. return this.userData.secretary[index];
  16358. }
  16359. static setSecretary(index, val) {
  16360. this.userData.secretary[index] = val;
  16361. this.saveUserData();
  16362. }
  16363. static getCurSecretary() {
  16364. return this.userData.curSecretary;
  16365. }
  16366. static setCurSecretary(index) {
  16367. this.userData.curSecretary = index;
  16368. this.saveUserData();
  16369. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16370. }
  16371. static getBallRod(index) {
  16372. return this.userData.ballRod[index];
  16373. }
  16374. static setBallRod(index, val) {
  16375. this.userData.ballRod[index] = val;
  16376. this.saveUserData();
  16377. }
  16378. static getCurBallRod() {
  16379. return this.userData.curBallRod;
  16380. }
  16381. static setCurBallRod(index) {
  16382. this.userData.curBallRod = index;
  16383. this.saveUserData();
  16384. }
  16385. static setSignData(val) {
  16386. this.userData.signData = val;
  16387. this.saveUserData();
  16388. }
  16389. static getSignData() {
  16390. return this.userData.signData;
  16391. }
  16392. static setSignTime(val) {
  16393. this.userData.signTime = val;
  16394. this.saveUserData();
  16395. }
  16396. static getSignTime() {
  16397. return this.userData.signTime;
  16398. }
  16399. static getDrawTimes() {
  16400. return this.userData.drawTimes;
  16401. }
  16402. static setDrawTimes(val, addUp = true) {
  16403. if (addUp) {
  16404. this.userData.drawTimes += val;
  16405. }
  16406. else {
  16407. this.userData.drawTimes = val;
  16408. }
  16409. this.saveUserData();
  16410. }
  16411. static getDrawAwardTimes() {
  16412. return this.userData.drawAwardTimes;
  16413. }
  16414. static setDrawAwardTimes(val) {
  16415. this.userData.drawAwardTimes = val;
  16416. this.saveUserData();
  16417. }
  16418. static getDailyfreeDrawTimes() {
  16419. return this.userData.dailyfreeDrawTimes;
  16420. }
  16421. static setDailyfreeDrawTimes(val) {
  16422. this.userData.dailyfreeDrawTimes = val;
  16423. this.saveUserData();
  16424. }
  16425. static setPower(val, addUp = true) {
  16426. if (addUp)
  16427. this.userData.power += val;
  16428. else
  16429. this.userData.power = val;
  16430. if (this.userData.power >= xGame.common.maxPower) {
  16431. this.userData.power = xGame.common.maxPower;
  16432. }
  16433. xGame.eventMgr.event(POWER_CHANGE, val);
  16434. this.saveUserData();
  16435. }
  16436. static getPower() {
  16437. return this.userData.power;
  16438. }
  16439. static setPowerTime(val) {
  16440. this.userData.powerTime = val;
  16441. this.saveUserData();
  16442. }
  16443. static getPowerTime() {
  16444. return this.userData.powerTime;
  16445. }
  16446. static powerEnough() {
  16447. return this.getPower() > 0;
  16448. }
  16449. static getChallengeTimes() {
  16450. return this.userData.challengeTimes;
  16451. }
  16452. static setChallengeTimes(val) {
  16453. this.userData.challengeTimes += val;
  16454. this.saveUserData();
  16455. }
  16456. static getExtraSign() {
  16457. return this.userData.extraSign;
  16458. }
  16459. static setExtraSign(val) {
  16460. this.userData.extraSign = val;
  16461. this.saveUserData();
  16462. }
  16463. static getClassicTimes() {
  16464. return this.userData.classicTimes;
  16465. }
  16466. static setClassicTimes() {
  16467. this.userData.classicTimes += 1;
  16468. this.saveUserData();
  16469. }
  16470. static getGuideHelpLine() {
  16471. return this.userData.guideHelpLine;
  16472. }
  16473. static setGuideHelpLine() {
  16474. this.userData.guideHelpLine = 1;
  16475. this.saveUserData();
  16476. }
  16477. static getNewUser() {
  16478. return this.userData.newUser;
  16479. }
  16480. static setNewUser() {
  16481. this.userData.newUser = false;
  16482. this.saveUserData();
  16483. }
  16484. static getRootBallFoul() {
  16485. return this.userData.rootBallFoul;
  16486. }
  16487. static setRootBallFoul() {
  16488. this.userData.rootBallFoul = 1;
  16489. this.saveUserData();
  16490. }
  16491. static getTimeoutFoul() {
  16492. return this.userData.timeoutFoul;
  16493. }
  16494. static setTimeoutFoul() {
  16495. this.userData.timeoutFoul = 1;
  16496. this.saveUserData();
  16497. }
  16498. }
  16499. DataMgr.isNewUser = false;
  16500. DataMgr.fristEnter = true;
  16501. DataMgr.levelType = 0;
  16502. DataMgr.awardId = 0;
  16503. DataMgr.awardCoin = 0;
  16504. DataMgr.sceneId = -1;
  16505. DataMgr.tryId = 0;
  16506. DataMgr.curLevel = 1;
  16507. DataMgr.vipLevel = 0;
  16508. DataMgr.maxLevel = 0;
  16509. DataMgr.awardRatio = 1;
  16510. DataMgr.gameList = [];
  16511. DataMgr.rankList = [];
  16512. DataMgr.recoverTime = 480000;
  16513. DataMgr.minScore = 0;
  16514. DataMgr.rankDis = 0;
  16515. DataMgr.userSaving = false;
  16516. DataMgr.gameSaving = false;
  16517. class D3Tween extends Laya.Script3D {
  16518. constructor() {
  16519. super();
  16520. this.isInited = false;
  16521. }
  16522. ;
  16523. init() {
  16524. if (this.isInited)
  16525. return;
  16526. this.isInited = true;
  16527. this.gameObj = this.owner;
  16528. this.transform = this.gameObj.transform;
  16529. }
  16530. get rotX() {
  16531. return this.transform.localRotationEulerX;
  16532. }
  16533. set rotX(v) {
  16534. this.transform.localRotationEulerX = v;
  16535. }
  16536. get rotY() {
  16537. return this.transform.localRotationEulerY;
  16538. }
  16539. set rotY(v) {
  16540. this.transform.localRotationEulerY = v;
  16541. }
  16542. get rotZ() {
  16543. return this.transform.localRotationEulerZ;
  16544. }
  16545. set rotZ(v) {
  16546. this.transform.localRotationEulerZ = v;
  16547. }
  16548. get posX() {
  16549. return this.transform.localPositionX;
  16550. }
  16551. set posX(v) {
  16552. this.transform.localPositionX = v;
  16553. }
  16554. get posY() {
  16555. return this.transform.localPositionY;
  16556. }
  16557. set posY(v) {
  16558. this.transform.localPositionY = v;
  16559. }
  16560. get posZ() {
  16561. return this.transform.localPositionZ;
  16562. }
  16563. set posZ(v) {
  16564. this.transform.localPositionZ = v;
  16565. }
  16566. get rotation() {
  16567. return this.transform.localRotation;
  16568. }
  16569. set rotation(v) {
  16570. this.transform.localRotation = v;
  16571. }
  16572. }
  16573. class D2Hole extends Laya.Script {
  16574. constructor() { super(); }
  16575. onTriggerEnter(collider) {
  16576. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16577. return;
  16578. }
  16579. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16580. if (collider.owner["mySrc"].isRunSkillAni) {
  16581. return;
  16582. }
  16583. if (collider.owner["mySrc"].number != 0) {
  16584. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16585. }
  16586. xGame.common.ballColliHole(collider);
  16587. xGame.common.recoverCameraView();
  16588. }
  16589. }
  16590. }
  16591. class Table extends Laya.Script3D {
  16592. constructor() {
  16593. super();
  16594. this.isSetBorder = false;
  16595. this.inited = false;
  16596. }
  16597. ;
  16598. onAwake() {
  16599. this.init();
  16600. }
  16601. init() {
  16602. if (this.inited)
  16603. return;
  16604. this.inited = true;
  16605. this.gameObj = this.owner;
  16606. this.border = this.gameObj.getChildByName("border");
  16607. }
  16608. setBorderPos() {
  16609. if (this.isSetBorder)
  16610. return;
  16611. this.isSetBorder = true;
  16612. let ui = xGame.common.gameUI.ui;
  16613. let bar1 = this.border.getChildByName("bar1");
  16614. let bar2 = this.border.getChildByName("bar2");
  16615. let bar3 = this.border.getChildByName("bar3");
  16616. let bar4 = this.border.getChildByName("bar4");
  16617. let bar5 = this.border.getChildByName("bar5");
  16618. let bar6 = this.border.getChildByName("bar6");
  16619. this.setInfo(bar1, ui.border.bar1, "box");
  16620. this.setInfo(bar2, ui.border.bar2, "box");
  16621. this.setInfo(bar3, ui.border.bar3, "box");
  16622. this.setInfo(bar4, ui.border.bar4, "box");
  16623. this.setInfo(bar5, ui.border.bar5, "box");
  16624. this.setInfo(bar6, ui.border.bar6, "box");
  16625. let circle1 = this.border.getChildByName("circle1");
  16626. let circle2 = this.border.getChildByName("circle2");
  16627. let circle3 = this.border.getChildByName("circle3");
  16628. let circle4 = this.border.getChildByName("circle4");
  16629. let circle5 = this.border.getChildByName("circle5");
  16630. let circle6 = this.border.getChildByName("circle6");
  16631. this.setInfo(circle1, ui.border.circle1, "circle");
  16632. this.setInfo(circle2, ui.border.circle2, "circle");
  16633. this.setInfo(circle3, ui.border.circle3, "circle");
  16634. this.setInfo(circle4, ui.border.circle4, "circle");
  16635. this.setInfo(circle5, ui.border.circle5, "circle");
  16636. this.setInfo(circle6, ui.border.circle6, "circle");
  16637. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16638. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16639. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16640. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16641. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16642. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16643. let arr = xGame.common.gameMgr.holePosList;
  16644. xGame.common.gameMgr.posObj = {
  16645. "1": arr[0],
  16646. "3": arr[2],
  16647. "4": arr[3],
  16648. "6": arr[5]
  16649. };
  16650. }
  16651. initHolePos(x, y) {
  16652. if (x < 300)
  16653. x += 25;
  16654. else if (x > 1000)
  16655. x -= 25;
  16656. else if (y > 200)
  16657. y -= 10;
  16658. else
  16659. y += 10;
  16660. if (y < 200)
  16661. y += 30;
  16662. else if (y > 500)
  16663. y -= 30;
  16664. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16665. }
  16666. setInfo(d3Obj, d2Obj, type) {
  16667. let ui = xGame.common.gameUI.ui;
  16668. let sprite = new Laya.Sprite();
  16669. ui.border.displayObject.addChild(sprite);
  16670. let colli = xGame.common.getCollider(type);
  16671. sprite.addComponentIntance(colli);
  16672. let rigy = xGame.common.getRigbody();
  16673. rigy.type = "static";
  16674. sprite.addComponentIntance(rigy);
  16675. let d3Pos = d3Obj.transform.position;
  16676. xGame.common.pos3to2Convert(d3Pos);
  16677. let scaleX = d3Obj.transform.localScaleX;
  16678. let scaleZ = d3Obj.transform.localScaleZ;
  16679. let width = xGame.common.scale3to2Convert(scaleZ);
  16680. let height = xGame.common.scale3to2Convert(scaleX);
  16681. sprite.pivotX = width / 2;
  16682. sprite.pivotY = height / 2;
  16683. sprite.x = d3Pos.x;
  16684. sprite.y = d3Pos.y;
  16685. sprite.width = width;
  16686. sprite.height = height;
  16687. d2Obj.x = d3Pos.x;
  16688. d2Obj.y = d3Pos.y;
  16689. d2Obj.width = width;
  16690. d2Obj.height = height;
  16691. if (type == "box") {
  16692. colli.width = width;
  16693. colli.height = height;
  16694. colli.isSensor = false;
  16695. colli.label = "border";
  16696. }
  16697. else {
  16698. colli.radius = width / 2;
  16699. colli.isSensor = true;
  16700. colli.label = "hole";
  16701. sprite.addComponent(D2Hole);
  16702. }
  16703. }
  16704. }
  16705. class D3World extends Laya.Script3D {
  16706. constructor() {
  16707. super();
  16708. this.loadNum = 0;
  16709. this.setLoadNum = 7;
  16710. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16711. }
  16712. onAwake() {
  16713. }
  16714. loadScene() {
  16715. this.scene = this.owner;
  16716. let url = `res/unityRes/root.lh`;
  16717. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16718. this.scene.addChild(prefab);
  16719. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16720. this.putCameraInfo();
  16721. this.camera.enableHDR = false;
  16722. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16723. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16724. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16725. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16726. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16727. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16728. this.knife.active = false;
  16729. this.loadD3Obj();
  16730. }));
  16731. }
  16732. putCameraInfo() {
  16733. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16734. this.cameraObj = new cameraType();
  16735. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16736. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16737. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16738. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16739. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16740. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16741. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16742. this.visitAngleChild.init();
  16743. this.visitRootObj.posX = this.visitAngleChild.posX;
  16744. this.visitRootObj.posY = this.visitAngleChild.posY;
  16745. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16746. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16747. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16748. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16749. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16750. xGame.common.showOneCamera("mainCamera");
  16751. }
  16752. loadD3Obj() {
  16753. this.loadTable();
  16754. this.loadRoom();
  16755. this.loadInHoleParticial();
  16756. this.loadIceParticial();
  16757. this.loadHitParticial();
  16758. this.loadFireworksParticial();
  16759. this.loadBall();
  16760. }
  16761. loadInHoleParticial() {
  16762. this.loadD3Res("inHoleEft", "", (prefab) => {
  16763. prefab.addComponent(Partical);
  16764. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16765. });
  16766. }
  16767. loadIceParticial() {
  16768. this.loadD3Res("iceEft", "", (prefab) => {
  16769. prefab.addComponent(Partical);
  16770. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16771. });
  16772. }
  16773. loadHitParticial() {
  16774. this.loadD3Res("hitEft", "", (prefab) => {
  16775. prefab.addComponent(Partical);
  16776. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16777. });
  16778. }
  16779. loadFireworksParticial() {
  16780. this.loadD3Res("fireworksEft", "", (prefab) => {
  16781. prefab.addComponent(Partical);
  16782. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16783. });
  16784. }
  16785. loadBall(index = 1) {
  16786. this.loadD3Res("ball", index, (prefab) => {
  16787. this.ballPrefab = prefab;
  16788. this.ballPrefab.addComponent(Ball);
  16789. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16790. });
  16791. }
  16792. loadTable(index = 1) {
  16793. this.loadD3Res("table", index, (prefab) => {
  16794. this.tableSrc = prefab.addComponent(Table);
  16795. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16796. this.d3Hand.init();
  16797. this.tableRoot.addChild(prefab);
  16798. });
  16799. }
  16800. loadRoom(index = 1) {
  16801. this.loadD3Res("room", index, (prefab) => {
  16802. this.roomRoot.addChild(prefab);
  16803. });
  16804. }
  16805. loadD3Res(type, index, callback) {
  16806. let url = `res/unityRes/${type}${index}.lh`;
  16807. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16808. callback && callback(prefab);
  16809. this.checkResLoad();
  16810. }));
  16811. }
  16812. checkResLoad() {
  16813. this.loadNum++;
  16814. if (this.loadNum >= this.setLoadNum) {
  16815. xGame.eventMgr.event(D3RES_LOADED);
  16816. }
  16817. }
  16818. prePlayEft() {
  16819. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16820. eft.transform.localPositionX = 0;
  16821. eft.transform.localPositionY = -5;
  16822. eft.transform.localPositionZ = 0;
  16823. eft.active = true;
  16824. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16825. ice.transform.localPositionX = 0;
  16826. ice.transform.localPositionY = -5;
  16827. ice.transform.localPositionZ = 0;
  16828. ice.active = true;
  16829. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16830. hit.transform.localPositionX = 0;
  16831. hit.transform.localPositionY = -5;
  16832. hit.transform.localPositionZ = 0;
  16833. hit.active = true;
  16834. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16835. fireworks.transform.localPositionX = 0;
  16836. fireworks.transform.localPositionY = -5;
  16837. fireworks.transform.localPositionZ = 0;
  16838. fireworks.active = true;
  16839. }
  16840. }
  16841. class cameraType {
  16842. }
  16843. class MoyuMgr$1 {
  16844. static initMoyu() {
  16845. this.moyuView = new MoyuView$1();
  16846. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16847. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16848. this.moyuView.ui.displayObject.zOrder = 1000;
  16849. this.moyuView.init();
  16850. this.moyuView.showTip(true);
  16851. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16852. window['XApk'] = this;
  16853. }
  16854. static showAge(show) {
  16855. if (this.moyuView)
  16856. this.moyuView.showAge(show);
  16857. }
  16858. static onPlatMsg(idx) {
  16859. if (!MoyuMgr$1.moyuView)
  16860. return;
  16861. if (idx == '0') {
  16862. MoyuMgr$1.moyuView.showTip(false);
  16863. }
  16864. }
  16865. static showAgree(call) {
  16866. if (this.moyuView)
  16867. this.moyuView.showAgree(call);
  16868. else
  16869. call && call();
  16870. }
  16871. static showXy(type = 1) {
  16872. if (this.moyuView)
  16873. this.moyuView.showXy(type);
  16874. }
  16875. }
  16876. MoyuMgr$1.isAdvise = false;
  16877. class MoyuView$1 {
  16878. constructor() {
  16879. this.ysxyNum = 1;
  16880. this.ysJson = null;
  16881. this.ui = ui_UIMoyu.createInstance();
  16882. }
  16883. init() {
  16884. this.ui.mainBg.visible = false;
  16885. this.ui.xyNode.visible = false;
  16886. this.ui.ageNode.visible = false;
  16887. this.ui.tipNode.visible = false;
  16888. this.ui.rnNode.visible = false;
  16889. this.ui.fcmNode.visible = false;
  16890. this.ui.ageTip.visible = false;
  16891. this.ui.msgNode.visible = false;
  16892. this.ui.visible = false;
  16893. this.ui.xyNode.xyList.setVirtual();
  16894. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16895. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16896. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16897. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16898. this.ui.xyNode.btnKnown.visible = false;
  16899. this.ui.xyNode.xy1.visible = false;
  16900. this.ui.xyNode.xy2.visible = false;
  16901. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16902. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16903. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16904. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16905. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16906. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16907. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16908. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16909. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16910. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16911. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16912. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16913. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16914. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16915. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16916. this.ysxyNum = 2;
  16917. }
  16918. }
  16919. onClick(obj) {
  16920. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16921. switch (obj) {
  16922. case this.ui.ageTip:
  16923. if (Moyu.isTTApk) {
  16924. this.ui.ageNode.visible = true;
  16925. this.ui.mainBg.visible = true;
  16926. }
  16927. break;
  16928. case this.ui.tipNode:
  16929. this.showTip(false);
  16930. break;
  16931. case this.ui.ageNode.btnAge:
  16932. this.ui.ageNode.visible = false;
  16933. this.ui.mainBg.visible = false;
  16934. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16935. this.ui.visible = false;
  16936. break;
  16937. case this.ui.xyNode.btnXy3:
  16938. case this.ui.xyNode.btnXy1:
  16939. this.loadXy(1);
  16940. break;
  16941. case this.ui.xyNode.btnXy2:
  16942. this.loadXy(2);
  16943. break;
  16944. case this.ui.xyNode.btnBack:
  16945. this.ui.xyNode.xy1.visible = true;
  16946. this.ui.xyNode.xy2.visible = false;
  16947. break;
  16948. case this.ui.xyNode.btnKnown:
  16949. this.ui.xyNode.visible = false;
  16950. this.ui.mainBg.visible = false;
  16951. this.ui.visible = false;
  16952. break;
  16953. case this.ui.rnNode.btnCheck:
  16954. this.check();
  16955. break;
  16956. case this.ui.rnNode.btnExit:
  16957. case this.ui.xyNode.btnNo:
  16958. this.ysxyNum--;
  16959. if (this.ysxyNum > 0)
  16960. this.showMsg("Refuse to quit the game once again");
  16961. else {
  16962. Moyu.userAgree(false);
  16963. Moyu.exit();
  16964. }
  16965. break;
  16966. case this.ui.xyNode.btnSure:
  16967. case this.ui.xyNode.btnYes:
  16968. DataMgr.userData.isAgree = true;
  16969. DataMgr.saveUserData();
  16970. this.onAgree();
  16971. break;
  16972. case this.ui.rnNode.btnDone:
  16973. this.ui.rnNode.visible = false;
  16974. this.ui.visible = false;
  16975. break;
  16976. case this.ui.fcmNode.btnRn:
  16977. this.showRn();
  16978. break;
  16979. }
  16980. }
  16981. showTip(show) {
  16982. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16983. return;
  16984. if (show) {
  16985. MoyuMgr$1.isAdvise = true;
  16986. this.ui.visible = true;
  16987. this.ui.tipNode.visible = true;
  16988. this.ui.tipNode.alpha = 1;
  16989. Laya.timer.once(1000, this, this.showTip, [false]);
  16990. }
  16991. else {
  16992. this.ui.tipNode.alpha = 1;
  16993. this.ui.tipNode.visible = true;
  16994. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16995. this.ui.tipNode.visible = false;
  16996. MoyuMgr$1.isAdvise = false;
  16997. }), 1000);
  16998. }
  16999. }
  17000. showAge(show, px = 0, py = 0) {
  17001. if (Moyu.platType > 10 && !Moyu.isIos) {
  17002. this.ui.ageTip.x = px;
  17003. this.ui.ageTip.y = py;
  17004. this.ui.ageTip.visible = show;
  17005. if (show)
  17006. this.ui.visible = true;
  17007. }
  17008. }
  17009. showAgree(call) {
  17010. this.agreeCall = call;
  17011. this.onAgree();
  17012. return;
  17013. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  17014. this.showXy(0);
  17015. }
  17016. else
  17017. this.onAgree();
  17018. }
  17019. onAgree() {
  17020. if (!this.ui.ageNode.visible)
  17021. this.ui.visible = false;
  17022. this.ui.xyNode.visible = false;
  17023. Moyu.userAgree(true);
  17024. this.showAge(false);
  17025. this.agreeCall && this.agreeCall();
  17026. this.showRn();
  17027. }
  17028. showMsg(txt) {
  17029. this.ui.msgNode.txtMsg.text = txt;
  17030. this.ui.msgNode.visible = true;
  17031. this.ui.msgNode.alpha = 1;
  17032. this.ui.visible = true;
  17033. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17034. this.ui.msgNode.visible = false;
  17035. }), 2500, true);
  17036. }
  17037. showRn() {
  17038. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17039. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17040. this.ui.rnNode.rn1.visible = true;
  17041. this.ui.rnNode.rn2.visible = false;
  17042. this.ui.rnNode.rn3.visible = false;
  17043. this.ui.rnNode.rn4.visible = false;
  17044. this.ui.rnNode.visible = true;
  17045. this.ui.mainBg.visible = true;
  17046. this.ui.rnNode.btnDone.visible = false;
  17047. this.ui.rnNode.btnExit.visible = true;
  17048. this.ui.rnNode.btnCheck.visible = true;
  17049. this.ui.fcmNode.visible = false;
  17050. this.ui.visible = true;
  17051. return;
  17052. }
  17053. }
  17054. this.showFcm();
  17055. }
  17056. showFcm() {
  17057. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17058. Moyu.initFCM(true);
  17059. if (Moyu.gameTime < 1)
  17060. this.fcmLoop();
  17061. else if (Moyu.gameTime < 999)
  17062. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17063. }
  17064. }
  17065. fcmLoop() {
  17066. if (Moyu.gameTime < 1) {
  17067. this.ui.rnNode.visible = false;
  17068. this.ui.fcmNode.visible = true;
  17069. this.ui.mainBg.visible = true;
  17070. this.ui.visible = true;
  17071. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17072. Laya.timer.clear(this.ui, this.fcmLoop);
  17073. }
  17074. }
  17075. check() {
  17076. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  17077. this.ui.rnNode.rn1.visible = false;
  17078. this.ui.rnNode.rn2.visible = false;
  17079. this.ui.rnNode.rn4.visible = true;
  17080. }
  17081. else if (this.ui.rnNode.rn4.visible) {
  17082. let name = this.ui.rnNode.inputName.text;
  17083. let code = this.ui.rnNode.inputCode.text;
  17084. if (code && code.length == 18) {
  17085. this.ui.rnNode.rn1.visible = false;
  17086. this.ui.rnNode.rn4.visible = false;
  17087. Moyu.authenticate(name, code, (res) => {
  17088. this.ui.rnNode.rn2.visible = !res;
  17089. this.ui.rnNode.rn3.visible = res;
  17090. this.ui.rnNode.btnDone.visible = res;
  17091. this.ui.rnNode.btnExit.visible = !res;
  17092. this.ui.rnNode.btnCheck.visible = !res;
  17093. if (res)
  17094. this.showFcm();
  17095. });
  17096. }
  17097. else
  17098. this.showMsg("信息填写不完整");
  17099. }
  17100. }
  17101. loadXy(type = 0) {
  17102. this.ui.xyNode.xy1.visible = false;
  17103. this.ui.xyNode.xy2.visible = true;
  17104. this.ui.xyNode.xyList.scrollToView(0);
  17105. if (type == 1) {
  17106. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  17107. }
  17108. else if (type == 2) {
  17109. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  17110. }
  17111. }
  17112. showXy(type = 0) {
  17113. this.xyBtn();
  17114. if (type == 0) {
  17115. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  17116. this.ui.xyNode.btnSure.visible = true;
  17117. }
  17118. else {
  17119. this.ui.xyNode.btnYes.visible = true;
  17120. this.ui.xyNode.btnNo.visible = true;
  17121. }
  17122. }
  17123. else {
  17124. this.ui.xyNode.btnKnown.visible = true;
  17125. this.ui.mainBg.visible = true;
  17126. }
  17127. this.ui.xyNode.xy1.visible = true;
  17128. this.ui.xyNode.xy2.visible = false;
  17129. this.ui.xyNode.visible = true;
  17130. this.ui.visible = true;
  17131. }
  17132. xyBtn() {
  17133. this.ui.xyNode.btnSure.visible = false;
  17134. this.ui.xyNode.btnYes.visible = false;
  17135. this.ui.xyNode.btnNo.visible = false;
  17136. this.ui.xyNode.btnKnown.visible = false;
  17137. {
  17138. this.ui.xyNode.btnXy3.visible = false;
  17139. this.ui.xyNode.btnXy2.visible = true;
  17140. this.ui.xyNode.btnXy1.visible = true;
  17141. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  17142. }
  17143. }
  17144. createXY(json) {
  17145. this.ysJson = json.content;
  17146. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  17147. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  17148. this.ui.xyNode.xy2.visible = true;
  17149. }
  17150. renderListItem(idx, cell) {
  17151. let xy = this.ysJson[idx];
  17152. cell.height = xy.line * 30;
  17153. cell.xyItem.text = xy.text;
  17154. }
  17155. onDestroy() {
  17156. this.agreeCall = null;
  17157. }
  17158. }
  17159. class UILoading extends UIBase {
  17160. constructor() {
  17161. super();
  17162. this.accTime = 0;
  17163. this.curNum = 0;
  17164. this.rate = 1;
  17165. this.loadSubOk = false;
  17166. this.loadResOK = false;
  17167. this.openLoading = true;
  17168. this.beginLoadRes = false;
  17169. this.finishD2 = false;
  17170. this.finishD3 = false;
  17171. }
  17172. onConstructor() {
  17173. this.ui = ui_UILoading.createInstance();
  17174. this.contentPane = this.ui;
  17175. this.isEject = false;
  17176. this._initUI();
  17177. this._addEvent();
  17178. }
  17179. _initUI() {
  17180. MoyuMgr$1.initMoyu();
  17181. }
  17182. _addEvent() {
  17183. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17184. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17185. }
  17186. show() {
  17187. super.show();
  17188. console.log('zh:加载分包资源');
  17189. loadSubRes(this.subResProgress.bind(this));
  17190. this.ui.txtLoad.text = "Loading...";
  17191. }
  17192. subResProgress(pro, finish) {
  17193. this.curNum = pro;
  17194. if (finish) {
  17195. this.curNum = 1;
  17196. this.loadSubOk = true;
  17197. }
  17198. }
  17199. laodD3Res() {
  17200. let scene3D = new Laya.Scene3D();
  17201. xGame.common.d3Scene = scene3D;
  17202. xGame.common.d3World = scene3D.addComponent(D3World);
  17203. xGame.common.d3World.loadScene();
  17204. }
  17205. loadD2Res() {
  17206. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17207. this.finishD2 = true;
  17208. this.checkLoadAll();
  17209. this.curNum = 1;
  17210. }), Laya.Handler.create(this, (pro) => {
  17211. this.curNum = pro;
  17212. }, null, false));
  17213. }
  17214. d3ResFinish() {
  17215. this.finishD3 = true;
  17216. this.checkLoadAll();
  17217. }
  17218. checkLoadAll() {
  17219. if (this.finishD2 && this.finishD3) {
  17220. this.loadResOK = true;
  17221. }
  17222. }
  17223. loadRes() {
  17224. this.laodD3Res();
  17225. this.loadD2Res();
  17226. }
  17227. myUpdate(dt) {
  17228. if (!this.openLoading)
  17229. return;
  17230. this.accTime += dt * this.rate;
  17231. if (this.accTime >= this.curNum)
  17232. this.accTime = this.curNum;
  17233. this.ui.loadinfo.value = this.accTime * 100;
  17234. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17235. if (!this.beginLoadRes) {
  17236. this.beginLoadRes = true;
  17237. this.ui.txtLoad.text = "Loading...";
  17238. this.curNum = 0;
  17239. this.accTime = 0;
  17240. this.loadRes();
  17241. }
  17242. if (this.loadResOK) {
  17243. this.openLoading = false;
  17244. Laya.timer.once(300, this, () => {
  17245. xGame.common.d3Scene.active = false;
  17246. MoyuMgr$1.showAgree(enterGame);
  17247. });
  17248. }
  17249. }
  17250. }
  17251. release() {
  17252. }
  17253. hide() {
  17254. super.hide();
  17255. this.release();
  17256. }
  17257. onClose() {
  17258. this.hide();
  17259. }
  17260. }
  17261. UILoading.uiName = "UILoading";
  17262. class UIRepentProp$1 extends UIBase {
  17263. constructor() {
  17264. super();
  17265. this.viewType = 0;
  17266. this.regretType = 0;
  17267. }
  17268. onConstructor() {
  17269. this.ui = ui_UIRepentProp.createInstance();
  17270. this.contentPane = this.ui;
  17271. this.isEject = false;
  17272. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17273. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17274. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17275. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17276. }
  17277. show(viewType, regretType, callback) {
  17278. PlatMgr.showInsert(true);
  17279. this.viewType = viewType;
  17280. this.regretType = regretType;
  17281. this.callback = callback;
  17282. super.show();
  17283. this.ui.t0.play();
  17284. this.ui.c1.selectedIndex = this.viewType;
  17285. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17286. if (this.viewType == 0) {
  17287. let guide = DataMgr.getGuideHelpLine();
  17288. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17289. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17290. }
  17291. xGame.common.gameMgr.gamePause = true;
  17292. }
  17293. hideSelf() {
  17294. xGame.common.gameMgr.gamePause = false;
  17295. this.callback && this.callback(false);
  17296. this.hide();
  17297. }
  17298. videoRegret() {
  17299. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  17300. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  17301. }
  17302. else {
  17303. console.log('zh:AD 失败,直接发放奖励');
  17304. this.qjff_AD_for_UIrepentProp_videoRegret();
  17305. }
  17306. }
  17307. qjff_AD_for_UIrepentProp_videoRegret() {
  17308. this.callback && this.callback(true);
  17309. this.hideSelf();
  17310. }
  17311. videoAddHelpLine() {
  17312. let guide = DataMgr.getGuideHelpLine();
  17313. if (guide == 0) {
  17314. this.callback && this.callback(true);
  17315. this.hideSelf();
  17316. DataMgr.setGuideHelpLine();
  17317. xGame.common.gameUI.ui.guideNode.visible = false;
  17318. }
  17319. else {
  17320. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  17321. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  17322. }
  17323. else {
  17324. console.log('zh:AD 失败,直接发放奖励');
  17325. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  17326. }
  17327. }
  17328. }
  17329. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  17330. this.callback && this.callback(true);
  17331. this.hideSelf();
  17332. }
  17333. }
  17334. UIRepentProp$1.uiName = "UIRepentProp";
  17335. class UIRodMethod$1 extends UIBase {
  17336. constructor() {
  17337. super();
  17338. this.isPressd = false;
  17339. }
  17340. onConstructor() {
  17341. this.ui = ui_UIRodMethod.createInstance();
  17342. this.contentPane = this.ui;
  17343. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17344. this.moveDir = new Laya.Vector2();
  17345. this.moveDest = new Laya.Vector2();
  17346. this.centerPos = new Laya.Vector2();
  17347. xGame.common.uiRodMethod = this;
  17348. }
  17349. show() {
  17350. super.show();
  17351. xGame.common.gameMgr.gamePause = true;
  17352. this.openPressDotEvent();
  17353. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17354. this.centerPos.x = this.ui.white.x;
  17355. this.centerPos.y = this.ui.white.y;
  17356. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17357. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17358. this.setDot();
  17359. }
  17360. setDot() {
  17361. this.ui.dot.x = this.moveDest.x;
  17362. this.ui.dot.y = this.moveDest.y;
  17363. }
  17364. closeSelf() {
  17365. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17366. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17367. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17368. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17369. xGame.common.gameMgr.gamePause = false;
  17370. this.hide();
  17371. }
  17372. openPressDotEvent() {
  17373. this.closePressDotEvent();
  17374. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17375. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17376. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17377. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17378. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17379. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17380. }
  17381. closePressDotEvent() {
  17382. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17383. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17384. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17385. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17386. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17387. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17388. }
  17389. onDown(e) {
  17390. if (e.type == Laya.Event.MOUSE_DOWN)
  17391. this.isPressd = true;
  17392. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17393. this.isPressd = false;
  17394. if (!this.isPressd)
  17395. return;
  17396. this.moveDest.x = e.stageX;
  17397. this.moveDest.y = e.stageY;
  17398. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17399. if (dis > 6724) {
  17400. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17401. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17402. }
  17403. this.setDot();
  17404. }
  17405. resetRod() {
  17406. this.ui.dot.x = this.ui.white.x;
  17407. this.ui.dot.y = this.ui.white.y;
  17408. this.gameRod.dot.x = this.gameRod.bg.x;
  17409. this.gameRod.dot.y = this.gameRod.bg.y;
  17410. xGame.common.rodOffest.x = 0;
  17411. xGame.common.rodOffest.y = 0;
  17412. }
  17413. }
  17414. UIRodMethod$1.uiName = "UIRodMethod";
  17415. class UIMsg$1 extends UIBase {
  17416. constructor() {
  17417. super();
  17418. }
  17419. onConstructor() {
  17420. this.ui = ui_UIMsg.createInstance();
  17421. this.contentPane = this.ui;
  17422. this.isEject = false;
  17423. this.isMuti = true;
  17424. }
  17425. show(msg, callback) {
  17426. super.show();
  17427. this.ui.tipsNode.msgTxt.text = msg;
  17428. this.ui.alpha = 1;
  17429. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17430. this.hide();
  17431. callback && callback();
  17432. }), 1000);
  17433. }
  17434. }
  17435. UIMsg$1.uiName = "UIMsg";
  17436. class UITips$1 extends UIBase {
  17437. constructor() {
  17438. super();
  17439. this.type = 0;
  17440. }
  17441. onConstructor() {
  17442. this.ui = ui_UITips.createInstance();
  17443. this.contentPane = this.ui;
  17444. this.isEject = false;
  17445. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17446. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17447. }
  17448. show(tipsTxt, womanTxt, type) {
  17449. super.show();
  17450. this.ui.t0.play();
  17451. this.ui.myNode.tipsTxt.text = tipsTxt;
  17452. this.ui.myNode.womanTxt.text = womanTxt;
  17453. PlatMgr.showInsert(true);
  17454. this.ui.myNode.c1.selectedIndex = type;
  17455. this.type = type;
  17456. switch (this.type) {
  17457. case TipsType.exitGame:
  17458. xGame.common.gameMgr.gamePause = true;
  17459. break;
  17460. case TipsType.foul:
  17461. Laya.timer.once(200, this, () => {
  17462. xGame.common.gameMgr.gamePause = true;
  17463. });
  17464. break;
  17465. default:
  17466. break;
  17467. }
  17468. }
  17469. clickLeftBtn() {
  17470. this.hide();
  17471. xGame.common.gameMgr.gamePause = false;
  17472. switch (this.type) {
  17473. case TipsType.exitGame:
  17474. break;
  17475. case TipsType.foul:
  17476. break;
  17477. default:
  17478. break;
  17479. }
  17480. }
  17481. clickRightBtn() {
  17482. this.hide();
  17483. switch (this.type) {
  17484. case TipsType.exitGame:
  17485. xGame.eventMgr.event(RESET_GAME);
  17486. xGame.uiMgr.Show(UIMain$1);
  17487. Moyu.recordEnd(this, null);
  17488. xGame.common.longHelpLine = false;
  17489. break;
  17490. case TipsType.foul:
  17491. xGame.common.gameMgr.gamePause = false;
  17492. Laya.timer.clearAll(this);
  17493. break;
  17494. default:
  17495. break;
  17496. }
  17497. }
  17498. }
  17499. UITips$1.uiName = "UITips";
  17500. class UIGame$1 extends UIBase {
  17501. constructor() {
  17502. super();
  17503. this.powerNum = 0;
  17504. this.isD3Inited = false;
  17505. this.isPrePlay = false;
  17506. this.isMoveRod = false;
  17507. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17508. this.rulerDis = 20;
  17509. this.rulerOffset = 0;
  17510. }
  17511. onConstructor() {
  17512. this.ui = ui_UIGame.createInstance();
  17513. this.contentPane = this.ui;
  17514. this.ui.x += xGame.common.sysOffestNum;
  17515. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17516. this.isEject = false;
  17517. xGame.common.gameUI = this;
  17518. this.initSelf();
  17519. }
  17520. isTurnSelf() {
  17521. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17522. return true;
  17523. }
  17524. }
  17525. initSelf() {
  17526. let topUI = this.ui.topNode;
  17527. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17528. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17529. this.barInfo = {};
  17530. this.barInfo.curY = 0;
  17531. this.barInfo.height = this.ui.powerNode.height;
  17532. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17533. this.barInfo.powerStartY = this.ui.powerNode.y;
  17534. xGame.common.aiPlayer = new AIPlayer();
  17535. xGame.common.gameMgr = new GameMgr();
  17536. xGame.common.skillMgr = new SkillMgr();
  17537. xGame.common.wordsMgr = new WordsMgr();
  17538. xGame.common.talkMgr = new TalkMgr();
  17539. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17540. console.log("加载经典模式表情文件chenggon !");
  17541. });
  17542. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17543. console.log("挑战模式奖励模式spine加载成功!");
  17544. });
  17545. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17546. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17547. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17548. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17549. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17550. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17551. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17552. }
  17553. getGanZiImg() {
  17554. let index = DataMgr.getCurBallRod();
  17555. let data = cfgTable.ballrodData[index + 1];
  17556. let gan_url = xGame.common.getGameIconUrl(data.img);
  17557. console.log('zh:getGanZiImg gan_url==' + gan_url);
  17558. this.ui.powerNode.showImg.url = gan_url;
  17559. console.log('zh:修改杆子图标O K');
  17560. }
  17561. returnHome() {
  17562. let tips = "Are you sure to exit the game?";
  17563. let woman = "Boss, why don't you play for a while longer?";
  17564. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17565. }
  17566. addRodMethodClick() {
  17567. if (this.isTurnSelf()) {
  17568. xGame.uiMgr.Show(UIRodMethod$1);
  17569. }
  17570. }
  17571. clickHelpLineBtn(force = false) {
  17572. if (!this.isTurnSelf())
  17573. return;
  17574. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17575. if (success) {
  17576. xGame.common.longHelpLine = true;
  17577. xGame.common.d2World.getHelpLine();
  17578. Moyu.sendDataEvent("guideNum");
  17579. }
  17580. else {
  17581. }
  17582. });
  17583. }
  17584. renderSelfDisplayBalls(index, target) {
  17585. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17586. target.myImg.url = xGame.common.getGameIconUrl(str);
  17587. }
  17588. renderAIDisplayBalls(index, target) {
  17589. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17590. target.myImg.url = xGame.common.getGameIconUrl(str);
  17591. ;
  17592. }
  17593. updateMode() {
  17594. if (xGame.common.gameMode == GameMode.classic) {
  17595. this.ui.topNode.scoreNode.visible = false;
  17596. }
  17597. else if (xGame.common.gameMode == GameMode.bigMove) {
  17598. this.ui.topNode.scoreNode.visible = true;
  17599. }
  17600. }
  17601. show() {
  17602. super.show();
  17603. console.log("zh:uigame show AADD");
  17604. this.ui.alpha = 0;
  17605. this.updateSelf();
  17606. xGame.common.gameMgr.gamePause = false;
  17607. xGame.common.gameUI.ui.blackAni.visible = false;
  17608. xGame.common.gameUI.ui.whiteAni.visible = false;
  17609. this.ui.powerEft.visible = false;
  17610. this.ui.colorNode.visible = false;
  17611. this.updateHead();
  17612. let curUse = DataMgr.getCurBallRod();
  17613. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  17614. this.getGanZiImg();
  17615. }
  17616. updateSelf() {
  17617. if (xGame.common.gameMode == GameMode.classic) {
  17618. this.ui.c1.selectedIndex = 0;
  17619. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17620. this.ui.topNode.middleNode.visible = true;
  17621. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17622. }
  17623. else if (xGame.common.gameMode == GameMode.bigMove) {
  17624. this.ui.c1.selectedIndex = 0;
  17625. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17626. this.ui.topNode.middleNode.visible = false;
  17627. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17628. let rand = xGame.common.randomNum(1, max);
  17629. let guide = DataMgr.getSkillGuide();
  17630. if (guide == 0)
  17631. rand = 1;
  17632. xGame.common.bigMoveLevelIndex = rand;
  17633. }
  17634. else if (xGame.common.gameMode == GameMode.placeBall) {
  17635. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17636. this.ui.c1.selectedIndex = 1 + data.type;
  17637. this.ui.alpha = 1;
  17638. this.startGame();
  17639. }
  17640. this.updateMode();
  17641. this.initD3world();
  17642. this.initD2world();
  17643. }
  17644. startGame() {
  17645. this.ui.snowNode.visible = Math.random() <= 0.1;
  17646. this.ui.d2Node.visible = false;
  17647. xGame.common.d3World.d3Hand.gameObj.active = false;
  17648. xGame.common.d3World.tableSrc.init();
  17649. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17650. this.cameraViewChange(() => {
  17651. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17652. switch (xGame.common.gameMode) {
  17653. case GameMode.classic:
  17654. xGame.common.d3World.d3Hand.gameObj.active = true;
  17655. this.playPutBallD3Ani();
  17656. break;
  17657. case GameMode.bigMove:
  17658. this.enterGame();
  17659. Laya.timer.once(500, this, () => {
  17660. this.ui.topNode.middleNode.visible = true;
  17661. this.ui.topNode.middleNode.t0.play();
  17662. });
  17663. break;
  17664. case GameMode.placeBall:
  17665. this.enterGame();
  17666. break;
  17667. default:
  17668. break;
  17669. }
  17670. });
  17671. PlatMgr.showBanner(false);
  17672. }
  17673. enterGame() {
  17674. this.ui.d2Node.visible = true;
  17675. xGame.common.d3World.d3Hand.gameObj.active = false;
  17676. xGame.common.showOneCamera("mainCamera");
  17677. Moyu.recordGame(30, true);
  17678. if (!this.isPrePlay) {
  17679. this.isPrePlay = true;
  17680. xGame.common.d3World.prePlayEft();
  17681. }
  17682. xGame.common.gameMgr.gameReady();
  17683. this.openAllEvent();
  17684. this.ui.snowNode.visible = false;
  17685. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17686. this.ui.helpBtn.visible = condition;
  17687. }
  17688. showHelpLineGuide() {
  17689. let longGuide = DataMgr.getGuideHelpLine();
  17690. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17691. this.ui.helpBtn.visible = true;
  17692. this.ui.guideNode.visible = true;
  17693. }
  17694. }
  17695. setTurnAlpha(alpha) {
  17696. this.ui.keduNode.alpha = alpha;
  17697. this.ui.ganNode.alpha = alpha;
  17698. this.ui.rodMethodNode.alpha = alpha;
  17699. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17700. }
  17701. cameraViewChange(callback) {
  17702. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17703. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17704. xGame.common.showOneCamera("visitAngle");
  17705. cameraSrc.localRotationEulerY = 180;
  17706. cameraSrc.localRotationEulerZ = 0;
  17707. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17708. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17709. callback && callback();
  17710. }));
  17711. }));
  17712. }
  17713. playPutBallD3Ani() {
  17714. xGame.common.showOneCamera("mainCamera");
  17715. let handSrc = xGame.common.d3World.d3Hand;
  17716. handSrc.gameObj.active = true;
  17717. handSrc.transform.localPositionZ = 3;
  17718. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17719. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17720. handSrc.gameObj.active = false;
  17721. this.enterGame();
  17722. }), 400);
  17723. }));
  17724. }
  17725. updateHead() {
  17726. let user = Moyu.getUserInfo();
  17727. this.ui.topNode.selfNameTxt.text = user.nickName;
  17728. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17729. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17730. if (DataMgr.getSkillGuide() < 1) {
  17731. this.ui.topNode.aiNameTxt.text = 'billiards';
  17732. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17733. }
  17734. else {
  17735. this.ui.topNode.aiNameTxt.text = aiData.name;
  17736. let randNo = Math.floor(Math.random() * 10) + 1;
  17737. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17738. }
  17739. }
  17740. initD2world() {
  17741. let node = this.ui.d2Root.displayObject;
  17742. let src = node.getComponent(D2World);
  17743. if (!src) {
  17744. xGame.common.d2World = node.addComponent(D2World);
  17745. }
  17746. xGame.common.d2World.initSelf();
  17747. }
  17748. initD3world() {
  17749. if (this.isD3Inited)
  17750. return;
  17751. this.isD3Inited = true;
  17752. let scene3D = xGame.common.d3Scene;
  17753. this.ui.d3Root.displayObject.addChild(scene3D);
  17754. scene3D.active = true;
  17755. xGame.common.d3World.tableSrc.setBorderPos();
  17756. }
  17757. onRootMove(e) {
  17758. let rootBall = xGame.common.d2World.rootBall;
  17759. this.ui.moveNode.x = e.x;
  17760. this.ui.moveNode.y = e.y;
  17761. rootBall.gameObj.x = e.x;
  17762. rootBall.gameObj.y = e.y;
  17763. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17764. }
  17765. aiRootMove(move) {
  17766. if (move)
  17767. this.hideBallUI();
  17768. else {
  17769. this.showBallUI();
  17770. xGame.common.d2World.getHelpLine();
  17771. }
  17772. }
  17773. aiForce(type, force = 0) {
  17774. this.pressTarget = PressType.powerNode;
  17775. if (type == 1)
  17776. this.onEventUp({ force: true });
  17777. else if (type == 2)
  17778. this.onEventMove({ stageY: force, force: true });
  17779. }
  17780. onEventPress(e) {
  17781. if (e.stopPropagation)
  17782. e.stopPropagation();
  17783. if (!this.isTurnSelf())
  17784. return;
  17785. let target = e.target;
  17786. switch (target) {
  17787. case this.ui.myPowerNode.displayObject:
  17788. this.pressTarget = PressType.powerNode;
  17789. this.barInfo.curY = e.stageY;
  17790. this.updateBarInfo();
  17791. break;
  17792. case this.ui.moveNode.displayObject:
  17793. this.pressTarget = PressType.moveNode;
  17794. this.hideBallUI();
  17795. this.eventObj.curX = this.ui.moveNode.x;
  17796. this.eventObj.curY = this.ui.moveNode.y;
  17797. this.ui.moveNode.finger.visible = false;
  17798. this.eventObj.lastX = e.stageX;
  17799. this.eventObj.lastY = e.stageY;
  17800. break;
  17801. case this.ui.rulerClickNode.displayObject:
  17802. this.pressTarget = PressType.rulerNode;
  17803. this.eventObj.lastY = e.stageY;
  17804. break;
  17805. case this.ui.d2Root.displayObject:
  17806. this.pressTarget = PressType.d2Root;
  17807. this.eventObj.lastX = e.stageX;
  17808. this.eventObj.lastY = e.stageY;
  17809. this.eventObj.starX = e.stageX;
  17810. this.eventObj.starY = e.stageY;
  17811. this.eventObj.curX = 0;
  17812. this.eventObj.curY = 0;
  17813. xGame.common.d2World.d2Gan.setGanLastInfo();
  17814. this.rulerOffset = 0;
  17815. break;
  17816. default:
  17817. break;
  17818. }
  17819. }
  17820. onEventMove(e) {
  17821. if (e.stopPropagation)
  17822. e.stopPropagation();
  17823. if (e && e.force) {
  17824. }
  17825. else {
  17826. if (!this.isTurnSelf())
  17827. return;
  17828. }
  17829. switch (this.pressTarget) {
  17830. case PressType.powerNode:
  17831. this.barInfo.curY = e.stageY;
  17832. this.updateBarInfo();
  17833. this.isMoveRod = true;
  17834. break;
  17835. case PressType.moveNode:
  17836. let rootBall = xGame.common.d2World.rootBall;
  17837. let radius = rootBall.gameObj.width / 2;
  17838. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17839. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17840. let border = xGame.common.d2World.borderRect;
  17841. if (curX <= border.x + radius)
  17842. curX = border.x + radius;
  17843. else if (curX >= border.x + border.width - radius)
  17844. curX = border.x + border.width - radius;
  17845. if (curY <= border.y + radius)
  17846. curY = border.y + radius;
  17847. else if (curY >= border.y + border.height - radius)
  17848. curY = border.y + border.height - radius;
  17849. if (xGame.common.gameMgr.isOpenBall) {
  17850. if (curX >= border.x + border.openBallW - radius)
  17851. curX = border.x + border.openBallW - radius;
  17852. }
  17853. this.ui.moveNode.x = curX;
  17854. this.ui.moveNode.y = curY;
  17855. rootBall.gameObj.x = curX;
  17856. rootBall.gameObj.y = curY;
  17857. rootBall.d3BallSrc.setTransPos(curX, curY);
  17858. this.isMoveRod = true;
  17859. break;
  17860. case PressType.rulerNode:
  17861. let yy = e.stageY - this.eventObj.lastY;
  17862. this.eventObj.lastY = e.stageY;
  17863. let ruler1 = this.ui.rulerNode.img1;
  17864. let ruler2 = this.ui.rulerNode.img2;
  17865. ruler1.y += yy;
  17866. ruler2.y += yy;
  17867. this.rulerOffset += yy;
  17868. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17869. this.rulerOffset = 0;
  17870. xGame.soundMgr.playSound("inch", 1, 10);
  17871. }
  17872. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17873. let h = ruler1.height;
  17874. this.checkGuide();
  17875. this.isMoveRod = true;
  17876. if (ruler1.y >= h) {
  17877. ruler1.y = -h;
  17878. ruler2.y = 0;
  17879. return;
  17880. }
  17881. else if (ruler1.y <= -h) {
  17882. ruler1.y = h;
  17883. ruler2.y = 0;
  17884. return;
  17885. }
  17886. if (ruler2.y >= h) {
  17887. ruler2.y = -h;
  17888. ruler1.y = 0;
  17889. return;
  17890. }
  17891. else if (ruler2.y <= -h) {
  17892. ruler2.y = h;
  17893. ruler1.y = 0;
  17894. return;
  17895. }
  17896. break;
  17897. case PressType.d2Root:
  17898. this.eventObj.curX = e.stageX;
  17899. this.eventObj.curY = e.stageY;
  17900. let offset = this.checkRodMoveDir();
  17901. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17902. this.eventObj.lastX = e.stageX;
  17903. this.eventObj.lastY = e.stageY;
  17904. break;
  17905. default:
  17906. break;
  17907. }
  17908. }
  17909. onEventUp(e) {
  17910. if (e.stopPropagation)
  17911. e.stopPropagation();
  17912. if (e && e.force) {
  17913. }
  17914. else {
  17915. if (!this.isTurnSelf())
  17916. return;
  17917. }
  17918. switch (this.pressTarget) {
  17919. case PressType.powerNode:
  17920. this.ui.powerNode.value = 0;
  17921. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17922. this.ui.powerTxt.text = "";
  17923. if (this.powerNum > 0) {
  17924. xGame.eventMgr.event(BALL_SHOOT);
  17925. xGame.common.d2World.shoot(this.powerNum);
  17926. xGame.common.d2World.d2Gan.shoot();
  17927. xGame.common.d2World.d2HelpLine.shoot();
  17928. this.finishGuide();
  17929. this.ui.powerEft.visible = false;
  17930. this.ui.colorNode.visible = false;
  17931. let ganStr = "";
  17932. if (this.powerNum <= 30) {
  17933. ganStr = "gan_30";
  17934. }
  17935. else if (this.powerNum <= 60) {
  17936. ganStr = "gan_50";
  17937. }
  17938. else {
  17939. ganStr = "gan_80";
  17940. }
  17941. xGame.soundMgr.playSound(ganStr);
  17942. }
  17943. break;
  17944. case PressType.moveNode:
  17945. let rootBall = xGame.common.d2World.rootBall;
  17946. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17947. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17948. let isIntersect = this.judgeBallIntersect();
  17949. if (isIntersect) {
  17950. this.ui.moveNode.x = lastX;
  17951. this.ui.moveNode.y = lastY;
  17952. rootBall.gameObj.x = lastX;
  17953. rootBall.gameObj.y = lastY;
  17954. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17955. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17956. }
  17957. else {
  17958. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17959. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17960. }
  17961. this.showBallUI();
  17962. this.ui.moveNode.finger.visible = true;
  17963. xGame.common.d2World.getHelpLine();
  17964. break;
  17965. case PressType.rulerNode:
  17966. break;
  17967. case PressType.d2Root:
  17968. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17969. if (dis <= 25) {
  17970. this.moveToClickDot(e);
  17971. }
  17972. break;
  17973. default:
  17974. break;
  17975. }
  17976. this.pressTarget = -1;
  17977. }
  17978. checkGuide() {
  17979. let guide = DataMgr.getSkillGuide();
  17980. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17981. xGame.common.guideStep++;
  17982. xGame.common.gameUI.ui.guide2.visible = false;
  17983. xGame.common.gameUI.ui.guide3.visible = true;
  17984. }
  17985. }
  17986. finishGuide() {
  17987. let guide = DataMgr.getSkillGuide();
  17988. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17989. xGame.common.guideStep = 10;
  17990. this.closeAllGuide();
  17991. }
  17992. }
  17993. closeAllGuide() {
  17994. xGame.common.gameUI.ui.guide1.visible = false;
  17995. xGame.common.gameUI.ui.guide2.visible = false;
  17996. xGame.common.gameUI.ui.guide3.visible = false;
  17997. }
  17998. updateBarInfo() {
  17999. let star = this.ui.powerNode.y;
  18000. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  18001. if (rate >= 1)
  18002. rate = 1;
  18003. if (rate <= 0)
  18004. rate = 0;
  18005. this.powerNum = Math.ceil(rate * 100);
  18006. this.ui.powerNode.value = this.powerNum;
  18007. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  18008. this.ui.colorNode.value = this.powerNum;
  18009. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  18010. this.ui.powerEft.visible = this.powerNum != 0;
  18011. this.ui.colorNode.visible = this.powerNum != 0;
  18012. this.ui.powerTxt.text = this.powerNum + "";
  18013. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  18014. }
  18015. forceCancel() {
  18016. this.ui.powerNode.value = 0;
  18017. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18018. this.ui.powerTxt.text = "";
  18019. }
  18020. checkRodMoveDir() {
  18021. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  18022. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18023. if (tempX >= 0 && tempY <= 0) {
  18024. return this.checkDir();
  18025. }
  18026. else if (tempX < 0 && tempY < 0) {
  18027. return this.checkDir(1, -1);
  18028. }
  18029. else if (tempX < 0 && tempY > 0) {
  18030. return this.checkDir(-1, -1);
  18031. }
  18032. else {
  18033. return this.checkDir(-1, 1);
  18034. }
  18035. }
  18036. checkDir(flagX = 1, flagY = 1) {
  18037. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18038. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18039. if (offsetY == 0) {
  18040. return offsetX * flagX;
  18041. }
  18042. if (offsetX == 0) {
  18043. return offsetY * flagY;
  18044. }
  18045. let angle = offsetY / offsetX;
  18046. if (Math.abs(angle) >= 1) {
  18047. return offsetY * flagY;
  18048. }
  18049. else {
  18050. return offsetX * flagX;
  18051. }
  18052. }
  18053. judgeBallIntersect() {
  18054. let rootBall = xGame.common.d2World.rootBall;
  18055. let ballArr = xGame.common.d2World.ballArr;
  18056. let radius = rootBall.gameObj.width / 2;
  18057. let temp;
  18058. let isIntersect = false;
  18059. for (let index = 0; index < ballArr.length; index++) {
  18060. temp = ballArr[index];
  18061. if (temp.number == rootBall.number)
  18062. continue;
  18063. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18064. if (isIntersect) {
  18065. break;
  18066. }
  18067. }
  18068. return isIntersect;
  18069. }
  18070. hideBallUI() {
  18071. let d2Gan = xGame.common.d2World.d2Gan;
  18072. if (!d2Gan.ui.isDisposed)
  18073. d2Gan.ui.visible = false;
  18074. let d2Help = xGame.common.d2World.d2HelpLine;
  18075. if (!d2Help.ui.isDisposed)
  18076. d2Help.ui.visible = false;
  18077. let rootBall = xGame.common.d2World.rootBall;
  18078. if (!rootBall.destroyed) {
  18079. rootBall.gameObj.active = false;
  18080. }
  18081. }
  18082. showBallUI() {
  18083. let d2Gan = xGame.common.d2World.d2Gan;
  18084. if (!d2Gan.ui.isDisposed)
  18085. d2Gan.ui.visible = true;
  18086. let d2Help = xGame.common.d2World.d2HelpLine;
  18087. if (!d2Help.ui.isDisposed)
  18088. d2Help.ui.visible = true;
  18089. let rootBall = xGame.common.d2World.rootBall;
  18090. if (!rootBall.destroyed) {
  18091. rootBall.gameObj.active = true;
  18092. }
  18093. }
  18094. moveToClickDot(e) {
  18095. if (!this.isMoveRod && !xGame.common.clickedBall) {
  18096. let root = xGame.common.d2World.rootBall.gameObj;
  18097. let xx = e.stageX - xGame.common.sysOffestNum;
  18098. let yy = e.stageY;
  18099. let x = xx - root.x;
  18100. let y = yy - root.y;
  18101. let angle = xGame.common.getfguiRotation(x, y);
  18102. xGame.common.d2World.d2Gan.ui.rotation = angle;
  18103. xGame.common.d2World.getHelpLine();
  18104. }
  18105. this.isMoveRod = false;
  18106. xGame.common.clickedBall = false;
  18107. }
  18108. openAllEvent() {
  18109. this.closeAllEvent();
  18110. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18111. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18112. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18113. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18114. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18115. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18116. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18117. }
  18118. closeAllEvent() {
  18119. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18120. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18121. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18122. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18123. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18124. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18125. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18126. }
  18127. resetGame() {
  18128. this.closeAllEvent();
  18129. this.hideBallUI();
  18130. xGame.common.gameMgr.gamePause = true;
  18131. }
  18132. }
  18133. UIGame$1.uiName = "UIGame";
  18134. class UIAddCoin$1 extends UIBase {
  18135. constructor() {
  18136. super();
  18137. this.coinNum = 2000;
  18138. }
  18139. onConstructor() {
  18140. this.ui = ui_UIAddCoin.createInstance();
  18141. this.contentPane = this.ui;
  18142. this.isEject = false;
  18143. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18144. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  18145. }
  18146. show() {
  18147. super.show();
  18148. this.ui.t0.play();
  18149. }
  18150. videoAddCoin() {
  18151. console.log('zh:qjff_AD_for_UIAddCoin');
  18152. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  18153. }
  18154. else {
  18155. console.log('zh:AD 失败,直接发放奖励');
  18156. this.qjff_AD_for_UIAddCoin();
  18157. }
  18158. }
  18159. qjff_AD_for_UIAddCoin() {
  18160. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  18161. this.hide();
  18162. }
  18163. }
  18164. UIAddCoin$1.uiName = "UIAddCoin";
  18165. class UIInvitation$1 extends UIBase {
  18166. constructor() {
  18167. super();
  18168. }
  18169. onConstructor() {
  18170. this.ui = ui_UIInvitation.createInstance();
  18171. this.contentPane = this.ui;
  18172. this.isEject = false;
  18173. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  18174. }
  18175. show() {
  18176. super.show();
  18177. }
  18178. enterGame() {
  18179. xGame.common.gameMode = GameMode.classic;
  18180. DataMgr.setChallengeTimes(1);
  18181. xGame.common.passAwardCoin = 2000;
  18182. let need = xGame.common.classicNiceNeddCoin;
  18183. if (DataMgr.coinEnough(need)) {
  18184. DataMgr.setCoin(-need);
  18185. xGame.eventMgr.event(RESTART_GAME, true);
  18186. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  18187. }
  18188. else {
  18189. xGame.eventMgr.event(RESTART_GAME, true);
  18190. }
  18191. this.hide();
  18192. }
  18193. hide() {
  18194. super.hide();
  18195. }
  18196. }
  18197. UIInvitation$1.uiName = "UIInvitation";
  18198. class UIPower$1 extends UIBase {
  18199. constructor() {
  18200. super();
  18201. }
  18202. onConstructor() {
  18203. this.ui = ui_UIPower.createInstance();
  18204. this.contentPane = this.ui;
  18205. this.isEject = false;
  18206. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18207. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18208. }
  18209. show() {
  18210. super.show();
  18211. this.ui.t0.play();
  18212. }
  18213. videoGetPower() {
  18214. console.log('zh:qjff_AD_for_uipower');
  18215. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  18216. }
  18217. else {
  18218. console.log('zh:AD 失败,直接发放奖励');
  18219. this.qjff_AD_for_uipower();
  18220. }
  18221. }
  18222. qjff_AD_for_uipower() {
  18223. DataMgr.setPower(xGame.common.videoPower, true);
  18224. xGame.eventMgr.event(POWER_TIME);
  18225. this.hide();
  18226. }
  18227. }
  18228. UIPower$1.uiName = "UIPower";
  18229. class UIGameEnd$1 extends UIBase {
  18230. constructor() {
  18231. super();
  18232. this.success = false;
  18233. this.awardCoinNum = 1000;
  18234. this.awardDiamondNum = 10;
  18235. }
  18236. onConstructor() {
  18237. this.ui = ui_UIGameEnd.createInstance();
  18238. this.contentPane = this.ui;
  18239. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18240. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18241. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18242. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18243. this.ui.talkNode.visible = false;
  18244. if (Moyu.isKs)
  18245. this.ui.closeNode.closeBtn.x += 100;
  18246. }
  18247. updateType() {
  18248. switch (xGame.common.gameMode) {
  18249. case GameMode.classic:
  18250. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18251. this.ui.coinNode.visible = this.success;
  18252. if (!this.success) {
  18253. Laya.timer.once(500, this, () => {
  18254. xGame.uiMgr.Show(UIAddCoin$1);
  18255. });
  18256. }
  18257. this.ui.isGetAward.visible = false;
  18258. this.ui.leftBtn.c1.selectedIndex = 3;
  18259. this.ui.rightBtn.c1.selectedIndex = 0;
  18260. this.moneyNode.ui.c1.selectedIndex = 1;
  18261. break;
  18262. case GameMode.bigMove:
  18263. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18264. this.ui.coinNode.visible = this.success;
  18265. if (xGame.common.gameMode == GameMode.bigMove) {
  18266. if (this.success) {
  18267. DataMgr.setSkillSuccessTimes(1, true);
  18268. DataMgr.setSkillAccTimes(1);
  18269. }
  18270. else {
  18271. DataMgr.setSkillSuccessTimes(0, false);
  18272. }
  18273. }
  18274. if (!this.success) {
  18275. Laya.timer.once(500, this, () => {
  18276. xGame.uiMgr.Show(UIAddCoin$1);
  18277. });
  18278. }
  18279. this.ui.isGetAward.visible = false;
  18280. this.ui.leftBtn.c1.selectedIndex = 3;
  18281. this.ui.rightBtn.c1.selectedIndex = 0;
  18282. this.moneyNode.ui.c1.selectedIndex = 1;
  18283. break;
  18284. case GameMode.placeBall:
  18285. this.ui.coinNode.visible = false;
  18286. if (this.success) {
  18287. if (xGame.common.placeBallStarNum == 3) {
  18288. this.ui.c1.selectedIndex = 2;
  18289. }
  18290. else {
  18291. this.ui.c1.selectedIndex = 3;
  18292. }
  18293. }
  18294. else {
  18295. this.ui.c1.selectedIndex = 4;
  18296. }
  18297. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18298. if (cfg.type == PlaceBallType.challenge) {
  18299. this.ui.c1.selectedIndex = 2;
  18300. }
  18301. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18302. this.updatePlaceBallBtn();
  18303. this.updatePlaceBallStarNum();
  18304. this.updatePlaceBallAwardState();
  18305. this.moneyNode.ui.c1.selectedIndex = 2;
  18306. this.moneyNode.checkPowerTime();
  18307. this.moneyNode.powerChange();
  18308. DataMgr.upRankData();
  18309. break;
  18310. default:
  18311. break;
  18312. }
  18313. }
  18314. updatePlaceBallBtn() {
  18315. this.ui.leftBtn.c1.selectedIndex = 5;
  18316. if (this.success) {
  18317. this.ui.rightBtn.c1.selectedIndex = 14;
  18318. }
  18319. else {
  18320. if (xGame.common.placeBallStarNum == 3) {
  18321. this.ui.rightBtn.c1.selectedIndex = 14;
  18322. }
  18323. else {
  18324. this.ui.rightBtn.c1.selectedIndex = 1;
  18325. }
  18326. }
  18327. }
  18328. updatePlaceBallStarNum() {
  18329. let starNum = xGame.common.placeBallStarNum;
  18330. if (starNum == 0)
  18331. this.ui.starNumNode.c1.selectedIndex = 3;
  18332. else {
  18333. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18334. }
  18335. }
  18336. updatePlaceBallAwardState() {
  18337. let level = xGame.common.placeBallCurLevel;
  18338. let starNum = xGame.common.placeBallStarNum;
  18339. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18340. let data = cfgTable.placeballData[level].award;
  18341. let cfg = cfgTable.placeballData[level];
  18342. this.awardDiamondNum = data[1];
  18343. this.awardCoinNum = data[0];
  18344. if (cfg.type == PlaceBallType.challenge) {
  18345. this.awardDiamondNum = 0;
  18346. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18347. }
  18348. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18349. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18350. if (cfg.type == PlaceBallType.challenge) {
  18351. this.ui.awardNode.coinNode.visible = true;
  18352. }
  18353. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18354. this.ui.awardNode.diamondNode.x = 265;
  18355. this.ui.awardNode.coinNode.x = 354;
  18356. }
  18357. else {
  18358. this.ui.awardNode.diamondNode.x = 291;
  18359. this.ui.awardNode.coinNode.x = 291;
  18360. }
  18361. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18362. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18363. if (this.awardCoinNum == 0) {
  18364. this.ui.awardNode.coinNode.numTxt.text = "";
  18365. }
  18366. if (getAward) {
  18367. this.ui.isGetAward.visible = true;
  18368. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18369. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18370. }
  18371. else {
  18372. this.ui.isGetAward.visible = false;
  18373. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18374. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18375. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18376. }
  18377. else {
  18378. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18379. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18380. }
  18381. }
  18382. }
  18383. show(success) {
  18384. super.show();
  18385. xGame.eventMgr.event(RESET_GAME);
  18386. this.success = success;
  18387. Laya.timer.clearAll(this);
  18388. this.playSecretaryAni();
  18389. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18390. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18391. offsetTime = Math.floor(offsetTime / 1000);
  18392. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18393. this.updateType();
  18394. Laya.timer.once(200, this, () => {
  18395. this.addAward(() => {
  18396. this.updateType();
  18397. Laya.timer.once(500, this, () => {
  18398. this.showChallengeLevel();
  18399. });
  18400. });
  18401. });
  18402. if (this.success) {
  18403. xGame.soundMgr.playSound('slots_roll01');
  18404. xGame.soundMgr.playSound("s_win");
  18405. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18406. }
  18407. else {
  18408. xGame.soundMgr.playSound('matchwin01');
  18409. xGame.soundMgr.playSound("s_lose");
  18410. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18411. }
  18412. if (!Moyu.isLegal)
  18413. PlatMgr.showBanner(true);
  18414. let challengeNum = DataMgr.getChallengeTimes();
  18415. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18416. DataMgr.setChallengeTimes(1);
  18417. }
  18418. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18419. DataMgr.setClassicTimes();
  18420. }
  18421. }
  18422. showChallengeLevel() {
  18423. if (DataMgr.getChallengeTimes() != 0)
  18424. return;
  18425. let skill = DataMgr.getSkillAccTimes();
  18426. let put = DataMgr.getPlaceBallLevelList().length;
  18427. if (skill >= 3 || put >= 5) {
  18428. xGame.uiMgr.Show(UIInvitation$1);
  18429. this.hide();
  18430. }
  18431. }
  18432. addAward(callback) {
  18433. if (!this.success) {
  18434. callback && callback();
  18435. return;
  18436. }
  18437. switch (xGame.common.gameMode) {
  18438. case GameMode.classic:
  18439. this.awardCoinNum = xGame.common.passAwardCoin;
  18440. this.awardDiamondNum = 0;
  18441. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18442. break;
  18443. case GameMode.bigMove:
  18444. this.awardCoinNum = xGame.common.passAwardCoin;
  18445. this.awardDiamondNum = 0;
  18446. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18447. callback && callback();
  18448. break;
  18449. case GameMode.placeBall:
  18450. let level = xGame.common.placeBallCurLevel;
  18451. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18452. if (xGame.common.placeBallStarNum != 3) {
  18453. callback && callback();
  18454. return;
  18455. }
  18456. else {
  18457. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18458. if (getAward) {
  18459. callback && callback();
  18460. return;
  18461. }
  18462. }
  18463. let cfg = cfgTable.placeballData[level];
  18464. let data = cfgTable.placeballData[level].award;
  18465. this.awardCoinNum = data[0];
  18466. this.awardDiamondNum = data[1];
  18467. if (cfg.type == PlaceBallType.challenge) {
  18468. this.awardDiamondNum = 0;
  18469. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18470. }
  18471. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18472. let diamondAward;
  18473. if (this.awardDiamondNum > 0) {
  18474. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18475. xGame.common.getAward([diamondAward, coinAward], callback);
  18476. }
  18477. else {
  18478. xGame.common.getAward([coinAward], callback);
  18479. }
  18480. if (cfg.type == PlaceBallType.normal) {
  18481. DataMgr.setPlaceBallAward(level);
  18482. }
  18483. break;
  18484. default:
  18485. break;
  18486. }
  18487. }
  18488. playSecretaryAni_old() {
  18489. let parent = this.ui.secretary.displayObject;
  18490. parent.destroyChildren();
  18491. let xx = this.ui.secretary.width / 2;
  18492. let yy = this.ui.secretary.height;
  18493. let scale = xGame.common.getSecretaryScale();
  18494. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18495. if (this.success) {
  18496. let rand = Math.random() <= 0.5 ? 2 : 3;
  18497. xGame.common.secretary.play(data, rand, false, parent, () => {
  18498. xGame.common.secretary.play(data, 1, true, parent);
  18499. });
  18500. }
  18501. else {
  18502. xGame.common.secretary.play(data, 0, true, parent);
  18503. }
  18504. }
  18505. playSecretaryAni() {
  18506. let parent = this.ui.secretary.displayObject;
  18507. parent.destroyChildren();
  18508. let xx = this.ui.secretary.width / 2;
  18509. let yy = this.ui.secretary.height;
  18510. let scale = xGame.common.getSecretaryScale();
  18511. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18512. if (this.success) {
  18513. let rand = 0;
  18514. xGame.common.secretary.play(data, 0, true, parent);
  18515. }
  18516. else {
  18517. xGame.common.secretary.play(data, 0, true, parent);
  18518. }
  18519. }
  18520. restartGame() {
  18521. switch (xGame.common.gameMode) {
  18522. case GameMode.classic:
  18523. xGame.eventMgr.event(RESTART_GAME);
  18524. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18525. break;
  18526. case GameMode.bigMove:
  18527. this.hide();
  18528. xGame.eventMgr.event(RESTART_GAME);
  18529. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18530. break;
  18531. default:
  18532. break;
  18533. }
  18534. }
  18535. hide() {
  18536. super.hide();
  18537. xGame.common.stopGirlPop(this.ui.talkNode);
  18538. PlatMgr.showBanner(false);
  18539. }
  18540. returnHome() {
  18541. this.hide();
  18542. let showFailWords = !this.success;
  18543. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18544. }
  18545. clickLeftBtn() {
  18546. switch (xGame.common.gameMode) {
  18547. case GameMode.classic:
  18548. case GameMode.bigMove:
  18549. this.returnHome();
  18550. break;
  18551. case GameMode.placeBall:
  18552. let level = xGame.common.placeBallCurLevel;
  18553. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18554. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18555. break;
  18556. default:
  18557. break;
  18558. }
  18559. }
  18560. powerStartPlaceBallLevel(level, btn) {
  18561. if (DataMgr.powerEnough()) {
  18562. btn.touchable = false;
  18563. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18564. btn.touchable = true;
  18565. DataMgr.setPower(-1);
  18566. xGame.eventMgr.event(POWER_TIME);
  18567. this.startPlaceBallLevel(level);
  18568. }));
  18569. }
  18570. else {
  18571. xGame.uiMgr.Show(UIPower$1, 0);
  18572. }
  18573. }
  18574. clickRightBtn() {
  18575. switch (xGame.common.gameMode) {
  18576. case GameMode.classic:
  18577. console.log('zh:clickRightBtn 111');
  18578. case GameMode.bigMove:
  18579. console.log('zh:clickRightBtn 222');
  18580. this.restartGame();
  18581. break;
  18582. case GameMode.placeBall:
  18583. console.log('zh:clickRightBtn 333');
  18584. let level = xGame.common.placeBallCurLevel;
  18585. let data = DataMgr.getPlaceBallLevel(level);
  18586. let curPss = data.play && !data.isCur;
  18587. if (curPss) {
  18588. console.log('zh:clickRightBtn 333-111');
  18589. console.log('zh:当前LV=' + level);
  18590. if (level == 60) {
  18591. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18592. Laya.timer.once(3000, this, () => {
  18593. this.returnHome();
  18594. });
  18595. }
  18596. else {
  18597. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18598. }
  18599. }
  18600. else {
  18601. console.log('zh:clickRightBtn 333-000');
  18602. Moyu.sendDataEvent("placeBallNextLevel");
  18603. console.log('zh:qjff_AD_for_uiGameEnd');
  18604. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  18605. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  18606. }
  18607. else {
  18608. console.log('zh:AD 失败,直接发放奖励');
  18609. this.qjff_AD_for_uiGameEnd(level);
  18610. }
  18611. }
  18612. break;
  18613. default:
  18614. console.log('zh:clickRightBtn 444');
  18615. break;
  18616. }
  18617. }
  18618. qjff_AD_for_uiGameEnd(level) {
  18619. DataMgr.setPlaceBallLevel(level, 1);
  18620. this.startPlaceBallLevel(level + 1);
  18621. }
  18622. startPlaceBallLevel(level) {
  18623. xGame.common.gameMode = GameMode.placeBall;
  18624. xGame.common.placeBallCurLevel = level;
  18625. xGame.uiMgr.Show(UIGame$1);
  18626. this.hide();
  18627. }
  18628. }
  18629. UIGameEnd$1.uiName = "UIGameEnd";
  18630. class ShowItem$1 {
  18631. constructor() {
  18632. this.ui = ui_ShowItem.createInstance();
  18633. }
  18634. destroySelf() {
  18635. if (!this.ui.isDisposed) {
  18636. this.ui.removeFromParent();
  18637. this.ui.dispose();
  18638. }
  18639. }
  18640. setParent(parent) {
  18641. parent.addChild(this.ui);
  18642. }
  18643. setPos(x, y) {
  18644. this.ui.x = x;
  18645. this.ui.y = y;
  18646. }
  18647. setUrl(index) {
  18648. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18649. }
  18650. }
  18651. class UILevelProp$1 extends UIBase {
  18652. constructor() {
  18653. super();
  18654. this.firstPos = 385;
  18655. this.secondPos = 467;
  18656. this.showItemArr = [];
  18657. }
  18658. onFontLoaded() {
  18659. try {
  18660. this.ui.myNode.conditionTxt.font = "arial";
  18661. console.log("zh: onFontLoaded 设置arial字体成功");
  18662. }
  18663. catch (error) {
  18664. console.log("zh: constructor onFontLoaded加载arial字体失败");
  18665. }
  18666. }
  18667. onConstructor() {
  18668. this.ui = ui_UILevelProp.createInstance();
  18669. this.contentPane = this.ui;
  18670. this.isEject = false;
  18671. this.addUIClick(this.ui.closeBtn, this.hide);
  18672. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18673. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18674. }
  18675. show(level) {
  18676. super.show();
  18677. this.ui.t1.play();
  18678. this.level = level;
  18679. this.data = cfgTable.placeballData[this.level];
  18680. this.updateSelf();
  18681. this.showPreView();
  18682. this.moneyNode.ui.c1.selectedIndex = 2;
  18683. this.moneyNode.checkPowerTime();
  18684. this.moneyNode.powerChange();
  18685. }
  18686. showPreView() {
  18687. let item;
  18688. let data;
  18689. for (let index = 0; index < this.showItemArr.length; index++) {
  18690. item = this.showItemArr[index];
  18691. item.destroySelf();
  18692. }
  18693. this.showItemArr = [];
  18694. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18695. for (const key in cfgData) {
  18696. data = cfgData[key];
  18697. item = new ShowItem$1();
  18698. item.setParent(this.ui.myNode.displayRoot);
  18699. item.setPos(data.x, data.y);
  18700. item.setUrl(data.value);
  18701. this.showItemArr.push(item);
  18702. }
  18703. }
  18704. updateSelf() {
  18705. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18706. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18707. if (this.data.ball == -1) {
  18708. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18709. }
  18710. else {
  18711. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  18712. }
  18713. let localData = DataMgr.getPlaceBallLevel(this.level);
  18714. let getAward = localData.getAward;
  18715. let cfg = cfgTable.placeballData[this.level];
  18716. let coin = this.data.award[0];
  18717. let diamond = this.data.award[1];
  18718. if (cfg.type == PlaceBallType.challenge) {
  18719. diamond = 0;
  18720. coin = 100;
  18721. }
  18722. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18723. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18724. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18725. if (cfg.type == PlaceBallType.challenge) {
  18726. this.ui.myNode.coinNode.numTxt.text = "";
  18727. }
  18728. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18729. if (coin > 0 && diamond > 0) {
  18730. this.ui.myNode.diamondNode.x = 385;
  18731. this.ui.myNode.coinNode.x = 467;
  18732. }
  18733. else {
  18734. this.ui.myNode.diamondNode.x = 385;
  18735. this.ui.myNode.coinNode.x = 385;
  18736. }
  18737. if (!getAward) {
  18738. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18739. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18740. }
  18741. else {
  18742. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18743. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18744. }
  18745. }
  18746. startGame() {
  18747. if (DataMgr.powerEnough()) {
  18748. this.ui.myNode.startBtn.touchable = false;
  18749. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18750. console.log('zh:startGame ');
  18751. this.ui.myNode.startBtn.touchable = true;
  18752. DataMgr.setPower(-1);
  18753. xGame.eventMgr.event(POWER_TIME);
  18754. xGame.common.gameMode = GameMode.placeBall;
  18755. xGame.common.placeBallCurLevel = this.level;
  18756. xGame.uiMgr.Show(UIGame$1);
  18757. xGame.uiMgr.Hide(UILevelDisplay$1);
  18758. xGame.uiMgr.Hide(UIMain$1);
  18759. this.hide();
  18760. }));
  18761. }
  18762. else {
  18763. console.log('zh:startGame no power');
  18764. xGame.uiMgr.Show(UIPower$1);
  18765. }
  18766. }
  18767. hide() {
  18768. super.hide();
  18769. }
  18770. }
  18771. UILevelProp$1.uiName = "UILevelProp";
  18772. class PutBallLevelDisplay$1 {
  18773. constructor(ui, index) {
  18774. this.index = 0;
  18775. this.ui = ui;
  18776. this.index = index;
  18777. this.ui.onClick(this, this.clickSelf);
  18778. this.updateSelf();
  18779. this.ui.levelTxt.text = (this.index + 1) + "";
  18780. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18781. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18782. }
  18783. updateSelf() {
  18784. let level = this.index + 1;
  18785. this.data = DataMgr.getPlaceBallLevel(level);
  18786. this.ui.starNode.c1.selectedIndex = this.data.star;
  18787. let isChallenge = cfgTable.placeballData[level].type;
  18788. if (this.data.isCur) {
  18789. if (isChallenge) {
  18790. this.ui.c1.selectedIndex = 5;
  18791. }
  18792. else {
  18793. this.ui.c1.selectedIndex = 2;
  18794. }
  18795. }
  18796. else {
  18797. if (this.data.play) {
  18798. if (this.data.star == 3) {
  18799. this.ui.c1.selectedIndex = 0;
  18800. }
  18801. else {
  18802. this.ui.c1.selectedIndex = 1;
  18803. }
  18804. }
  18805. else {
  18806. if (isChallenge) {
  18807. this.ui.c1.selectedIndex = 4;
  18808. }
  18809. else {
  18810. this.ui.c1.selectedIndex = 3;
  18811. }
  18812. }
  18813. }
  18814. }
  18815. clickSelf() {
  18816. if (!this.data.play)
  18817. return;
  18818. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18819. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18820. }
  18821. }
  18822. class UILevelDisplay$1 extends UIBase {
  18823. constructor() {
  18824. super();
  18825. }
  18826. onConstructor() {
  18827. this.ui = ui_UILevelDisplay.createInstance();
  18828. this.contentPane = this.ui;
  18829. this.isEject = false;
  18830. this.myList = this.ui.myNode.myList;
  18831. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18832. this.levelItemArr = [];
  18833. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18834. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18835. this.myList.numItems = levelNum;
  18836. if (Moyu.isKs)
  18837. this.ui.closeNode.closeBtn.x += 100;
  18838. }
  18839. levelItemRender(index, target) {
  18840. let item = new PutBallLevelDisplay$1(target, index);
  18841. this.levelItemArr.push(item);
  18842. }
  18843. show() {
  18844. super.show();
  18845. this.updateLevel();
  18846. this.scrollToPlace();
  18847. }
  18848. updateLevel() {
  18849. let temp;
  18850. for (let index = 0; index < this.levelItemArr.length; index++) {
  18851. temp = this.levelItemArr[index];
  18852. temp.updateSelf();
  18853. }
  18854. }
  18855. scrollToPlace() {
  18856. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18857. let passArr = DataMgr.getPlaceBallLevelList();
  18858. let offest = passArr.length;
  18859. if (offest >= maxNum - 1)
  18860. offest = maxNum - 1;
  18861. this.myList.scrollToView(offest, true, true);
  18862. }
  18863. hide() {
  18864. super.hide();
  18865. }
  18866. }
  18867. UILevelDisplay$1.uiName = "UILevelDisplay";
  18868. class UIMatching$1 extends UIBase {
  18869. constructor() {
  18870. super();
  18871. }
  18872. onConstructor() {
  18873. this.ui = ui_UIMatching.createInstance();
  18874. this.contentPane = this.ui;
  18875. this.isEject = false;
  18876. }
  18877. show(callback) {
  18878. super.show();
  18879. PlatMgr.showBanner(true);
  18880. this.callback = callback;
  18881. let user = Moyu.getUserInfo();
  18882. if (!this.selfPot) {
  18883. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18884. }
  18885. if (!this.aiPot) {
  18886. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18887. }
  18888. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18889. this.ui.selfHead.nameTxt.text = user.nickName;
  18890. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18891. this.ui.aiHead.nameTxt.text = "???";
  18892. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18893. this.ui.selfHead.c1.selectedIndex = 0;
  18894. this.ui.aiHead.c1.selectedIndex = 0;
  18895. this.ui.selfHead.x = this.selfPot.x;
  18896. this.ui.selfHead.y = this.selfPot.y;
  18897. this.ui.aiHead.x = this.aiPot.x;
  18898. this.ui.aiHead.y = this.aiPot.y;
  18899. switch (xGame.common.gameMode) {
  18900. case GameMode.classic:
  18901. break;
  18902. case GameMode.bigMove:
  18903. this.initSkillData();
  18904. break;
  18905. default:
  18906. break;
  18907. }
  18908. this.ui.t1.play(Laya.Handler.create(this, () => {
  18909. this.ui.t2.play(Laya.Handler.create(this, () => {
  18910. switch (xGame.common.gameMode) {
  18911. case GameMode.classic:
  18912. this.waitingPeople();
  18913. break;
  18914. case GameMode.bigMove:
  18915. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18916. break;
  18917. default:
  18918. break;
  18919. }
  18920. }));
  18921. }));
  18922. }
  18923. initSkillData() {
  18924. this.skillSelectData = [];
  18925. let skillUrl = xGame.common.skillIconList;
  18926. let skillName = xGame.common.skillNameList;
  18927. let skillLevel = DataMgr.getBigSkillList();
  18928. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18929. for (let index = 0; index < 5; index++) {
  18930. let obj = {};
  18931. obj.skillImg = skillUrl[index];
  18932. obj.skillName = skillName[index];
  18933. obj.skillType = skillType[index];
  18934. obj.skillLevel = skillLevel[index];
  18935. this.skillSelectData.push(obj);
  18936. }
  18937. }
  18938. getAISkillLevel(myLevel) {
  18939. let video = xGame.common.upSkillLevel;
  18940. let aiLevel;
  18941. let temp;
  18942. if (video) {
  18943. temp = xGame.common.randomNum(-2, -1);
  18944. }
  18945. else {
  18946. if (myLevel <= 5) {
  18947. temp = xGame.common.randomNum(1, 3);
  18948. }
  18949. else if (myLevel <= 9) {
  18950. temp = xGame.common.randomNum(-2, 1);
  18951. }
  18952. else {
  18953. temp = xGame.common.randomNum(-4, 0);
  18954. }
  18955. }
  18956. aiLevel = temp + myLevel;
  18957. if (aiLevel <= 1)
  18958. aiLevel = 1;
  18959. if (aiLevel >= 10)
  18960. aiLevel = 10;
  18961. return aiLevel;
  18962. }
  18963. getAISkillType() {
  18964. return xGame.common.randomNum(1, 4);
  18965. let successTimes = DataMgr.getSkillSuccessTimes();
  18966. let info = cfgTable.aiskillData[successTimes];
  18967. if (!info) {
  18968. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18969. info = cfgTable.aiskillData[max];
  18970. }
  18971. let dataArr = info.skillselect;
  18972. let myCfg = {};
  18973. for (let index = 0; index < dataArr.length; index++) {
  18974. let temp = dataArr[index].split('-');
  18975. myCfg[temp[0]] = {};
  18976. myCfg[temp[0]].id = parseInt(temp[0]);
  18977. myCfg[temp[0]].weight = parseInt(temp[1]);
  18978. }
  18979. let aiCfg = xGame.common.initWeight(myCfg);
  18980. let curData = xGame.common.getRandomWeightData(aiCfg);
  18981. return parseInt(curData.id);
  18982. }
  18983. getAISkillData(index) {
  18984. let myLevel = this.skillSelectData[index].skillLevel;
  18985. let aiLevel = this.getAISkillLevel(myLevel);
  18986. let aiType = this.getAISkillType() - 1;
  18987. return { aiLevel, aiType } = { aiLevel, aiType };
  18988. }
  18989. skillSelectFinish(index) {
  18990. let aiInfo = this.getAISkillData(index);
  18991. xGame.common.gameMgr.selfCurSkill = index;
  18992. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18993. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18994. this.ui.selfHead.c1.selectedIndex = 1;
  18995. this.ui.aiHead.c1.selectedIndex = 1;
  18996. let myData = this.skillSelectData[index];
  18997. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18998. let guide = DataMgr.getSkillGuide();
  18999. if (guide == 0) {
  19000. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  19001. }
  19002. else {
  19003. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  19004. }
  19005. let aiData = this.skillSelectData[aiInfo.aiType];
  19006. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  19007. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  19008. this.waitingPeople();
  19009. }
  19010. waitingPeople() {
  19011. let time = xGame.common.randomNum(1000, 3000);
  19012. time += 1000;
  19013. Laya.timer.once(time, this, () => {
  19014. this.matchingSuccess();
  19015. });
  19016. }
  19017. matchingSuccess() {
  19018. let gameUI = xGame.common.gameUI;
  19019. let name = gameUI.ui.topNode.aiNameTxt.text;
  19020. let url = gameUI.ui.topNode.aiHeadLoader.url;
  19021. this.ui.aiHead.nameTxt.text = name;
  19022. this.ui.aiHead.headImg.url = url;
  19023. name = gameUI.ui.topNode.selfNameTxt.text;
  19024. url = gameUI.ui.topNode.selfHeadLoader.url;
  19025. this.ui.selfHead.nameTxt.text = name;
  19026. this.ui.selfHead.headImg.url = url;
  19027. this.ui.t3.play(Laya.Handler.create(this, () => {
  19028. this.callback && this.callback();
  19029. this.ui.t4.play(Laya.Handler.create(this, () => {
  19030. this.destroySelf();
  19031. }));
  19032. }));
  19033. }
  19034. destroySelf() {
  19035. this.callback = null;
  19036. this.skillSelectData = null;
  19037. this.selfPot = null;
  19038. this.aiPot = null;
  19039. if (!this.ui.isDisposed) {
  19040. this.ui.removeFromParent();
  19041. this.ui.dispose();
  19042. }
  19043. xGame.uiMgr.destroyUI(this);
  19044. }
  19045. }
  19046. UIMatching$1.uiName = "UIMatching";
  19047. class SkillDisplay$1 {
  19048. constructor(ui, data, uiIndex) {
  19049. this.starX = 0;
  19050. this.starY = 0;
  19051. this.index = 0;
  19052. this.ui = ui;
  19053. this.data = data;
  19054. this.index = uiIndex;
  19055. this.initSelf();
  19056. console.log('zh:SkillDisplay constructor this.skillData=', data);
  19057. }
  19058. initSelf() {
  19059. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  19060. this.ui.nameTxt.text = this.data.name;
  19061. this.ui.describeTxt.text = this.data.describe;
  19062. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  19063. this.ui.startBtn.onClick(this, this.startGame);
  19064. this.updateSelf();
  19065. }
  19066. updateSelf() {
  19067. this.checkTry();
  19068. let level = DataMgr.getBigSkillByIndex(this.index);
  19069. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  19070. }
  19071. checkTry() {
  19072. let index = this.index;
  19073. let level = DataMgr.getBigSkillByIndex(index);
  19074. if (level == null) {
  19075. DataMgr.setBigSkill(index, 1, false);
  19076. level = 1;
  19077. }
  19078. this.ui.levelTxt.text = "LV." + level;
  19079. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  19080. this.ui.tryNode.visible = true;
  19081. else
  19082. this.ui.tryNode.visible = false;
  19083. }
  19084. clickAddLevel() {
  19085. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19086. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  19087. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  19088. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  19089. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19090. }
  19091. else {
  19092. console.log('zh:AD 失败,直接发放奖励');
  19093. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19094. }
  19095. }
  19096. qjff_AD_for_skilldisplay_clickAddLevel() {
  19097. DataMgr.setBigSkill(this.data.index, 1);
  19098. this.updateSelf();
  19099. xGame.common.upSkillLevel = true;
  19100. }
  19101. startGame() {
  19102. if (this.data.index == 3) {
  19103. alert('Coming soon!');
  19104. return;
  19105. }
  19106. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19107. let needCoin = xGame.common.bigMoveNeedCoin;
  19108. xGame.common.passAwardCoin = 2000;
  19109. let guide = DataMgr.getSkillGuide();
  19110. console.log('zh:startGame guide=' + guide);
  19111. xGame.common.temSelfLevel = 0;
  19112. if (guide == 0) {
  19113. needCoin = 0;
  19114. xGame.common.temSelfLevel = 100;
  19115. }
  19116. if (DataMgr.coinEnough(needCoin)) {
  19117. DataMgr.setCoin(-needCoin);
  19118. xGame.common.curPlayerSkillType = this.index;
  19119. if (guide == 0)
  19120. xGame.common.curPlayerSkillType = 0;
  19121. xGame.uiMgr.Show(UIGame$1);
  19122. xGame.uiMgr.Hide(UIMain$1);
  19123. xGame.uiMgr.Show(UIMatching$1, () => {
  19124. xGame.common.gameUI.ui.alpha = 1;
  19125. xGame.common.gameUI.startGame();
  19126. xGame.uiMgr.Hide(UISkill$1);
  19127. });
  19128. }
  19129. else {
  19130. xGame.uiMgr.Show(UIAddProp$1, 0);
  19131. Moyu.sendDataEvent("AddCoinVideo");
  19132. }
  19133. }
  19134. }
  19135. class UISkill$1 extends UIBase {
  19136. constructor() {
  19137. super();
  19138. this.skillData = [];
  19139. }
  19140. onConstructor() {
  19141. this.ui = ui_UISkill.createInstance();
  19142. this.contentPane = this.ui;
  19143. this.isEject = false;
  19144. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19145. this.initSkillData();
  19146. console.log('zh:aaaaaa1111111111');
  19147. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  19148. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  19149. console.log('zh:aaaaaa22222222');
  19150. this.displayList = [];
  19151. this.ui.skillNode.skillList.numItems = 3;
  19152. this.addUIClick(this.ui, this.interuptSecretary);
  19153. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  19154. this.ui.talkNode.visible = false;
  19155. if (Moyu.isKs)
  19156. this.ui.closeNode.closeBtn.x += 100;
  19157. }
  19158. show() {
  19159. super.show();
  19160. this.playSecretaryIdle();
  19161. this.moneyNode.ui.c1.selectedIndex = 1;
  19162. Laya.timer.clearAll(this);
  19163. xGame.soundMgr.playSound("s_start");
  19164. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19165. let guide = DataMgr.getSkillGuide();
  19166. this.ui.guideNode.visible = guide == 0;
  19167. let item = this.getSkillItemByUIIndex(0);
  19168. if (guide == 0) {
  19169. item.ui.c1.selectedIndex = 1;
  19170. }
  19171. else {
  19172. item.ui.c1.selectedIndex = 0;
  19173. }
  19174. this.ui.guideNode.guideBtn.visible = guide == 0;
  19175. for (let index = 0; index < this.displayList.length; index++) {
  19176. this.displayList[index].checkTry();
  19177. }
  19178. }
  19179. getSkillItemByUIIndex(cur) {
  19180. for (let index = 0; index < this.displayList.length; index++) {
  19181. if (this.displayList[index].index == cur) {
  19182. return this.displayList[index];
  19183. }
  19184. }
  19185. }
  19186. enterGuideLevel() {
  19187. let item = this.getSkillItemByUIIndex(0);
  19188. item.startGame();
  19189. if (DataMgr.getNewUser())
  19190. Moyu.sendDataEvent("gameStart1");
  19191. }
  19192. initSkillData() {
  19193. this.skillData = [];
  19194. let nameList = xGame.common.skillNameList;
  19195. let iconList = xGame.common.skillIconList;
  19196. let describeList = [
  19197. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  19198. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  19199. "The power of frost descends—freezing the flow and taking full control of the game!"
  19200. ];
  19201. console.log('zh:initSkillData 111111111');
  19202. let data;
  19203. for (let index = 0; index < nameList.length; index++) {
  19204. data = {};
  19205. data.name = nameList[index];
  19206. data.icon = iconList[index];
  19207. data.describe = describeList[index];
  19208. data.index = index;
  19209. this.skillData.push(data);
  19210. }
  19211. }
  19212. updateSkillItem(index, target) {
  19213. if (this.displayList[index] == null) {
  19214. let uiIndex;
  19215. switch (index) {
  19216. case 0:
  19217. uiIndex = 1;
  19218. break;
  19219. case 1:
  19220. uiIndex = 0;
  19221. break;
  19222. case 2:
  19223. uiIndex = 2;
  19224. break;
  19225. case 3:
  19226. uiIndex = 3;
  19227. break;
  19228. default:
  19229. break;
  19230. }
  19231. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  19232. this.displayList.push(temp);
  19233. }
  19234. }
  19235. playSecretaryIdle() {
  19236. let parent = this.ui.secretary.displayObject;
  19237. parent.destroyChildren();
  19238. let xx = this.ui.secretary.width / 2;
  19239. let yy = this.ui.secretary.height;
  19240. let scale = xGame.common.getSecretaryScale();
  19241. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19242. xGame.common.secretary.play(data, 0, true, parent);
  19243. }
  19244. returnUIMain() {
  19245. this.hide();
  19246. xGame.common.stopGirlPop(this.ui.talkNode);
  19247. xGame.uiMgr.Show(UIMain$1);
  19248. }
  19249. interuptSecretary() {
  19250. Laya.timer.clearAll(this);
  19251. this.playSecretaryRandomSound();
  19252. }
  19253. playSecretaryRandomSound() {
  19254. if (this.isHide)
  19255. return;
  19256. let time = xGame.common.randomNum(45000, 60000);
  19257. Laya.timer.once(time, this, () => {
  19258. if (this.isHide)
  19259. return;
  19260. let index = xGame.common.randomNum(4, 7);
  19261. xGame.soundMgr.playSound("s_main0" + index);
  19262. let words = 1;
  19263. switch (index) {
  19264. case 4:
  19265. words = 5;
  19266. break;
  19267. case 5:
  19268. words = 3;
  19269. break;
  19270. case 6:
  19271. words = 6;
  19272. break;
  19273. case 7:
  19274. words = 7;
  19275. break;
  19276. default:
  19277. break;
  19278. }
  19279. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19280. this.playSecretaryRandomSound();
  19281. });
  19282. }
  19283. }
  19284. UISkill$1.uiName = "UISkill";
  19285. class UIAddProp$1 extends UIBase {
  19286. constructor() {
  19287. super();
  19288. this.curType = "";
  19289. }
  19290. onConstructor() {
  19291. this.ui = ui_UIAddProp.createInstance();
  19292. this.contentPane = this.ui;
  19293. this.isEject = false;
  19294. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19295. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  19296. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  19297. this.updateUI();
  19298. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  19299. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  19300. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  19301. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  19302. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  19303. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  19304. }
  19305. show(type) {
  19306. super.show();
  19307. this.curType = type == 0 ? "coin" : "diamond";
  19308. this.switchBtn("");
  19309. this.ui.t0.play();
  19310. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  19311. PlatMgr.showInsert(true);
  19312. }
  19313. closeSelf() {
  19314. this.hide();
  19315. }
  19316. updateUI() {
  19317. let data = cfgTable.moneyData;
  19318. let temp;
  19319. let obj;
  19320. for (const key in data) {
  19321. temp = data[key];
  19322. obj = this.ui.myNode["node" + key];
  19323. if (parseInt(key) <= 2) {
  19324. obj.diamondTxt.text = "+" + temp.num;
  19325. }
  19326. else {
  19327. obj.coinTxt.text = temp.num;
  19328. obj.diamondTxt.text = temp.get.split('_')[1];
  19329. }
  19330. }
  19331. this.updateDiamondShare();
  19332. }
  19333. updateDiamondShare() {
  19334. let data = DataMgr.getShareDiamondTimes();
  19335. if (data >= xGame.common.maxShareDiamondTimes) {
  19336. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  19337. this.ui.myNode.node1.touchable = false;
  19338. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19339. }
  19340. else {
  19341. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  19342. this.ui.myNode.node1.touchable = true;
  19343. }
  19344. }
  19345. switchBtn(type) {
  19346. if (type == "")
  19347. type = this.curType;
  19348. else {
  19349. if (this.curType == type) {
  19350. return;
  19351. }
  19352. else {
  19353. this.curType = type;
  19354. }
  19355. }
  19356. if (type == "coin") {
  19357. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19358. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19359. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19360. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19361. this.ui.myNode.c1.selectedIndex = 0;
  19362. }
  19363. else {
  19364. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19365. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19366. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19367. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19368. this.ui.myNode.c1.selectedIndex = 1;
  19369. }
  19370. }
  19371. convertCoin(index) {
  19372. let data = cfgTable.moneyData[index];
  19373. let coinNum = data.num;
  19374. let str = data.get.split('_')[1];
  19375. let needDiamond = parseInt(str);
  19376. if (DataMgr.diamondEnough(needDiamond)) {
  19377. DataMgr.setDiamond(-needDiamond);
  19378. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19379. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19380. }
  19381. else {
  19382. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19383. this.switchBtn("diamond");
  19384. }
  19385. }
  19386. videoGetDiamond() {
  19387. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  19388. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  19389. }
  19390. else {
  19391. console.log('zh:AD 失败,直接发放奖励');
  19392. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  19393. }
  19394. }
  19395. qjff_AD_for_uiAddProp_videoGetDiamond() {
  19396. let num = cfgTable.moneyData[2].num;
  19397. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19398. this.closeSelf();
  19399. }
  19400. videoGetCoin() {
  19401. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  19402. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  19403. }
  19404. else {
  19405. console.log('zh:AD 失败,直接发放奖励');
  19406. this.qjff_AD_for_uiAddProp_videoGetCoin();
  19407. }
  19408. }
  19409. qjff_AD_for_uiAddProp_videoGetCoin() {
  19410. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19411. this.closeSelf();
  19412. }
  19413. shareGetDiamond() {
  19414. let times = DataMgr.getShareDiamondTimes();
  19415. if (times >= xGame.common.maxShareDiamondTimes) {
  19416. console.log('zh: 233333333333 maxShareDiamondTimes');
  19417. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19418. }
  19419. else {
  19420. console.log('zh:33333333333333ad');
  19421. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  19422. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  19423. }
  19424. else {
  19425. console.log('zh:AD 失败,直接发放奖励');
  19426. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  19427. }
  19428. }
  19429. }
  19430. qjff_AD_for_uiAddProp_shareGetDiamond() {
  19431. let diamond = xGame.common.randomNum(50, 100);
  19432. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19433. DataMgr.setShareDiamondTimes(1);
  19434. this.updateDiamondShare();
  19435. }
  19436. openPutBallView() {
  19437. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19438. let skill = xGame.uiMgr.getUI(UISkill$1);
  19439. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19440. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19441. if (end && !end.isHide) {
  19442. xGame.uiMgr.Hide(UIGameEnd$1);
  19443. xGame.uiMgr.Show(UIMain$1);
  19444. }
  19445. if (skill && !skill.isHide)
  19446. xGame.uiMgr.Hide(UISkill$1);
  19447. if (uigame && !uigame.isHide)
  19448. xGame.uiMgr.Hide(UIGame$1);
  19449. if (level && !level.isHide) {
  19450. }
  19451. else {
  19452. xGame.uiMgr.Show(UILevelDisplay$1);
  19453. }
  19454. this.closeSelf();
  19455. }
  19456. }
  19457. UIAddProp$1.uiName = "UIAddProp";
  19458. class MoneyNode$1 {
  19459. constructor(ui) {
  19460. this.leftTime = 0;
  19461. this.ui = ui;
  19462. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19463. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19464. this.ui.addPowerBtn.onClick(this, this.addPower);
  19465. this.ui.c1.selectedIndex = 1;
  19466. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19467. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19468. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19469. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19470. this.coinChange();
  19471. this.diamondChange();
  19472. this.powerChange();
  19473. }
  19474. addPower() {
  19475. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19476. xGame.uiMgr.Show(UIPower$1);
  19477. }
  19478. powerChange() {
  19479. let powerNum = DataMgr.getPower();
  19480. this.ui.powerTxt.text = powerNum + "";
  19481. }
  19482. checkPowerTime() {
  19483. let cur = new Date().getTime();
  19484. let last = DataMgr.getPowerTime();
  19485. if (last == 0) {
  19486. last = cur;
  19487. DataMgr.setPowerTime(cur);
  19488. }
  19489. let power = DataMgr.getPower();
  19490. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19491. Laya.timer.clearAll(this);
  19492. if (power >= xGame.common.natureMaxPower) {
  19493. this.ui.powerTimeTxt.text = "";
  19494. DataMgr.setPowerTime(cur);
  19495. return;
  19496. }
  19497. if (power + offset >= xGame.common.natureMaxPower) {
  19498. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19499. this.ui.powerTimeTxt.text = "";
  19500. DataMgr.setPowerTime(cur);
  19501. }
  19502. else {
  19503. if (offset > 0) {
  19504. DataMgr.setPower(offset);
  19505. DataMgr.setPowerTime(cur);
  19506. }
  19507. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19508. this.leftTime = xGame.common.powerRecoverNum - time;
  19509. if (this.leftTime <= 0)
  19510. this.leftTime = 0;
  19511. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19512. Laya.timer.loop(1000, this, this.updatePowerTime);
  19513. }
  19514. }
  19515. updatePowerTime() {
  19516. this.leftTime -= 1;
  19517. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19518. if (this.leftTime <= 0) {
  19519. this.checkPowerTime();
  19520. }
  19521. }
  19522. coinChange() {
  19523. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19524. }
  19525. diamondChange() {
  19526. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19527. }
  19528. addCoin() {
  19529. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19530. Moyu.sendDataEvent("AddCoinBtn");
  19531. xGame.uiMgr.Show(UIAddProp$1, 0);
  19532. }
  19533. addDiamond() {
  19534. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19535. Moyu.sendDataEvent("AddDiamondBtn");
  19536. xGame.uiMgr.Show(UIAddProp$1, 1);
  19537. }
  19538. }
  19539. class SettingNode$1 {
  19540. constructor(ui) {
  19541. this.showSetting = false;
  19542. this.openSound = true;
  19543. this.openShake = true;
  19544. this.ui = ui;
  19545. this.ui.soundBtn.onClick(this, this.switchSound);
  19546. this.ui.shakeBtn.onClick(this, this.switchShake);
  19547. this.ui.xyBtn.onClick(this, this.onXy);
  19548. this.ui.clickNode.onClick(this, this.changeSetting);
  19549. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19550. this.ui.xyBtn.visible = false;
  19551. this.ui.shakeBtn.visible = false;
  19552. }
  19553. changeSetting() {
  19554. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19555. this.showSetting = !this.showSetting;
  19556. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19557. }
  19558. switchSound() {
  19559. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19560. this.openSound = !this.openSound;
  19561. Moyu.onSetting(this.openSound, this.openShake);
  19562. xGame.soundMgr.onSetting(this.openSound);
  19563. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19564. }
  19565. switchShake() {
  19566. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19567. this.openShake = !this.openShake;
  19568. Moyu.onSetting(this.openSound, this.openShake);
  19569. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19570. }
  19571. onXy() {
  19572. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19573. MoyuMgr$1.showXy(1);
  19574. }
  19575. }
  19576. class UIDraw$1 extends UIBase {
  19577. constructor() {
  19578. super();
  19579. this.curKey = 0;
  19580. }
  19581. onConstructor() {
  19582. this.ui = ui_UIDraw.createInstance();
  19583. this.contentPane = this.ui;
  19584. this.isEject = false;
  19585. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19586. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19587. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19588. this.initDraw();
  19589. this.initUI();
  19590. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19591. if (Moyu.isKs)
  19592. this.ui.closeNode.closeBtn.x += 100;
  19593. }
  19594. show() {
  19595. super.show();
  19596. this.ui.t0.play();
  19597. this.playSecretaryIdle();
  19598. this.updateDraw();
  19599. this.checkFree();
  19600. if (PlatMgr.bannerDelay > 0) {
  19601. this.ui.closeNode.closeBtn.visible = false;
  19602. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19603. this.ui.closeNode.closeBtn.visible = true;
  19604. });
  19605. }
  19606. PlatMgr.showRateBanner();
  19607. }
  19608. hide() {
  19609. Laya.timer.clearAll(this);
  19610. super.hide();
  19611. }
  19612. checkFree() {
  19613. let isFree = DataMgr.getDailyfreeDrawTimes();
  19614. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19615. }
  19616. initDraw() {
  19617. this.drawObj = [];
  19618. let data = cfgTable.drawData;
  19619. let temp;
  19620. let weight = 0;
  19621. for (const key in data) {
  19622. temp = data[key];
  19623. weight += temp.weight;
  19624. this.drawObj.push(weight);
  19625. }
  19626. this.allWeight = weight;
  19627. }
  19628. initUI() {
  19629. let data = cfgTable.drawData;
  19630. let temp;
  19631. let img;
  19632. let txt;
  19633. for (const key in data) {
  19634. temp = data[key];
  19635. img = this.ui.myNode.rotNode["img" + key];
  19636. txt = this.ui.myNode.rotNode["txt" + key];
  19637. img.url = xGame.common.getGameIconUrl(temp.icon);
  19638. txt.visible = true;
  19639. if (temp.award > 2) {
  19640. img.rotation = 0;
  19641. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19642. }
  19643. else {
  19644. img.rotation = temp.rotation;
  19645. txt.text = temp.num;
  19646. }
  19647. }
  19648. }
  19649. getCurkey() {
  19650. let rand = Math.random() * this.allWeight;
  19651. let temp;
  19652. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19653. temp = this.drawObj[index];
  19654. if (index == 0) {
  19655. if (rand < temp) {
  19656. return index + 1;
  19657. }
  19658. }
  19659. else {
  19660. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19661. return index + 1;
  19662. }
  19663. }
  19664. }
  19665. return 2;
  19666. }
  19667. startDraw() {
  19668. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19669. if (freeTimes > 0) {
  19670. this.beginDraw();
  19671. DataMgr.setDailyfreeDrawTimes(0);
  19672. this.checkFree();
  19673. }
  19674. else {
  19675. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  19676. }
  19677. else {
  19678. console.log('zh:AD 失败,直接发放奖励');
  19679. this.qjff_chouJiang();
  19680. }
  19681. }
  19682. }
  19683. qjff_chouJiang() {
  19684. this.beginDraw();
  19685. }
  19686. beginDraw() {
  19687. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19688. this.ui.drawBtn.touchable = false;
  19689. this.curKey = this.getCurkey();
  19690. console.log("当前key", this.curKey);
  19691. let cell = 60;
  19692. let lap = 3;
  19693. let angle = cell * (this.curKey - 1) + lap * 360;
  19694. let target = this.ui.myNode.rotNode;
  19695. target.rotation = 0;
  19696. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19697. console.log("旋转完成");
  19698. this.ui.drawBtn.touchable = true;
  19699. this.getAward();
  19700. }));
  19701. }
  19702. getAward() {
  19703. let data = cfgTable.drawData[this.curKey];
  19704. let temp = new AwardType();
  19705. temp.type = data.award;
  19706. temp.num = data.num;
  19707. xGame.common.getAward([temp], () => {
  19708. DataMgr.setDrawTimes(1);
  19709. this.updateDraw();
  19710. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19711. });
  19712. }
  19713. updateDraw() {
  19714. let drawTimes = DataMgr.getDrawTimes();
  19715. let awardTimes = DataMgr.getDrawAwardTimes();
  19716. if (Math.floor(drawTimes / 3) > awardTimes) {
  19717. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19718. this.ui.extraNode.boxBtn.touchable = true;
  19719. this.ui.extraNode.tipsTxt.text = "3/3";
  19720. this.ui.extraNode.barNode.width = 265;
  19721. this.getExtraAward();
  19722. }
  19723. else {
  19724. this.ui.extraNode.boxBtn.t0.stop();
  19725. this.ui.extraNode.boxBtn.touchable = false;
  19726. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19727. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19728. }
  19729. let data = cfgTable.drawData[1];
  19730. if (awardTimes == 0) {
  19731. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19732. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19733. this.ui.myNode.rotNode.img1.rotation = 0;
  19734. }
  19735. else {
  19736. let award = data.nextid;
  19737. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19738. this.ui.myNode.rotNode.txt1.text = award[1];
  19739. this.ui.myNode.rotNode.img1.rotation = 0;
  19740. }
  19741. }
  19742. getExtraAward() {
  19743. let drawTimes = DataMgr.getDrawTimes();
  19744. let awardTimes = DataMgr.getDrawAwardTimes();
  19745. let data = cfgTable.drawData[1];
  19746. let award = new AwardType();
  19747. if (awardTimes == 0) {
  19748. award.num = data.num;
  19749. award.type = data.award;
  19750. xGame.common.getAward([award], () => {
  19751. let all = Math.floor(drawTimes / 3);
  19752. DataMgr.setDrawAwardTimes(all);
  19753. this.updateDraw();
  19754. });
  19755. }
  19756. else {
  19757. award.num = parseInt(data.nextid[1]);
  19758. award.type = parseInt(data.nextid[0]);
  19759. xGame.common.getAward([award], () => {
  19760. let all = Math.floor(drawTimes / 3);
  19761. DataMgr.setDrawAwardTimes(all);
  19762. this.updateDraw();
  19763. });
  19764. }
  19765. }
  19766. closeSelf() {
  19767. this.hide();
  19768. }
  19769. playSecretaryIdle() {
  19770. let parent = this.ui.secretary.displayObject;
  19771. parent.destroyChildren();
  19772. let xx = this.ui.secretary.width / 2;
  19773. let yy = this.ui.secretary.height;
  19774. let scale = xGame.common.getSecretaryScale();
  19775. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19776. xGame.common.secretary.play(data, 0, true, parent);
  19777. }
  19778. }
  19779. UIDraw$1.uiName = "UIDraw";
  19780. class UIRanking$1 extends UIBase {
  19781. constructor() {
  19782. super();
  19783. this.showSelf = true;
  19784. this.rankType = 1;
  19785. this.rankList = [];
  19786. this.myIndex = 0;
  19787. this.myStar = 0;
  19788. }
  19789. onConstructor() {
  19790. this.ui = ui_UIRanking.createInstance();
  19791. this.contentPane = this.ui;
  19792. this.isEject = false;
  19793. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19794. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19795. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19796. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19797. this.ui.myNode.myList.setVirtual();
  19798. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19799. }
  19800. show() {
  19801. super.show();
  19802. this.myIndex = 51;
  19803. Moyu.getRankList({
  19804. rankId: xGame.common.curRankID,
  19805. type: MoyuRankType.total,
  19806. page: 1,
  19807. pageSize: 50,
  19808. }, this, this.updateItemData);
  19809. this.updateSelf();
  19810. let self = Moyu.getUserInfo();
  19811. if (!self.isAuth) {
  19812. Moyu.initUser(this, () => {
  19813. DataMgr.upRankData();
  19814. });
  19815. }
  19816. }
  19817. updateSelfItem() {
  19818. let self = Moyu.getUserInfo();
  19819. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19820. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19821. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19822. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19823. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19824. }
  19825. updateItemData(data) {
  19826. this.myStar = xGame.common.getAllStarNum();
  19827. if (this.rankList.length < 2) {
  19828. this.rankList = data;
  19829. let self = Moyu.getUserInfo();
  19830. for (let i = 0; i < data.length; i++) {
  19831. let data = this.rankList[i];
  19832. if (data.userId == self.userId) {
  19833. this.rankList.splice(i, 1);
  19834. break;
  19835. }
  19836. }
  19837. for (let i = 0; i < data.length; i++) {
  19838. let data = this.rankList[i];
  19839. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19840. this.myIndex = i + 1;
  19841. let user = { headIcon: self.headIcon, nickName: "myself" };
  19842. let ud = { user: user, data: {} };
  19843. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19844. if (Moyu.platType < 11) {
  19845. user.headIcon = self.headIcon;
  19846. user.nickName = self.nickName;
  19847. }
  19848. this.rankList.splice(i, 0, md);
  19849. break;
  19850. }
  19851. }
  19852. }
  19853. this.updateSelfItem();
  19854. this.ui.myNode.myList.numItems = this.rankList.length;
  19855. }
  19856. updateItemUI(index, obj) {
  19857. let data = this.rankList[index];
  19858. let userData = JSON.parse(data.userData).user;
  19859. obj.nameTxt.text = userData.nickName.toString();
  19860. obj.valueTxt.text = data.rankScore;
  19861. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19862. obj.rankTxt.text = index + 1;
  19863. switch (index) {
  19864. case 0:
  19865. this.setImg(obj, 1, 0, 0);
  19866. obj.rankTxt.color = "#FFC047";
  19867. break;
  19868. case 1:
  19869. this.setImg(obj, 0, 1, 0);
  19870. obj.rankTxt.color = "#ACACAC";
  19871. break;
  19872. case 2:
  19873. this.setImg(obj, 0, 0, 1);
  19874. obj.rankTxt.color = "#D09672";
  19875. break;
  19876. default:
  19877. this.setImg(obj, 0, 0, 0);
  19878. obj.rankTxt.color = "#496FAB";
  19879. break;
  19880. }
  19881. }
  19882. setImg(obj, a, b, c) {
  19883. obj.img1.visible = a ? true : false;
  19884. obj.img2.visible = b ? true : false;
  19885. obj.img3.visible = c ? true : false;
  19886. }
  19887. changeList(type) {
  19888. this.rankType = type;
  19889. this.updateSelf();
  19890. }
  19891. changeSelfNode() {
  19892. this.showSelf = !this.showSelf;
  19893. this.updateSelf();
  19894. }
  19895. updateSelf() {
  19896. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19897. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19898. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19899. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19900. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19901. }
  19902. }
  19903. UIRanking$1.uiName = "UIRanking";
  19904. class UISecretary$1 extends UIBase {
  19905. constructor() {
  19906. super();
  19907. this.curIndex = 1;
  19908. }
  19909. onConstructor() {
  19910. this.ui = ui_UISecretary.createInstance();
  19911. this.contentPane = this.ui;
  19912. this.isEject = false;
  19913. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19914. this.nodeObj = { left: null, right: null, cur: null };
  19915. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19916. }
  19917. show() {
  19918. super.show();
  19919. this.ui.t0.play();
  19920. this.updateData();
  19921. }
  19922. addSecretarySpine(node, spineName) {
  19923. if (spineName == "mishu") {
  19924. if (this.secretarySpine1) {
  19925. node.displayObject.destroyChildren();
  19926. this.playWoman(this.secretarySpine1, node.displayObject);
  19927. }
  19928. else {
  19929. let spine1 = new SpineMgr("mishu", () => {
  19930. this.secretarySpine1 = spine1;
  19931. this.playWoman(this.secretarySpine1, node.displayObject);
  19932. });
  19933. }
  19934. }
  19935. else {
  19936. if (this.secretarySpine2) {
  19937. node.displayObject.destroyChildren();
  19938. this.playWoman(this.secretarySpine2, node.displayObject);
  19939. }
  19940. else {
  19941. let spine2 = new SpineMgr("xiaomishu2", () => {
  19942. this.secretarySpine2 = spine2;
  19943. this.playWoman(this.secretarySpine2, node.displayObject);
  19944. });
  19945. }
  19946. }
  19947. }
  19948. playWoman(node, parent) {
  19949. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  19950. let yy = this.ui.myNode.gameNode3.secretary.height;
  19951. let scale = 1.5;
  19952. if (node == this.secretarySpine2) {
  19953. scale = 1.2;
  19954. }
  19955. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19956. node.play(data, 0, true, parent);
  19957. }
  19958. turnLeft() {
  19959. this.curIndex--;
  19960. if (this.curIndex < 1) {
  19961. this.curIndex = 2;
  19962. }
  19963. let left = this.nodeObj.left;
  19964. let right = this.nodeObj.right;
  19965. let cur = this.nodeObj.cur;
  19966. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19967. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19968. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19969. this.updateData();
  19970. }));
  19971. this.ui.myNode.setChildIndex(right, 2);
  19972. this.nodeObj.left = cur;
  19973. this.nodeObj.right = left;
  19974. this.nodeObj.cur = right;
  19975. }
  19976. turnRight() {
  19977. this.curIndex++;
  19978. if (this.curIndex > 2) {
  19979. this.curIndex = 1;
  19980. }
  19981. let left = this.nodeObj.left;
  19982. let right = this.nodeObj.right;
  19983. let cur = this.nodeObj.cur;
  19984. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19985. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19986. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19987. this.updateData();
  19988. }));
  19989. this.ui.myNode.setChildIndex(left, 2);
  19990. this.nodeObj.left = right;
  19991. this.nodeObj.right = cur;
  19992. this.nodeObj.cur = left;
  19993. }
  19994. updateData() {
  19995. console.log('zh: updateData FFFFFFFFFF');
  19996. let data = cfgTable.secretaryshopData;
  19997. let children = this.ui.myNode._children;
  19998. let temp;
  19999. let curData;
  20000. for (let index = 0; index < children.length; index++) {
  20001. temp = children[index];
  20002. curData = data[1];
  20003. temp.heightTxt.text = curData.height;
  20004. temp.foodTxt.text = curData.food;
  20005. temp.historyTxt.text = curData.history;
  20006. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  20007. this.addSecretarySpine(temp.secretary, curData.spine);
  20008. let womanIndex = curData.id - 1;
  20009. let getWoman = DataMgr.getSecretary(womanIndex);
  20010. let curUse = DataMgr.getCurSecretary();
  20011. if (getWoman) {
  20012. if (curUse == womanIndex) {
  20013. temp.purchaseBtn.c1.selectedIndex = 1;
  20014. }
  20015. else {
  20016. temp.purchaseBtn.c1.selectedIndex = 2;
  20017. }
  20018. }
  20019. else {
  20020. temp.purchaseBtn.c1.selectedIndex = 0;
  20021. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  20022. }
  20023. temp.purchaseBtn.visible = false;
  20024. }
  20025. }
  20026. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  20027. console.log('zh: 点击了clickSecretary ');
  20028. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20029. if (getWoman) {
  20030. if (curUse != womanIndex) {
  20031. console.log();
  20032. DataMgr.setCurSecretary(womanIndex);
  20033. this.updateData();
  20034. }
  20035. }
  20036. else {
  20037. console.log('zh:点击购买了');
  20038. let need = needDiamond;
  20039. if (DataMgr.diamondEnough(need)) {
  20040. DataMgr.setDiamond(-need);
  20041. DataMgr.setSecretary(womanIndex, 1);
  20042. DataMgr.setCurSecretary(womanIndex);
  20043. this.updateData();
  20044. }
  20045. else {
  20046. xGame.uiMgr.Show(UIAddProp$1, 1);
  20047. }
  20048. }
  20049. }
  20050. closeSelf() {
  20051. this.hide();
  20052. }
  20053. }
  20054. UISecretary$1.uiName = "UISecretary";
  20055. class BallRodDisplay$1 {
  20056. constructor(ui, index) {
  20057. this.index = 0;
  20058. this.uiIndex = 0;
  20059. this.ui = ui;
  20060. this.index = index;
  20061. this.initData();
  20062. }
  20063. initData() {
  20064. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  20065. let data = cfgTable.ballrodData[this.index + 1];
  20066. this.ui.nameTxt.text = data.name;
  20067. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  20068. this.ui.levelNode.c1.selectedIndex = data.quality;
  20069. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  20070. if (data.spine) {
  20071. this.mySpine = new SpineMgr(data.spine, () => {
  20072. let xx = 150;
  20073. let yy = 70;
  20074. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  20075. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  20076. });
  20077. }
  20078. }
  20079. updateSelf() {
  20080. console.log('zh:updateSelf -------------- ');
  20081. let get = DataMgr.getBallRod(this.index);
  20082. if (get == null)
  20083. get = 1;
  20084. let curUse = DataMgr.getCurBallRod();
  20085. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20086. if (get) {
  20087. if (curUse == this.index) {
  20088. this.ui.purchaseBtn.c1.selectedIndex = 0;
  20089. }
  20090. else {
  20091. this.ui.purchaseBtn.c1.selectedIndex = 1;
  20092. }
  20093. }
  20094. else {
  20095. this.ui.purchaseBtn.c1.selectedIndex = 2;
  20096. }
  20097. }
  20098. buyBallRod() {
  20099. console.log('zh:buyBallRod eeeeee');
  20100. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20101. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  20102. switch (selectedIndex) {
  20103. case 0:
  20104. break;
  20105. case 1:
  20106. console.log('zh:点击了 USE THIS');
  20107. DataMgr.setCurBallRod(this.index);
  20108. let curUse = DataMgr.getCurBallRod();
  20109. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20110. let ui = xGame.uiMgr.getUI(UIShop$1);
  20111. ui.updateBallRod();
  20112. break;
  20113. case 2:
  20114. let data = cfgTable.ballrodData[this.index + 1];
  20115. let need = data.price;
  20116. if (DataMgr.diamondEnough(need)) {
  20117. DataMgr.setDiamond(-need);
  20118. DataMgr.setBallRod(this.index, 1);
  20119. DataMgr.setCurBallRod(this.index);
  20120. let ui = xGame.uiMgr.getUI(UIShop$1);
  20121. ui.updateBallRod();
  20122. }
  20123. else {
  20124. xGame.uiMgr.Show(UIAddProp$1, 1);
  20125. }
  20126. break;
  20127. default:
  20128. break;
  20129. }
  20130. }
  20131. }
  20132. class UIShop$1 extends UIBase {
  20133. constructor() {
  20134. super();
  20135. this.itemNums = 0;
  20136. }
  20137. onConstructor() {
  20138. this.ui = ui_UIShop.createInstance();
  20139. this.contentPane = this.ui;
  20140. this.isEject = false;
  20141. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20142. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20143. this.addUIClick(this.ui, this.interuptSecretary);
  20144. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  20145. this.ballRodArr = [];
  20146. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  20147. this.ui.myNode.myList.numItems = this.itemNums;
  20148. if (Moyu.isKs)
  20149. this.ui.closeNode.closeBtn.x += 100;
  20150. }
  20151. show() {
  20152. super.show();
  20153. this.playSecretaryIdle();
  20154. this.updateBallRod();
  20155. }
  20156. updateBallRod() {
  20157. for (let index = 0; index < this.ballRodArr.length; index++) {
  20158. this.ballRodArr[index].updateSelf();
  20159. }
  20160. }
  20161. renderBallRod(sort, obj) {
  20162. let index = this.getIndexBySort(sort + 1) - 1;
  20163. let ballRod = new BallRodDisplay$1(obj, index);
  20164. this.ballRodArr.push(ballRod);
  20165. }
  20166. getIndexBySort(sort) {
  20167. let object = cfgTable.ballrodData;
  20168. for (const key in object) {
  20169. if (object[key].sort == sort) {
  20170. return parseInt(key);
  20171. }
  20172. }
  20173. }
  20174. playSecretaryIdle() {
  20175. let parent = this.ui.secretary.displayObject;
  20176. parent.destroyChildren();
  20177. let xx = this.ui.secretary.width / 2;
  20178. let yy = this.ui.secretary.height;
  20179. let scale = xGame.common.getSecretaryScale();
  20180. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20181. xGame.common.secretary.play(data, 0, true, parent);
  20182. }
  20183. interuptSecretary() {
  20184. Laya.timer.clearAll(this);
  20185. this.playSecretaryRandomSound();
  20186. }
  20187. playSecretaryRandomSound() {
  20188. if (this.isHide)
  20189. return;
  20190. let time = xGame.common.randomNum(45000, 60000);
  20191. Laya.timer.once(time, this, () => {
  20192. if (this.isHide)
  20193. return;
  20194. let index = xGame.common.randomNum(4, 7);
  20195. xGame.soundMgr.playSound("s_main0" + index);
  20196. let words = 1;
  20197. switch (index) {
  20198. case 4:
  20199. words = 5;
  20200. break;
  20201. case 5:
  20202. words = 3;
  20203. break;
  20204. case 6:
  20205. words = 6;
  20206. break;
  20207. case 7:
  20208. words = 7;
  20209. break;
  20210. default:
  20211. break;
  20212. }
  20213. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20214. this.playSecretaryRandomSound();
  20215. });
  20216. }
  20217. closeSelf() {
  20218. this.hide();
  20219. }
  20220. }
  20221. UIShop$1.uiName = "UIShop";
  20222. class SignMax$1 {
  20223. constructor(ui) {
  20224. this.ui = ui;
  20225. }
  20226. updateSelf(index, sameDay, curDayIndex) {
  20227. let data = cfgTable.signData[index + 1];
  20228. this.ui.titleTxt.text = data.title;
  20229. let arr1 = data.award[0].split('-');
  20230. let arr2 = data.award[1].split('-');
  20231. let num1 = parseInt(arr1[1]);
  20232. let num2 = parseInt(arr2[1]);
  20233. this.ui.numTxt1.text = num1 + "";
  20234. this.ui.numTxt2.text = num2 + "";
  20235. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  20236. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  20237. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  20238. this.ui.numTxt1.visible = false;
  20239. }
  20240. else {
  20241. this.ui.numTxt1.visible = true;
  20242. }
  20243. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  20244. this.ui.numTxt2.visible = false;
  20245. }
  20246. else {
  20247. this.ui.numTxt2.visible = true;
  20248. }
  20249. if (index < curDayIndex) {
  20250. this.ui.c1.selectedIndex = 1;
  20251. }
  20252. else if (index == curDayIndex) {
  20253. if (sameDay) {
  20254. this.ui.c1.selectedIndex = 2;
  20255. }
  20256. else {
  20257. this.ui.c1.selectedIndex = 2;
  20258. }
  20259. }
  20260. else {
  20261. this.ui.c1.selectedIndex = 0;
  20262. }
  20263. }
  20264. }
  20265. class SignNormal$1 {
  20266. constructor(ui) {
  20267. this.ui = ui;
  20268. }
  20269. updateSelf(index, sameDay, curDayIndex) {
  20270. let data = cfgTable.signData[index + 1];
  20271. this.ui.titleTxt.text = data.title;
  20272. let arr = data.award[0].split('-');
  20273. let type = parseInt(arr[0]);
  20274. let num = parseInt(arr[1]);
  20275. this.ui.numTxt.text = num + "";
  20276. if (type > 2) {
  20277. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  20278. this.ui.myIcon.rotation = 0;
  20279. }
  20280. else {
  20281. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  20282. this.ui.myIcon.rotation = 0;
  20283. }
  20284. if (xGame.common.signAwardContainsRod(data.award)) {
  20285. this.ui.numTxt.visible = false;
  20286. }
  20287. else {
  20288. this.ui.numTxt.visible = true;
  20289. }
  20290. if (index < curDayIndex) {
  20291. this.ui.c1.selectedIndex = 1;
  20292. }
  20293. else if (index == curDayIndex) {
  20294. if (sameDay) {
  20295. this.ui.c1.selectedIndex = 2;
  20296. }
  20297. else {
  20298. this.ui.c1.selectedIndex = 2;
  20299. }
  20300. }
  20301. else {
  20302. this.ui.c1.selectedIndex = 0;
  20303. }
  20304. }
  20305. }
  20306. class UISign$1 extends UIBase {
  20307. constructor() {
  20308. super();
  20309. this.curDayIndex = 0;
  20310. this.starX = 0;
  20311. }
  20312. onConstructor() {
  20313. this.ui = ui_UISign.createInstance();
  20314. this.contentPane = this.ui;
  20315. this.isEject = false;
  20316. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20317. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20318. this.initSignItem();
  20319. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  20320. this.addUIClick(this.ui.againBtn, this.againGetAward);
  20321. }
  20322. show() {
  20323. super.show();
  20324. this.ui.t0.play();
  20325. this.playSecretaryIdle();
  20326. this.updateSign();
  20327. }
  20328. initSignItem() {
  20329. this.signArr = [];
  20330. for (let index = 0; index < 6; index++) {
  20331. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  20332. this.signArr.push(temp);
  20333. }
  20334. this.signMax = new SignMax$1(this.ui.myNode.day7);
  20335. if (Moyu.isKs)
  20336. this.ui.closeNode.closeBtn.x += 100;
  20337. }
  20338. updateSign() {
  20339. let sameDay = xGame.common.judgeSameDay();
  20340. let max = 7;
  20341. this.curDayIndex = DataMgr.getSignData();
  20342. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  20343. this.curDayIndex = 0;
  20344. if (!sameDay) {
  20345. this.ui.normalBtn.visible = true;
  20346. this.ui.tipsNode.visible = false;
  20347. this.ui.againBtn.visible = false;
  20348. }
  20349. else {
  20350. this.ui.normalBtn.visible = false;
  20351. let again = DataMgr.getExtraSign();
  20352. let isCurrency = false;
  20353. let index = this.curDayIndex;
  20354. if (index == 0)
  20355. index = 7;
  20356. let award = cfgTable.signData[index].award;
  20357. let num = award[0].split("-")[0];
  20358. if (num == "1" || num == "2")
  20359. isCurrency = true;
  20360. let showAgain = again == 0 && isCurrency;
  20361. this.ui.againBtn.visible = showAgain;
  20362. this.ui.tipsNode.visible = !showAgain;
  20363. }
  20364. for (let index = 0; index < this.signArr.length; index++) {
  20365. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20366. }
  20367. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20368. }
  20369. playSecretaryIdle() {
  20370. let parent = this.ui.secretary.displayObject;
  20371. parent.destroyChildren();
  20372. let xx = this.ui.secretary.width / 2;
  20373. let yy = this.ui.secretary.height;
  20374. let scale = xGame.common.getSecretaryScale();
  20375. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20376. xGame.common.secretary.play(data, 0, true, parent);
  20377. }
  20378. closeSelf() {
  20379. this.hide();
  20380. }
  20381. normalGetAward() {
  20382. let sameDay = xGame.common.judgeSameDay();
  20383. if (!sameDay) {
  20384. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20385. let temp;
  20386. let type;
  20387. let num;
  20388. let arr = [];
  20389. for (let index = 0; index < award.length; index++) {
  20390. temp = award[index].split("-");
  20391. type = parseInt(temp[0]);
  20392. num = parseInt(temp[1]);
  20393. let awardType = new AwardType();
  20394. awardType.num = num;
  20395. awardType.type = type;
  20396. arr.push(awardType);
  20397. }
  20398. xGame.common.getAward(arr, (watchVideo) => {
  20399. this.curDayIndex++;
  20400. if (this.curDayIndex > 7)
  20401. this.curDayIndex = 0;
  20402. DataMgr.setSignData(this.curDayIndex);
  20403. DataMgr.setSignTime(new Date().getTime());
  20404. if (watchVideo) {
  20405. DataMgr.setExtraSign(1);
  20406. Moyu.sendDataEvent("signIn1");
  20407. }
  20408. this.updateSign();
  20409. });
  20410. }
  20411. }
  20412. againGetAward() {
  20413. Moyu.sendDataEvent("signIn2");
  20414. console.log('zh:qjff_AD_for_uisign');
  20415. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  20416. }
  20417. else {
  20418. console.log('zh:AD 失败,直接发放奖励');
  20419. this.qjff_AD_for_uisign();
  20420. }
  20421. }
  20422. qjff_AD_for_uisign() {
  20423. let index = this.curDayIndex;
  20424. if (index == 0)
  20425. index = 7;
  20426. let award = cfgTable.signData[index].award;
  20427. let temp;
  20428. let type;
  20429. let num;
  20430. for (let index = 0; index < award.length; index++) {
  20431. temp = award[index].split("-");
  20432. type = parseInt(temp[0]);
  20433. num = parseInt(temp[1]) * 3;
  20434. xGame.common.playObjFlyAnim(num, type);
  20435. }
  20436. DataMgr.setExtraSign(1);
  20437. this.updateSign();
  20438. }
  20439. }
  20440. UISign$1.uiName = "UISign";
  20441. class UIModeSelection$1 extends UIBase {
  20442. constructor() {
  20443. super();
  20444. }
  20445. onConstructor() {
  20446. this.ui = ui_UIModeSelection.createInstance();
  20447. this.contentPane = this.ui;
  20448. this.isEject = false;
  20449. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20450. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20451. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20452. this.addUIClick(this.ui.closeBtn, this.hide);
  20453. this.peopleArr = [650, 6900, 3800];
  20454. this.peopleOffest = [50, 500, 200];
  20455. this.updateSelf();
  20456. }
  20457. show(callback) {
  20458. super.show();
  20459. this.ui.t0.play();
  20460. this.callback = callback;
  20461. }
  20462. updateSelf() {
  20463. let cfg = cfgTable.modeselectData;
  20464. for (let index = 1; index <= 3; index++) {
  20465. let node = this.ui.myNode["type" + index];
  20466. node.need.text = cfg[index].need;
  20467. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20468. node.peopleTxt.text = this.getRandPeople(index - 1);
  20469. }
  20470. }
  20471. enterGame(type) {
  20472. xGame.common.classicRoomType = type;
  20473. let cfg = cfgTable.modeselectData[type];
  20474. let need = cfg.need;
  20475. xGame.common.passAwardCoin = cfg.award;
  20476. if (DataMgr.coinEnough(need)) {
  20477. DataMgr.setCoin(-need);
  20478. this.ui.myNode["type" + type].t0.play();
  20479. Laya.timer.once(200, this, () => {
  20480. this.callback && this.callback();
  20481. });
  20482. }
  20483. else {
  20484. Moyu.sendDataEvent("AddCoinVideo");
  20485. xGame.uiMgr.Show(UIAddProp$1, 0);
  20486. }
  20487. }
  20488. getRandPeople(index) {
  20489. let rand = this.peopleOffest[index];
  20490. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20491. }
  20492. }
  20493. UIModeSelection$1.uiName = "UIModeSelection";
  20494. class UITry$1 extends UIBase {
  20495. constructor() {
  20496. super();
  20497. this.closeTime = 0;
  20498. this.closeNum = 0;
  20499. this.skillUrl = xGame.common.skillIconList;
  20500. }
  20501. onConstructor() {
  20502. this.ui = ui_UITry.createInstance();
  20503. this.contentPane = this.ui;
  20504. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  20505. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  20506. }
  20507. show() {
  20508. super.show();
  20509. this.closeNum = 0;
  20510. this.closeTime = 15;
  20511. this.ui.t0.play();
  20512. PlatMgr.showRateBanner();
  20513. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20514. Laya.timer.loop(1000, this, this.updateTime);
  20515. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  20516. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  20517. xGame.common.gameMgr.gamePause = true;
  20518. }
  20519. updateTime() {
  20520. if (this.closeTime > 1) {
  20521. this.closeTime--;
  20522. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20523. }
  20524. else
  20525. this.hide();
  20526. }
  20527. hide() {
  20528. Laya.timer.clearAll(this);
  20529. Moyu.showBannerAd(false);
  20530. super.hide();
  20531. xGame.common.gameMgr.gamePause = false;
  20532. }
  20533. onTry() {
  20534. console.log('zh:qjff_AD_for_uitry');
  20535. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  20536. }
  20537. else {
  20538. console.log('zh:AD 失败,直接发放奖励');
  20539. this.qjff_AD_for_uitry();
  20540. }
  20541. }
  20542. qjff_AD_for_uitry() {
  20543. let select = xGame.common.curPlayerSkillType;
  20544. DataMgr.gameData.trySkill = select;
  20545. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  20546. DataMgr.saveGameData();
  20547. DataMgr.setBigSkill(select, 1);
  20548. xGame.showTip("Trial Successful");
  20549. this.hide();
  20550. }
  20551. onCancel() {
  20552. if (this.closeNum > 0) {
  20553. this.closeNum--;
  20554. if (this.closeNum < 2)
  20555. this.hide();
  20556. return;
  20557. }
  20558. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  20559. this.onTry();
  20560. }
  20561. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  20562. this.closeNum = 3;
  20563. }
  20564. else
  20565. this.hide();
  20566. }
  20567. }
  20568. UITry$1.uiName = "UITry";
  20569. class UIGetAward$1 extends UIBase {
  20570. constructor() {
  20571. super();
  20572. this.showTriple = true;
  20573. }
  20574. onConstructor() {
  20575. this.ui = ui_UIGetAward.createInstance();
  20576. this.contentPane = this.ui;
  20577. this.isEject = false;
  20578. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  20579. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  20580. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  20581. }
  20582. show(arr, showTriple, callback) {
  20583. super.show();
  20584. this.ui.t0.play();
  20585. this.ui.eftNode.visible = true;
  20586. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  20587. this.ui.eftNode.visible = false;
  20588. }), 1, 0, 0, 0.9);
  20589. this.awardArr = arr;
  20590. this.showTriple = showTriple;
  20591. this.callback = callback;
  20592. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  20593. this.ui.myList.numItems = arr.length;
  20594. xGame.soundMgr.playSound("getaward");
  20595. }
  20596. updateSelf(index, obj) {
  20597. let temp = this.awardArr[index];
  20598. let icon = this.getIcon(temp.type);
  20599. let str = icon;
  20600. if (temp.type > 2) {
  20601. str = "s" + icon;
  20602. }
  20603. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  20604. obj.myIcon.rotation = 0;
  20605. obj.numTxt.text = temp.num + "";
  20606. obj.numTxt.visible = temp.type > 2 ? false : true;
  20607. obj.nameTxt.text = this.getNameStr(temp.type);
  20608. }
  20609. renderItem(index, obj) {
  20610. this.updateSelf(index, obj);
  20611. }
  20612. tripleGetAward() {
  20613. console.log('zh:qjff_AD_for_uigetAward');
  20614. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  20615. }
  20616. else {
  20617. console.log('zh:AD 失败,直接发放奖励');
  20618. this.qjff_AD_for_uigetAward();
  20619. }
  20620. }
  20621. qjff_AD_for_uigetAward() {
  20622. this.getAward(3);
  20623. }
  20624. normalGetAward() {
  20625. if (PlatMgr.isMisVideo())
  20626. this.tripleGetAward();
  20627. else
  20628. this.getAward();
  20629. }
  20630. getAward(times = 1) {
  20631. this.hide();
  20632. for (let index = 0; index < this.awardArr.length; index++) {
  20633. this.awardArr[index].num *= times;
  20634. }
  20635. this.callback && this.callback(times != 1);
  20636. }
  20637. getIcon(type) {
  20638. switch (type) {
  20639. case Prop.diamond:
  20640. return "ty_zs";
  20641. case Prop.coin:
  20642. return "ty_jb";
  20643. case Prop.gan1:
  20644. return "qg1";
  20645. case Prop.gan2:
  20646. return "qg2";
  20647. case Prop.gan3:
  20648. return "qg3";
  20649. case Prop.gan4:
  20650. return "qg4";
  20651. default:
  20652. break;
  20653. }
  20654. }
  20655. getNameStr(type) {
  20656. switch (type) {
  20657. case Prop.diamond:
  20658. return "Diamond";
  20659. case Prop.coin:
  20660. return "Coins";
  20661. case Prop.gan1:
  20662. case Prop.gan2:
  20663. case Prop.gan3:
  20664. case Prop.gan4:
  20665. return cfgTable.ballrodData[type - 1].name;
  20666. default:
  20667. break;
  20668. }
  20669. }
  20670. }
  20671. UIGetAward$1.uiName = "UIGetAward";
  20672. class UIBox$1 extends UIBase {
  20673. constructor() {
  20674. super();
  20675. this.boxNum = 0;
  20676. this.boxMax = 10;
  20677. this.inAd = false;
  20678. this.isClose = false;
  20679. }
  20680. onConstructor() {
  20681. this.ui = ui_UIBox.createInstance();
  20682. this.contentPane = this.ui;
  20683. this.isEject = false;
  20684. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  20685. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  20686. Laya.timer.loop(1000, this, this.update);
  20687. }
  20688. update() {
  20689. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  20690. this.boxNum -= 1;
  20691. this.upBar();
  20692. }
  20693. }
  20694. upBar() {
  20695. if (this.boxNum > this.boxMax)
  20696. this.boxNum = this.boxMax;
  20697. this.ui.bar.value = this.boxNum * 10;
  20698. }
  20699. show() {
  20700. super.show();
  20701. this.isClose = false;
  20702. this.boxNum = 0;
  20703. this.inAd = false;
  20704. this.upBar();
  20705. this.ui.t0.play();
  20706. this.ui.closeBtn.visible = false;
  20707. Laya.timer.once(3000, this, () => {
  20708. this.ui.closeBtn.visible = true;
  20709. this.ui.bar.alpha = 1;
  20710. });
  20711. Laya.timer.once(500, this, () => {
  20712. this.ui.t1.play();
  20713. });
  20714. }
  20715. hide() {
  20716. Laya.timer.clearAll(this);
  20717. Moyu.showBannerAd(false);
  20718. super.hide();
  20719. }
  20720. onOpenBox() {
  20721. this.boxNum++;
  20722. if (this.boxNum < this.boxMax) {
  20723. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  20724. Moyu.showInsertAd(0, PlatMgr.insertGap);
  20725. }
  20726. else if (this.boxNum == this.boxMax) {
  20727. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  20728. this.ui.openBtn.c1.selectedIndex = 13;
  20729. this.inAd = true;
  20730. }
  20731. else
  20732. this.getAward();
  20733. }
  20734. else if (this.inAd) {
  20735. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  20736. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  20737. }
  20738. else {
  20739. console.log('zh:AD 失败,直接发放奖励');
  20740. this.qjff_AD_for_UIBOX_onOpenBox();
  20741. }
  20742. }
  20743. this.upBar();
  20744. }
  20745. qjff_AD_for_UIBOX_onOpenBox() {
  20746. this.getAward();
  20747. }
  20748. onCloseBox() {
  20749. if (this.isClose)
  20750. this.hide();
  20751. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  20752. this.isClose = true;
  20753. PlatMgr.showBanner(true, 0, 3000);
  20754. }
  20755. else
  20756. this.hide();
  20757. }
  20758. getAward() {
  20759. let str = "";
  20760. if (Math.random() < 0.5) {
  20761. let max = Moyu.isLegal ? 500 : 2500;
  20762. let num = xGame.tools.random(max, 500 + max);
  20763. DataMgr.setCoin(num);
  20764. str = "金币x" + num;
  20765. }
  20766. else {
  20767. let max = Moyu.isLegal ? 10 : 30;
  20768. let num = xGame.tools.random(max, 30 + max);
  20769. DataMgr.setDiamond(num);
  20770. str = "钻石x" + num;
  20771. }
  20772. xGame.showTip("恭喜获得-" + str);
  20773. this.hide();
  20774. }
  20775. }
  20776. UIBox$1.uiName = "UIBox";
  20777. class UIMain$1 extends UIBase {
  20778. constructor() {
  20779. super();
  20780. this.firstEnter = true;
  20781. }
  20782. nativeCallJs(msg) {
  20783. let t = msg;
  20784. console.log("zh: nativeCallJs 奖励开始发放:", t);
  20785. switch (t) {
  20786. case 'qjff_chouJiang':
  20787. let dui = xGame.uiMgr.getUI(UIDraw$1);
  20788. dui.qjff_chouJiang();
  20789. break;
  20790. case 'qjff_AD_for_uisign':
  20791. let dui2 = xGame.uiMgr.getUI(UISign$1);
  20792. dui2.qjff_AD_for_uisign();
  20793. break;
  20794. case 'qjff_AD_for_uitry':
  20795. let dui3 = xGame.uiMgr.getUI(UITry$1);
  20796. dui3.qjff_AD_for_uitry();
  20797. break;
  20798. case 'qjff_AD_for_uipower':
  20799. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  20800. dui4.qjff_AD_for_uipower();
  20801. break;
  20802. case 'qjff_AD_for_uigetAward':
  20803. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  20804. dui5.qjff_AD_for_uigetAward();
  20805. break;
  20806. case 'qjff_AD_for_uiGameEnd':
  20807. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  20808. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  20809. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  20810. break;
  20811. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  20812. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  20813. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  20814. break;
  20815. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  20816. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  20817. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  20818. break;
  20819. case 'qjff_AD_for_UIrepentProp_videoRegret':
  20820. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  20821. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  20822. break;
  20823. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  20824. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  20825. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20826. break;
  20827. case 'qjff_AD_for_UIBOX_onOpenBox':
  20828. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  20829. dui11.qjff_AD_for_UIBOX_onOpenBox();
  20830. break;
  20831. case 'qjff_AD_for_UIAddCoin':
  20832. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  20833. dui12.qjff_AD_for_UIAddCoin();
  20834. break;
  20835. case '111a':
  20836. let dui14 = xGame.uiMgr.getUI(UISign$1);
  20837. dui14.qjff_AD_for_uisign();
  20838. break;
  20839. case '222a':
  20840. let dui15 = xGame.uiMgr.getUI(UISign$1);
  20841. dui15.qjff_AD_for_uisign();
  20842. break;
  20843. case '333a':
  20844. let dui16 = xGame.uiMgr.getUI(UISign$1);
  20845. dui16.qjff_AD_for_uisign();
  20846. break;
  20847. default:
  20848. console.log('zh:未知的方法名字' + t);
  20849. break;
  20850. }
  20851. }
  20852. onConstructor() {
  20853. console.log('zh: UIMain onConstructor');
  20854. this.ui = ui_UIMain.createInstance();
  20855. this.contentPane = this.ui;
  20856. this.isEject = false;
  20857. this.addEvent();
  20858. this.addClickSpine();
  20859. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20860. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20861. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20862. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20863. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20864. let curUse = DataMgr.getCurSecretary();
  20865. this.changeSecretary(curUse);
  20866. this.ui.talkNode.visible = false;
  20867. let guide = DataMgr.getSkillGuide();
  20868. if (xGame.common.isNewDay && guide == 1) {
  20869. xGame.common.isNewDay = false;
  20870. xGame.soundMgr.playSound("s_main01");
  20871. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20872. console.log("zh:播放小秘书每天语音");
  20873. }
  20874. this.ui.n83.visible = false;
  20875. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  20876. }
  20877. changeSecretary(curUse) {
  20878. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20879. xGame.common.secretary && xGame.common.secretary.dispose();
  20880. this.addSecretarySpine(name);
  20881. }
  20882. addSecretarySpine(name) {
  20883. let spine = new SpineMgr(name, () => {
  20884. this.playSecretaryIdle();
  20885. });
  20886. xGame.common.secretary = spine;
  20887. }
  20888. addClickSpine() {
  20889. let clickSpine = new SpineMgr("dianji", () => {
  20890. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20891. let parent = Laya.stage;
  20892. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20893. clickSpine.play(data, 0, false, parent, (spine) => {
  20894. spine.destroy(true);
  20895. });
  20896. });
  20897. });
  20898. }
  20899. addEvent() {
  20900. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20901. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20902. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20903. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20904. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20905. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20906. this.addUIClick(this.ui, this.interuptSecretary);
  20907. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20908. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20909. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20910. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20911. this.addUIClick(this.ui.signBtn, this.openSignView);
  20912. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20913. }
  20914. show(showFailWords) {
  20915. super.show();
  20916. this.moneyNode.ui.c1.selectedIndex = 1;
  20917. this.playSecretaryIdle();
  20918. xGame.soundMgr.playMusic("caromhall01", 0);
  20919. Laya.timer.clearAll(this);
  20920. this.playSecretaryRandomSound();
  20921. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  20922. if (showFailWords) {
  20923. console.log('zh:uimain.ts ');
  20924. setTimeout(() => {
  20925. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20926. let words = -1;
  20927. if (str == "s_main02") {
  20928. words = 2;
  20929. }
  20930. else {
  20931. words = 3;
  20932. }
  20933. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20934. xGame.soundMgr.playSound(str);
  20935. }, 300);
  20936. }
  20937. this.showGuide();
  20938. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20939. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20940. let guide = DataMgr.getSkillGuide();
  20941. if (guide == 1) {
  20942. let randTime = xGame.common.randomNum(300, 800);
  20943. if (this.firstEnter) {
  20944. this.firstEnter = false;
  20945. randTime += 900;
  20946. }
  20947. Laya.timer.once(randTime, this, () => {
  20948. xGame.common.autoPopUIView();
  20949. });
  20950. }
  20951. }
  20952. checkActive(show) {
  20953. }
  20954. showGuide() {
  20955. let guide = DataMgr.getSkillGuide();
  20956. this.ui.guideBtn.visible = guide == 0;
  20957. this.ui.enterGuide.visible = false;
  20958. this.ui.secretaryGuide.visible = guide == 0;
  20959. if (guide == 0) {
  20960. xGame.soundMgr.playSound("s_guide");
  20961. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20962. }
  20963. }
  20964. ensureSecretary() {
  20965. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  20966. this.ui.secretaryGuide.visible = false;
  20967. this.ui.enterGuide.visible = true;
  20968. this.ui.wordsNode.t0.play();
  20969. if (DataMgr.getNewUser())
  20970. Moyu.sendDataEvent("gameReady");
  20971. }
  20972. playSecretaryIdle() {
  20973. let parent = this.ui.secretary.displayObject;
  20974. parent.destroyChildren();
  20975. let xx = this.ui.secretary.width / 2;
  20976. let yy = this.ui.secretary.height;
  20977. let scale = xGame.common.getSecretaryScale();
  20978. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20979. console.log("zh:playSecretaryIdle", data);
  20980. xGame.common.secretary.play(data, 0, true, parent);
  20981. }
  20982. startGame(type) {
  20983. xGame.common.gameMode = type;
  20984. Moyu.sendDataEvent("PlayGame", { type: type });
  20985. switch (xGame.common.gameMode) {
  20986. case GameMode.classic:
  20987. let challengeTimes = DataMgr.getChallengeTimes();
  20988. if (challengeTimes == 0) {
  20989. xGame.uiMgr.Show(UIInvitation$1);
  20990. }
  20991. else {
  20992. this.beginGame();
  20993. }
  20994. break;
  20995. case GameMode.bigMove:
  20996. this.beginGame();
  20997. if (DataMgr.getNewUser())
  20998. Moyu.sendDataEvent("gameStart0");
  20999. break;
  21000. default:
  21001. break;
  21002. }
  21003. }
  21004. beginGame(isNice = false) {
  21005. console.log('zh:beginGame beginGame beginGame');
  21006. if (xGame.common.gameMode == GameMode.classic) {
  21007. if (isNice) {
  21008. this.enterClassic();
  21009. }
  21010. else {
  21011. xGame.uiMgr.Show(UIModeSelection$1, () => {
  21012. this.enterClassic();
  21013. });
  21014. }
  21015. }
  21016. else if (xGame.common.gameMode == GameMode.bigMove) {
  21017. this.ui.enterGuide.visible = false;
  21018. xGame.uiMgr.Show(UISkill$1);
  21019. }
  21020. }
  21021. enterClassic() {
  21022. xGame.uiMgr.Show(UIGame$1);
  21023. xGame.uiMgr.Show(UIMatching$1, () => {
  21024. if (!this.isHide)
  21025. this.hide();
  21026. xGame.common.gameUI.ui.alpha = 1;
  21027. xGame.common.gameUI.startGame();
  21028. xGame.uiMgr.Hide(UIGameEnd$1);
  21029. });
  21030. }
  21031. startGlobal() {
  21032. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21033. }
  21034. startWeekly() {
  21035. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21036. }
  21037. zhouSaiMonth() {
  21038. console.log('zh: zhouSaiMonth 被调用');
  21039. }
  21040. startPlaceBall() {
  21041. xGame.uiMgr.Show(UILevelDisplay$1);
  21042. }
  21043. hide() {
  21044. console.log('zh:uimain hide ...');
  21045. super.hide();
  21046. xGame.common.stopGirlPop(this.ui.talkNode);
  21047. }
  21048. onGetUserInfo(force = false) {
  21049. if (Moyu.isWx) {
  21050. let info = Moyu.getSystemInfo();
  21051. if (info)
  21052. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  21053. }
  21054. else {
  21055. Moyu.initUser(this, this.freshUser, force);
  21056. }
  21057. if (!Moyu.hasUserInfo) {
  21058. let user = Moyu.getUserInfo();
  21059. user.headIcon = 'res/ty_touxiang.png';
  21060. }
  21061. this.freshUser();
  21062. }
  21063. freshUser() {
  21064. let user = Moyu.getUserInfo();
  21065. if (!user.isAuth) {
  21066. user.headIcon = 'res/ty_touxiang.png';
  21067. }
  21068. else
  21069. DataMgr.upRankData();
  21070. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  21071. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  21072. }
  21073. interuptSecretary() {
  21074. Laya.timer.clearAll(this);
  21075. this.playSecretaryRandomSound();
  21076. }
  21077. playSecretaryRandomSound() {
  21078. if (this.isHide)
  21079. return;
  21080. let time = xGame.common.randomNum(45000, 60000);
  21081. Laya.timer.once(time, this, () => {
  21082. if (this.isHide)
  21083. return;
  21084. let index = xGame.common.randomNum(4, 7);
  21085. xGame.soundMgr.playSound("s_main0" + index);
  21086. let words = 1;
  21087. switch (index) {
  21088. case 4:
  21089. words = 5;
  21090. break;
  21091. case 5:
  21092. words = 3;
  21093. break;
  21094. case 6:
  21095. words = 6;
  21096. break;
  21097. case 7:
  21098. words = 7;
  21099. break;
  21100. default:
  21101. break;
  21102. }
  21103. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21104. this.playSecretaryRandomSound();
  21105. });
  21106. }
  21107. openSecretaryView() {
  21108. xGame.uiMgr.Show(UISecretary$1);
  21109. Moyu.sendDataEvent("secretary");
  21110. }
  21111. openShopView() {
  21112. xGame.uiMgr.Show(UIShop$1);
  21113. }
  21114. openSignView() {
  21115. xGame.uiMgr.Show(UISign$1);
  21116. }
  21117. openDrawView() {
  21118. xGame.uiMgr.Show(UIDraw$1);
  21119. }
  21120. openRanking() {
  21121. xGame.uiMgr.Show(UIRanking$1);
  21122. Moyu.sendDataEvent("rankingList");
  21123. }
  21124. }
  21125. UIMain$1.uiName = "UIMain";
  21126. function InitShader() {
  21127. }
  21128. function appInit() {
  21129. xGame.context.init(getLoadingResList(), initCallback);
  21130. }
  21131. function getLoadingResList() {
  21132. return [
  21133. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  21134. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  21135. ];
  21136. }
  21137. function getGameResList() {
  21138. return [
  21139. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  21140. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  21141. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  21142. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  21143. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  21144. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  21145. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  21146. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  21147. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  21148. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  21149. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  21150. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  21151. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  21152. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  21153. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  21154. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  21155. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  21156. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  21157. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  21158. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  21159. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  21160. ];
  21161. }
  21162. function initCallback() {
  21163. window["DataMgr"] = DataMgr;
  21164. DataMgr.Init();
  21165. Moyu.init(getPlat(), this, () => {
  21166. DataMgr.isNewDay();
  21167. PlatMgr.initConfig();
  21168. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  21169. }, true);
  21170. console.log('zh:开始sm init1 start');
  21171. xGame.soundMgr.init();
  21172. console.log('zh:开始sm init1 end');
  21173. xGame.uiMgr.init();
  21174. xGame.uiMgr.clearTempData();
  21175. xGame.uiMgr.bindFUI(fguiRes.loading);
  21176. xGame.uiMgr.Show(UILoading);
  21177. }
  21178. function loadSubRes(callback) {
  21179. var tab = ["asset", "res", "spine"];
  21180. let subDone = 0;
  21181. for (var i = 0; i < tab.length; i++) {
  21182. let sub = tab[i];
  21183. Moyu.loadSubRes(sub, (pro) => {
  21184. callback && callback(pro, false);
  21185. }).then(() => {
  21186. subDone++;
  21187. if (subDone >= tab.length)
  21188. callback && callback(1, true);
  21189. });
  21190. }
  21191. }
  21192. function enterGame() {
  21193. xGame.cfgMgr.init();
  21194. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  21195. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  21196. xGame.uiMgr.Hide(UILoading);
  21197. fgui.UIPackage.removePackage(fguiRes.loading);
  21198. xGame.uiMgr.bindFUI(fguiRes.game);
  21199. xGame.uiMgr.Show(UIMain$1);
  21200. if (DataMgr.getNewUser())
  21201. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  21202. }
  21203. function getPlat() {
  21204. let cfg = new MoyuCfg();
  21205. cfg.plat = MoyuPlat.web;
  21206. cfg.myId = 120;
  21207. cfg.myKey = '8848a885774230a4';
  21208. cfg.version = 0;
  21209. if (window.hasOwnProperty("gamebox")) {
  21210. cfg.plat = MoyuPlat.f399;
  21211. cfg.version = 0;
  21212. }
  21213. else if (window.hasOwnProperty("ks")) {
  21214. cfg.plat = MoyuPlat.ks;
  21215. cfg.version = 0;
  21216. cfg.ads.ksVideoId = '2300002254_01';
  21217. cfg.ads.ksInsertId = '2300002254_02';
  21218. }
  21219. else if (Laya.Browser.onTTMiniGame) {
  21220. cfg.plat = MoyuPlat.tt;
  21221. cfg.version = 0;
  21222. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  21223. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  21224. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  21225. }
  21226. else if (Laya.Browser.onMiniGame) {
  21227. cfg.plat = MoyuPlat.wx;
  21228. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  21229. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  21230. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  21231. }
  21232. else if (Laya.Browser.onQQMiniGame) {
  21233. cfg.plat = MoyuPlat.qq;
  21234. }
  21235. else if (Laya.Browser.onQGMiniGame) {
  21236. cfg.plat = MoyuPlat.op;
  21237. cfg.ads.opVideoId = '455502';
  21238. cfg.ads.opBannerId = '455507';
  21239. }
  21240. else if (Laya.Browser.onVVMiniGame) {
  21241. cfg.plat = MoyuPlat.vv;
  21242. cfg.version = 0;
  21243. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  21244. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  21245. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  21246. }
  21247. else if (Laya.Browser.onHWMiniGame) {
  21248. cfg.plat = MoyuPlat.hw;
  21249. }
  21250. else if (window["mz"]) {
  21251. cfg.plat = MoyuPlat.mz;
  21252. }
  21253. else {
  21254. let cfg = window['conchConfig'];
  21255. if (cfg) {
  21256. var os = cfg.getOS();
  21257. if (os == "Conch-ios") {
  21258. cfg.plat = MoyuPlat.ios;
  21259. }
  21260. else if (os == "Conch-android") {
  21261. }
  21262. }
  21263. }
  21264. return cfg;
  21265. }
  21266. class Main {
  21267. constructor() {
  21268. if (window["Laya3D"])
  21269. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  21270. else {
  21271. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  21272. this.initMain();
  21273. }
  21274. }
  21275. initMain() {
  21276. Laya["Physics"] && Laya["Physics"].enable();
  21277. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  21278. Laya.stage.scaleMode = GameConfig.scaleMode;
  21279. Laya.stage.screenMode = GameConfig.screenMode;
  21280. Laya.stage.alignV = GameConfig.alignV;
  21281. Laya.stage.alignH = GameConfig.alignH;
  21282. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  21283. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  21284. Laya.enableDebugPanel();
  21285. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  21286. Laya["PhysicsDebugDraw"].enable();
  21287. if (GameConfig.stat)
  21288. Laya.Stat.show();
  21289. Laya.alertGlobalError(true);
  21290. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  21291. }
  21292. onVersionLoaded() {
  21293. appInit();
  21294. }
  21295. }
  21296. new Main();
  21297. }());
  21298. //# sourceMappingURL=bundle.js.map