1
0

bundle.js 978 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513
  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 LOGIN_OUT = "LOGIN_OUT";
  52. let LOGIN_IN = "LOGIN_IN";
  53. let keyForLoginInfo = "userInfo";
  54. let TIP_MSG_key = {
  55. loginTimeOut: "Login timed out, please log in again.",
  56. pleaseLoginIn: "Please log in."
  57. };
  58. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  59. let poolKey = {
  60. inHoleEft: "inHoleEft",
  61. d3ball: "d3ball",
  62. iceEft: "iceEft",
  63. hitEft: "hitEft",
  64. fireworksEft: "fireworksEft",
  65. };
  66. var GameMode;
  67. (function (GameMode) {
  68. GameMode[GameMode["classic"] = 0] = "classic";
  69. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  70. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  71. })(GameMode || (GameMode = {}));
  72. var SkillType;
  73. (function (SkillType) {
  74. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  75. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  76. SkillType[SkillType["ice"] = 2] = "ice";
  77. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  78. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  79. })(SkillType || (SkillType = {}));
  80. var ClassicWordsType;
  81. (function (ClassicWordsType) {
  82. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  83. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  84. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  85. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  86. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  87. })(ClassicWordsType || (ClassicWordsType = {}));
  88. var PressType;
  89. (function (PressType) {
  90. PressType[PressType["powerNode"] = 0] = "powerNode";
  91. PressType[PressType["d2Root"] = 1] = "d2Root";
  92. PressType[PressType["moveNode"] = 2] = "moveNode";
  93. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  94. })(PressType || (PressType = {}));
  95. var PlaceBallType;
  96. (function (PlaceBallType) {
  97. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  98. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  99. })(PlaceBallType || (PlaceBallType = {}));
  100. var EAdType;
  101. (function (EAdType) {
  102. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  103. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  104. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  105. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  106. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  107. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  108. EAdType[EAdType["sign"] = 6] = "sign";
  109. EAdType[EAdType["draw"] = 7] = "draw";
  110. EAdType[EAdType["triple"] = 8] = "triple";
  111. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  112. EAdType[EAdType["getPower"] = 10] = "getPower";
  113. EAdType[EAdType["box"] = 11] = "box";
  114. EAdType[EAdType["try"] = 12] = "try";
  115. EAdType[EAdType["againSign"] = 13] = "againSign";
  116. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  117. })(EAdType || (EAdType = {}));
  118. var Prop;
  119. (function (Prop) {
  120. Prop[Prop["diamond"] = 1] = "diamond";
  121. Prop[Prop["coin"] = 2] = "coin";
  122. Prop[Prop["gan1"] = 3] = "gan1";
  123. Prop[Prop["gan2"] = 4] = "gan2";
  124. Prop[Prop["gan3"] = 5] = "gan3";
  125. Prop[Prop["gan4"] = 6] = "gan4";
  126. })(Prop || (Prop = {}));
  127. var TipsType;
  128. (function (TipsType) {
  129. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  130. TipsType[TipsType["foul"] = 1] = "foul";
  131. })(TipsType || (TipsType = {}));
  132. class AwardType {
  133. constructor(type, num) {
  134. this.type = type;
  135. this.num = num;
  136. }
  137. }
  138. var define = /*#__PURE__*/Object.freeze({
  139. fguiRes: fguiRes,
  140. ballCamp: ballCamp,
  141. FoulType: FoulType,
  142. ALL_BALL_STOP: ALL_BALL_STOP,
  143. WAIT_SHOOT: WAIT_SHOOT,
  144. D3RES_LOADED: D3RES_LOADED,
  145. BALL_SHOOT: BALL_SHOOT,
  146. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  147. RESET_GAME: RESET_GAME,
  148. COIN_CHANGE: COIN_CHANGE,
  149. DIAMOND_CHANGE: DIAMOND_CHANGE,
  150. RESTART_GAME: RESTART_GAME,
  151. GET_USER_INFO: GET_USER_INFO,
  152. CHANGE_SECRETARY: CHANGE_SECRETARY,
  153. POWER_CHANGE: POWER_CHANGE,
  154. POWER_TIME: POWER_TIME,
  155. LOGIN_OUT: LOGIN_OUT,
  156. LOGIN_IN: LOGIN_IN,
  157. keyForLoginInfo: keyForLoginInfo,
  158. TIP_MSG_key: TIP_MSG_key,
  159. baseHeadUrl: baseHeadUrl,
  160. poolKey: poolKey,
  161. get GameMode () { return GameMode; },
  162. get SkillType () { return SkillType; },
  163. get ClassicWordsType () { return ClassicWordsType; },
  164. get PressType () { return PressType; },
  165. get PlaceBallType () { return PlaceBallType; },
  166. get EAdType () { return EAdType; },
  167. get Prop () { return Prop; },
  168. get TipsType () { return TipsType; },
  169. AwardType: AwardType
  170. });
  171. class CContext {
  172. constructor() {
  173. this.winSize = { width: 0, height: 0 };
  174. this.notchHeight = 0;
  175. this.bannerHeight = 0;
  176. }
  177. init(resList, callback) {
  178. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  179. this.notchHeight = this.getNotchHeight();
  180. this.bannerHeight = this.getBannerHeight();
  181. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  182. callback && callback();
  183. }));
  184. }
  185. getNotchHeight() {
  186. let notchHeight = 50;
  187. if (Laya.Browser.onMiniGame) {
  188. let deviceInfo = wx.getSystemInfoSync();
  189. if (Laya.Browser.onIOS) {
  190. if (deviceInfo.model.search('iPhone X') != -1) {
  191. notchHeight = deviceInfo.statusBarHeight - 10;
  192. }
  193. else {
  194. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  195. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  196. notchHeight = deviceInfo.statusBarHeight - 10;
  197. }
  198. }
  199. }
  200. else if (Laya.Browser.onAndroid) {
  201. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  202. notchHeight = deviceInfo.statusBarHeight;
  203. }
  204. }
  205. }
  206. return notchHeight;
  207. }
  208. getBannerHeight() {
  209. return 0;
  210. }
  211. }
  212. let context = new CContext();
  213. var Handler = Laya.Handler;
  214. var Tween = Laya.Tween;
  215. function playClickEffect(btn) {
  216. if (!btn)
  217. return;
  218. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  219. if (!btn)
  220. return;
  221. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  222. if (!btn)
  223. return;
  224. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  225. }), 0, true);
  226. }), 0, true);
  227. }
  228. function getNumList(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(Number(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getStrList(strList) {
  240. let dataList = [];
  241. if (strList) {
  242. let list = strList;
  243. let array = list.split('|');
  244. for (var v in array) {
  245. dataList.push(String(array[v]));
  246. }
  247. }
  248. return dataList;
  249. }
  250. function getRandStr(len) {
  251. 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'];
  252. let str = "";
  253. for (let i = 0; i < len; i++) {
  254. let rand = random(0, list.length);
  255. str += list[rand];
  256. }
  257. return str;
  258. }
  259. function getUserId() {
  260. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  261. return str;
  262. }
  263. function formatPos(pos, len = 2) {
  264. let v = Math.pow(10, len);
  265. pos.x = Math.floor(pos.x * v) / v;
  266. pos.y = Math.floor(pos.y * v) / v;
  267. if (pos.z)
  268. pos.z = Math.floor(pos.z * v) / v;
  269. return pos;
  270. }
  271. function setPosInt(pos) {
  272. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  273. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  274. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  275. return pos;
  276. }
  277. function random(min, max) {
  278. var rang = max - min;
  279. var rand = Math.random() * rang;
  280. return Math.floor(rand) + min;
  281. }
  282. function randomList(list, num) {
  283. if (list.length <= num)
  284. return list;
  285. let arry = [];
  286. list.forEach(item => {
  287. arry.push(item);
  288. });
  289. let nums = [];
  290. for (let i = 0; i < num; i++) {
  291. let rand = random(0, arry.length);
  292. let v = arry[rand];
  293. nums.push(v);
  294. arry.splice(rand, 1);
  295. }
  296. return nums;
  297. }
  298. function worldToScreen(camera, point, pos) {
  299. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  300. pos.x = pos.x / Laya.stage.clientScaleX;
  301. pos.y = pos.y / Laya.stage.clientScaleY;
  302. }
  303. function getStringLenght(str) {
  304. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. function reviseString(str, len) {
  307. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  308. if (ld > len) {
  309. let sl = Math.floor(len / 2);
  310. let rs = str.substring(0, sl);
  311. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  312. while (d + 2 < len) {
  313. sl++;
  314. rs = str.substring(0, sl);
  315. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  316. }
  317. return rs + "...";
  318. }
  319. return str;
  320. }
  321. function getCoinString(coin) {
  322. if (coin < 10000)
  323. return coin.toString();
  324. else if (coin < 1000000) {
  325. let vh = Math.ceil(coin / 100);
  326. return (vh / 10) + "k";
  327. }
  328. else if (coin < 1000000000) {
  329. var vh = Math.ceil(coin / 100000);
  330. return (vh / 10) + "m";
  331. }
  332. else if (coin < 1000000000000) {
  333. var vh = Math.ceil(coin / 100000000);
  334. return (vh / 10) + "b";
  335. }
  336. else if (coin < 1000000000000000) {
  337. var vh = Math.ceil(coin / 100000000000);
  338. return (vh / 10) + "t";
  339. }
  340. }
  341. function getV3Dest(pos, dir, dis, dest) {
  342. dir.x *= dis;
  343. dir.y *= dis;
  344. dir.z *= dis;
  345. Laya.Vector3.add(pos, dir, dest);
  346. return dest;
  347. }
  348. function getV2Dest(x1, y1, dir, dis, dest) {
  349. dest.x = x1 + dir.x * dis;
  350. dest.y = y1 + dir.y * dis;
  351. return dest;
  352. }
  353. function getV2Dir(x1, y1, x2, y2, dir) {
  354. dir.x = x2 - x1;
  355. dir.y = y2 - y1;
  356. Laya.Vector2.normalize(dir, dir);
  357. return dir;
  358. }
  359. function getV3Dir(p1, p2, dir) {
  360. Laya.Vector3.subtract(p1, p2, dir);
  361. Laya.Vector3.normalize(dir, dir);
  362. return dir;
  363. }
  364. function copyPos(ip, op) {
  365. op.x = ip.x;
  366. op.y = ip.y;
  367. if (ip.z)
  368. op.z = ip.z;
  369. return op;
  370. }
  371. function getScreenImg() {
  372. let gl = Laya.WebGLContext.mainContext;
  373. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  374. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  375. let w = gl.drawingBufferWidth;
  376. let h = gl.drawingBufferHeight;
  377. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  378. texture2d.setPixels(pixels);
  379. return new Laya.Texture(texture2d);
  380. }
  381. function playMoveByPositions(sp, positions, v, completeCallback) {
  382. let p;
  383. let play = () => {
  384. if (positions.length == 0) {
  385. completeCallback();
  386. return;
  387. }
  388. p = positions[0];
  389. positions.splice(0, 1);
  390. 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, () => {
  391. play();
  392. }));
  393. };
  394. play();
  395. }
  396. function setStarPos(node, num, max) {
  397. for (let i = 1; i <= 5; i++) {
  398. let img = node.getChildAt(i - 1);
  399. img.width = img.height = 30;
  400. img.pivotX = img.pivotY = 0.5;
  401. img.gray = i > num;
  402. img.visible = i <= max;
  403. if (max == 3) {
  404. img.x = node.width / 2 + (i - 2) * 30 - 15;
  405. img.y = node.height - 40;
  406. if (i == 2)
  407. img.y = node.height - 30;
  408. }
  409. else if (max == 5) {
  410. let ly = Math.abs(i - 3);
  411. img.x = node.width / 2 + (i - 3) * 20 - 15;
  412. img.y = node.height - ly * 8 - 30;
  413. }
  414. }
  415. }
  416. function playLoopAnimRotate(sp, time, clockwise = true) {
  417. let rotation;
  418. sp.rotation = sp.rotation % 360;
  419. if (clockwise) {
  420. rotation = -360;
  421. }
  422. else {
  423. rotation = 360;
  424. }
  425. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  426. this.playLoopAnimRotate(sp, time, clockwise);
  427. }));
  428. }
  429. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  430. let x, y;
  431. if (isBig) {
  432. x = valueXMin;
  433. y = valueYMin;
  434. }
  435. else {
  436. x = valueXMax;
  437. y = valueYMax;
  438. }
  439. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  440. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  441. }));
  442. }
  443. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  444. let scale;
  445. if (isBig) {
  446. scale = valueMin;
  447. }
  448. else {
  449. scale = valueMax;
  450. }
  451. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  452. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  453. }));
  454. }
  455. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  456. let value;
  457. if (isBig) {
  458. value = valueMin;
  459. }
  460. else {
  461. value = valueMax;
  462. }
  463. if (count) {
  464. count--;
  465. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  466. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  467. }));
  468. }
  469. else {
  470. sp.rotation = 0;
  471. }
  472. }
  473. function inRect(rect, p) {
  474. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  475. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  476. return true;
  477. }
  478. }
  479. return false;
  480. }
  481. function getNumberK(number) {
  482. if (number < 1000) {
  483. return number.toString();
  484. }
  485. else {
  486. return (number / 1000).toFixed(1) + "k";
  487. }
  488. }
  489. function pointInsideCircle(point, circle, r) {
  490. if (r === 0)
  491. return false;
  492. var dx = circle.x - point.x;
  493. var dy = circle.y - point.y;
  494. return dx * dx + dy * dy <= r * r;
  495. }
  496. function formatString(str, data) {
  497. if (!str || data == undefined) {
  498. return str;
  499. }
  500. if (typeof data === "object") {
  501. for (var key in data) {
  502. if (data.hasOwnProperty(key)) {
  503. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  504. }
  505. }
  506. }
  507. else {
  508. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  509. return str.replace(reg, function (match, index) {
  510. return args[index - (-1)];
  511. });
  512. }
  513. return str;
  514. }
  515. function getIntersection(a, b) {
  516. let t = [];
  517. for (var i = 0; i < a.length; i++) {
  518. for (var j = 0; j < b.length; j++) {
  519. if (a[i] == b[j]) {
  520. t.push(a[i]);
  521. }
  522. }
  523. }
  524. return t;
  525. }
  526. function getComplement(a, b) {
  527. let t = [];
  528. let count = false;
  529. for (var i = 0; i < a.length; i++) {
  530. count = false;
  531. for (var j = 0; j < b.length; j++) {
  532. if (a[i] == b[j]) {
  533. count = true;
  534. break;
  535. }
  536. }
  537. if (!count) {
  538. t.push(a[i]);
  539. }
  540. }
  541. return t;
  542. }
  543. function geSpriteStageRect(sp) {
  544. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  545. let rect = {
  546. x: point.x,
  547. y: point.y,
  548. width: sp.width * sp.globalScaleX,
  549. height: sp.height * sp.globalScaleY
  550. };
  551. return rect;
  552. }
  553. function touchButton(button) {
  554. let event = new Laya.Event();
  555. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  556. }
  557. function setColor(sprite, r, g, b) {
  558. var redMat = [
  559. r / 255, 0, 0, 0, 0,
  560. g / 255, 0, 0, 0, 0,
  561. b / 255, 0, 0, 0, 0,
  562. 0, 0, 0, 1, 0,
  563. ];
  564. var filter = new Laya.ColorFilter(redMat);
  565. sprite.filters = [filter];
  566. }
  567. function clone(obj, newobj = {}) {
  568. for (var attr in obj) {
  569. if (typeof obj[attr] == "object") {
  570. newobj[attr] = clone(obj[attr], newobj[attr]);
  571. }
  572. else {
  573. newobj[attr] = obj[attr];
  574. }
  575. }
  576. return newobj;
  577. }
  578. function _ms(arr, compare, begin, end) {
  579. const size = end - begin;
  580. if (size <= 1) {
  581. return;
  582. }
  583. const middle = (end + begin) >> 1;
  584. _ms(arr, compare, begin, middle);
  585. _ms(arr, compare, middle, end);
  586. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  587. return;
  588. }
  589. const merged = [];
  590. let leftIndex = begin, rightIndex = middle;
  591. while (merged.length < size) {
  592. if (leftIndex === middle) {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. else if (rightIndex === end) {
  596. merged.push(arr[leftIndex++]);
  597. }
  598. else {
  599. const c = compare(arr[leftIndex], arr[rightIndex]);
  600. if (c <= 0) {
  601. merged.push(arr[leftIndex++]);
  602. }
  603. else {
  604. merged.push(arr[rightIndex++]);
  605. }
  606. }
  607. }
  608. arr.splice(begin, size, ...merged);
  609. }
  610. function sort(arr, compare) {
  611. if (!Array.isArray(arr)) {
  612. throw new Error('sort的参数必须为数组');
  613. }
  614. _ms(arr, compare, 0, arr.length);
  615. return arr;
  616. }
  617. function getLanguage(id) {
  618. }
  619. function getLanguageByTip(id) {
  620. }
  621. function toWeights(array) {
  622. let max = 0;
  623. for (var i = 0; i < array.length; i++) {
  624. max = max + array[i];
  625. if (array[i] == 0) {
  626. array[i] = 0;
  627. }
  628. else {
  629. array[i] = max;
  630. }
  631. }
  632. return array;
  633. }
  634. function unique(array) {
  635. var n = {}, r = [], len = array.length, val, type;
  636. for (var i = 0; i < array.length; i++) {
  637. val = array[i];
  638. type = typeof val;
  639. if (!n[val]) {
  640. n[val] = [type];
  641. r.push(val);
  642. }
  643. else if (n[val].indexOf(type) < 0) {
  644. n[val].push(type);
  645. r.push(val);
  646. }
  647. }
  648. return r;
  649. }
  650. function unique1(array) {
  651. var r = [];
  652. for (var i = 0, l = array.length; i < l; i++) {
  653. for (var j = i + 1; j < l; j++)
  654. if (array[i] == array[j])
  655. j == ++i;
  656. r.push(array[i]);
  657. }
  658. return r;
  659. }
  660. function getDistance(x1, y1, x2, y2) {
  661. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  662. }
  663. function getV2Dis(pos1, pos2) {
  664. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  665. }
  666. function getV2SqDis(pos1, pos2) {
  667. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  668. }
  669. function getDis(x1, y1, x2, y2) {
  670. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  671. }
  672. function getDeltaxy(x1, y1, x2, y2) {
  673. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  674. }
  675. function getSymbolNumber(num) {
  676. if (num > 0) {
  677. return "+" + num;
  678. }
  679. else if (num < 0) {
  680. return num.toString();
  681. }
  682. return num.toString();
  683. }
  684. function fixNumber(num, length) {
  685. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  686. }
  687. function toThousands(num) {
  688. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  689. }
  690. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  691. function fmtMoney(money) {
  692. money = toThousands(money.replace(/^0+/, ''));
  693. if (money.length == 0) {
  694. money = "0";
  695. }
  696. let unit = 0;
  697. for (var i = 0; i < money.length; i++) {
  698. if (money.charAt(i) == ",") {
  699. unit++;
  700. }
  701. }
  702. if (unit == 0) {
  703. return money;
  704. }
  705. else {
  706. let idx = money.indexOf(",");
  707. if (idx) {
  708. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  709. }
  710. return money.replace(",", ".");
  711. }
  712. }
  713. function flatten(arr) {
  714. while (arr.some(item => Array.isArray(item))) {
  715. arr = [].concat(...arr);
  716. }
  717. return arr;
  718. }
  719. function getDistanceByPoint(p1, p2) {
  720. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  721. }
  722. function getAngleByPoint(p1, p2) {
  723. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  724. }
  725. function toIntByArray(array) {
  726. for (var index = 0; index < array.length; index++) {
  727. array[index] = parseInt(array[index]);
  728. }
  729. return array;
  730. }
  731. function getAngle0To360(angle) {
  732. while (angle < 0) {
  733. angle += 360;
  734. }
  735. while (angle >= 360) {
  736. angle -= 360;
  737. }
  738. return angle;
  739. }
  740. function toAngle(radian) {
  741. return radian * 180 / Math.PI;
  742. }
  743. function toRadian(angle) {
  744. return angle * Math.PI / 180;
  745. }
  746. function getArrayValueRandom(array) {
  747. return array[random(0, array.length - 1)];
  748. }
  749. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  750. }
  751. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  752. }
  753. function fmtTimeMMSS(time) {
  754. if (time < 0) {
  755. time = 0;
  756. }
  757. else
  758. time = Math.floor(time);
  759. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  760. }
  761. function fmtTimeMS(time) {
  762. if (time < 0) {
  763. time = 0;
  764. }
  765. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  766. }
  767. function fmtTimeHHMM(time) {
  768. if (time < 0) {
  769. time = 0;
  770. }
  771. time = Math.floor(time / 1000);
  772. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  773. }
  774. let severTime = 0;
  775. function getServerTime() {
  776. return new Date(new Date().getTime() - severTime);
  777. }
  778. function setServerTime(data) {
  779. severTime = (new Date().getTime() - data);
  780. }
  781. var tools = /*#__PURE__*/Object.freeze({
  782. playClickEffect: playClickEffect,
  783. getNumList: getNumList,
  784. getStrList: getStrList,
  785. getRandStr: getRandStr,
  786. getUserId: getUserId,
  787. formatPos: formatPos,
  788. setPosInt: setPosInt,
  789. random: random,
  790. randomList: randomList,
  791. worldToScreen: worldToScreen,
  792. getStringLenght: getStringLenght,
  793. reviseString: reviseString,
  794. getCoinString: getCoinString,
  795. getV3Dest: getV3Dest,
  796. getV2Dest: getV2Dest,
  797. getV2Dir: getV2Dir,
  798. getV3Dir: getV3Dir,
  799. copyPos: copyPos,
  800. getScreenImg: getScreenImg,
  801. playMoveByPositions: playMoveByPositions,
  802. setStarPos: setStarPos,
  803. playLoopAnimRotate: playLoopAnimRotate,
  804. playLoopAnimPosition: playLoopAnimPosition,
  805. playLoopAnimScale: playLoopAnimScale,
  806. playLoopAnimRotation: playLoopAnimRotation,
  807. inRect: inRect,
  808. getNumberK: getNumberK,
  809. pointInsideCircle: pointInsideCircle,
  810. formatString: formatString,
  811. getIntersection: getIntersection,
  812. getComplement: getComplement,
  813. geSpriteStageRect: geSpriteStageRect,
  814. touchButton: touchButton,
  815. setColor: setColor,
  816. clone: clone,
  817. sort: sort,
  818. getLanguage: getLanguage,
  819. getLanguageByTip: getLanguageByTip,
  820. toWeights: toWeights,
  821. unique: unique,
  822. unique1: unique1,
  823. getDistance: getDistance,
  824. getV2Dis: getV2Dis,
  825. getV2SqDis: getV2SqDis,
  826. getDis: getDis,
  827. getDeltaxy: getDeltaxy,
  828. getSymbolNumber: getSymbolNumber,
  829. fixNumber: fixNumber,
  830. toThousands: toThousands,
  831. fmtMoney: fmtMoney,
  832. flatten: flatten,
  833. getDistanceByPoint: getDistanceByPoint,
  834. getAngleByPoint: getAngleByPoint,
  835. toIntByArray: toIntByArray,
  836. getAngle0To360: getAngle0To360,
  837. toAngle: toAngle,
  838. toRadian: toRadian,
  839. getArrayValueRandom: getArrayValueRandom,
  840. promptByTip: promptByTip,
  841. promptByErrorCode: promptByErrorCode,
  842. fmtTimeMMSS: fmtTimeMMSS,
  843. fmtTimeMS: fmtTimeMS,
  844. fmtTimeHHMM: fmtTimeHHMM,
  845. getServerTime: getServerTime,
  846. setServerTime: setServerTime
  847. });
  848. class HttpMgr {
  849. constructor() {
  850. this.isDev = false;
  851. HttpMgr._instance = this;
  852. }
  853. static getInstance() {
  854. if (!this._instance) {
  855. this._instance = new HttpMgr();
  856. }
  857. return this._instance;
  858. }
  859. sendPost(url, data, call) {
  860. let httpObj = new Laya.HttpRequest();
  861. httpObj.http.timeout = 5000;
  862. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  863. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  864. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  865. function errorHandler(error) {
  866. console.log("errorHandler:" + error);
  867. alert("Please check your network connection.");
  868. }
  869. function completeHandler(data) {
  870. if (data && data.length > 0) {
  871. let jsonData = JSON.parse(data);
  872. if (call)
  873. call(jsonData);
  874. }
  875. }
  876. }
  877. getReqData() {
  878. let reqData = JSON.stringify({
  879. gameName: "TQ",
  880. gameUserName: "zhangSan",
  881. isDev: this.isDev
  882. });
  883. return reqData;
  884. }
  885. sendPost2025(reqUrl, data, call) {
  886. let isDev = this.isDev;
  887. let urlTop = "https://api.kessongame.site/";
  888. let urlMid = urlTop + "prod-api/api/";
  889. if (isDev) {
  890. urlTop = "http://192.168.1.13:8090/";
  891. urlMid = urlTop + "api/";
  892. console.log('zh:TEST环境');
  893. }
  894. else {
  895. console.log('zh:SC环境');
  896. }
  897. let url = urlMid + reqUrl;
  898. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  899. if (isDev) {
  900. url = urlTop + reqUrl;
  901. }
  902. else {
  903. url = urlTop + "prod-api/" + reqUrl;
  904. }
  905. }
  906. let headers = ["Content-Type", "application/json; charset=UTF-8"];
  907. if (reqUrl.indexOf("/api/game/") >= 0) {
  908. }
  909. const keyForLoginInfo = "userInfo";
  910. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  911. if (userInfoData != null) {
  912. try {
  913. let bb = JSON.parse(userInfoData);
  914. if (bb) {
  915. let token = bb.token;
  916. headers.push("Authorization");
  917. headers.push(`Bearer ${token}`);
  918. }
  919. }
  920. catch (e) {
  921. }
  922. }
  923. let httpObj = new Laya.HttpRequest();
  924. httpObj.http.timeout = 5000;
  925. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  926. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  927. httpObj.send(url, data, 'post', 'text', headers);
  928. function errorHandler(error) {
  929. if (call) {
  930. call("{'msg':'Network exception','code':500}");
  931. }
  932. else {
  933. alert("Tip:Please check your network connection.");
  934. }
  935. }
  936. function completeHandler(data) {
  937. if (data && data.length > 0) {
  938. let jsonData = JSON.parse(data);
  939. if (call)
  940. call(jsonData);
  941. }
  942. }
  943. }
  944. sendGet(url, call) {
  945. let httpObj = new Laya.HttpRequest();
  946. httpObj.http.timeout = 5000;
  947. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  948. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  949. httpObj.send(url, '', 'get');
  950. function errorHandler(error) {
  951. console.log("errorHandler:" + error);
  952. }
  953. function completeHandler(data) {
  954. if (data && data.length > 0) {
  955. if (call)
  956. call(data);
  957. }
  958. }
  959. }
  960. }
  961. HttpMgr._instance = null;
  962. class LightShader extends Laya.Sprite {
  963. constructor() {
  964. super();
  965. this._time = 0;
  966. this._sin = 0;
  967. this.initShader();
  968. }
  969. initShader() {
  970. var vs = `
  971. #define FSHIGHPRECISION
  972. attribute vec4 posuv;
  973. uniform vec2 size;
  974. varying vec4 v_texcoord;
  975. void main() {
  976. vec4 pos = vec4(posuv.xy,0.,1.);
  977. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  978. gl_Position=pos1;
  979. v_texcoord.xy = posuv.xy;
  980. }
  981. `;
  982. var ps = `
  983. #define FSHIGHPRECISION
  984. precision highp float;
  985. varying vec4 v_texcoord;
  986. uniform vec2 size;
  987. uniform sampler2D texture;
  988. uniform float u_Time;
  989. void main() {
  990. vec4 color= texture2D(texture, v_texcoord.xy);
  991. float width = 0.2;
  992. float start = u_Time;
  993. float offset = 1.0;
  994. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  995. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  996. {
  997. color.r=1.1;
  998. color.g=1.1;
  999. color.b=1.1;
  1000. gl_FragColor = color;
  1001. } else {
  1002. gl_FragColor = color;
  1003. }
  1004. }
  1005. `;
  1006. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  1007. this.customRenderEnable = true;
  1008. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  1009. }
  1010. customRender(context, x, y) {
  1011. this.onUpdate();
  1012. if (!this.texture)
  1013. return;
  1014. let xx = x - this.pivotX;
  1015. let yy = y - this.pivotY;
  1016. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1017. }
  1018. onUpdate() {
  1019. this._time += 2 * Laya.timer.delta * 0.001;
  1020. this._sin = Math.sin(this._time);
  1021. if (this._sin > 0.99) {
  1022. this._sin = 0;
  1023. this._time = 0;
  1024. }
  1025. this.shaderValue['u_Time'] = this._sin;
  1026. }
  1027. }
  1028. LightShader.DissolveSurfaceSaveName = 9997;
  1029. class UIBase extends fairygui.Window {
  1030. constructor() {
  1031. super();
  1032. this.isEject = true;
  1033. this.isHide = true;
  1034. this.showbanner = true;
  1035. this.className = "";
  1036. this.isMuti = false;
  1037. this.showbanner = false;
  1038. this.onConstructor();
  1039. }
  1040. checkActive(show) {
  1041. }
  1042. getUIName() {
  1043. return UIBase.uiName;
  1044. }
  1045. onConstructor() {
  1046. try {
  1047. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoadedForBase));
  1048. console.log("zh: base加载arial字体成功");
  1049. }
  1050. catch (error) {
  1051. console.log("zh: base加载arial字体失败");
  1052. }
  1053. }
  1054. onFontLoadedForBase() {
  1055. try {
  1056. Laya.Text.defaultFont = "arial";
  1057. console.log("zh: base 设置arial字体成功");
  1058. }
  1059. catch (error) {
  1060. console.log("zh: base 设置arial字体失败");
  1061. }
  1062. }
  1063. onInit() {
  1064. if (!!this.contentPane) {
  1065. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1066. }
  1067. this.setPivot(0.5, 0.5, false);
  1068. }
  1069. doShowAnimation() {
  1070. if (!this.isEject)
  1071. return;
  1072. super.doShowAnimation();
  1073. Laya.Tween.clearTween(this);
  1074. this.scaleX = this.scaleY = 0.8;
  1075. let tweenFunc1 = (func) => {
  1076. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1077. };
  1078. let tweenFunc2 = (func) => {
  1079. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1080. };
  1081. tweenFunc1(tweenFunc2);
  1082. }
  1083. show(...args) {
  1084. super.show();
  1085. this._openParam = args;
  1086. this.isHide = false;
  1087. xGame.uiMgr.checkUIState();
  1088. }
  1089. moveBannerButton() {
  1090. }
  1091. showBannerButton() {
  1092. this.bannerButton.visible = true;
  1093. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1094. this.bannerButton.touchable = true;
  1095. }));
  1096. }
  1097. hide() {
  1098. super.hide();
  1099. this.isHide = true;
  1100. xGame.uiMgr.checkUIState();
  1101. }
  1102. Dispose() {
  1103. super.dispose();
  1104. }
  1105. myUpdate(delay) {
  1106. }
  1107. refresh() { }
  1108. setGlobalFont(root) {
  1109. try {
  1110. console.log('zh: setGlobalFont start');
  1111. let fontName = "arial";
  1112. const setFont = (obj) => {
  1113. if (obj instanceof fairygui.GTextField) {
  1114. obj.font = fontName;
  1115. }
  1116. if (obj instanceof fairygui.GComponent) {
  1117. for (let i = 0; i < obj.numChildren; i++) {
  1118. setFont(obj.getChildAt(i));
  1119. }
  1120. }
  1121. };
  1122. const rootNode = root || this.contentPane;
  1123. if (rootNode) {
  1124. setFont(rootNode);
  1125. }
  1126. }
  1127. catch (error) {
  1128. console.log('zh: setGlobalFont error=' + error);
  1129. }
  1130. finally {
  1131. console.log('zh: setGlobalFont end');
  1132. }
  1133. }
  1134. addUIClick(obj, func, arr = null) {
  1135. obj.onClick(this, func, arr);
  1136. obj.onClick(this, this.playBtnSound);
  1137. }
  1138. offUIClick(obj, func) {
  1139. obj.offClick(this, func);
  1140. }
  1141. playBtnSound() {
  1142. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1143. }
  1144. }
  1145. UIBase.lastShowBanner = 0;
  1146. UIBase.showBannerNum = 0;
  1147. UIBase.uiName = "";
  1148. class ui_UIDraw extends fgui.GComponent {
  1149. static createInstance() {
  1150. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1151. }
  1152. onConstruct() {
  1153. this.n_bj = (this.getChild("n_bj"));
  1154. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  1155. this.myNode = (this.getChild("myNode"));
  1156. this.extraNode = (this.getChild("extraNode"));
  1157. this.closeNode = (this.getChild("closeNode"));
  1158. this.moneyNode = (this.getChild("moneyNode"));
  1159. this.n38 = (this.getChild("n38"));
  1160. this.talkNode = (this.getChild("talkNode"));
  1161. this.secretary = (this.getChild("secretary"));
  1162. this.drawBtn = (this.getChild("drawBtn"));
  1163. this.t0 = this.getTransition("t0");
  1164. }
  1165. }
  1166. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1167. class ui_UIBox extends fgui.GComponent {
  1168. static createInstance() {
  1169. return (fgui.UIPackage.createObject("game", "UIBox"));
  1170. }
  1171. onConstruct() {
  1172. this.n0 = (this.getChild("n0"));
  1173. this.n12 = (this.getChild("n12"));
  1174. this.n1 = (this.getChild("n1"));
  1175. this.n2 = (this.getChild("n2"));
  1176. this.bar = (this.getChild("bar"));
  1177. this.closeBtn = (this.getChild("closeBtn"));
  1178. this.openBtn = (this.getChild("openBtn"));
  1179. this.t0 = this.getTransition("t0");
  1180. this.t1 = this.getTransition("t1");
  1181. }
  1182. }
  1183. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1184. class LocalStorageManager {
  1185. test1() {
  1186. LocalStorageManager.setItem("playerName", "Tom");
  1187. LocalStorageManager.setItem("playerLevel", 5);
  1188. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  1189. const name = LocalStorageManager.getItem("playerName");
  1190. const level = LocalStorageManager.getItem("playerLevel");
  1191. const data = LocalStorageManager.getItem("playerData");
  1192. console.log(name);
  1193. console.log(level);
  1194. console.log(data);
  1195. LocalStorageManager.removeItem("playerLevel");
  1196. }
  1197. static setItem(key, value) {
  1198. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  1199. }
  1200. static getItem(key) {
  1201. const data = Laya.LocalStorage.getItem(key);
  1202. if (data === null)
  1203. return null;
  1204. try {
  1205. return JSON.parse(data);
  1206. }
  1207. catch (e) {
  1208. return data;
  1209. }
  1210. }
  1211. static removeItem(key) {
  1212. Laya.LocalStorage.removeItem(key);
  1213. }
  1214. static clear() {
  1215. Laya.LocalStorage.clear();
  1216. }
  1217. static hasJosnKey(key) {
  1218. var value = Laya.LocalStorage.getJSON(key);
  1219. if (value != null) {
  1220. return true;
  1221. }
  1222. else {
  1223. return false;
  1224. }
  1225. }
  1226. static hasKey(key) {
  1227. return Laya.LocalStorage.getItem(key) !== null;
  1228. }
  1229. }
  1230. class GlobalManager {
  1231. constructor() {
  1232. }
  1233. registerMethod(name, method) {
  1234. console.log('zh: 注册全局方法', name);
  1235. this[name] = method;
  1236. }
  1237. callMethod(name, ...args) {
  1238. console.log('zh: 调用全局方法', name);
  1239. if (this[name]) {
  1240. return this[name](...args);
  1241. }
  1242. else {
  1243. console.error(`zh: 全局方法 Method ${name} not found`);
  1244. }
  1245. }
  1246. }
  1247. GlobalManager.instance = new GlobalManager();
  1248. class JSBridgeUtils {
  1249. constructor() { }
  1250. static get instance() {
  1251. if (!this._instance) {
  1252. this._instance = new JSBridgeUtils();
  1253. }
  1254. return this._instance;
  1255. }
  1256. initBridge() {
  1257. if (!Laya.Browser.onAndroid) {
  1258. console.log('zh:非android dev');
  1259. return;
  1260. }
  1261. let cfg = window['conchConfig'];
  1262. if (cfg) {
  1263. var os = cfg.getOS();
  1264. if (os == "Conch-android") {
  1265. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1266. if (this.bridge) {
  1267. return true;
  1268. }
  1269. else {
  1270. return false;
  1271. }
  1272. }
  1273. else {
  1274. return false;
  1275. }
  1276. }
  1277. else {
  1278. return false;
  1279. }
  1280. }
  1281. testAd1() {
  1282. if (!Laya.Browser.onAndroid) {
  1283. console.log('zh:非android dev');
  1284. return;
  1285. }
  1286. if (!this.initBridge()) {
  1287. return;
  1288. }
  1289. let rs = this.bridge.call("testString", "hello");
  1290. console.log('zh:testString rs=' + rs);
  1291. }
  1292. testAdCallBack() {
  1293. if (!this.initBridge()) {
  1294. return;
  1295. }
  1296. console.log("zh:testAdCallBack start");
  1297. const defaultObj = { code: 200, msg: "req update Ui" };
  1298. const reqObj = { code: 300, msg: "hello java ui" };
  1299. this.bridge.callWithBack((rsStr) => {
  1300. const rsObj = JSON.parse(rsStr);
  1301. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1302. }, "testAsyncCallback", JSON.stringify(reqObj));
  1303. }
  1304. showInternAd(mark) {
  1305. let boo1 = this.checkAdForUserOrderForSpid17(1);
  1306. if (boo1) {
  1307. console.log('zh: VIP SPID = 1,免除插页AD');
  1308. return false;
  1309. }
  1310. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1311. if (boo7) {
  1312. console.log('zh: VIP SPID = 7,免除任何AD');
  1313. return false;
  1314. }
  1315. console.log('zh:showInternAd start');
  1316. if (!Laya.Browser.onAndroid) {
  1317. console.log('zh:showInternAd 非android dev');
  1318. return false;
  1319. }
  1320. if (!this.initBridge()) {
  1321. return false;
  1322. }
  1323. let rs = this.bridge.call("showInternAd", mark);
  1324. try {
  1325. const result = JSON.parse(rs);
  1326. if (result.code === 200) {
  1327. console.log("zh:showInternAd OK");
  1328. return true;
  1329. }
  1330. else {
  1331. console.warn("zh:showInternAd FAILL:", result.msg);
  1332. return false;
  1333. }
  1334. }
  1335. catch (e) {
  1336. console.error("zh:解析桥接返回值失败:", e);
  1337. return false;
  1338. }
  1339. }
  1340. exitAndCloseGame() {
  1341. if (!Laya.Browser.onAndroid) {
  1342. return;
  1343. }
  1344. if (!this.initBridge()) {
  1345. return;
  1346. }
  1347. console.log('zh:开始关闭游戏-');
  1348. this.bridge.call("exitAndCloseGame");
  1349. }
  1350. checkAdForUserOrderForSpid17(spid) {
  1351. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  1352. if (userInfo != null) {
  1353. if (!userInfo.buySpids) {
  1354. userInfo.buySpids = { 1: false, 7: false };
  1355. }
  1356. else {
  1357. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  1358. }
  1359. let boo = userInfo.buySpids[spid];
  1360. if (!boo) {
  1361. console.log('zh:刷新一下用户的AD权利');
  1362. DataMgr.loadUserSpOrderForAd();
  1363. }
  1364. console.log('zh:检查是否免AD SPID=' + spid + '= 免除AD?=' + boo);
  1365. return boo;
  1366. }
  1367. return false;
  1368. }
  1369. showRewardAd(mark) {
  1370. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1371. if (boo7) {
  1372. console.log('zh: VIP SPID = 7,免除任何AD');
  1373. return false;
  1374. }
  1375. if (!Laya.Browser.onAndroid) {
  1376. return false;
  1377. }
  1378. if (!this.initBridge()) {
  1379. return false;
  1380. }
  1381. let rs = this.bridge.call("showRewardAd", mark);
  1382. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1383. try {
  1384. const result = JSON.parse(rs);
  1385. if (result.code === 200) {
  1386. console.log("zh:广告显示成功");
  1387. return true;
  1388. }
  1389. else {
  1390. console.warn("zh:广告显示失败:", result.msg);
  1391. return false;
  1392. }
  1393. }
  1394. catch (e) {
  1395. console.error("zh:解析桥接返回值失败:", e);
  1396. return false;
  1397. }
  1398. }
  1399. logEventForAdNoParams(eventName) {
  1400. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1401. if (!Laya.Browser.onAndroid) {
  1402. return;
  1403. }
  1404. if (!this.initBridge()) {
  1405. return;
  1406. }
  1407. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1408. this.bridge.call("logEventForAdNoParams", eventName);
  1409. }
  1410. logEventForAdHaveParams(eventName, jsonStr) {
  1411. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1412. if (!Laya.Browser.onAndroid) {
  1413. return;
  1414. }
  1415. if (!this.initBridge()) {
  1416. return;
  1417. }
  1418. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1419. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1420. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1421. }
  1422. logEventForFirebase(eventName, jsonStr) {
  1423. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1424. if (!Laya.Browser.onAndroid) {
  1425. return;
  1426. }
  1427. if (!this.initBridge()) {
  1428. return;
  1429. }
  1430. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1431. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1432. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1433. }
  1434. testNetTip() {
  1435. if (Laya.Browser.onAndroid) {
  1436. let boo = this.getNetworkAvailable();
  1437. this.showToast2("Network error, reward unavailable");
  1438. return;
  1439. }
  1440. }
  1441. getNetworkAvailable() {
  1442. if (!Laya.Browser.onAndroid) {
  1443. return;
  1444. }
  1445. if (!this.initBridge()) {
  1446. return;
  1447. }
  1448. let boo = this.bridge.call("getNetworkAvailable");
  1449. console.log("zh:getNetworkAvailable boo=" + boo);
  1450. return boo;
  1451. }
  1452. showToast2(msg) {
  1453. if (!Laya.Browser.onAndroid) {
  1454. return;
  1455. }
  1456. if (!this.initBridge()) {
  1457. return;
  1458. }
  1459. this.bridge.call("showToast2", msg);
  1460. }
  1461. showConfirmationDialogForExit(title, msg) {
  1462. if (!Laya.Browser.onAndroid) {
  1463. return;
  1464. }
  1465. if (!this.initBridge()) {
  1466. return;
  1467. }
  1468. this.bridge.call("showConfirmationDialogForExit", title, msg);
  1469. }
  1470. loginOutForApp() {
  1471. if (!Laya.Browser.onAndroid) {
  1472. return;
  1473. }
  1474. if (!this.initBridge()) {
  1475. return;
  1476. }
  1477. this.bridge.call("loginOutForApp");
  1478. }
  1479. startGgPay(token, ggSpid, spid) {
  1480. if (!Laya.Browser.onAndroid) {
  1481. return;
  1482. }
  1483. if (!this.initBridge()) {
  1484. return;
  1485. }
  1486. let jsonObj = {
  1487. token: token,
  1488. ggSpid: ggSpid,
  1489. spid: spid,
  1490. spsl: 1
  1491. };
  1492. let reqData = JSON.stringify(jsonObj);
  1493. console.log("zh:startGgPay ts reqData=" + reqData);
  1494. this.bridge.call("startGgPay", reqData);
  1495. }
  1496. testPay1ForMoNiPayOver(token, ggSpid, spid) {
  1497. if (!Laya.Browser.onAndroid) {
  1498. return;
  1499. }
  1500. if (!this.initBridge()) {
  1501. return;
  1502. }
  1503. let jsonObj = {
  1504. token: token,
  1505. ggSpid: ggSpid,
  1506. spid: spid,
  1507. spsl: 1
  1508. };
  1509. let reqData = JSON.stringify(jsonObj);
  1510. console.log("zh:testPay1ForMoNiPayOver ts reqData=" + reqData);
  1511. this.bridge.call("testPay1ForMoNiPayOver", reqData);
  1512. }
  1513. nativeCallJs(msg) {
  1514. console.log("zh:nativeCallJs received data: 1111", msg);
  1515. if (msg === 'Ad1') {
  1516. GlobalManager.instance.callMethod('Ad1');
  1517. console.log("zh: Ad1 奖励发送成功");
  1518. }
  1519. else if (msg === 'Ad2') {
  1520. GlobalManager.instance.callMethod('Ad2');
  1521. console.log("zh: Ad2 奖励发送成功");
  1522. }
  1523. else if (msg === 'Ad3') {
  1524. GlobalManager.instance.callMethod('Ad3');
  1525. console.log("zh: Ad3 奖励发送成功");
  1526. }
  1527. else if (msg === 'Ad4') {
  1528. GlobalManager.instance.callMethod('Ad4');
  1529. console.log("zh: Ad4 奖励发送成功");
  1530. }
  1531. else if (msg === 'Ad5') {
  1532. console.log("zh: Ad5 奖励发送成功");
  1533. GlobalManager.instance.callMethod('Ad5');
  1534. }
  1535. }
  1536. }
  1537. class UIBox extends UIBase {
  1538. constructor() {
  1539. super();
  1540. this.boxNum = 0;
  1541. this.boxMax = 10;
  1542. this.inAd = false;
  1543. this.isClose = false;
  1544. }
  1545. onConstructor() {
  1546. this.ui = ui_UIBox.createInstance();
  1547. this.contentPane = this.ui;
  1548. this.isEject = false;
  1549. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1550. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1551. Laya.timer.loop(1000, this, this.update);
  1552. }
  1553. update() {
  1554. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1555. this.boxNum -= 1;
  1556. this.upBar();
  1557. }
  1558. }
  1559. upBar() {
  1560. if (this.boxNum > this.boxMax)
  1561. this.boxNum = this.boxMax;
  1562. this.ui.bar.value = this.boxNum * 10;
  1563. }
  1564. show() {
  1565. super.show();
  1566. this.isClose = false;
  1567. this.boxNum = 0;
  1568. this.inAd = false;
  1569. this.upBar();
  1570. this.ui.t0.play();
  1571. this.ui.closeBtn.visible = false;
  1572. Laya.timer.once(3000, this, () => {
  1573. this.ui.closeBtn.visible = true;
  1574. this.ui.bar.alpha = 1;
  1575. });
  1576. Laya.timer.once(500, this, () => {
  1577. this.ui.t1.play();
  1578. });
  1579. this.setGlobalFont(this.ui);
  1580. }
  1581. hide() {
  1582. Laya.timer.clearAll(this);
  1583. Moyu.showBannerAd(false);
  1584. super.hide();
  1585. }
  1586. onOpenBox() {
  1587. this.boxNum++;
  1588. if (this.boxNum < this.boxMax) {
  1589. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1590. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1591. }
  1592. }
  1593. else if (this.boxNum == this.boxMax) {
  1594. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1595. this.ui.openBtn.c1.selectedIndex = 13;
  1596. this.inAd = true;
  1597. }
  1598. else
  1599. this.getAward();
  1600. }
  1601. else if (this.inAd) {
  1602. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1603. if (Laya.Browser.onAndroid) {
  1604. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1605. if (!boo) {
  1606. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1607. return;
  1608. }
  1609. }
  1610. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1611. }
  1612. else {
  1613. console.log('zh:AD 失败,直接发放奖励');
  1614. this.qjff_AD_for_UIBOX_onOpenBox();
  1615. }
  1616. }
  1617. this.upBar();
  1618. }
  1619. qjff_AD_for_UIBOX_onOpenBox() {
  1620. this.getAward();
  1621. }
  1622. onCloseBox() {
  1623. if (this.isClose)
  1624. this.hide();
  1625. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1626. this.isClose = true;
  1627. PlatMgr.showBanner(true, 0, 3000);
  1628. }
  1629. else
  1630. this.hide();
  1631. }
  1632. getAward() {
  1633. let str = "";
  1634. if (Math.random() < 0.5) {
  1635. let max = Moyu.isLegal ? 500 : 2500;
  1636. let num = xGame.tools.random(max, 500 + max);
  1637. DataMgr.setCoin(num);
  1638. str = "金币x" + num;
  1639. }
  1640. else {
  1641. let max = Moyu.isLegal ? 10 : 30;
  1642. let num = xGame.tools.random(max, 30 + max);
  1643. DataMgr.setDiamond(num);
  1644. str = "钻石x" + num;
  1645. }
  1646. xGame.showTip("恭喜获得-" + str);
  1647. this.hide();
  1648. }
  1649. }
  1650. UIBox.uiName = "UIBox";
  1651. class ui_UITry extends fgui.GComponent {
  1652. static createInstance() {
  1653. return (fgui.UIPackage.createObject("game", "UITry"));
  1654. }
  1655. onConstruct() {
  1656. this.n11 = (this.getChild("n11"));
  1657. this.myNode = (this.getChild("myNode"));
  1658. this.t0 = this.getTransition("t0");
  1659. }
  1660. }
  1661. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1662. class UITry extends UIBase {
  1663. constructor() {
  1664. super();
  1665. this.closeTime = 0;
  1666. this.closeNum = 0;
  1667. this.skillUrl = xGame.common.skillIconList;
  1668. }
  1669. onConstructor() {
  1670. this.ui = ui_UITry.createInstance();
  1671. this.contentPane = this.ui;
  1672. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1673. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1674. }
  1675. show() {
  1676. super.show();
  1677. this.closeNum = 0;
  1678. this.closeTime = 15;
  1679. this.ui.t0.play();
  1680. PlatMgr.showRateBanner();
  1681. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1682. Laya.timer.loop(1000, this, this.updateTime);
  1683. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1684. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1685. xGame.common.gameMgr.gamePause = true;
  1686. this.setGlobalFont(this.ui);
  1687. }
  1688. updateTime() {
  1689. if (this.closeTime > 1) {
  1690. this.closeTime--;
  1691. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1692. }
  1693. else
  1694. this.hide();
  1695. }
  1696. hide() {
  1697. Laya.timer.clearAll(this);
  1698. Moyu.showBannerAd(false);
  1699. super.hide();
  1700. xGame.common.gameMgr.gamePause = false;
  1701. }
  1702. onTry() {
  1703. console.log('zh:qjff_AD_for_uitry');
  1704. if (Laya.Browser.onAndroid) {
  1705. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1706. if (!boo) {
  1707. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1708. return;
  1709. }
  1710. }
  1711. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1712. }
  1713. else {
  1714. console.log('zh:AD 失败,直接发放奖励');
  1715. this.qjff_AD_for_uitry();
  1716. }
  1717. }
  1718. qjff_AD_for_uitry() {
  1719. let select = xGame.common.curPlayerSkillType;
  1720. DataMgr.gameData.trySkill = select;
  1721. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1722. DataMgr.saveGameData();
  1723. DataMgr.setBigSkill(select, 1);
  1724. xGame.showTip("Trial Successful");
  1725. this.hide();
  1726. }
  1727. onCancel() {
  1728. if (this.closeNum > 0) {
  1729. this.closeNum--;
  1730. if (this.closeNum < 2)
  1731. this.hide();
  1732. return;
  1733. }
  1734. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1735. this.onTry();
  1736. }
  1737. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1738. this.closeNum = 3;
  1739. }
  1740. else
  1741. this.hide();
  1742. }
  1743. }
  1744. UITry.uiName = "UITry";
  1745. class PlatMgr {
  1746. static initConfig() {
  1747. this.lastVt = 0;
  1748. if (!Moyu.platConfig)
  1749. return;
  1750. for (let k in Moyu.platConfig) {
  1751. let pd = this[k];
  1752. let pc = Moyu.platConfig[k];
  1753. if (pd != undefined && pc != undefined)
  1754. this[k] = pc;
  1755. }
  1756. Moyu.setBannerPos(0.5, 1);
  1757. }
  1758. static rand100(num) {
  1759. return xGame.tools.random(0, 100) < num;
  1760. }
  1761. static isMisVideo() {
  1762. let dt = Laya.timer.currTimer - this.lastVt;
  1763. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1764. this.lastVt = Laya.timer.currTimer;
  1765. return true;
  1766. }
  1767. else {
  1768. if (this.rand100(this.fullVideoRate)) {
  1769. console.log('zh:插屏 ad start');
  1770. JSBridgeUtils.instance.showInternAd('platMgr');
  1771. }
  1772. return false;
  1773. }
  1774. }
  1775. static showVideo(call, type) {
  1776. Moyu.showVideoAd(() => {
  1777. this.lastVt = Laya.timer.currTimer;
  1778. call && call();
  1779. }, type);
  1780. }
  1781. static showInsert(delay = false) {
  1782. if (this.getRand() < this.insertRate) {
  1783. let dt = delay ? this.insertDelay : 0;
  1784. console.log('zh:插屏 ad start');
  1785. JSBridgeUtils.instance.showInternAd('gameInsert');
  1786. }
  1787. }
  1788. static gameInsert() {
  1789. let t = this.getRand();
  1790. let r = this.gameInsertRate;
  1791. if (t < r) {
  1792. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1793. }
  1794. }
  1795. static showRateBanner() {
  1796. if (this.getRand() < this.bannerRate)
  1797. this.showBanner(true, this.bannerDelay, 3000);
  1798. }
  1799. static showBanner(show, delay = 0, hide = 0) {
  1800. if (2 > 1) {
  1801. console.log('zh:显示showBanner广告 直接返回');
  1802. return;
  1803. }
  1804. if (!show)
  1805. Moyu.showBannerAd(false);
  1806. else {
  1807. Laya.timer.clear(this, this.bannerShow);
  1808. if (delay > 0)
  1809. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1810. else
  1811. this.bannerShow(true);
  1812. if (hide > 0)
  1813. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1814. }
  1815. }
  1816. static bannerShow(show) {
  1817. if (2 > 1) {
  1818. console.log('zh:显示showBanner广告 直接返回');
  1819. return;
  1820. }
  1821. Moyu.showBannerAd(show);
  1822. console.log("showBanner" + show);
  1823. }
  1824. static getRand() {
  1825. return xGame.tools.random(0, 100);
  1826. }
  1827. static openBox() {
  1828. if (this.getRand() < this.boxRate)
  1829. xGame.uiMgr.Show(UIBox);
  1830. }
  1831. static openTry() {
  1832. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1833. return;
  1834. if (this.getRand() < this.tryRate)
  1835. xGame.uiMgr.Show(UITry);
  1836. else if (DataMgr.gameData.gameCount == 1)
  1837. xGame.uiMgr.Show(UITry);
  1838. }
  1839. }
  1840. PlatMgr.forceShare = 0;
  1841. PlatMgr.signAdRate = 0;
  1842. PlatMgr.forceVideoRate = 0;
  1843. PlatMgr.forceVideoGap = 0;
  1844. PlatMgr.fullVideoRate = 0;
  1845. PlatMgr.gameInsertRate = 0;
  1846. PlatMgr.insertGap = 0;
  1847. PlatMgr.insertDelay = 0;
  1848. PlatMgr.insertRate = 0;
  1849. PlatMgr.boxRate = 0;
  1850. PlatMgr.boxVideoRate = 0;
  1851. PlatMgr.boxInsertRate = 0;
  1852. PlatMgr.boxBannerRate = 0;
  1853. PlatMgr.tryRate = 0;
  1854. PlatMgr.tryClose3Rate = 0;
  1855. PlatMgr.tryVideoRate = 0;
  1856. PlatMgr.bannerRate = 0;
  1857. PlatMgr.lastVt = 0;
  1858. class ui_UIAddProp extends fgui.GComponent {
  1859. static createInstance() {
  1860. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1861. }
  1862. onConstruct() {
  1863. this.n11 = (this.getChild("n11"));
  1864. this.myNode = (this.getChild("myNode"));
  1865. this.closeBtn = (this.getChild("closeBtn"));
  1866. this.t0 = this.getTransition("t0");
  1867. }
  1868. }
  1869. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1870. class SpineMgr {
  1871. constructor(name, loadCb = null) {
  1872. this.loaded = false;
  1873. this.spineName = '';
  1874. this.loadedCallback = loadCb;
  1875. this.templet = new Laya.Templet();
  1876. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1877. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1878. if (name === 'mishu') {
  1879. this.templet.loadAni('spine/nvmishu.sk');
  1880. }
  1881. else {
  1882. this.templet.loadAni(`spine/${name}.sk`);
  1883. }
  1884. this.templet.lock = true;
  1885. this.spineName = name;
  1886. }
  1887. onError() {
  1888. console.log("zh:spine加载出错");
  1889. }
  1890. parseComplete() {
  1891. this.loaded = true;
  1892. this.loadedCallback && this.loadedCallback();
  1893. }
  1894. dispose() {
  1895. if (this.templet && !this.templet.destroyed) {
  1896. this.templet.destroy();
  1897. }
  1898. this.templet = null;
  1899. }
  1900. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1901. if (!this.loaded) {
  1902. return;
  1903. }
  1904. let spine;
  1905. if (mySpine) {
  1906. spine = mySpine;
  1907. }
  1908. else {
  1909. spine = this.createSpine(data, parent);
  1910. }
  1911. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1912. if (!isLoop) {
  1913. spine.on(Laya.Event.STOPPED, this, () => {
  1914. spine.offAll(Laya.Event.STOPPED);
  1915. callback && callback(spine);
  1916. });
  1917. }
  1918. return spine;
  1919. }
  1920. createSpine(data, parent, type = 1) {
  1921. let spine;
  1922. spine = this.templet.buildArmature(type);
  1923. spine.showSkinByIndex(0);
  1924. parent.addChild(spine);
  1925. spine.pos(data.x, data.y);
  1926. spine.scale(data.scaleX, data.scaleY, true);
  1927. return spine;
  1928. }
  1929. }
  1930. var AIState;
  1931. (function (AIState) {
  1932. AIState[AIState["none"] = 0] = "none";
  1933. AIState[AIState["idle"] = 1] = "idle";
  1934. AIState[AIState["reset"] = 2] = "reset";
  1935. AIState[AIState["move"] = 3] = "move";
  1936. AIState[AIState["wait"] = 4] = "wait";
  1937. AIState[AIState["select"] = 5] = "select";
  1938. AIState[AIState["turn"] = 6] = "turn";
  1939. AIState[AIState["shoot"] = 7] = "shoot";
  1940. AIState[AIState["leave"] = 8] = "leave";
  1941. })(AIState || (AIState = {}));
  1942. class AIPlayer {
  1943. constructor() {
  1944. this.dtime = 30;
  1945. this.awayTime = 0;
  1946. this.awayNum = 0;
  1947. this.hideTime = 0;
  1948. this.rootMoveTime = 0;
  1949. this.isGuide = false;
  1950. this.state = AIState.none;
  1951. this.waitTime = 0;
  1952. this.forceNum = 0;
  1953. this.forceMax = 0;
  1954. this.ballSize = 33;
  1955. this.selectNum = 0;
  1956. this.destRot = 0;
  1957. this.aiLv = 10;
  1958. this.kickBall = [];
  1959. this.lineBall = [];
  1960. this.scoreBall = [];
  1961. this.holeBall = [];
  1962. this.turnNum = 0;
  1963. this.setNum = 0;
  1964. this.setMax = 0;
  1965. this.setRate = 0;
  1966. this.rectL = 0;
  1967. this.rectR = 0;
  1968. this.rectT = 0;
  1969. this.rectB = 0;
  1970. this.rootPos = { x: 0, y: 0 };
  1971. this.bestForce = 0;
  1972. this.bestAngle = 180;
  1973. this.bestPos = { x: 0, y: 0 };
  1974. this.bestKick = { x: 0, y: 0 };
  1975. this.posList = [];
  1976. this.posIdx = 0;
  1977. this.chatTime = 3000;
  1978. this.tempDir1 = new Laya.Vector2();
  1979. this.tempDir2 = new Laya.Vector2();
  1980. this.tempDir3 = new Laya.Vector2();
  1981. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1982. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1983. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1984. this.gameSrc = xGame.common.gameUI;
  1985. this.hideTime = Laya.timer.currTimer;
  1986. Moyu.setOnTipCall((id) => {
  1987. if (id == 20012)
  1988. this.hideTime = Laya.timer.currTimer;
  1989. else
  1990. (id == 20011);
  1991. {
  1992. let dt = Laya.timer.currTimer - this.hideTime;
  1993. console.log("onshow" + dt);
  1994. if (dt > 30000 && this.state > AIState.none)
  1995. xGame.common.gameMgr.aiGameEnd(false);
  1996. }
  1997. }, this);
  1998. }
  1999. init() {
  2000. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  2001. this.awayTime = xGame.tools.random(5000, 10000);
  2002. this.awayNum = 0;
  2003. this.hideTime = Laya.timer.currTimer;
  2004. let rect = xGame.common.d2World.borderRect;
  2005. this.rectL = Math.ceil(rect.x) + 17;
  2006. this.rectT = Math.ceil(rect.y) + 17;
  2007. this.rectR = Math.floor(rect.x + rect.width) - 17;
  2008. this.rectB = Math.floor(rect.y + rect.height) - 17;
  2009. this.wBall = xGame.common.d2World.rootBall;
  2010. this.ballSize = this.wBall.gameObj.width - 1;
  2011. if (this.posList.length < 1) {
  2012. let dp = 40;
  2013. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  2014. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  2015. let dx = i < this.rectR ? i : this.rectR;
  2016. let dy = j < this.rectB ? j : this.rectB;
  2017. let order = xGame.tools.random(0, 1000);
  2018. this.posList.push({ x: dx, y: dy, order: order });
  2019. }
  2020. }
  2021. this.posList.sort(function (a, b) {
  2022. return a.order - b.order;
  2023. });
  2024. this.setMax = this.posList.length;
  2025. }
  2026. this.state = AIState.idle;
  2027. }
  2028. setAiLevel(num) {
  2029. this.aiLv = num;
  2030. }
  2031. initBall() {
  2032. this.rootPos.x = this.wBall.gameObj.x;
  2033. this.rootPos.y = this.wBall.gameObj.y;
  2034. this.initHoleBall();
  2035. }
  2036. initHoleBall() {
  2037. this.kickBall = [];
  2038. this.lineBall = [];
  2039. this.scoreBall = [];
  2040. this.holeBall = [];
  2041. this.selectNum = 0;
  2042. this.forceNum = 0;
  2043. this.forceMax = 0;
  2044. this.turnNum = 0;
  2045. let list = xGame.common.d2World.ballArr;
  2046. if (list.length < 20 && !this.isGuide) {
  2047. let holes = xGame.common.gameMgr.holePosList;
  2048. for (let i = 0; i < list.length; i++) {
  2049. let obj = list[i];
  2050. if (!obj)
  2051. continue;
  2052. obj.kickPos.x = 0;
  2053. obj.kickPos.y = 0;
  2054. obj.poleAngle = 0;
  2055. obj.hard = 0;
  2056. obj.borderDis = 0;
  2057. obj.kickAngle = 180;
  2058. if (obj.number == 0)
  2059. continue;
  2060. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  2061. continue;
  2062. if (obj.number == 8 && xGame.common.gameMode == 0) {
  2063. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  2064. continue;
  2065. }
  2066. let b = obj.gameObj;
  2067. let wbp = this.rootPos;
  2068. let bx = wbp.x - b.x;
  2069. let by = wbp.y - b.y;
  2070. obj.borderDis = xGame.tools.random(0, 100);
  2071. this.kickBall.push(obj);
  2072. if (!this.isLine(wbp, obj))
  2073. continue;
  2074. obj.kickAngle = xGame.tools.random(90, 180);
  2075. obj.kickPos.x = b.x;
  2076. obj.kickPos.y = b.y;
  2077. this.lineBall.push(obj);
  2078. let minDis = 999999;
  2079. let hole = false;
  2080. for (let j = 0; j < holes.length; j++) {
  2081. let hp = holes[j];
  2082. if (bx >= 0 && hp.x > b.x + 100)
  2083. continue;
  2084. if (bx <= 0 && hp.x < b.x - 100)
  2085. continue;
  2086. if (by < -10 && hp.y < wbp.y)
  2087. continue;
  2088. if (by > 10 && hp.y > wbp.y)
  2089. continue;
  2090. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  2091. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  2092. if (dis < minDis) {
  2093. let dx = b.x - this.tempDir1.x * this.ballSize;
  2094. let dy = b.y - this.tempDir1.y * this.ballSize;
  2095. this.tempDir3.x = this.tempDir1.x;
  2096. this.tempDir3.y = this.tempDir1.y;
  2097. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  2098. obj.kickPos.x = dx;
  2099. obj.kickPos.y = dy;
  2100. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  2101. if (num > 1)
  2102. num = 1;
  2103. obj.kickAngle = Math.acos(num) * 57.3;
  2104. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  2105. dis = dis * 2;
  2106. if (Math.abs(hp.x - 600) < 100)
  2107. dis += 50;
  2108. obj.hard = dis + obj.kickAngle * 3;
  2109. hole = true;
  2110. }
  2111. }
  2112. }
  2113. }
  2114. if (hole) {
  2115. this.scoreBall.push(obj);
  2116. this.holeBall.push(obj);
  2117. }
  2118. }
  2119. this.scoreBall.sort(function (a, b) {
  2120. return a.hard - b.hard;
  2121. });
  2122. this.holeBall.sort(function (a, b) {
  2123. return a.kickAngle - b.kickAngle;
  2124. });
  2125. this.kickBall.sort(function (a, b) {
  2126. return a.borderDis - b.borderDis;
  2127. });
  2128. }
  2129. else {
  2130. let max = list.length - 1;
  2131. let i = xGame.tools.random(0, max);
  2132. for (i; i <= max; i++) {
  2133. let idx = i >= max ? i -= max : i;
  2134. let obj = list[idx];
  2135. if (obj && obj.number != 0) {
  2136. obj.kickAngle = xGame.tools.random(90, 180);
  2137. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  2138. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  2139. this.lineBall.push(obj);
  2140. break;
  2141. }
  2142. }
  2143. }
  2144. }
  2145. selectBall() {
  2146. let ball = null;
  2147. this.destRot = 0;
  2148. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  2149. let ai = 110 - this.aiLv * 10;
  2150. let mis = xGame.tools.random(-ai, ai) * 0.005;
  2151. let score = false;
  2152. if (this.scoreBall.length < 1) {
  2153. if (this.lineBall.length < 1) {
  2154. for (let i = 0; i < this.kickBall.length; i++) {
  2155. let list = [];
  2156. let bo = this.kickBall[i];
  2157. let bobj = bo.gameObj;
  2158. let rect = xGame.common.d2World.borderRect;
  2159. let mobj = this.wBall.gameObj;
  2160. let minb = bobj.y - rect.y - 20;
  2161. let minw = mobj.y - rect.y - 50;
  2162. if (minb > 0 && minw > 0) {
  2163. let dlenx = 0;
  2164. let dleny = mobj.y - rect.y;
  2165. let spx = mobj.x;
  2166. let spy = rect.y - dleny;
  2167. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2168. }
  2169. minb = rect.y + rect.height - bobj.y - 20;
  2170. minw = rect.y + rect.height - mobj.y - 50;
  2171. if (minb > 0 && minw > 0) {
  2172. let dlenx = 0;
  2173. let dleny = rect.y + rect.height - mobj.y;
  2174. let spx = mobj.x;
  2175. let spy = rect.y + rect.height + dleny;
  2176. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2177. }
  2178. minb = bobj.x - rect.x - 20;
  2179. minw = mobj.x - rect.x - 50;
  2180. if (minb > 0 && minw > 0) {
  2181. let dlenx = mobj.x - rect.x;
  2182. let dleny = 0;
  2183. let spx = rect.x - dlenx;
  2184. let spy = mobj.y;
  2185. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2186. }
  2187. minb = rect.x + rect.width - bobj.x - 20;
  2188. minw = rect.x + rect.width - mobj.x - 50;
  2189. if (minb > 0 && minw > 0) {
  2190. let dlenx = rect.x + rect.width - mobj.x;
  2191. let dleny = 0;
  2192. let spx = rect.x + rect.width + dlenx;
  2193. let spy = mobj.y;
  2194. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2195. }
  2196. list.sort(function (a, b) {
  2197. return a.order - b.order;
  2198. });
  2199. for (let i = 0; i < list.length; i++) {
  2200. let data = list[i];
  2201. let mx = mobj.x - bobj.x;
  2202. let my = mobj.y - bobj.y;
  2203. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2204. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2205. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2206. if (num > 1)
  2207. num = 1;
  2208. let cos = Math.acos(num);
  2209. if (cos > 1.57)
  2210. cos = 1.57;
  2211. else if (cos < 0.01)
  2212. cos = 0.01;
  2213. let tan = Math.tan(cos);
  2214. let dx = tan * data.dleny;
  2215. let dy = tan * data.dlenx;
  2216. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2217. if (Math.abs(bx - 667) < 40)
  2218. continue;
  2219. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2220. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2221. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2222. this.forceMax = dis * 0.08;
  2223. this.destRot += mis * 0.1;
  2224. this.setKick(bx, by);
  2225. return true;
  2226. }
  2227. }
  2228. }
  2229. }
  2230. else {
  2231. ball = xGame.common.getRandArrEle(this.lineBall);
  2232. }
  2233. }
  2234. else {
  2235. for (let i = 0; i < this.scoreBall.length; i++) {
  2236. if (i < this.scoreBall.length - 1) {
  2237. let rand = 70 + this.aiLv * 10 + i * 10;
  2238. if (xGame.tools.random(0, 100) < rand) {
  2239. ball = this.scoreBall[i];
  2240. break;
  2241. }
  2242. }
  2243. else {
  2244. ball = this.scoreBall[i];
  2245. break;
  2246. }
  2247. }
  2248. score = true;
  2249. this.selectNum++;
  2250. }
  2251. if (!ball)
  2252. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2253. if (this.selectNum >= max) {
  2254. let dx = ball.gameObj.x;
  2255. let dy = ball.gameObj.y;
  2256. let kickAngle = 0;
  2257. if (score) {
  2258. dx = ball.kickPos.x;
  2259. dy = ball.kickPos.y;
  2260. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2261. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2262. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2263. if (adot > 1)
  2264. adot = 1;
  2265. kickAngle = Math.acos(adot) * 57.3;
  2266. if (kickAngle > 45) {
  2267. let kdx = ball.kickPos.x - ball.gameObj.x;
  2268. let kdy = ball.kickPos.y - ball.gameObj.y;
  2269. dx = ball.kickPos.x - kdx * mis * 0.3;
  2270. dy = ball.kickPos.y - kdy * mis * 0.3;
  2271. }
  2272. else
  2273. this.destRot += mis;
  2274. }
  2275. else if (ball.poleAngle != 0) {
  2276. this.destRot += ball.poleAngle;
  2277. }
  2278. if (xGame.common.gameMode == 0) {
  2279. let af = kickAngle * 0.08;
  2280. this.forceMax = ball.hard * 0.1 + af * af;
  2281. }
  2282. this.setKick(dx, dy);
  2283. }
  2284. else {
  2285. let rand = this.aiLv * 5 + 40;
  2286. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2287. ball = xGame.common.getRandArrEle(this.scoreBall);
  2288. else
  2289. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2290. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2291. if (xGame.tools.random(0, 100) > rand) {
  2292. this.selectNum = max;
  2293. }
  2294. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2295. this.selectNum++;
  2296. }
  2297. ball.onClick(0, true);
  2298. }
  2299. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2300. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2301. let balls = xGame.common.d2World.ballArr;
  2302. let max = xGame.tools.getDis(hx, hy, bx, by);
  2303. for (let index = 0; index < balls.length; index++) {
  2304. let obj = balls[index];
  2305. if (obj.number == 0)
  2306. continue;
  2307. if (obj.number == bn || obj.number == dn)
  2308. continue;
  2309. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2310. if (dis * dis > max)
  2311. continue;
  2312. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2313. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2314. if (num > 1)
  2315. num = 1;
  2316. if (num < 0)
  2317. continue;
  2318. let gap = Math.sin(Math.acos(num)) * dis;
  2319. if (gap < this.ballSize)
  2320. return true;
  2321. }
  2322. return false;
  2323. }
  2324. isLine(xy, ball) {
  2325. let bx = xy.x;
  2326. let by = xy.y;
  2327. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2328. let dis = ball.getDestDis(xy);
  2329. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2330. let sin = Math.sin(angle);
  2331. let cos = Math.cos(angle);
  2332. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2333. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2334. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2335. let dx = bx + this.tempDir2.x * dis;
  2336. let dy = by + this.tempDir2.y * dis;
  2337. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2338. sin = Math.sin(-angle);
  2339. cos = Math.cos(-angle);
  2340. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2341. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2342. dx = bx + this.tempDir2.x * dis;
  2343. dy = by + this.tempDir2.y * dis;
  2344. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2345. if (isr && isl)
  2346. return false;
  2347. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2348. }
  2349. return true;
  2350. }
  2351. turnPole() {
  2352. this.turnNum++;
  2353. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2354. let dr = rot - this.destRot;
  2355. let abs = Math.abs(dr) % 360;
  2356. if (abs > 180) {
  2357. if (rot > 180)
  2358. rot -= 360;
  2359. if (this.destRot > 180)
  2360. this.destRot -= 360;
  2361. }
  2362. let max = this.turnNum * 5 + this.aiLv * 5;
  2363. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2364. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2365. let at = xGame.tools.random(1000, 2000);
  2366. if (!this.onAway(3))
  2367. at += xGame.tools.random(10000, 15000);
  2368. this.setState(AIState.shoot, at);
  2369. }
  2370. else {
  2371. let mr = 0;
  2372. if (abs > 3)
  2373. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2374. else if (Math.random() > 0.6)
  2375. mr = xGame.tools.random(1, 10) * 0.1;
  2376. mr = dr > 0 ? -mr : mr;
  2377. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2378. }
  2379. }
  2380. setKick(dx, dy) {
  2381. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2382. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2383. this.tempDir1.x = 0;
  2384. this.tempDir1.y = 1;
  2385. this.tempDir2.y = -this.tempDir2.y;
  2386. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2387. if (num > 1)
  2388. num = 1;
  2389. let rot = Math.acos(num) * 57.3;
  2390. if (this.tempDir2.x < 0)
  2391. rot = 360 - rot;
  2392. this.destRot += rot;
  2393. if (!xGame.common.gameMgr.finishOneShoot) {
  2394. this.forceMax += xGame.tools.random(10, 50);
  2395. this.forceMax -= this.aiLv * 2;
  2396. if (this.forceMax < 20)
  2397. this.forceMax = 20;
  2398. }
  2399. if (this.forceMax > 100)
  2400. this.forceMax = 101;
  2401. else if (this.forceMax < 10)
  2402. this.forceMax += xGame.tools.random(0, 10);
  2403. if (xGame.common.gameMode == 1)
  2404. this.forceMax = xGame.tools.random(80, 100);
  2405. else
  2406. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2407. let max = 2000 - this.aiLv * 100;
  2408. if (Math.random() > 0.8)
  2409. max += xGame.tools.random(100, 2000);
  2410. this.setState(AIState.turn, xGame.tools.random(500, max));
  2411. }
  2412. shoot() {
  2413. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2414. if (Math.random() > 0.8) {
  2415. this.gameSrc.aiForce(1);
  2416. this.setState(AIState.wait);
  2417. }
  2418. }
  2419. else {
  2420. let df = xGame.tools.random(3, 8);
  2421. if (this.forceNum < this.forceMax)
  2422. this.forceNum += df;
  2423. else
  2424. this.forceNum -= df;
  2425. let startY = this.gameSrc.ui.powerNode.y;
  2426. let height = this.gameSrc.ui.powerNode.height;
  2427. let force = startY + height * this.forceNum * 0.01;
  2428. this.gameSrc.aiForce(2, force);
  2429. }
  2430. }
  2431. reset() {
  2432. for (let i = 0; i < 4; i++) {
  2433. this.setRate--;
  2434. this.setNum++;
  2435. let pos = this.posList[this.posIdx];
  2436. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2437. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2438. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2439. this.rootPos.x = 387;
  2440. if (this.rootPos.x < this.rectL)
  2441. this.rootPos.x = this.rectL;
  2442. else if (this.rootPos.x > this.rectR)
  2443. this.rootPos.x = this.rectR;
  2444. if (this.rootPos.y < this.rectT)
  2445. this.rootPos.y = this.rectT;
  2446. else if (this.rootPos.y > this.rectB)
  2447. this.rootPos.y = this.rectB;
  2448. this.posIdx++;
  2449. let max = this.posList.length;
  2450. if (this.posIdx >= max)
  2451. this.posIdx -= max;
  2452. this.initHoleBall();
  2453. let ball = null;
  2454. if (this.scoreBall.length > 0)
  2455. ball = this.scoreBall[0];
  2456. else if (this.lineBall.length > 0)
  2457. ball = xGame.common.getRandArrEle(this.lineBall);
  2458. if (ball && ball.kickAngle < this.bestAngle) {
  2459. this.bestAngle = ball.kickAngle;
  2460. this.bestKick.x = ball.kickPos.x;
  2461. this.bestKick.y = ball.kickPos.y;
  2462. this.bestPos.x = this.rootPos.x;
  2463. this.bestPos.y = this.rootPos.y;
  2464. this.bestForce = ball.hard * 0.08;
  2465. }
  2466. }
  2467. if (this.setNum >= this.setMax)
  2468. this.setMax = 0;
  2469. if (this.setRate < 1) {
  2470. this.setState(AIState.move, 0);
  2471. this.rootMoveTime = Laya.timer.currTimer;
  2472. this.gameSrc.aiRootMove(true);
  2473. }
  2474. }
  2475. delayLine() {
  2476. this.gameSrc.aiRootMove(false);
  2477. }
  2478. move() {
  2479. if (this.bestPos.x < 1)
  2480. this.bestPos = this.rootPos;
  2481. let wObj = this.wBall.gameObj;
  2482. let destx = wObj.x;
  2483. let desty = wObj.y;
  2484. let dx = Math.abs(destx - this.bestPos.x);
  2485. let dy = Math.abs(desty - this.bestPos.y);
  2486. let mx = 3 + dx * 0.03;
  2487. let my = 3 + dy * 0.03;
  2488. if (dx < 4 && dy < 4) {
  2489. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2490. dt = dt < 1000 ? 1000 - dt : 0;
  2491. if (this.setMax > 0) {
  2492. let min = this.setMax * 0.3 + this.aiLv * 5;
  2493. this.setRate = xGame.tools.random(min, this.setMax);
  2494. this.setState(AIState.reset, 0);
  2495. }
  2496. else {
  2497. this.destRot = 0;
  2498. this.forceMax = this.bestForce;
  2499. this.setKick(this.bestKick.x, this.bestKick.y);
  2500. }
  2501. if (dt > 100) {
  2502. Laya.timer.clear(this, this.delayLine);
  2503. Laya.timer.once(dt, this, this.delayLine);
  2504. }
  2505. else
  2506. this.gameSrc.aiRootMove(false);
  2507. }
  2508. else {
  2509. if (dx > 4)
  2510. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2511. if (dy > 4)
  2512. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2513. this.gameSrc.onRootMove({ x: destx, y: desty });
  2514. }
  2515. }
  2516. resetRoot() {
  2517. this.bestAngle = 180;
  2518. this.bestForce = 0;
  2519. this.setMax = this.posList.length;
  2520. this.posIdx = xGame.tools.random(0, this.setMax);
  2521. let min = this.setMax * 0.3 + this.aiLv * 5;
  2522. this.setRate = xGame.tools.random(min, this.setMax);
  2523. let max = 2000 - this.aiLv * 100;
  2524. if (Math.random() > 0.8)
  2525. max += xGame.tools.random(100, 1000);
  2526. if (this.isGuide)
  2527. this.setState(AIState.select, 500);
  2528. else if (this.onAway(2))
  2529. this.setState(AIState.reset, xGame.tools.random(400, max));
  2530. else
  2531. this.setState(AIState.none);
  2532. if (xGame.common.gameMgr.finishOneShoot)
  2533. this.chat();
  2534. }
  2535. runAI() {
  2536. if (this.state > AIState.idle)
  2537. return;
  2538. this.initBall();
  2539. this.onGame(2500);
  2540. if (Math.random() > 0.6)
  2541. this.chat();
  2542. }
  2543. stopRun() {
  2544. this.setState(AIState.idle);
  2545. }
  2546. onGame(base) {
  2547. let max = base - this.aiLv * 100;
  2548. if (Math.random() > 0.8)
  2549. max += xGame.tools.random(100, 1000);
  2550. if (this.onAway(2))
  2551. this.setState(AIState.select, xGame.tools.random(500, max));
  2552. else
  2553. this.setState(AIState.none);
  2554. }
  2555. setState(sta, wt = 0) {
  2556. if (this.state == AIState.none)
  2557. return;
  2558. this.state = sta;
  2559. this.waitTime = wt;
  2560. }
  2561. onUpdate() {
  2562. if (this.state == AIState.none)
  2563. return;
  2564. this.awayTime -= this.dtime;
  2565. if (this.awayTime < 1) {
  2566. this.awayTime = xGame.tools.random(6000, 10000);
  2567. this.awayNum += (11 - this.aiLv);
  2568. this.onAway(1);
  2569. }
  2570. if (this.waitTime >= 0) {
  2571. this.waitTime -= this.dtime;
  2572. return;
  2573. }
  2574. switch (this.state) {
  2575. case AIState.idle:
  2576. this.chat();
  2577. break;
  2578. case AIState.reset:
  2579. this.reset();
  2580. break;
  2581. case AIState.move:
  2582. this.move();
  2583. break;
  2584. case AIState.leave:
  2585. this.state = AIState.none;
  2586. xGame.common.gameMgr.aiGameEnd(true);
  2587. break;
  2588. case AIState.select:
  2589. this.selectBall();
  2590. break;
  2591. case AIState.turn:
  2592. this.turnPole();
  2593. break;
  2594. case AIState.shoot:
  2595. this.shoot();
  2596. break;
  2597. }
  2598. }
  2599. onAway(type) {
  2600. if (type == 1) {
  2601. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2602. let num = this.awayNum + db * 20;
  2603. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2604. xGame.common.gameMgr.aiLeave();
  2605. this.setState(AIState.leave, 6666);
  2606. }
  2607. }
  2608. else if (type == 2) {
  2609. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2610. let num = this.awayNum + db * 30;
  2611. if (xGame.tools.random(0, 10000) < num)
  2612. return false;
  2613. }
  2614. else if (type == 3) {
  2615. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2616. let num = this.awayNum + db * 10;
  2617. if (xGame.tools.random(0, 4000) < num)
  2618. return false;
  2619. }
  2620. return true;
  2621. }
  2622. chat() {
  2623. if (this.chatTime > 0) {
  2624. this.chatTime -= this.dtime;
  2625. return;
  2626. }
  2627. this.chatTime = xGame.tools.random(2000, 10000);
  2628. let rand = xGame.tools.random(0, 100);
  2629. if (rand < 15)
  2630. this.talk();
  2631. else if (rand < 35)
  2632. this.emotion();
  2633. }
  2634. talk() {
  2635. xGame.common.talkMgr.showAITalk(0);
  2636. }
  2637. emotion() {
  2638. xGame.common.talkMgr.showAIEmotion(0);
  2639. }
  2640. resetAI() {
  2641. this.stopRun();
  2642. this.state = AIState.none;
  2643. }
  2644. }
  2645. class Partical extends Laya.Script3D {
  2646. constructor() {
  2647. super();
  2648. this.duration = 2000;
  2649. }
  2650. ;
  2651. onAwake() {
  2652. this.gameObj = this.owner;
  2653. }
  2654. onEnable() {
  2655. this.openTimer();
  2656. }
  2657. openTimer() {
  2658. Laya.timer.once(this.duration, this, this.disappear);
  2659. }
  2660. setCallback(obj, callback) {
  2661. this.obj = obj;
  2662. this.callback = callback;
  2663. Laya.timer.clearAll(this);
  2664. Laya.timer.once(this.duration, this, this.disappear);
  2665. }
  2666. disappear() {
  2667. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2668. this.callback && this.callback(this.obj);
  2669. }
  2670. }
  2671. class Ball extends Laya.Script3D {
  2672. constructor() {
  2673. super();
  2674. this.posV3 = new Laya.Vector3();
  2675. this.rotRate = 2.1;
  2676. this.rotSpeed = new Laya.Vector3();
  2677. this.myIndex = 0;
  2678. }
  2679. onAwake() {
  2680. this.gameObj = this.owner;
  2681. this.transform = this.gameObj.transform;
  2682. this.ballNode = this.gameObj.getChildByName("Ball");
  2683. this.shadowNode = this.gameObj.getChildByName("shadow");
  2684. }
  2685. initSelf(index, x, y, owner) {
  2686. this.d2BallSrc = owner;
  2687. this.myIndex = index;
  2688. this.setAlbedoTexture();
  2689. this.setTransPos(x, y);
  2690. this.setScale();
  2691. this.ballNode.transform.localRotationEulerX = 90;
  2692. if (index == 0) {
  2693. }
  2694. }
  2695. setAlbedoTexture(isIce = false) {
  2696. let url;
  2697. if (isIce) {
  2698. url = `res/d3Res/ballTexture/ice.jpg`;
  2699. }
  2700. else {
  2701. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2702. }
  2703. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2704. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2705. }));
  2706. }
  2707. runFireworks(obj, delay, callback) {
  2708. Laya.timer.clearAll(this);
  2709. Laya.timer.once(delay + 1, this, () => {
  2710. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2711. fire.transform.localPositionX = this.transform.localPositionX;
  2712. fire.transform.localPositionY = this.transform.localPositionY;
  2713. fire.transform.localPositionZ = this.transform.localPositionZ;
  2714. let src = fire.getComponent(Partical);
  2715. src.duration = 1000;
  2716. src.setCallback(obj, callback);
  2717. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2718. eft.transform.localPositionX = this.transform.localPositionX;
  2719. eft.transform.localPositionY = this.transform.localPositionY;
  2720. eft.transform.localPositionZ = this.transform.localPositionZ;
  2721. });
  2722. }
  2723. setTransPos(x, y) {
  2724. this.setRotation();
  2725. xGame.common.pos2to3Convert(x, y, this.posV3);
  2726. this.transform.localPositionX = this.posV3.x;
  2727. this.transform.localPositionY = 0;
  2728. this.transform.localPositionZ = this.posV3.z;
  2729. this.transform.localRotationEulerX = 0;
  2730. this.transform.localRotationEulerY = 0;
  2731. this.transform.localRotationEulerZ = 0;
  2732. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2733. this.shadowNode.transform.localPositionY = 0.1;
  2734. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2735. }
  2736. setRotation() {
  2737. if (this.d2BallSrc.canRot) {
  2738. let speed = this.d2BallSrc.rigy.linearVelocity;
  2739. this.rotSpeed.x = speed.x * this.rotRate;
  2740. this.rotSpeed.z = speed.y * this.rotRate;
  2741. this.rotSpeed.y = this.d2BallSrc.rotY;
  2742. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2743. }
  2744. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2745. this.rotSpeed.x = this.rotSpeed.y = 0;
  2746. this.rotSpeed.y = this.d2BallSrc.rotY;
  2747. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2748. }
  2749. }
  2750. setScale() {
  2751. let radius = xGame.common.d2World.rootBall.ui.width;
  2752. let scale = xGame.common.scale2to3Convert(radius);
  2753. this.transform.localScaleX = scale;
  2754. this.transform.localScaleY = scale;
  2755. this.transform.localScaleZ = scale;
  2756. }
  2757. playInHoleEft() {
  2758. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2759. eft.transform.position = this.transform.position;
  2760. }
  2761. playIceEft() {
  2762. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2763. eft.transform.position = this.transform.position;
  2764. }
  2765. get scaleXYZ() {
  2766. return this.transform.localScaleX;
  2767. }
  2768. set scaleXYZ(val) {
  2769. this.transform.localScaleX = val;
  2770. this.transform.localScaleY = val;
  2771. this.transform.localScaleZ = val;
  2772. }
  2773. get posX() {
  2774. return this.transform.localPositionX;
  2775. }
  2776. set posX(val) {
  2777. this.transform.localPositionX = val;
  2778. }
  2779. get posY() {
  2780. return this.transform.localPositionY;
  2781. }
  2782. set posY(val) {
  2783. this.transform.localPositionY = val;
  2784. }
  2785. get posZ() {
  2786. return this.transform.localPositionZ;
  2787. }
  2788. set posZ(val) {
  2789. this.transform.localPositionZ = val;
  2790. }
  2791. destroySelf() {
  2792. this.posV3 = null;
  2793. this.rotSpeed = null;
  2794. this.d2BallSrc = null;
  2795. this.ballNode = null;
  2796. this.gameObj.destroy(true);
  2797. this.transform = null;
  2798. this.destroy();
  2799. }
  2800. }
  2801. class ui_D2Ball extends fgui.GComponent {
  2802. static createInstance() {
  2803. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2804. }
  2805. onConstruct() {
  2806. this.myIcon = (this.getChild("myIcon"));
  2807. this.inner = (this.getChild("inner"));
  2808. this.n8 = (this.getChild("n8"));
  2809. this.n4 = (this.getChild("n4"));
  2810. this.wrongTips = (this.getChild("wrongTips"));
  2811. this.rightTips = (this.getChild("rightTips"));
  2812. this.breathAni = this.getTransition("breathAni");
  2813. }
  2814. }
  2815. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2816. class D2BallSrc extends Laya.Script {
  2817. constructor() {
  2818. super();
  2819. this.number = 0;
  2820. this.startX = 0;
  2821. this.startY = 0;
  2822. this.angleV2 = new Laya.Vector2();
  2823. this.isRootBall = false;
  2824. this.isBlackBall = false;
  2825. this.ballType = "";
  2826. this.canRot = true;
  2827. this.rotY = 0;
  2828. this.poleAngle = 0;
  2829. this.kickPos = { x: 0, y: 0 };
  2830. this.hard = 0;
  2831. this.kickAngle = 0;
  2832. this.borderDis = 0;
  2833. this.speedP10 = 5.6;
  2834. this.lastSpeed = { x: 0, y: 0 };
  2835. this.stillSpeed = 0.12;
  2836. this.ballFunc = "normal";
  2837. this.isRunSkillAni = false;
  2838. this.isInHole = false;
  2839. this.iceOwner = "";
  2840. this.forceRun = false;
  2841. this.myUNID = "";
  2842. this.rectL = 0;
  2843. this.rectR = 0;
  2844. this.rectT = 0;
  2845. this.rectB = 0;
  2846. this.forceVec = new Laya.Vector2();
  2847. this.lastDis = 0;
  2848. this.helpOut = { type: "", x: 0, y: 0 };
  2849. }
  2850. initSelf(number, x, y, d3Ball) {
  2851. if (!this.gameObj)
  2852. this.gameObj = this.owner;
  2853. this.number = number;
  2854. this.startX = x;
  2855. this.startY = y;
  2856. this.d3Ball = d3Ball;
  2857. this.isRootBall = false;
  2858. this.isBlackBall = false;
  2859. this.ballType = "";
  2860. if (number == 0) {
  2861. this.isRootBall = true;
  2862. }
  2863. else if (number == 8) {
  2864. this.isBlackBall = true;
  2865. }
  2866. else {
  2867. if (number <= 7) {
  2868. this.ballType = ballCamp.full;
  2869. }
  2870. else {
  2871. this.ballType = ballCamp.flower;
  2872. }
  2873. }
  2874. this.setInfo();
  2875. this.setD3Ball();
  2876. this.owner["mySrc"] = this;
  2877. this.rigy.linearDamping = 1;
  2878. D2BallSrc._unid++;
  2879. this.myUNID = "d2ball" + D2BallSrc._unid;
  2880. let rect = xGame.common.d2World.borderRect;
  2881. this.rectL = Math.ceil(rect.x) + 20;
  2882. this.rectT = Math.ceil(rect.y) + 20;
  2883. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2884. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2885. }
  2886. setInfo() {
  2887. this.gameObj.x = this.startX;
  2888. this.gameObj.y = this.startY;
  2889. let radius = this.ui.width / 2;
  2890. this.gameObj.width = radius * 2;
  2891. this.gameObj.height = radius * 2;
  2892. if (xGame.common.showDebug) {
  2893. this.ui.myIcon.alpha = 1;
  2894. this.ui.inner.alpha = 1;
  2895. }
  2896. else {
  2897. this.ui.myIcon.alpha = 0;
  2898. this.ui.inner.alpha = 0;
  2899. }
  2900. }
  2901. setD3Ball() {
  2902. this.d3Ball = this.d3Ball;
  2903. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2904. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2905. }
  2906. onUpdate() {
  2907. if (xGame.common.gameMgr.gamePause)
  2908. return;
  2909. if (this.isInHole)
  2910. return;
  2911. if (!xGame.common.d2World.openCheckStill)
  2912. return;
  2913. this.runBall();
  2914. }
  2915. runBall() {
  2916. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2917. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2918. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2919. this.judgeBorder();
  2920. }
  2921. getDestDis(dest) {
  2922. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2923. }
  2924. setmyXY(x, y) {
  2925. this.d3BallSrc.setTransPos(x, y);
  2926. }
  2927. getSpeed() {
  2928. let speed = this.rigy.linearVelocity;
  2929. return speed.x * speed.x + speed.y * speed.y;
  2930. }
  2931. onTriggerEnter(collider) {
  2932. if (!collider || !collider.owner)
  2933. return;
  2934. let coll = "collide";
  2935. let speed = this.getSpeed();
  2936. let sv2 = this.speedP10 * this.speedP10;
  2937. if (collider.label == "ball") {
  2938. if (speed < 9 && this.number != 0)
  2939. coll = "";
  2940. else if (speed < sv2)
  2941. coll = "collide_4";
  2942. else if (speed < sv2 * 6.2)
  2943. coll = "collide_3";
  2944. else if (speed < sv2 * 25)
  2945. coll = "collide_2";
  2946. else if (speed < sv2 * 56)
  2947. coll = "collide_1";
  2948. xGame.soundMgr.playSound(coll);
  2949. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2950. if (collider.owner) {
  2951. let rig = collider.owner.getComponent(D2BallSrc);
  2952. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2953. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2954. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2955. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2956. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2957. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2958. let rx = 0;
  2959. let ry = 0;
  2960. if (this.gameObj.x < this.rectL)
  2961. rx = vx;
  2962. else if (this.gameObj.x > this.rectR)
  2963. rx = -vx;
  2964. else if (this.gameObj.y < this.rectT)
  2965. ry = vy;
  2966. else if (this.gameObj.y > this.rectB)
  2967. ry = -vy;
  2968. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2969. }
  2970. }
  2971. if (this.number != 0) {
  2972. return;
  2973. }
  2974. else {
  2975. if (this.forceRun) {
  2976. console.log("randon force");
  2977. this.applyForce(collider);
  2978. }
  2979. }
  2980. if (xGame.common.d2World.isOnSameLine) {
  2981. xGame.common.d2World.isOnSameLine = false;
  2982. this.rigy.linearVelocity = { x: 0, y: 0 };
  2983. }
  2984. if (xGame.common.gameMgr.firstColliObj == null) {
  2985. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2986. xGame.common.gameMgr.isTouchedBall = true;
  2987. }
  2988. }
  2989. else {
  2990. xGame.common.recoverCameraView();
  2991. let wallStr = "";
  2992. if (speed < 9) { }
  2993. else if (speed < sv2) { }
  2994. else if (speed < sv2 * 6.2)
  2995. wallStr = "wall_30";
  2996. else if (speed < sv2 * 25)
  2997. wallStr = "wall_50";
  2998. else if (speed < sv2 * 56)
  2999. wallStr = "wall_80";
  3000. xGame.soundMgr.playSound(wallStr);
  3001. }
  3002. }
  3003. applyForce(collider) {
  3004. let src = collider.owner.mySrc;
  3005. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  3006. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  3007. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  3008. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  3009. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  3010. }
  3011. checkWrongBall(playEft = true) {
  3012. if (this.isInHole)
  3013. return;
  3014. xGame.common.gameMgr.inHoleBalls.push(this.number);
  3015. if (this.number != 0 && playEft)
  3016. this.d3BallSrc.playInHoleEft();
  3017. let coll = "inpocket_1";
  3018. let speed = this.getSpeed();
  3019. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  3020. if (speed < 9 && this.number != 0)
  3021. coll = "";
  3022. else if (speed < sv2 * 6.2)
  3023. coll = "inpocket_4";
  3024. else if (speed < sv2 * 25)
  3025. coll = "collide_3";
  3026. else if (speed < sv2 * 56)
  3027. coll = "collide_2";
  3028. xGame.soundMgr.playSound(coll);
  3029. this.isInHole = true;
  3030. if (this.number == 0) {
  3031. console.log("白球进了。。");
  3032. this.reset();
  3033. this.rigy.linearVelocity = { x: 0, y: 0 };
  3034. this.hideSelf();
  3035. xGame.common.gameUI.ui.whiteAni.visible = true;
  3036. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  3037. xGame.common.gameUI.ui.whiteAni.visible = false;
  3038. }));
  3039. }
  3040. else {
  3041. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  3042. xGame.common.d2World.removeOneBall(this);
  3043. this.destroySelf();
  3044. xGame.common.playHappySound(this.number);
  3045. this.runFlyEft();
  3046. }
  3047. }
  3048. runFlyEft() {
  3049. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  3050. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  3051. }
  3052. }
  3053. hideSelf() {
  3054. if (this.d3Ball)
  3055. this.d3Ball.active = false;
  3056. }
  3057. showSelf() {
  3058. this.isInHole = false;
  3059. if (this.d3Ball && !this.d3Ball.active)
  3060. this.d3Ball.active = true;
  3061. }
  3062. isStill() {
  3063. let speed = this.rigy.linearVelocity;
  3064. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  3065. this.rigy.linearVelocity = { x: 0, y: 0 };
  3066. return true;
  3067. }
  3068. return false;
  3069. }
  3070. reset() {
  3071. }
  3072. destroySelf() {
  3073. this.d3BallSrc.destroySelf();
  3074. if (!this.ui.isDisposed) {
  3075. this.ui.removeFromParent();
  3076. this.ui.dispose();
  3077. this.ui = null;
  3078. }
  3079. this.outColli = null;
  3080. this.innerColli = null;
  3081. this.rigy = null;
  3082. this.d3Ball = null;
  3083. this.d3BallSrc = null;
  3084. this.angleV2 = null;
  3085. this.gameObj.destroy(true);
  3086. this.destroy();
  3087. }
  3088. judgeBorder() {
  3089. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  3090. return;
  3091. }
  3092. if (this.destroyed)
  3093. return;
  3094. if (xGame.common.gameMode == GameMode.classic)
  3095. return;
  3096. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  3097. if (isOver) {
  3098. this.checkWrongBall();
  3099. }
  3100. }
  3101. onClick(e, force = false) {
  3102. if (this.number == 0)
  3103. return;
  3104. if (force) {
  3105. }
  3106. else {
  3107. if (xGame.common.d2World.openCheckStill)
  3108. return;
  3109. if (!xGame.common.gameMgr.selfTurn) {
  3110. return;
  3111. }
  3112. }
  3113. if (!xGame.common.gameMgr.finishOneShoot)
  3114. return;
  3115. let root = xGame.common.d2World.rootBall.gameObj;
  3116. let x = this.gameObj.x - root.x;
  3117. let y = this.gameObj.y - root.y;
  3118. let angle = xGame.common.getfguiRotation(x, y);
  3119. xGame.common.d2World.d2Gan.ui.rotation = angle;
  3120. xGame.common.d2World.getHelpLine();
  3121. xGame.common.clickedBall = true;
  3122. this.checkGuide();
  3123. }
  3124. checkGuide() {
  3125. let guide = DataMgr.getSkillGuide();
  3126. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3127. xGame.common.guideStep++;
  3128. xGame.common.gameUI.ui.guide1.visible = false;
  3129. xGame.common.gameUI.ui.guide2.visible = true;
  3130. }
  3131. }
  3132. checkDistance(disX, disY, angle) {
  3133. let diameter = this.gameObj.width - 1;
  3134. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3135. if (!this.lastDis)
  3136. this.lastDis = dis;
  3137. else {
  3138. if (dis > this.lastDis) {
  3139. this.helpOut.type = "remove";
  3140. return this.helpOut;
  3141. }
  3142. }
  3143. if (dis <= Math.pow(diameter, 2)) {
  3144. let del = 0.01;
  3145. let offest = 0;
  3146. let realX = disX - this.gameObj.x;
  3147. let realY = disY - this.gameObj.y;
  3148. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3149. offest += del;
  3150. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3151. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3152. }
  3153. this.helpOut.type = "ok";
  3154. this.helpOut.x = realX + this.gameObj.x;
  3155. this.helpOut.y = realY + this.gameObj.y;
  3156. return this.helpOut;
  3157. }
  3158. else {
  3159. this.helpOut.type = "no";
  3160. return this.helpOut;
  3161. }
  3162. }
  3163. clearBallEft() {
  3164. this.clearBallRightEft();
  3165. this.clearBallWrongEft();
  3166. }
  3167. clearBallRightEft() {
  3168. this.ui.breathAni.stop();
  3169. this.ui.rightTips.visible = false;
  3170. }
  3171. clearBallWrongEft() {
  3172. this.ui.wrongTips.visible = false;
  3173. }
  3174. showWrongEft() {
  3175. if (!xGame.common.gameMgr.selfTurn)
  3176. return;
  3177. this.ui.wrongTips.visible = true;
  3178. }
  3179. showRightEft() {
  3180. if (!xGame.common.gameMgr.selfTurn)
  3181. return;
  3182. this.ui.rightTips.visible = true;
  3183. this.ui.rightTips.scaleX = 1;
  3184. this.ui.rightTips.scaleY = 1;
  3185. this.ui.breathAni.play();
  3186. }
  3187. setBallFunc(type, owner) {
  3188. if (type == "ice") {
  3189. this.ballFunc = type;
  3190. this.d3BallSrc.setAlbedoTexture(true);
  3191. this.rigy.type = "static";
  3192. this.iceOwner = owner;
  3193. }
  3194. else {
  3195. if (owner == this.iceOwner) {
  3196. this.ballFunc = type;
  3197. this.d3BallSrc.setAlbedoTexture(false);
  3198. this.rigy.type = "dynamic";
  3199. }
  3200. }
  3201. }
  3202. }
  3203. D2BallSrc._unid = 0;
  3204. class D2RootBallSrc extends D2BallSrc {
  3205. constructor() {
  3206. super();
  3207. this.maxSpeed = 0;
  3208. this.classicMaxSpeed = 2.2;
  3209. this.bigSkillMaxSpeed = 4;
  3210. this.angle = 0;
  3211. this.allPercent = 0;
  3212. this.linearPercent = 0;
  3213. this.anglePercent = 0;
  3214. this.maxAngleRate = 0.6;
  3215. this.baseRot = 7;
  3216. this.angleMax = 0;
  3217. this.speed = new Laya.Vector2();
  3218. this.rotSpeed = new Laya.Vector2();
  3219. }
  3220. isStill() {
  3221. let speed = this.rigy.linearVelocity;
  3222. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3223. if (this.anglePercent <= 0.1) {
  3224. this.rigy.linearVelocity = { x: 0, y: 0 };
  3225. return true;
  3226. }
  3227. }
  3228. return false;
  3229. }
  3230. reset() {
  3231. this.linearPercent = 0;
  3232. this.anglePercent = 0;
  3233. }
  3234. setSpeed(percent, angle) {
  3235. this.allPercent = percent;
  3236. this.angle = angle;
  3237. this.setAngleSpeed();
  3238. this.setLinearSpeed();
  3239. let hit = "hit";
  3240. if (percent < 25)
  3241. hit = "hit03";
  3242. else if (percent < 50)
  3243. hit = "hit02";
  3244. else if (percent < 75)
  3245. hit = "hit01";
  3246. xGame.soundMgr.playSound(hit);
  3247. }
  3248. setAngleSpeed() {
  3249. let offest = xGame.common.rodOffest;
  3250. let radius = 82;
  3251. let rate = Math.abs(offest.y / radius) * 0.5;
  3252. if (offest.y > 0)
  3253. this.angleMax = -this.baseRot * 2;
  3254. else
  3255. this.angleMax = this.baseRot;
  3256. this.rotY = -offest.x / radius * 100;
  3257. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3258. this.linearPercent = this.allPercent - this.anglePercent;
  3259. }
  3260. setLinearSpeed() {
  3261. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3262. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3263. if (!xGame.common.longHelpLine) {
  3264. let offset = -150 + xGame.common.randomNum(0, 300);
  3265. offset /= 100;
  3266. this.angle += offset;
  3267. }
  3268. }
  3269. }
  3270. let sin = Math.sin(this.angle * Math.PI / 180);
  3271. let cos = Math.cos(this.angle * Math.PI / 180);
  3272. switch (xGame.common.gameMode) {
  3273. case GameMode.classic:
  3274. this.maxSpeed = this.classicMaxSpeed;
  3275. break;
  3276. case GameMode.bigMove:
  3277. this.maxSpeed = this.bigSkillMaxSpeed;
  3278. break;
  3279. case GameMode.placeBall:
  3280. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3281. if (data.type == 1) {
  3282. this.maxSpeed = this.bigSkillMaxSpeed;
  3283. }
  3284. else {
  3285. this.maxSpeed = this.classicMaxSpeed;
  3286. }
  3287. break;
  3288. default:
  3289. break;
  3290. }
  3291. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3292. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3293. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3294. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3295. this.rigy.applyLinearImpulseToCenter(this.speed);
  3296. }
  3297. onUpdate() {
  3298. if (this.anglePercent > 0.1) {
  3299. this.anglePercent *= 0.97;
  3300. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3301. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3302. this.rigy.applyForceToCenter(this.rotSpeed);
  3303. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3304. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3305. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3306. if (num > 0.9)
  3307. this.canRot = true;
  3308. }
  3309. else
  3310. this.canRot = true;
  3311. if (Math.abs(this.rotY) > 0.1)
  3312. this.rotY *= 0.98;
  3313. super.onUpdate();
  3314. }
  3315. destroySelf() {
  3316. super.destroySelf();
  3317. this.speed = null;
  3318. }
  3319. }
  3320. class D2Ball extends Laya.Sprite {
  3321. constructor(isRootBall = false) {
  3322. super();
  3323. this.ui = ui_D2Ball.createInstance();
  3324. this.pivotX = this.ui.width / 2;
  3325. this.pivotY = this.ui.width / 2;
  3326. this.x = 0;
  3327. this.y = 0;
  3328. this.addChild(this.ui.displayObject);
  3329. this.ui.displayObject.x += this.ui.width / 2;
  3330. this.ui.displayObject.y += this.ui.width / 2;
  3331. if (isRootBall) {
  3332. this.d2Src = this.addComponent(D2RootBallSrc);
  3333. }
  3334. else {
  3335. this.d2Src = this.addComponent(D2BallSrc);
  3336. }
  3337. this.d2Src.ui = this.ui;
  3338. this.addCircleCollider();
  3339. this.addInnerCircleCollider();
  3340. this.addRigyBody();
  3341. }
  3342. addCircleCollider() {
  3343. let colli = xGame.common.getCollider("circle");
  3344. colli.radius = this.ui.width / 2;
  3345. this.addComponentIntance(colli);
  3346. this.d2Src.outColli = colli;
  3347. colli.label = "ball";
  3348. }
  3349. addInnerCircleCollider() {
  3350. let colli = xGame.common.getCollider("circle");
  3351. colli.radius = this.ui.inner.width / 2;
  3352. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3353. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3354. this.addComponentIntance(colli);
  3355. this.d2Src.innerColli = colli;
  3356. colli.label = "inner";
  3357. }
  3358. addRigyBody() {
  3359. let rigy = xGame.common.getRigbody();
  3360. rigy.type = "dynamic";
  3361. this.addComponentIntance(rigy);
  3362. this.d2Src.rigy = rigy;
  3363. }
  3364. disposeSelf() {
  3365. if (!this.ui.isDisposed) {
  3366. this.ui.dispose();
  3367. this.ui.removeFromParent();
  3368. this.ui = null;
  3369. }
  3370. }
  3371. }
  3372. class ui_D2Gan extends fgui.GComponent {
  3373. static createInstance() {
  3374. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3375. }
  3376. onConstruct() {
  3377. this.myIcon = (this.getChild("myIcon"));
  3378. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3379. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3380. this.self = (this.getChild("self"));
  3381. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3382. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3383. this.ai = (this.getChild("ai"));
  3384. }
  3385. }
  3386. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3387. class D2Gan {
  3388. constructor() {
  3389. this.offset = 0.15;
  3390. this.cell = 1.5;
  3391. this.onBallCell = 0.4;
  3392. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3393. this.moveNum = 70;
  3394. this.rulerRate = 0.1;
  3395. this.ui = ui_D2Gan.createInstance();
  3396. this.changeSelfRod();
  3397. this.changeAIRod();
  3398. }
  3399. changeSelfRod() {
  3400. let index = DataMgr.getCurBallRod();
  3401. let data = cfgTable.ballrodData[index + 1];
  3402. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3403. this.selfMySpine && this.selfMySpine.dispose();
  3404. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3405. if (data.spine) {
  3406. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3407. this.selfMySpine = new SpineMgr(data.spine, () => {
  3408. let xx = this.ui.selfEftRoot.width / 2;
  3409. let yy = this.ui.selfEftRoot.height / 2;
  3410. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3411. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3412. outSpine.rotation = -90;
  3413. });
  3414. }
  3415. }
  3416. changeAIRod() {
  3417. let length = Object.keys(cfgTable.ballrodData).length;
  3418. let rand = Math.floor(length * Math.random()) + 1;
  3419. let data = cfgTable.ballrodData[rand];
  3420. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3421. this.aiMySpine && this.aiMySpine.dispose();
  3422. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3423. if (data.spine) {
  3424. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3425. this.aiMySpine = new SpineMgr(data.spine, () => {
  3426. let xx = this.ui.aiEftRoot.width / 2;
  3427. let yy = this.ui.aiEftRoot.height / 2;
  3428. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3429. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3430. outSpine.rotation = -90;
  3431. });
  3432. }
  3433. }
  3434. setGanLastInfo() {
  3435. this.lastInfo.rotation = this.ui.rotation;
  3436. this.lastInfo.x = this.ui.x;
  3437. this.lastInfo.y = this.ui.y;
  3438. }
  3439. rotateSelf(flag, isRuler = false) {
  3440. let angle;
  3441. flag = flag * this.offset;
  3442. if (xGame.common.d2World.isHelpLineOnBall) {
  3443. angle = flag * this.onBallCell;
  3444. }
  3445. else {
  3446. angle = flag * this.cell;
  3447. }
  3448. if (isRuler) {
  3449. angle *= this.rulerRate;
  3450. }
  3451. this.ui.rotation += angle;
  3452. xGame.common.d2World.getHelpLine();
  3453. }
  3454. checkDistance() {
  3455. let target = xGame.common.d2World.targetBall;
  3456. let root = xGame.common.d2World.rootBall;
  3457. if (target == null) {
  3458. return 1;
  3459. }
  3460. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3461. if (dis <= 2500) {
  3462. return 5;
  3463. }
  3464. return 1;
  3465. }
  3466. rotDest(rot) {
  3467. this.ui.rotation = rot;
  3468. xGame.common.d2World.getHelpLine();
  3469. }
  3470. storagePower(powerNum) {
  3471. let pos = (powerNum / 100) * this.moveNum;
  3472. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3473. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3474. this.ui.x = this.lastInfo.x + xx;
  3475. this.ui.y = this.lastInfo.y + yy;
  3476. }
  3477. shoot() {
  3478. this.storagePower(0);
  3479. this.ui.visible = false;
  3480. }
  3481. destroySelf() {
  3482. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3483. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3484. this.selfMySpine && this.selfMySpine.dispose();
  3485. this.aiMySpine && this.aiMySpine.dispose();
  3486. this.lastInfo = null;
  3487. if (!this.ui.isDisposed) {
  3488. this.ui.removeFromParent();
  3489. this.ui.dispose();
  3490. }
  3491. }
  3492. }
  3493. class ui_HelpLine extends fgui.GComponent {
  3494. static createInstance() {
  3495. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3496. }
  3497. onConstruct() {
  3498. this.n10 = (this.getChild("n10"));
  3499. this.rect = (this.getChild("rect"));
  3500. this.dir11 = (this.getChild("dir11"));
  3501. this.dir = (this.getChild("dir"));
  3502. this.rootDir = (this.getChild("rootDir"));
  3503. this.dirDot = (this.getChild("dirDot"));
  3504. }
  3505. }
  3506. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3507. class D2HelpLine {
  3508. constructor() {
  3509. this.starX = 0;
  3510. this.starY = 0;
  3511. this.ui = ui_HelpLine.createInstance();
  3512. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3513. this.starX = this.ui.rect.x;
  3514. this.starY = this.ui.rect.y;
  3515. }
  3516. shoot() {
  3517. this.ui.visible = false;
  3518. }
  3519. destroySelf() {
  3520. if (this.ui.isDisposed) {
  3521. this.ui.removeFromParent();
  3522. this.ui.dispose();
  3523. }
  3524. }
  3525. }
  3526. class D2World extends Laya.Script {
  3527. constructor() {
  3528. super();
  3529. this.ballArr = [];
  3530. this.openCheckStill = false;
  3531. this.checkArr = [];
  3532. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3533. this.isHelpLineOnBall = false;
  3534. this.isOnSameLine = false;
  3535. this.reflectAngle = 0;
  3536. this.powerPercent = 0;
  3537. this.inHolesSpeed = [];
  3538. this.outDir = new Laya.Vector2();
  3539. this.rootDir = new Laya.Vector2();
  3540. this.aiLv = 0;
  3541. this.rootPos = new Laya.Vector2();
  3542. this.tempDir1 = new Laya.Vector2();
  3543. this.tempDir2 = new Laya.Vector2();
  3544. this.tempDir3 = new Laya.Vector2();
  3545. this.ballSize = 33;
  3546. this.destRot = 0;
  3547. }
  3548. initSelf() {
  3549. this.createBalls();
  3550. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3551. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3552. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3553. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3554. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3555. }
  3556. setBorderRect() {
  3557. let ui = xGame.common.gameUI.ui;
  3558. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3559. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3560. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3561. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3562. this.borderRect.x = starX;
  3563. this.borderRect.y = starY;
  3564. this.borderRect.width = width;
  3565. this.borderRect.height = height;
  3566. }
  3567. resetGame() {
  3568. this.openCheckStill = false;
  3569. let temp;
  3570. for (let index = 0; index < this.ballArr.length; index++) {
  3571. temp = this.ballArr[index];
  3572. temp.destroySelf();
  3573. }
  3574. xGame.common.d3World.ballRoot.destroyChildren();
  3575. xGame.common.gameUI.ui.ballNode.removeChildren();
  3576. console.log("进入摧毁逻辑");
  3577. this.d2Gan.destroySelf();
  3578. this.d2HelpLine.destroySelf();
  3579. this.ballArr = [];
  3580. }
  3581. setD2Gan() {
  3582. let ballNode = this.rootBall.ui;
  3583. let d2Gan = new D2Gan();
  3584. this.d2Gan = d2Gan;
  3585. let ganNode = d2Gan.ui;
  3586. ballNode.addChild(ganNode);
  3587. ganNode.pivotX = ganNode.pivotX;
  3588. ganNode.pivotY = ganNode.pivotY;
  3589. ganNode.x = ganNode.myIcon.width / 2;
  3590. ganNode.y = this.rootBall.gameObj.width;
  3591. d2Gan.setGanLastInfo();
  3592. }
  3593. setHelpLine() {
  3594. let d2Help = new D2HelpLine();
  3595. this.d2HelpLine = d2Help;
  3596. }
  3597. createBalls() {
  3598. let cfg;
  3599. switch (xGame.common.gameMode) {
  3600. case GameMode.classic:
  3601. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3602. break;
  3603. case GameMode.bigMove:
  3604. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3605. break;
  3606. case GameMode.placeBall:
  3607. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3608. break;
  3609. default:
  3610. break;
  3611. }
  3612. cfg = JSON.parse(JSON.stringify(cfg));
  3613. for (const key in cfg) {
  3614. if (cfg[key].value == 0) {
  3615. this.createRootBall(cfg[key]);
  3616. delete cfg[key];
  3617. break;
  3618. }
  3619. }
  3620. this.createOtherBalls(cfg);
  3621. }
  3622. createRootBall(data) {
  3623. let root = new D2Ball(true);
  3624. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3625. this.rootBall = root.d2Src;
  3626. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3627. let d3BallSrc = d3Ball.getComponent(Ball);
  3628. xGame.common.d3World.rootBall = d3Ball;
  3629. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3630. let xx = data.x;
  3631. let yy = data.y;
  3632. let numer = data.value;
  3633. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3634. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3635. this.ballArr.push(this.rootBall);
  3636. this.setD2Gan();
  3637. this.setHelpLine();
  3638. }
  3639. createOtherBalls(cfg) {
  3640. let temp;
  3641. let src;
  3642. let data;
  3643. for (const key in cfg) {
  3644. data = cfg[key];
  3645. temp = new D2Ball();
  3646. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3647. src = temp.d2Src;
  3648. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3649. src.initSelf(data.value, data.x, data.y, d3Ball);
  3650. this.ballArr.push(src);
  3651. }
  3652. }
  3653. shoot(percent) {
  3654. this.powerPercent = percent;
  3655. this.openCheckStill = true;
  3656. let d2Angle = this.d2Gan.ui.rotation;
  3657. this.rootBall.setSpeed(percent, d2Angle);
  3658. this.clearBallAllEft();
  3659. this.changePlayerView();
  3660. }
  3661. onUpdate() {
  3662. if (!this.openCheckStill)
  3663. return;
  3664. this.checkStill();
  3665. }
  3666. checkStill() {
  3667. for (let index = 0; index < this.ballArr.length; index++) {
  3668. if (!this.ballArr[index].isStill()) {
  3669. return;
  3670. }
  3671. }
  3672. xGame.eventMgr.event(ALL_BALL_STOP);
  3673. }
  3674. allBallStop() {
  3675. this.openCheckStill = false;
  3676. xGame.common.recoverCameraView();
  3677. }
  3678. waitShoot() {
  3679. if (!this.d2Gan.ui.isDisposed) {
  3680. this.d2Gan.ui.visible = true;
  3681. }
  3682. if (!this.d2HelpLine.ui.isDisposed) {
  3683. this.d2HelpLine.ui.visible = true;
  3684. }
  3685. this.clearBallAllEft();
  3686. this.showBallRightEft();
  3687. this.getHelpLine();
  3688. this.inHolesSpeed = [];
  3689. this.selectOneBall();
  3690. }
  3691. _getAllBallArr() {
  3692. let arr = this.ballArr;
  3693. let outArr = [];
  3694. for (let index = 0; index < arr.length; index++) {
  3695. if (arr[index] instanceof D2RootBallSrc)
  3696. continue;
  3697. if (arr[index].ballFunc == "ice")
  3698. continue;
  3699. if (arr[index].destroyed)
  3700. continue;
  3701. outArr.push(arr[index]);
  3702. }
  3703. return outArr;
  3704. }
  3705. _getBlackObj() {
  3706. let arr = this.ballArr;
  3707. for (let index = 0; index < arr.length; index++) {
  3708. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3709. return arr[index];
  3710. }
  3711. }
  3712. }
  3713. selectOneBall() {
  3714. let all = this._getAllBallArr();
  3715. let target;
  3716. switch (xGame.common.gameMode) {
  3717. case GameMode.classic:
  3718. if (xGame.common.gameMgr.selfTurn) {
  3719. let self = xGame.common.gameMgr.selfBallArr;
  3720. let black = this._getBlackObj();
  3721. if (xGame.common.gameMgr.ensureBallType) {
  3722. if (self.length > 0) {
  3723. let out = [];
  3724. for (let j = 0; j < all.length; j++) {
  3725. if (self.indexOf(all[j].number) > -1) {
  3726. out.push(all[j]);
  3727. }
  3728. }
  3729. target = this.selectBestEnterOne(out);
  3730. }
  3731. else {
  3732. target = this.selectBestEnterOne([black]);
  3733. }
  3734. }
  3735. else {
  3736. target = this.selectBestEnterOne(all);
  3737. }
  3738. }
  3739. else {
  3740. target = this.selectBestEnterOne(all);
  3741. }
  3742. break;
  3743. case GameMode.bigMove:
  3744. target = this.selectBestEnterOne(all);
  3745. break;
  3746. case GameMode.placeBall:
  3747. if (all.length > 0) {
  3748. target = this.selectBestEnterOne(all);
  3749. }
  3750. break;
  3751. default:
  3752. break;
  3753. }
  3754. if (target && !target.destroyed && target.onClick) {
  3755. target.onClick(0, true);
  3756. let num = -200 + xGame.common.randomNum(0, 400);
  3757. num /= 150;
  3758. if (xGame.common.longHelpLine) {
  3759. num = 0;
  3760. }
  3761. this.destRot += num;
  3762. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3763. }
  3764. }
  3765. removeOneBall(ball) {
  3766. for (let index = 0; index < this.ballArr.length; index++) {
  3767. if (this.ballArr[index].id == ball.id) {
  3768. this.ballArr.splice(index, 1);
  3769. break;
  3770. }
  3771. }
  3772. }
  3773. getHelpLine() {
  3774. this.d2HelpLine.ui.dirDot.visible = false;
  3775. this.isOnSameLine = false;
  3776. let startX = this.rootBall.gameObj.x;
  3777. let startY = this.rootBall.gameObj.y;
  3778. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3779. if (dis == null) {
  3780. this.d2HelpLine.ui.visible = false;
  3781. console.error("辅助线异常");
  3782. return;
  3783. }
  3784. this.d2HelpLine.ui.visible = true;
  3785. let angle = this.d2Gan.ui.rotation;
  3786. let radius = 16.5;
  3787. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3788. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3789. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3790. if (colliObj == null) {
  3791. this.getColliPos(disX, disY, radius, angle);
  3792. xGame.common.d2World.isHelpLineOnBall = false;
  3793. this.targetBall = null;
  3794. this.reflectAngle = 0;
  3795. this.showBallWrongEft();
  3796. }
  3797. else {
  3798. let target = colliObj.src;
  3799. let radius = 16.5;
  3800. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3801. dis1 = Math.sqrt(dis1);
  3802. let realDis = colliObj.disHon - dis1;
  3803. let dir = colliObj.dir;
  3804. let xx = startX + dir.x * realDis;
  3805. let yy = startY + dir.y * realDis;
  3806. this.getColliPos(xx, yy, radius, angle);
  3807. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3808. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3809. let offset = xGame.common.rodOffest;
  3810. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3811. this.isOnSameLine = true;
  3812. }
  3813. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3814. xGame.common.d2World.isHelpLineOnBall = true;
  3815. this.targetBall = target;
  3816. this.reflectAngle = reflectAngle;
  3817. this.showBallWrongEft();
  3818. if (xGame.common.longHelpLine) {
  3819. this.delayReflectLine(target, reflectAngle);
  3820. }
  3821. }
  3822. }
  3823. getBorderDot(startX, startY, angle) {
  3824. let radius = 17;
  3825. let distance;
  3826. let isDone;
  3827. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3828. isDone = this.judgeUpDown(distance, angle, startX);
  3829. if (isDone != null) {
  3830. return isDone;
  3831. }
  3832. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3833. isDone = this.judgeUpDown(distance, angle, startX);
  3834. if (isDone != null) {
  3835. return isDone;
  3836. }
  3837. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3838. isDone = this.judgeLeftRight(distance, angle, startY);
  3839. if (isDone != null) {
  3840. return isDone;
  3841. }
  3842. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3843. isDone = this.judgeLeftRight(distance, angle, startY);
  3844. if (isDone != null) {
  3845. return isDone;
  3846. }
  3847. }
  3848. judgeUpDown(distance, angle, startX) {
  3849. let flag = Math.sin(angle * Math.PI / 180);
  3850. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3851. if (distance >= 0) {
  3852. if (flag > 0) {
  3853. if (temp < this.borderRect.x + this.borderRect.width) {
  3854. return distance;
  3855. }
  3856. }
  3857. else {
  3858. if (temp > this.borderRect.x) {
  3859. return distance;
  3860. }
  3861. }
  3862. }
  3863. }
  3864. judgeLeftRight(distance, angle, starY) {
  3865. let flag = -Math.cos(angle * Math.PI / 180);
  3866. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3867. if (distance >= 0) {
  3868. if (flag > 0) {
  3869. if (temp < this.borderRect.y + this.borderRect.height) {
  3870. return distance;
  3871. }
  3872. }
  3873. else {
  3874. if (temp > this.borderRect.y) {
  3875. return distance;
  3876. }
  3877. }
  3878. }
  3879. }
  3880. clearBallAllEft() {
  3881. let temp;
  3882. for (let index = 0; index < this.ballArr.length; index++) {
  3883. temp = this.ballArr[index];
  3884. temp.clearBallEft();
  3885. }
  3886. }
  3887. showBallRightEft() {
  3888. let gameMgr = xGame.common.gameMgr;
  3889. let temp;
  3890. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3891. if (targetArr.length <= 0)
  3892. return;
  3893. for (let index = 0; index < this.ballArr.length; index++) {
  3894. temp = this.ballArr[index];
  3895. if (targetArr.indexOf(temp.number) > -1) {
  3896. temp.showRightEft();
  3897. }
  3898. }
  3899. }
  3900. showBallWrongEft() {
  3901. let gameMgr = xGame.common.gameMgr;
  3902. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3903. if (targetArr.length <= 0)
  3904. return;
  3905. let temp;
  3906. for (let index = 0; index < this.ballArr.length; index++) {
  3907. temp = this.ballArr[index];
  3908. if (this.targetBall && this.targetBall.number == temp.number) {
  3909. if (targetArr.indexOf(temp.number) <= -1) {
  3910. temp.showWrongEft();
  3911. }
  3912. else {
  3913. temp.clearBallWrongEft();
  3914. }
  3915. }
  3916. else {
  3917. temp.clearBallWrongEft();
  3918. }
  3919. }
  3920. }
  3921. getColliPos(x, y, radius, angle) {
  3922. this.d2HelpLine.ui.x = x;
  3923. this.d2HelpLine.ui.y = y;
  3924. let dirX = x - this.rootBall.gameObj.x;
  3925. let dirY = y - this.rootBall.gameObj.y;
  3926. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3927. if (rectH <= 0)
  3928. rectH = 0;
  3929. this.d2HelpLine.ui.rect.height = 0;
  3930. this.d2HelpLine.ui.rect.height = rectH;
  3931. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3932. if (rectH < this.rootBall.gameObj.width) {
  3933. this.d2HelpLine.ui.rect.visible = false;
  3934. }
  3935. else {
  3936. this.d2HelpLine.ui.rect.visible = true;
  3937. }
  3938. this.d2HelpLine.ui.dir.visible = false;
  3939. this.d2HelpLine.ui.rootDir.visible = false;
  3940. }
  3941. getReflectLine(x, y, radius, target) {
  3942. this.d2HelpLine.ui.dir.visible = true;
  3943. let dirX = target.x - x;
  3944. let dirY = target.y - y;
  3945. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3946. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3947. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3948. this.d2HelpLine.ui.dir.height = 48;
  3949. this.d2HelpLine.ui.dir.rotation = angle;
  3950. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3951. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3952. return angle;
  3953. }
  3954. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3955. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3956. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3957. let targetX = target.gameObj.x;
  3958. let targetY = target.gameObj.y;
  3959. this.outDir.setValue(targetX - xx, targetY - yy);
  3960. this.rootDir.setValue(rtX - xx, rtY - yy);
  3961. let ver = Math.PI / 2;
  3962. let sin = Math.sin(ver);
  3963. let cos = Math.cos(ver);
  3964. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3965. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3966. this.outDir.setValue(outX, outY);
  3967. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3968. Laya.Vector2.normalize(this.outDir, this.outDir);
  3969. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3970. if (Math.abs(result) <= 0.08) {
  3971. this.d2HelpLine.ui.rootDir.visible = false;
  3972. return;
  3973. }
  3974. if (result > 0) {
  3975. angle += 90;
  3976. }
  3977. else if (result < 0) {
  3978. angle -= 90;
  3979. }
  3980. this.d2HelpLine.ui.rootDir.visible = true;
  3981. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3982. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3983. this.d2HelpLine.ui.rootDir.rotation = angle;
  3984. }
  3985. delayReflectLine(obj, angle) {
  3986. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3987. return;
  3988. }
  3989. this.isOnSameLine = false;
  3990. let startX = obj.gameObj.x;
  3991. let startY = obj.gameObj.y;
  3992. let dis = this.getBorderDot(startX, startY, angle);
  3993. if (dis == null) {
  3994. this.d2HelpLine.ui.dirDot.visible = false;
  3995. return;
  3996. }
  3997. this.d2HelpLine.ui.visible = true;
  3998. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3999. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4000. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  4001. if (colliObj == null) {
  4002. this.setDelayLine(disX, disY, obj, angle);
  4003. }
  4004. else {
  4005. let radius = 16;
  4006. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  4007. dis1 = Math.sqrt(dis1);
  4008. let realDis = colliObj.disHon - dis1;
  4009. let dir = colliObj.dir;
  4010. let xx = startX + dir.x * realDis;
  4011. let yy = startY + dir.y * realDis;
  4012. this.setDelayLine(xx, yy, obj, angle);
  4013. }
  4014. }
  4015. setDelayLine(x, y, obj, angle) {
  4016. let dirX = x - obj.gameObj.x;
  4017. let dirY = y - obj.gameObj.y;
  4018. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  4019. if (rectH <= 0)
  4020. rectH = 0;
  4021. this.d2HelpLine.ui.dir.height = rectH;
  4022. this.d2HelpLine.ui.dirDot.visible = true;
  4023. this.d2HelpLine.ui.dirDot.x = 17;
  4024. this.d2HelpLine.ui.dirDot.y = 17;
  4025. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  4026. ;
  4027. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  4028. }
  4029. changePlayerView() {
  4030. if (Math.random() >= 0.7)
  4031. return;
  4032. if (!this.targetBall) {
  4033. return;
  4034. }
  4035. if (!xGame.common.gameMgr.selfTurn)
  4036. return;
  4037. switch (xGame.common.gameMode) {
  4038. case GameMode.classic:
  4039. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  4040. if (this.targetBall.number != 8) {
  4041. return;
  4042. }
  4043. }
  4044. break;
  4045. case GameMode.bigMove:
  4046. return;
  4047. case GameMode.placeBall:
  4048. break;
  4049. default:
  4050. break;
  4051. }
  4052. let startX = this.targetBall.gameObj.x;
  4053. let startY = this.targetBall.gameObj.y;
  4054. let angle = this.reflectAngle;
  4055. let dis = this.getBorderDot(startX, startY, angle);
  4056. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4057. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4058. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  4059. if (colliObj) {
  4060. return;
  4061. }
  4062. let offset = 40;
  4063. let posObj = xGame.common.gameMgr.posObj;
  4064. let temp;
  4065. let radius;
  4066. let tarX, tarY;
  4067. for (const key in posObj) {
  4068. temp = posObj[key];
  4069. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4070. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4071. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4072. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4073. xGame.common.showOneCamera("angle" + key);
  4074. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4075. Laya.physicsTimer.scale = 0.7;
  4076. break;
  4077. }
  4078. }
  4079. }
  4080. selectBestEnterOne(arr) {
  4081. this.aiLv = xGame.tools.random(1, 11);
  4082. this.aiLv = 10;
  4083. this.wBall = xGame.common.d2World.rootBall;
  4084. this.rootPos.x = this.wBall.gameObj.x;
  4085. this.rootPos.y = this.wBall.gameObj.y;
  4086. this.initHoleBall(arr);
  4087. return this.selectBall();
  4088. }
  4089. selectBall() {
  4090. let ball = null;
  4091. this.destRot = 0;
  4092. let ai = 110 - this.aiLv * 10;
  4093. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4094. let score = false;
  4095. if (this.scoreBall.length < 1) {
  4096. if (this.lineBall.length < 1) {
  4097. for (let i = 0; i < this.kickBall.length; i++) {
  4098. let list = [];
  4099. let bo = this.kickBall[i];
  4100. let bobj = bo.gameObj;
  4101. let rect = xGame.common.d2World.borderRect;
  4102. let mobj = this.wBall.gameObj;
  4103. let minb = bobj.y - rect.y - 20;
  4104. let minw = mobj.y - rect.y - 50;
  4105. if (minb > 0 && minw > 0) {
  4106. let dlenx = 0;
  4107. let dleny = mobj.y - rect.y;
  4108. let spx = mobj.x;
  4109. let spy = rect.y - dleny;
  4110. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4111. }
  4112. minb = rect.y + rect.height - bobj.y - 20;
  4113. minw = rect.y + rect.height - mobj.y - 50;
  4114. if (minb > 0 && minw > 0) {
  4115. let dlenx = 0;
  4116. let dleny = rect.y + rect.height - mobj.y;
  4117. let spx = mobj.x;
  4118. let spy = rect.y + rect.height + dleny;
  4119. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4120. }
  4121. minb = bobj.x - rect.x - 20;
  4122. minw = mobj.x - rect.x - 50;
  4123. if (minb > 0 && minw > 0) {
  4124. let dlenx = mobj.x - rect.x;
  4125. let dleny = 0;
  4126. let spx = rect.x - dlenx;
  4127. let spy = mobj.y;
  4128. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4129. }
  4130. minb = rect.x + rect.width - bobj.x - 20;
  4131. minw = rect.x + rect.width - mobj.x - 50;
  4132. if (minb > 0 && minw > 0) {
  4133. let dlenx = rect.x + rect.width - mobj.x;
  4134. let dleny = 0;
  4135. let spx = rect.x + rect.width + dlenx;
  4136. let spy = mobj.y;
  4137. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4138. }
  4139. list.sort(function (a, b) {
  4140. return a.order - b.order;
  4141. });
  4142. for (let i = 0; i < list.length; i++) {
  4143. let data = list[i];
  4144. let mx = mobj.x - bobj.x;
  4145. let my = mobj.y - bobj.y;
  4146. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4147. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4148. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4149. if (num > 1)
  4150. num = 1;
  4151. let cos = Math.acos(num);
  4152. if (cos > 1.57)
  4153. cos = 1.57;
  4154. else if (cos < 0.01)
  4155. cos = 0.01;
  4156. let tan = Math.tan(cos);
  4157. let dx = tan * data.dleny;
  4158. let dy = tan * data.dlenx;
  4159. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4160. if (Math.abs(bx - 667) < 40)
  4161. continue;
  4162. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4163. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4164. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4165. this.forceMax = dis * 0.08;
  4166. this.destRot += mis * 0.1;
  4167. this.setKick(bx, by);
  4168. return true;
  4169. }
  4170. }
  4171. }
  4172. }
  4173. else {
  4174. ball = xGame.common.getRandArrEle(this.lineBall);
  4175. }
  4176. }
  4177. else {
  4178. for (let i = 0; i < this.scoreBall.length; i++) {
  4179. if (i < this.scoreBall.length - 1) {
  4180. let rand = 70 + this.aiLv * 10 + i * 10;
  4181. if (xGame.tools.random(0, 100) < rand) {
  4182. ball = this.scoreBall[i];
  4183. break;
  4184. }
  4185. }
  4186. else {
  4187. ball = this.scoreBall[i];
  4188. break;
  4189. }
  4190. }
  4191. score = true;
  4192. this.selectNum++;
  4193. }
  4194. if (!ball)
  4195. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4196. let dx = ball.gameObj.x;
  4197. let dy = ball.gameObj.y;
  4198. let kickAngle = 0;
  4199. if (score) {
  4200. dx = ball.kickPos.x;
  4201. dy = ball.kickPos.y;
  4202. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4203. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4204. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4205. if (adot > 1)
  4206. adot = 1;
  4207. kickAngle = Math.acos(adot) * 57.3;
  4208. if (kickAngle > 45) {
  4209. let kdx = ball.kickPos.x - ball.gameObj.x;
  4210. let kdy = ball.kickPos.y - ball.gameObj.y;
  4211. dx = ball.kickPos.x - kdx * mis * 0.3;
  4212. dy = ball.kickPos.y - kdy * mis * 0.3;
  4213. }
  4214. else
  4215. this.destRot += mis;
  4216. }
  4217. else if (ball.poleAngle != 0) {
  4218. this.destRot += ball.poleAngle;
  4219. }
  4220. if (xGame.common.gameMode == 0) {
  4221. let af = kickAngle * 0.08;
  4222. this.forceMax = ball.hard * 0.1 + af * af;
  4223. }
  4224. this.setKick(dx, dy);
  4225. return ball;
  4226. }
  4227. initHoleBall(arr) {
  4228. this.kickBall = [];
  4229. this.lineBall = [];
  4230. this.scoreBall = [];
  4231. this.holeBall = [];
  4232. this.selectNum = 0;
  4233. this.forceNum = 0;
  4234. this.forceMax = 0;
  4235. this.turnNum = 0;
  4236. let list = arr;
  4237. let holes = xGame.common.gameMgr.holePosList;
  4238. let self = xGame.common.aiPlayer;
  4239. for (let i = 0; i < list.length; i++) {
  4240. let obj = list[i];
  4241. if (!obj)
  4242. continue;
  4243. obj.kickPos.x = 0;
  4244. obj.kickPos.y = 0;
  4245. obj.poleAngle = 0;
  4246. obj.hard = 0;
  4247. obj.borderDis = 0;
  4248. obj.kickAngle = 180;
  4249. let b = obj.gameObj;
  4250. let wbp = this.rootPos;
  4251. let bx = wbp.x - b.x;
  4252. let by = wbp.y - b.y;
  4253. obj.borderDis = xGame.tools.random(0, 100);
  4254. this.kickBall.push(obj);
  4255. if (!this.isLine(wbp, obj))
  4256. continue;
  4257. obj.kickAngle = xGame.tools.random(90, 180);
  4258. obj.kickPos.x = b.x;
  4259. obj.kickPos.y = b.y;
  4260. this.lineBall.push(obj);
  4261. let minDis = 999999;
  4262. let hole = false;
  4263. for (let j = 0; j < holes.length; j++) {
  4264. let hp = holes[j];
  4265. if (bx >= 0 && hp.x > b.x + 100)
  4266. continue;
  4267. if (bx <= 0 && hp.x < b.x - 100)
  4268. continue;
  4269. if (by < -10 && hp.y < wbp.y)
  4270. continue;
  4271. if (by > 10 && hp.y > wbp.y)
  4272. continue;
  4273. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4274. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4275. if (dis < minDis) {
  4276. let dx = b.x - this.tempDir1.x * this.ballSize;
  4277. let dy = b.y - this.tempDir1.y * this.ballSize;
  4278. this.tempDir3.x = this.tempDir1.x;
  4279. this.tempDir3.y = this.tempDir1.y;
  4280. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4281. obj.kickPos.x = dx;
  4282. obj.kickPos.y = dy;
  4283. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4284. if (num > 1)
  4285. num = 1;
  4286. obj.kickAngle = Math.acos(num) * 57.3;
  4287. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4288. dis = dis * 2;
  4289. if (Math.abs(hp.x - 600) < 100)
  4290. dis += 50;
  4291. obj.hard = dis + obj.kickAngle * 3;
  4292. hole = true;
  4293. }
  4294. }
  4295. }
  4296. }
  4297. if (hole) {
  4298. this.scoreBall.push(obj);
  4299. this.holeBall.push(obj);
  4300. }
  4301. }
  4302. this.scoreBall.sort(function (a, b) {
  4303. return a.hard - b.hard;
  4304. });
  4305. this.holeBall.sort(function (a, b) {
  4306. return a.kickAngle - b.kickAngle;
  4307. });
  4308. this.kickBall.sort(function (a, b) {
  4309. return a.borderDis - b.borderDis;
  4310. });
  4311. }
  4312. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4313. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4314. let balls = xGame.common.d2World.ballArr;
  4315. let max = xGame.tools.getDis(hx, hy, bx, by);
  4316. for (let index = 0; index < balls.length; index++) {
  4317. let obj = balls[index];
  4318. if (obj.number == 0)
  4319. continue;
  4320. if (obj.number == bn || obj.number == dn)
  4321. continue;
  4322. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4323. if (dis * dis > max)
  4324. continue;
  4325. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4326. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4327. if (num > 1)
  4328. num = 1;
  4329. if (num < 0)
  4330. continue;
  4331. let gap = Math.sin(Math.acos(num)) * dis;
  4332. if (gap < this.ballSize)
  4333. return true;
  4334. }
  4335. return false;
  4336. }
  4337. isLine(xy, ball) {
  4338. let bx = xy.x;
  4339. let by = xy.y;
  4340. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4341. let dis = ball.getDestDis(xy);
  4342. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4343. let sin = Math.sin(angle);
  4344. let cos = Math.cos(angle);
  4345. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4346. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4347. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4348. let dx = bx + this.tempDir2.x * dis;
  4349. let dy = by + this.tempDir2.y * dis;
  4350. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4351. sin = Math.sin(-angle);
  4352. cos = Math.cos(-angle);
  4353. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4354. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4355. dx = bx + this.tempDir2.x * dis;
  4356. dy = by + this.tempDir2.y * dis;
  4357. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4358. if (isr && isl)
  4359. return false;
  4360. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4361. }
  4362. return true;
  4363. }
  4364. setKick(dx, dy) {
  4365. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4366. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4367. this.tempDir1.x = 0;
  4368. this.tempDir1.y = 1;
  4369. this.tempDir2.y = -this.tempDir2.y;
  4370. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4371. if (num > 1)
  4372. num = 1;
  4373. let rot = Math.acos(num) * 57.3;
  4374. if (this.tempDir2.x < 0)
  4375. rot = 360 - rot;
  4376. this.destRot += rot;
  4377. }
  4378. }
  4379. class ui_UIGame extends fgui.GComponent {
  4380. static createInstance() {
  4381. return (fgui.UIPackage.createObject("game", "UIGame"));
  4382. }
  4383. onConstruct() {
  4384. this.c1 = this.getController("c1");
  4385. this.d3Root = (this.getChild("d3Root"));
  4386. this.clickNode = (this.getChild("clickNode"));
  4387. this.d2Root = (this.getChild("d2Root"));
  4388. this.topNode = (this.getChild("topNode"));
  4389. this.n72 = (this.getChild("n72"));
  4390. this.n40 = (this.getChild("n40"));
  4391. this.rulerNode = (this.getChild("rulerNode"));
  4392. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4393. this.n50 = (this.getChild("n50"));
  4394. this.keduNode = (this.getChild("keduNode"));
  4395. this.powerTxt = (this.getChild("powerTxt"));
  4396. this.powerNode = (this.getChild("powerNode"));
  4397. this.colorNode = (this.getChild("colorNode"));
  4398. this.powerEft = (this.getChild("powerEft"));
  4399. this.myPowerNode = (this.getChild("myPowerNode"));
  4400. this.ganNode = (this.getChild("ganNode"));
  4401. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4402. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4403. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4404. this.skillRod = (this.getChild("skillRod"));
  4405. this.border = (this.getChild("border"));
  4406. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4407. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4408. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4409. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4410. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4411. this.guanyuNode = (this.getChild("guanyuNode"));
  4412. this.helpBtn = (this.getChild("helpBtn"));
  4413. this.wordsBtn = (this.getChild("wordsBtn"));
  4414. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4415. this.returnBtn = (this.getChild("returnBtn"));
  4416. this.ballNode = (this.getChild("ballNode"));
  4417. this.whiteAni = (this.getChild("whiteAni"));
  4418. this.blackAni = (this.getChild("blackAni"));
  4419. this.selfTurn = (this.getChild("selfTurn"));
  4420. this.aiTurn = (this.getChild("aiTurn"));
  4421. this.deskNode = (this.getChild("deskNode"));
  4422. this.moveNode = (this.getChild("moveNode"));
  4423. this.selfTalk = (this.getChild("selfTalk"));
  4424. this.aiTalk = (this.getChild("aiTalk"));
  4425. this.d2Node = (this.getChild("d2Node"));
  4426. this.snowNode = (this.getChild("snowNode"));
  4427. this.guide2 = (this.getChild("guide2"));
  4428. this.guide1 = (this.getChild("guide1"));
  4429. this.guide3 = (this.getChild("guide3"));
  4430. this.guideNode = (this.getChild("guideNode"));
  4431. }
  4432. }
  4433. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4434. class ui_UIGameEnd extends fgui.GComponent {
  4435. static createInstance() {
  4436. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4437. }
  4438. onConstruct() {
  4439. this.c1 = this.getController("c1");
  4440. this.n22 = (this.getChild("n22"));
  4441. this.n2 = (this.getChild("n2"));
  4442. this.n52 = (this.getChild("n52"));
  4443. this.n53 = (this.getChild("n53"));
  4444. this.coinNode = (this.getChild("coinNode"));
  4445. this.closeNode = (this.getChild("closeNode"));
  4446. this.moneyNode = (this.getChild("moneyNode"));
  4447. this.secretary = (this.getChild("secretary"));
  4448. this.n27 = (this.getChild("n27"));
  4449. this.n29 = (this.getChild("n29"));
  4450. this.talkNode = (this.getChild("talkNode"));
  4451. this.n38 = (this.getChild("n38"));
  4452. this.n39 = (this.getChild("n39"));
  4453. this.n40 = (this.getChild("n40"));
  4454. this.awardNode = (this.getChild("awardNode"));
  4455. this.starNumNode = (this.getChild("starNumNode"));
  4456. this.n47 = (this.getChild("n47"));
  4457. this.conditionNode = (this.getChild("conditionNode"));
  4458. this.isGetAward = (this.getChild("isGetAward"));
  4459. this.leftBtn = (this.getChild("leftBtn"));
  4460. this.rightBtn = (this.getChild("rightBtn"));
  4461. this.btnNode = (this.getChild("btnNode"));
  4462. }
  4463. }
  4464. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4465. class ui_UIAddCoin extends fgui.GComponent {
  4466. static createInstance() {
  4467. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4468. }
  4469. onConstruct() {
  4470. this.n11 = (this.getChild("n11"));
  4471. this.myNode = (this.getChild("myNode"));
  4472. this.t0 = this.getTransition("t0");
  4473. }
  4474. }
  4475. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4476. class UIAddCoin extends UIBase {
  4477. constructor() {
  4478. super();
  4479. this.coinNum = 2000;
  4480. }
  4481. onConstructor() {
  4482. this.ui = ui_UIAddCoin.createInstance();
  4483. this.contentPane = this.ui;
  4484. this.isEject = false;
  4485. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4486. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4487. }
  4488. show() {
  4489. super.show();
  4490. this.ui.t0.play();
  4491. this.setGlobalFont(this.ui);
  4492. }
  4493. videoAddCoin() {
  4494. console.log('zh:qjff_AD_for_UIAddCoin');
  4495. if (Laya.Browser.onAndroid) {
  4496. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4497. if (!boo) {
  4498. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4499. return;
  4500. }
  4501. }
  4502. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4503. }
  4504. else {
  4505. console.log('zh:AD 失败,直接发放奖励');
  4506. this.qjff_AD_for_UIAddCoin();
  4507. }
  4508. }
  4509. qjff_AD_for_UIAddCoin() {
  4510. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4511. this.hide();
  4512. }
  4513. }
  4514. UIAddCoin.uiName = "UIAddCoin";
  4515. class ui_UIInvitation extends fgui.GComponent {
  4516. static createInstance() {
  4517. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4518. }
  4519. onConstruct() {
  4520. this.n14 = (this.getChild("n14"));
  4521. this.myNode = (this.getChild("myNode"));
  4522. this.t0 = this.getTransition("t0");
  4523. }
  4524. }
  4525. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4526. class UIInvitation extends UIBase {
  4527. constructor() {
  4528. super();
  4529. }
  4530. onConstructor() {
  4531. this.ui = ui_UIInvitation.createInstance();
  4532. this.contentPane = this.ui;
  4533. this.isEject = false;
  4534. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4535. }
  4536. show() {
  4537. super.show();
  4538. this.setGlobalFont(this.ui);
  4539. }
  4540. enterGame() {
  4541. xGame.common.gameMode = GameMode.classic;
  4542. DataMgr.setChallengeTimes(1);
  4543. xGame.common.passAwardCoin = 2000;
  4544. let need = xGame.common.classicNiceNeddCoin;
  4545. if (DataMgr.coinEnough(need)) {
  4546. DataMgr.setCoin(-need);
  4547. xGame.eventMgr.event(RESTART_GAME, true);
  4548. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4549. }
  4550. else {
  4551. xGame.eventMgr.event(RESTART_GAME, true);
  4552. }
  4553. this.hide();
  4554. }
  4555. hide() {
  4556. super.hide();
  4557. }
  4558. }
  4559. UIInvitation.uiName = "UIInvitation";
  4560. class ui_UIMain extends fgui.GComponent {
  4561. static createInstance() {
  4562. return (fgui.UIPackage.createObject("game", "UIMain"));
  4563. }
  4564. onConstruct() {
  4565. this.n47 = (this.getChild("n47"));
  4566. this.n10 = (this.getChild("n10"));
  4567. this.secretary = (this.getChild("secretary"));
  4568. this.moneyNode = (this.getChild("moneyNode"));
  4569. this.headNode = (this.getChild("headNode"));
  4570. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4571. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4572. this.classicBtn = (this.getChild("classicBtn"));
  4573. this.globalBtn = (this.getChild("globalBtn"));
  4574. this.n44 = (this.getChild("n44"));
  4575. this.n_dengLu = (this.getChild("n_dengLu"));
  4576. this.settingNode = (this.getChild("settingNode"));
  4577. this.drawBtn = (this.getChild("drawBtn"));
  4578. this.signBtn = (this.getChild("signBtn"));
  4579. this.shopBtn = (this.getChild("shopBtn"));
  4580. this.n45 = (this.getChild("n45"));
  4581. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4582. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4583. this.rankBtn = (this.getChild("rankBtn"));
  4584. this.n46 = (this.getChild("n46"));
  4585. this.liucheng1 = (this.getChild("liucheng1"));
  4586. this.rightBtn = (this.getChild("rightBtn"));
  4587. this.n75 = (this.getChild("n75"));
  4588. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4589. this.liucheng2 = (this.getChild("liucheng2"));
  4590. this.guideBtn = (this.getChild("guideBtn"));
  4591. this.n73 = (this.getChild("n73"));
  4592. this.wordsNode = (this.getChild("wordsNode"));
  4593. this.enterGuide = (this.getChild("enterGuide"));
  4594. this.talkNode = (this.getChild("talkNode"));
  4595. this.n83 = (this.getChild("n83"));
  4596. this.n84 = (this.getChild("n84"));
  4597. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4598. }
  4599. }
  4600. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4601. class ui_UIMoyu extends fgui.GComponent {
  4602. static createInstance() {
  4603. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4604. }
  4605. onConstruct() {
  4606. this.ageTip = (this.getChild("ageTip"));
  4607. this.mainBg = (this.getChild("mainBg"));
  4608. this.xyNode = (this.getChild("xyNode"));
  4609. this.rnNode = (this.getChild("rnNode"));
  4610. this.fcmNode = (this.getChild("fcmNode"));
  4611. this.ageNode = (this.getChild("ageNode"));
  4612. this.tipNode = (this.getChild("tipNode"));
  4613. this.msgNode = (this.getChild("msgNode"));
  4614. }
  4615. }
  4616. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4617. class MoyuMgr {
  4618. static initMoyu() {
  4619. this.moyuView = new MoyuView();
  4620. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4621. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4622. this.moyuView.ui.displayObject.zOrder = 1000;
  4623. this.moyuView.init();
  4624. this.moyuView.showTip(true);
  4625. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4626. window['XApk'] = this;
  4627. }
  4628. static showAge(show) {
  4629. if (this.moyuView)
  4630. this.moyuView.showAge(show);
  4631. }
  4632. static onPlatMsg(idx) {
  4633. if (!MoyuMgr.moyuView)
  4634. return;
  4635. if (idx == '0') {
  4636. MoyuMgr.moyuView.showTip(false);
  4637. }
  4638. }
  4639. static showAgree(call) {
  4640. if (this.moyuView)
  4641. this.moyuView.showAgree(call);
  4642. else
  4643. call && call();
  4644. }
  4645. static showXy(type = 1) {
  4646. if (this.moyuView)
  4647. this.moyuView.showXy(type);
  4648. }
  4649. }
  4650. MoyuMgr.isAdvise = false;
  4651. class MoyuView {
  4652. constructor() {
  4653. this.ysxyNum = 1;
  4654. this.ysJson = null;
  4655. this.ui = ui_UIMoyu.createInstance();
  4656. }
  4657. init() {
  4658. this.ui.mainBg.visible = false;
  4659. this.ui.xyNode.visible = false;
  4660. this.ui.ageNode.visible = false;
  4661. this.ui.tipNode.visible = false;
  4662. this.ui.rnNode.visible = false;
  4663. this.ui.fcmNode.visible = false;
  4664. this.ui.ageTip.visible = false;
  4665. this.ui.msgNode.visible = false;
  4666. this.ui.visible = false;
  4667. this.ui.xyNode.xyList.setVirtual();
  4668. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4669. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4670. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4671. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4672. this.ui.xyNode.btnKnown.visible = false;
  4673. this.ui.xyNode.xy1.visible = false;
  4674. this.ui.xyNode.xy2.visible = false;
  4675. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4676. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4677. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4678. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4679. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4680. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4681. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4682. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4683. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4684. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4685. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4686. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4687. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4688. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4689. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4690. this.ysxyNum = 2;
  4691. }
  4692. }
  4693. onClick(obj) {
  4694. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4695. switch (obj) {
  4696. case this.ui.ageTip:
  4697. if (Moyu.isTTApk) {
  4698. this.ui.ageNode.visible = true;
  4699. this.ui.mainBg.visible = true;
  4700. }
  4701. break;
  4702. case this.ui.tipNode:
  4703. this.showTip(false);
  4704. break;
  4705. case this.ui.ageNode.btnAge:
  4706. this.ui.ageNode.visible = false;
  4707. this.ui.mainBg.visible = false;
  4708. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4709. this.ui.visible = false;
  4710. break;
  4711. case this.ui.xyNode.btnXy3:
  4712. case this.ui.xyNode.btnXy1:
  4713. this.loadXy(1);
  4714. break;
  4715. case this.ui.xyNode.btnXy2:
  4716. this.loadXy(2);
  4717. break;
  4718. case this.ui.xyNode.btnBack:
  4719. this.ui.xyNode.xy1.visible = true;
  4720. this.ui.xyNode.xy2.visible = false;
  4721. break;
  4722. case this.ui.xyNode.btnKnown:
  4723. this.ui.xyNode.visible = false;
  4724. this.ui.mainBg.visible = false;
  4725. this.ui.visible = false;
  4726. break;
  4727. case this.ui.rnNode.btnCheck:
  4728. this.check();
  4729. break;
  4730. case this.ui.rnNode.btnExit:
  4731. case this.ui.xyNode.btnNo:
  4732. this.ysxyNum--;
  4733. if (this.ysxyNum > 0)
  4734. this.showMsg("Refuse to quit the game once again");
  4735. else {
  4736. Moyu.userAgree(false);
  4737. Moyu.exit();
  4738. }
  4739. break;
  4740. case this.ui.xyNode.btnSure:
  4741. case this.ui.xyNode.btnYes:
  4742. DataMgr.userData.isAgree = true;
  4743. DataMgr.saveUserData();
  4744. this.onAgree();
  4745. break;
  4746. case this.ui.rnNode.btnDone:
  4747. this.ui.rnNode.visible = false;
  4748. this.ui.visible = false;
  4749. break;
  4750. case this.ui.fcmNode.btnRn:
  4751. this.showRn();
  4752. break;
  4753. }
  4754. }
  4755. showTip(show) {
  4756. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4757. return;
  4758. if (show) {
  4759. MoyuMgr.isAdvise = true;
  4760. this.ui.visible = true;
  4761. this.ui.tipNode.visible = true;
  4762. this.ui.tipNode.alpha = 1;
  4763. Laya.timer.once(1000, this, this.showTip, [false]);
  4764. }
  4765. else {
  4766. this.ui.tipNode.alpha = 1;
  4767. this.ui.tipNode.visible = true;
  4768. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4769. this.ui.tipNode.visible = false;
  4770. MoyuMgr.isAdvise = false;
  4771. }), 1000);
  4772. }
  4773. }
  4774. showAge(show, px = 0, py = 0) {
  4775. if (Moyu.platType > 10 && !Moyu.isIos) {
  4776. this.ui.ageTip.x = px;
  4777. this.ui.ageTip.y = py;
  4778. this.ui.ageTip.visible = show;
  4779. if (show)
  4780. this.ui.visible = true;
  4781. }
  4782. }
  4783. showAgree(call) {
  4784. this.agreeCall = call;
  4785. this.onAgree();
  4786. return;
  4787. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4788. this.showXy(0);
  4789. }
  4790. else
  4791. this.onAgree();
  4792. }
  4793. onAgree() {
  4794. if (!this.ui.ageNode.visible)
  4795. this.ui.visible = false;
  4796. this.ui.xyNode.visible = false;
  4797. Moyu.userAgree(true);
  4798. this.showAge(false);
  4799. this.agreeCall && this.agreeCall();
  4800. this.showRn();
  4801. }
  4802. showMsg(txt) {
  4803. this.ui.msgNode.txtMsg.text = txt;
  4804. this.ui.msgNode.visible = true;
  4805. this.ui.msgNode.alpha = 1;
  4806. this.ui.visible = true;
  4807. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4808. this.ui.msgNode.visible = false;
  4809. }), 2500, true);
  4810. }
  4811. showRn() {
  4812. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4813. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4814. this.ui.rnNode.rn1.visible = true;
  4815. this.ui.rnNode.rn2.visible = false;
  4816. this.ui.rnNode.rn3.visible = false;
  4817. this.ui.rnNode.rn4.visible = false;
  4818. this.ui.rnNode.visible = true;
  4819. this.ui.mainBg.visible = true;
  4820. this.ui.rnNode.btnDone.visible = false;
  4821. this.ui.rnNode.btnExit.visible = true;
  4822. this.ui.rnNode.btnCheck.visible = true;
  4823. this.ui.fcmNode.visible = false;
  4824. this.ui.visible = true;
  4825. return;
  4826. }
  4827. }
  4828. this.showFcm();
  4829. }
  4830. showFcm() {
  4831. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4832. Moyu.initFCM(true);
  4833. if (Moyu.gameTime < 1)
  4834. this.fcmLoop();
  4835. else if (Moyu.gameTime < 999)
  4836. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4837. }
  4838. }
  4839. fcmLoop() {
  4840. if (Moyu.gameTime < 1) {
  4841. this.ui.rnNode.visible = false;
  4842. this.ui.fcmNode.visible = true;
  4843. this.ui.mainBg.visible = true;
  4844. this.ui.visible = true;
  4845. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4846. Laya.timer.clear(this.ui, this.fcmLoop);
  4847. }
  4848. }
  4849. check() {
  4850. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4851. this.ui.rnNode.rn1.visible = false;
  4852. this.ui.rnNode.rn2.visible = false;
  4853. this.ui.rnNode.rn4.visible = true;
  4854. }
  4855. else if (this.ui.rnNode.rn4.visible) {
  4856. let name = this.ui.rnNode.inputName.text;
  4857. let code = this.ui.rnNode.inputCode.text;
  4858. if (code && code.length == 18) {
  4859. this.ui.rnNode.rn1.visible = false;
  4860. this.ui.rnNode.rn4.visible = false;
  4861. Moyu.authenticate(name, code, (res) => {
  4862. this.ui.rnNode.rn2.visible = !res;
  4863. this.ui.rnNode.rn3.visible = res;
  4864. this.ui.rnNode.btnDone.visible = res;
  4865. this.ui.rnNode.btnExit.visible = !res;
  4866. this.ui.rnNode.btnCheck.visible = !res;
  4867. if (res)
  4868. this.showFcm();
  4869. });
  4870. }
  4871. else
  4872. this.showMsg("信息填写不完整");
  4873. }
  4874. }
  4875. loadXy(type = 0) {
  4876. this.ui.xyNode.xy1.visible = false;
  4877. this.ui.xyNode.xy2.visible = true;
  4878. this.ui.xyNode.xyList.scrollToView(0);
  4879. if (type == 1) {
  4880. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4881. }
  4882. else if (type == 2) {
  4883. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4884. }
  4885. }
  4886. showXy(type = 0) {
  4887. this.xyBtn();
  4888. if (type == 0) {
  4889. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4890. this.ui.xyNode.btnSure.visible = true;
  4891. }
  4892. else {
  4893. this.ui.xyNode.btnYes.visible = true;
  4894. this.ui.xyNode.btnNo.visible = true;
  4895. }
  4896. }
  4897. else {
  4898. this.ui.xyNode.btnKnown.visible = true;
  4899. this.ui.mainBg.visible = true;
  4900. }
  4901. this.ui.xyNode.xy1.visible = true;
  4902. this.ui.xyNode.xy2.visible = false;
  4903. this.ui.xyNode.visible = true;
  4904. this.ui.visible = true;
  4905. }
  4906. xyBtn() {
  4907. this.ui.xyNode.btnSure.visible = false;
  4908. this.ui.xyNode.btnYes.visible = false;
  4909. this.ui.xyNode.btnNo.visible = false;
  4910. this.ui.xyNode.btnKnown.visible = false;
  4911. {
  4912. this.ui.xyNode.btnXy3.visible = false;
  4913. this.ui.xyNode.btnXy2.visible = true;
  4914. this.ui.xyNode.btnXy1.visible = true;
  4915. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4916. }
  4917. }
  4918. createXY(json) {
  4919. this.ysJson = json.content;
  4920. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4921. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4922. this.ui.xyNode.xy2.visible = true;
  4923. }
  4924. renderListItem(idx, cell) {
  4925. let xy = this.ysJson[idx];
  4926. cell.height = xy.line * 30;
  4927. cell.xyItem.text = xy.text;
  4928. }
  4929. onDestroy() {
  4930. this.agreeCall = null;
  4931. }
  4932. }
  4933. class SettingNode {
  4934. constructor(ui) {
  4935. this.showSetting = false;
  4936. this.openSound = true;
  4937. this.openShake = true;
  4938. this.ui = ui;
  4939. this.ui.soundBtn.onClick(this, this.switchSound);
  4940. this.ui.shakeBtn.onClick(this, this.switchShake);
  4941. this.ui.xyBtn.onClick(this, this.onXy);
  4942. this.ui.clickNode.onClick(this, this.changeSetting);
  4943. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4944. this.ui.xyBtn.visible = false;
  4945. this.ui.shakeBtn.visible = false;
  4946. }
  4947. changeSetting() {
  4948. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4949. this.showSetting = !this.showSetting;
  4950. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4951. }
  4952. switchSound() {
  4953. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4954. this.openSound = !this.openSound;
  4955. Moyu.onSetting(this.openSound, this.openShake);
  4956. xGame.soundMgr.onSetting(this.openSound);
  4957. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4958. }
  4959. switchShake() {
  4960. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4961. this.openShake = !this.openShake;
  4962. Moyu.onSetting(this.openSound, this.openShake);
  4963. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4964. }
  4965. onXy() {
  4966. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4967. MoyuMgr.showXy(1);
  4968. }
  4969. }
  4970. class ui_UILevelDisplay extends fgui.GComponent {
  4971. static createInstance() {
  4972. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4973. }
  4974. onConstruct() {
  4975. this.n9 = (this.getChild("n9"));
  4976. this.myNode = (this.getChild("myNode"));
  4977. this.closeNode = (this.getChild("closeNode"));
  4978. }
  4979. }
  4980. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4981. class ui_UILevelProp extends fgui.GComponent {
  4982. static createInstance() {
  4983. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4984. }
  4985. onConstruct() {
  4986. this.n16 = (this.getChild("n16"));
  4987. this.myNode = (this.getChild("myNode"));
  4988. this.closeBtn = (this.getChild("closeBtn"));
  4989. this.moneyNode = (this.getChild("moneyNode"));
  4990. this.t1 = this.getTransition("t1");
  4991. }
  4992. }
  4993. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4994. class ui_ShowItem extends fgui.GComponent {
  4995. static createInstance() {
  4996. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4997. }
  4998. onConstruct() {
  4999. this.myImg = (this.getChild("myImg"));
  5000. }
  5001. }
  5002. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  5003. class ShowItem {
  5004. constructor() {
  5005. this.ui = ui_ShowItem.createInstance();
  5006. }
  5007. destroySelf() {
  5008. if (!this.ui.isDisposed) {
  5009. this.ui.removeFromParent();
  5010. this.ui.dispose();
  5011. }
  5012. }
  5013. setParent(parent) {
  5014. parent.addChild(this.ui);
  5015. }
  5016. setPos(x, y) {
  5017. this.ui.x = x;
  5018. this.ui.y = y;
  5019. }
  5020. setUrl(index) {
  5021. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  5022. }
  5023. }
  5024. class ui_UIPower extends fgui.GComponent {
  5025. static createInstance() {
  5026. return (fgui.UIPackage.createObject("game", "UIPower"));
  5027. }
  5028. onConstruct() {
  5029. this.n11 = (this.getChild("n11"));
  5030. this.myNode = (this.getChild("myNode"));
  5031. this.t0 = this.getTransition("t0");
  5032. }
  5033. }
  5034. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  5035. class UIPower extends UIBase {
  5036. constructor() {
  5037. super();
  5038. }
  5039. onConstructor() {
  5040. this.ui = ui_UIPower.createInstance();
  5041. this.contentPane = this.ui;
  5042. this.isEject = false;
  5043. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  5044. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  5045. }
  5046. show() {
  5047. super.show();
  5048. this.ui.t0.play();
  5049. this.setGlobalFont(this.ui);
  5050. }
  5051. videoGetPower() {
  5052. console.log('zh:qjff_AD_for_uipower');
  5053. if (Laya.Browser.onAndroid) {
  5054. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  5055. if (!boo) {
  5056. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  5057. return;
  5058. }
  5059. }
  5060. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  5061. }
  5062. else {
  5063. console.log('zh:AD 失败,直接发放奖励');
  5064. this.qjff_AD_for_uipower();
  5065. }
  5066. }
  5067. qjff_AD_for_uipower() {
  5068. DataMgr.setPower(xGame.common.videoPower, true);
  5069. xGame.eventMgr.event(POWER_TIME);
  5070. this.hide();
  5071. }
  5072. }
  5073. UIPower.uiName = "UIPower";
  5074. class UILevelProp extends UIBase {
  5075. constructor() {
  5076. super();
  5077. this.firstPos = 385;
  5078. this.secondPos = 467;
  5079. this.showItemArr = [];
  5080. }
  5081. onConstructor() {
  5082. this.ui = ui_UILevelProp.createInstance();
  5083. this.contentPane = this.ui;
  5084. this.isEject = false;
  5085. this.addUIClick(this.ui.closeBtn, this.hide);
  5086. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5087. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5088. }
  5089. show(level) {
  5090. super.show();
  5091. this.ui.t1.play();
  5092. this.level = level;
  5093. this.data = cfgTable.placeballData[this.level];
  5094. this.updateSelf();
  5095. this.showPreView();
  5096. this.moneyNode.ui.c1.selectedIndex = 2;
  5097. this.moneyNode.checkPowerTime();
  5098. this.moneyNode.powerChange();
  5099. this.setGlobalFont(this.ui);
  5100. }
  5101. showPreView() {
  5102. let item;
  5103. let data;
  5104. for (let index = 0; index < this.showItemArr.length; index++) {
  5105. item = this.showItemArr[index];
  5106. item.destroySelf();
  5107. }
  5108. this.showItemArr = [];
  5109. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5110. for (const key in cfgData) {
  5111. data = cfgData[key];
  5112. item = new ShowItem();
  5113. item.setParent(this.ui.myNode.displayRoot);
  5114. item.setPos(data.x, data.y);
  5115. item.setUrl(data.value);
  5116. this.showItemArr.push(item);
  5117. }
  5118. }
  5119. updateSelf() {
  5120. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5121. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5122. if (this.data.ball == -1) {
  5123. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5124. }
  5125. else {
  5126. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5127. }
  5128. let localData = DataMgr.getPlaceBallLevel(this.level);
  5129. let getAward = localData.getAward;
  5130. let cfg = cfgTable.placeballData[this.level];
  5131. let coin = this.data.award[0];
  5132. let diamond = this.data.award[1];
  5133. if (cfg.type == PlaceBallType.challenge) {
  5134. diamond = 0;
  5135. coin = 100;
  5136. }
  5137. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5138. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5139. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5140. if (cfg.type == PlaceBallType.challenge) {
  5141. this.ui.myNode.coinNode.numTxt.text = "";
  5142. }
  5143. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5144. if (coin > 0 && diamond > 0) {
  5145. this.ui.myNode.diamondNode.x = 385;
  5146. this.ui.myNode.coinNode.x = 467;
  5147. }
  5148. else {
  5149. this.ui.myNode.diamondNode.x = 385;
  5150. this.ui.myNode.coinNode.x = 385;
  5151. }
  5152. if (!getAward) {
  5153. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5154. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5155. }
  5156. else {
  5157. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5158. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5159. }
  5160. }
  5161. startGame() {
  5162. if (DataMgr.powerEnough()) {
  5163. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5164. this.ui.myNode.startBtn.touchable = false;
  5165. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5166. console.log('zh:startGame ');
  5167. this.ui.myNode.startBtn.touchable = true;
  5168. DataMgr.setPower(-1);
  5169. xGame.eventMgr.event(POWER_TIME);
  5170. xGame.common.gameMode = GameMode.placeBall;
  5171. xGame.common.placeBallCurLevel = this.level;
  5172. xGame.uiMgr.Show(UIGame);
  5173. this.logEventForChallenge_level_start(this.level);
  5174. xGame.uiMgr.Hide(UILevelDisplay);
  5175. xGame.uiMgr.Hide(UIMain);
  5176. this.hide();
  5177. }));
  5178. }
  5179. else {
  5180. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5181. xGame.uiMgr.Show(UIPower);
  5182. }
  5183. }
  5184. logEventForChallenge_level_start(level) {
  5185. let keyStr = 'sjmd_challenge_level_start';
  5186. let jsonStr = {
  5187. "count": 1,
  5188. "gold_balance ": DataMgr.getCoin(),
  5189. "level": level,
  5190. "diamond_balance ": DataMgr.getDiamond()
  5191. };
  5192. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5193. const d = LocalStorageManager.getItem(keyStr);
  5194. if (level > d.level) {
  5195. jsonStr.count = d.count + 1;
  5196. LocalStorageManager.setItem(keyStr, jsonStr);
  5197. }
  5198. else {
  5199. }
  5200. }
  5201. else {
  5202. LocalStorageManager.setItem(keyStr, jsonStr);
  5203. }
  5204. const reqStr = JSON.stringify(jsonStr);
  5205. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5206. }
  5207. hide() {
  5208. super.hide();
  5209. }
  5210. }
  5211. UILevelProp.uiName = "UILevelProp";
  5212. class PutBallLevelDisplay {
  5213. constructor(ui, index) {
  5214. this.index = 0;
  5215. this.ui = ui;
  5216. this.index = index;
  5217. this.ui.onClick(this, this.clickSelf);
  5218. this.updateSelf();
  5219. this.ui.levelTxt.text = (this.index + 1) + "";
  5220. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5221. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5222. }
  5223. updateSelf() {
  5224. let level = this.index + 1;
  5225. this.data = DataMgr.getPlaceBallLevel(level);
  5226. this.ui.starNode.c1.selectedIndex = this.data.star;
  5227. let isChallenge = cfgTable.placeballData[level].type;
  5228. if (this.data.isCur) {
  5229. if (isChallenge) {
  5230. this.ui.c1.selectedIndex = 5;
  5231. }
  5232. else {
  5233. this.ui.c1.selectedIndex = 2;
  5234. }
  5235. }
  5236. else {
  5237. if (this.data.play) {
  5238. if (this.data.star == 3) {
  5239. this.ui.c1.selectedIndex = 0;
  5240. }
  5241. else {
  5242. this.ui.c1.selectedIndex = 1;
  5243. }
  5244. }
  5245. else {
  5246. if (isChallenge) {
  5247. this.ui.c1.selectedIndex = 4;
  5248. }
  5249. else {
  5250. this.ui.c1.selectedIndex = 3;
  5251. }
  5252. }
  5253. }
  5254. }
  5255. clickSelf() {
  5256. if (!this.data.play)
  5257. return;
  5258. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5259. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5260. }
  5261. }
  5262. class UILevelDisplay extends UIBase {
  5263. constructor() {
  5264. super();
  5265. }
  5266. onConstructor() {
  5267. this.ui = ui_UILevelDisplay.createInstance();
  5268. this.contentPane = this.ui;
  5269. this.isEject = false;
  5270. this.myList = this.ui.myNode.myList;
  5271. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5272. this.levelItemArr = [];
  5273. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5274. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5275. this.myList.numItems = levelNum;
  5276. }
  5277. levelItemRender(index, target) {
  5278. let item = new PutBallLevelDisplay(target, index);
  5279. this.levelItemArr.push(item);
  5280. }
  5281. show() {
  5282. super.show();
  5283. this.updateLevel();
  5284. this.scrollToPlace();
  5285. this.setGlobalFont(this.ui);
  5286. }
  5287. updateLevel() {
  5288. let temp;
  5289. for (let index = 0; index < this.levelItemArr.length; index++) {
  5290. temp = this.levelItemArr[index];
  5291. temp.updateSelf();
  5292. }
  5293. }
  5294. scrollToPlace() {
  5295. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5296. let passArr = DataMgr.getPlaceBallLevelList();
  5297. let offest = passArr.length;
  5298. if (offest >= maxNum - 1)
  5299. offest = maxNum - 1;
  5300. this.myList.scrollToView(offest, true, true);
  5301. }
  5302. hide() {
  5303. super.hide();
  5304. }
  5305. }
  5306. UILevelDisplay.uiName = "UILevelDisplay";
  5307. class ui_UIMatching extends fgui.GComponent {
  5308. static createInstance() {
  5309. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5310. }
  5311. onConstruct() {
  5312. this.n5 = (this.getChild("n5"));
  5313. this.n49 = (this.getChild("n49"));
  5314. this.n51 = (this.getChild("n51"));
  5315. this.n64 = (this.getChild("n64"));
  5316. this.n2 = (this.getChild("n2"));
  5317. this.n53 = (this.getChild("n53"));
  5318. this.n54 = (this.getChild("n54"));
  5319. this.n56 = (this.getChild("n56"));
  5320. this.n58 = (this.getChild("n58"));
  5321. this.n59 = (this.getChild("n59"));
  5322. this.n57 = (this.getChild("n57"));
  5323. this.n60 = (this.getChild("n60"));
  5324. this.n62 = (this.getChild("n62"));
  5325. this.awardTxt = (this.getChild("awardTxt"));
  5326. this.n61 = (this.getChild("n61"));
  5327. this.selfHead = (this.getChild("selfHead"));
  5328. this.aiHead = (this.getChild("aiHead"));
  5329. this.n82 = (this.getChild("n82"));
  5330. this.n84 = (this.getChild("n84"));
  5331. this.n83 = (this.getChild("n83"));
  5332. this.t1 = this.getTransition("t1");
  5333. this.t2 = this.getTransition("t2");
  5334. this.t3 = this.getTransition("t3");
  5335. this.t4 = this.getTransition("t4");
  5336. }
  5337. }
  5338. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5339. class UIMatching extends UIBase {
  5340. constructor() {
  5341. super();
  5342. }
  5343. onConstructor() {
  5344. this.ui = ui_UIMatching.createInstance();
  5345. this.contentPane = this.ui;
  5346. this.isEject = false;
  5347. }
  5348. show(callback) {
  5349. super.show();
  5350. PlatMgr.showBanner(true);
  5351. this.callback = callback;
  5352. let user = Moyu.getUserInfo();
  5353. if (!this.selfPot) {
  5354. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5355. }
  5356. if (!this.aiPot) {
  5357. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5358. }
  5359. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5360. this.ui.selfHead.nameTxt.text = user.nickName;
  5361. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5362. this.ui.aiHead.nameTxt.text = "???";
  5363. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5364. this.ui.selfHead.c1.selectedIndex = 0;
  5365. this.ui.aiHead.c1.selectedIndex = 0;
  5366. this.ui.selfHead.x = this.selfPot.x;
  5367. this.ui.selfHead.y = this.selfPot.y;
  5368. this.ui.aiHead.x = this.aiPot.x;
  5369. this.ui.aiHead.y = this.aiPot.y;
  5370. switch (xGame.common.gameMode) {
  5371. case GameMode.classic:
  5372. break;
  5373. case GameMode.bigMove:
  5374. this.initSkillData();
  5375. break;
  5376. default:
  5377. break;
  5378. }
  5379. this.ui.t1.play(Laya.Handler.create(this, () => {
  5380. this.ui.t2.play(Laya.Handler.create(this, () => {
  5381. switch (xGame.common.gameMode) {
  5382. case GameMode.classic:
  5383. this.waitingPeople();
  5384. break;
  5385. case GameMode.bigMove:
  5386. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5387. break;
  5388. default:
  5389. break;
  5390. }
  5391. }));
  5392. }));
  5393. this.setGlobalFont(this.ui);
  5394. }
  5395. initSkillData() {
  5396. this.skillSelectData = [];
  5397. let skillUrl = xGame.common.skillIconList;
  5398. let skillName = xGame.common.skillNameList;
  5399. let skillLevel = DataMgr.getBigSkillList();
  5400. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5401. for (let index = 0; index < 5; index++) {
  5402. let obj = {};
  5403. obj.skillImg = skillUrl[index];
  5404. obj.skillName = skillName[index];
  5405. obj.skillType = skillType[index];
  5406. obj.skillLevel = skillLevel[index];
  5407. this.skillSelectData.push(obj);
  5408. }
  5409. }
  5410. getAISkillLevel(myLevel) {
  5411. let video = xGame.common.upSkillLevel;
  5412. let aiLevel;
  5413. let temp;
  5414. if (video) {
  5415. temp = xGame.common.randomNum(-2, -1);
  5416. }
  5417. else {
  5418. if (myLevel <= 5) {
  5419. temp = xGame.common.randomNum(1, 3);
  5420. }
  5421. else if (myLevel <= 9) {
  5422. temp = xGame.common.randomNum(-2, 1);
  5423. }
  5424. else {
  5425. temp = xGame.common.randomNum(-4, 0);
  5426. }
  5427. }
  5428. aiLevel = temp + myLevel;
  5429. if (aiLevel <= 1)
  5430. aiLevel = 1;
  5431. if (aiLevel >= 10)
  5432. aiLevel = 10;
  5433. return aiLevel;
  5434. }
  5435. getAISkillType() {
  5436. return xGame.common.randomNum(1, 4);
  5437. let successTimes = DataMgr.getSkillSuccessTimes();
  5438. let info = cfgTable.aiskillData[successTimes];
  5439. if (!info) {
  5440. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5441. info = cfgTable.aiskillData[max];
  5442. }
  5443. let dataArr = info.skillselect;
  5444. let myCfg = {};
  5445. for (let index = 0; index < dataArr.length; index++) {
  5446. let temp = dataArr[index].split('-');
  5447. myCfg[temp[0]] = {};
  5448. myCfg[temp[0]].id = parseInt(temp[0]);
  5449. myCfg[temp[0]].weight = parseInt(temp[1]);
  5450. }
  5451. let aiCfg = xGame.common.initWeight(myCfg);
  5452. let curData = xGame.common.getRandomWeightData(aiCfg);
  5453. return parseInt(curData.id);
  5454. }
  5455. getAISkillData(index) {
  5456. let myLevel = this.skillSelectData[index].skillLevel;
  5457. let aiLevel = this.getAISkillLevel(myLevel);
  5458. let aiType = this.getAISkillType() - 1;
  5459. return { aiLevel, aiType } = { aiLevel, aiType };
  5460. }
  5461. skillSelectFinish(index) {
  5462. let aiInfo = this.getAISkillData(index);
  5463. xGame.common.gameMgr.selfCurSkill = index;
  5464. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5465. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5466. this.ui.selfHead.c1.selectedIndex = 1;
  5467. this.ui.aiHead.c1.selectedIndex = 1;
  5468. let myData = this.skillSelectData[index];
  5469. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5470. let guide = DataMgr.getSkillGuide();
  5471. if (guide == 0) {
  5472. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5473. }
  5474. else {
  5475. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5476. }
  5477. let aiData = this.skillSelectData[aiInfo.aiType];
  5478. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5479. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5480. this.waitingPeople();
  5481. }
  5482. waitingPeople() {
  5483. let time = xGame.common.randomNum(1000, 3000);
  5484. time += 1000;
  5485. Laya.timer.once(time, this, () => {
  5486. this.matchingSuccess();
  5487. });
  5488. }
  5489. matchingSuccess() {
  5490. let gameUI = xGame.common.gameUI;
  5491. let name = gameUI.ui.topNode.aiNameTxt.text;
  5492. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5493. this.ui.aiHead.nameTxt.text = name;
  5494. this.ui.aiHead.headImg.url = url;
  5495. name = gameUI.ui.topNode.selfNameTxt.text;
  5496. url = gameUI.ui.topNode.selfHeadLoader.url;
  5497. this.ui.selfHead.nameTxt.text = name;
  5498. this.ui.selfHead.headImg.url = url;
  5499. this.ui.t3.play(Laya.Handler.create(this, () => {
  5500. this.callback && this.callback();
  5501. this.ui.t4.play(Laya.Handler.create(this, () => {
  5502. this.destroySelf();
  5503. }));
  5504. }));
  5505. }
  5506. destroySelf() {
  5507. this.callback = null;
  5508. this.skillSelectData = null;
  5509. this.selfPot = null;
  5510. this.aiPot = null;
  5511. if (!this.ui.isDisposed) {
  5512. this.ui.removeFromParent();
  5513. this.ui.dispose();
  5514. }
  5515. xGame.uiMgr.destroyUI(this);
  5516. }
  5517. }
  5518. UIMatching.uiName = "UIMatching";
  5519. class ui_UIRanking extends fgui.GComponent {
  5520. static createInstance() {
  5521. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5522. }
  5523. onConstruct() {
  5524. this.n26 = (this.getChild("n26"));
  5525. this.myNode = (this.getChild("myNode"));
  5526. }
  5527. }
  5528. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5529. class UIRanking extends UIBase {
  5530. constructor() {
  5531. super();
  5532. this.showSelf = true;
  5533. this.rankType = 1;
  5534. this.rankList = [];
  5535. this.topX = 10;
  5536. this.myIndex = this.topX + 1;
  5537. this.myStar = 0;
  5538. }
  5539. onConstructor() {
  5540. this.ui = ui_UIRanking.createInstance();
  5541. this.contentPane = this.ui;
  5542. this.isEject = false;
  5543. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5544. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5545. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5546. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5547. this.ui.myNode.myList.setVirtual();
  5548. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5549. }
  5550. show() {
  5551. super.show();
  5552. this.getPaiHangBangDataFormJosnFile();
  5553. this.updateSelf();
  5554. let self = Moyu.getUserInfo();
  5555. if (!self.isAuth) {
  5556. Moyu.initUser(this, () => {
  5557. DataMgr.upRankData();
  5558. });
  5559. }
  5560. this.setGlobalFont(this.ui);
  5561. }
  5562. getPaiHangBangDataFormJosnFile() {
  5563. const rankingList = cfgTable.paiHangBangData.list;
  5564. this.updateItemData(rankingList);
  5565. }
  5566. updateSelfItem() {
  5567. console.log('zh:Moyu.platType =' + Moyu.platType);
  5568. let self = Moyu.getUserInfo();
  5569. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5570. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5571. if (this.myIndex > this.topX) {
  5572. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5573. }
  5574. else {
  5575. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5576. }
  5577. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5578. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5579. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5580. }
  5581. updateItemData(data) {
  5582. this.myStar = xGame.common.getAllStarNum();
  5583. if (this.rankList.length < 2) {
  5584. this.rankList = data;
  5585. let self = Moyu.getUserInfo();
  5586. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5587. self.headIcon = self.headIcon;
  5588. for (let i = 0; i < data.length; i++) {
  5589. let data = this.rankList[i];
  5590. if (data.userId == self.userId) {
  5591. this.rankList.splice(i, 1);
  5592. break;
  5593. }
  5594. }
  5595. for (let i = 0; i < data.length; i++) {
  5596. let data = this.rankList[i];
  5597. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5598. this.myIndex = i + 1;
  5599. let user = { headIcon: self.headIcon, nickName: "myself" };
  5600. let ud = { user: user, data: {} };
  5601. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5602. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5603. if (Moyu.platType < 11) {
  5604. user.headIcon = self.headIcon;
  5605. user.nickName = self.nickName;
  5606. }
  5607. this.rankList.splice(i, 0, md);
  5608. break;
  5609. }
  5610. }
  5611. }
  5612. this.updateSelfItem();
  5613. this.ui.myNode.myList.numItems = this.rankList.length;
  5614. }
  5615. updateItemUI(index, obj) {
  5616. let data = this.rankList[index];
  5617. let userData = JSON.parse(data.userData).user;
  5618. obj.nameTxt.text = userData.nickName.toString();
  5619. obj.valueTxt.text = data.rankScore;
  5620. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5621. obj.rankTxt.text = index + 1;
  5622. switch (index) {
  5623. case 0:
  5624. this.setImg(obj, 1, 0, 0);
  5625. obj.rankTxt.color = "#FFC047";
  5626. break;
  5627. case 1:
  5628. this.setImg(obj, 0, 1, 0);
  5629. obj.rankTxt.color = "#ACACAC";
  5630. break;
  5631. case 2:
  5632. this.setImg(obj, 0, 0, 1);
  5633. obj.rankTxt.color = "#D09672";
  5634. break;
  5635. default:
  5636. this.setImg(obj, 0, 0, 0);
  5637. obj.rankTxt.color = "#496FAB";
  5638. break;
  5639. }
  5640. }
  5641. setImg(obj, a, b, c) {
  5642. obj.img1.visible = a ? true : false;
  5643. obj.img2.visible = b ? true : false;
  5644. obj.img3.visible = c ? true : false;
  5645. }
  5646. changeList(type) {
  5647. this.rankType = type;
  5648. this.updateSelf();
  5649. }
  5650. changeSelfNode() {
  5651. this.showSelf = !this.showSelf;
  5652. this.updateSelf();
  5653. }
  5654. updateSelf() {
  5655. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5656. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5657. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5658. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5659. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5660. }
  5661. }
  5662. UIRanking.uiName = "UIRanking";
  5663. class ui_UISecretary extends fgui.GComponent {
  5664. static createInstance() {
  5665. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5666. }
  5667. onConstruct() {
  5668. this.n0 = (this.getChild("n0"));
  5669. this.myNode = (this.getChild("myNode"));
  5670. this.closeBtn = (this.getChild("closeBtn"));
  5671. this.t0 = this.getTransition("t0");
  5672. }
  5673. }
  5674. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5675. class UISecretary extends UIBase {
  5676. constructor() {
  5677. super();
  5678. this.curIndex = 1;
  5679. }
  5680. onConstructor() {
  5681. this.ui = ui_UISecretary.createInstance();
  5682. this.contentPane = this.ui;
  5683. this.isEject = false;
  5684. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5685. this.nodeObj = { left: null, right: null, cur: null };
  5686. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5687. }
  5688. show() {
  5689. super.show();
  5690. this.ui.t0.play();
  5691. this.updateData();
  5692. this.setGlobalFont(this.ui);
  5693. }
  5694. addSecretarySpine(node, spineName) {
  5695. if (spineName == "mishu") {
  5696. if (this.secretarySpine1) {
  5697. node.displayObject.destroyChildren();
  5698. this.playWoman(this.secretarySpine1, node.displayObject);
  5699. }
  5700. else {
  5701. let spine1 = new SpineMgr("mishu", () => {
  5702. this.secretarySpine1 = spine1;
  5703. this.playWoman(this.secretarySpine1, node.displayObject);
  5704. });
  5705. }
  5706. }
  5707. else {
  5708. if (this.secretarySpine2) {
  5709. node.displayObject.destroyChildren();
  5710. this.playWoman(this.secretarySpine2, node.displayObject);
  5711. }
  5712. else {
  5713. let spine2 = new SpineMgr("xiaomishu2", () => {
  5714. this.secretarySpine2 = spine2;
  5715. this.playWoman(this.secretarySpine2, node.displayObject);
  5716. });
  5717. }
  5718. }
  5719. }
  5720. playWoman(node, parent) {
  5721. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5722. let yy = this.ui.myNode.gameNode3.secretary.height;
  5723. let scale = 1.5;
  5724. if (node == this.secretarySpine2) {
  5725. scale = 1.2;
  5726. }
  5727. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5728. node.play(data, 0, true, parent);
  5729. }
  5730. turnLeft() {
  5731. this.curIndex--;
  5732. if (this.curIndex < 1) {
  5733. this.curIndex = 2;
  5734. }
  5735. let left = this.nodeObj.left;
  5736. let right = this.nodeObj.right;
  5737. let cur = this.nodeObj.cur;
  5738. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5739. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5740. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5741. this.updateData();
  5742. }));
  5743. this.ui.myNode.setChildIndex(right, 2);
  5744. this.nodeObj.left = cur;
  5745. this.nodeObj.right = left;
  5746. this.nodeObj.cur = right;
  5747. }
  5748. turnRight() {
  5749. this.curIndex++;
  5750. if (this.curIndex > 2) {
  5751. this.curIndex = 1;
  5752. }
  5753. let left = this.nodeObj.left;
  5754. let right = this.nodeObj.right;
  5755. let cur = this.nodeObj.cur;
  5756. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5757. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5758. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5759. this.updateData();
  5760. }));
  5761. this.ui.myNode.setChildIndex(left, 2);
  5762. this.nodeObj.left = right;
  5763. this.nodeObj.right = cur;
  5764. this.nodeObj.cur = left;
  5765. }
  5766. updateData() {
  5767. console.log('zh: updateData FFFFFFFFFF');
  5768. let data = cfgTable.secretaryshopData;
  5769. let children = this.ui.myNode._children;
  5770. let temp;
  5771. let curData;
  5772. for (let index = 0; index < children.length; index++) {
  5773. temp = children[index];
  5774. curData = data[1];
  5775. temp.heightTxt.text = curData.height;
  5776. temp.foodTxt.text = curData.food;
  5777. temp.historyTxt.text = curData.history;
  5778. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5779. this.addSecretarySpine(temp.secretary, curData.spine);
  5780. let womanIndex = curData.id - 1;
  5781. let getWoman = DataMgr.getSecretary(womanIndex);
  5782. let curUse = DataMgr.getCurSecretary();
  5783. if (getWoman) {
  5784. if (curUse == womanIndex) {
  5785. temp.purchaseBtn.c1.selectedIndex = 1;
  5786. }
  5787. else {
  5788. temp.purchaseBtn.c1.selectedIndex = 2;
  5789. }
  5790. }
  5791. else {
  5792. temp.purchaseBtn.c1.selectedIndex = 0;
  5793. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5794. }
  5795. temp.purchaseBtn.visible = false;
  5796. }
  5797. }
  5798. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5799. console.log('zh: 点击了clickSecretary ');
  5800. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5801. if (getWoman) {
  5802. if (curUse != womanIndex) {
  5803. console.log();
  5804. DataMgr.setCurSecretary(womanIndex);
  5805. this.updateData();
  5806. }
  5807. }
  5808. else {
  5809. console.log('zh:点击购买了');
  5810. let need = needDiamond;
  5811. if (DataMgr.diamondEnough(need)) {
  5812. DataMgr.setDiamond(-need);
  5813. DataMgr.setSecretary(womanIndex, 1);
  5814. DataMgr.setCurSecretary(womanIndex);
  5815. this.updateData();
  5816. }
  5817. else {
  5818. xGame.uiMgr.Show(UIAddProp, 1);
  5819. }
  5820. }
  5821. }
  5822. closeSelf() {
  5823. this.hide();
  5824. }
  5825. }
  5826. UISecretary.uiName = "UISecretary";
  5827. class ui_UIShop extends fgui.GComponent {
  5828. static createInstance() {
  5829. return (fgui.UIPackage.createObject("game", "UIShop"));
  5830. }
  5831. onConstruct() {
  5832. this.n48 = (this.getChild("n48"));
  5833. this.n0 = (this.getChild("n0"));
  5834. this.secretary = (this.getChild("secretary"));
  5835. this.talkNode = (this.getChild("talkNode"));
  5836. this.closeNode = (this.getChild("closeNode"));
  5837. this.moneyNode = (this.getChild("moneyNode"));
  5838. this.myNode = (this.getChild("myNode"));
  5839. }
  5840. }
  5841. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5842. class ui_UIMsg extends fgui.GComponent {
  5843. static createInstance() {
  5844. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5845. }
  5846. onConstruct() {
  5847. this.tipsNode = (this.getChild("tipsNode"));
  5848. }
  5849. }
  5850. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5851. class UIMsg extends UIBase {
  5852. constructor() {
  5853. super();
  5854. }
  5855. onConstructor() {
  5856. this.ui = ui_UIMsg.createInstance();
  5857. this.contentPane = this.ui;
  5858. this.isEject = false;
  5859. this.isMuti = true;
  5860. }
  5861. show(msg, callback) {
  5862. super.show();
  5863. this.ui.tipsNode.msgTxt.text = msg;
  5864. this.ui.alpha = 1;
  5865. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5866. this.hide();
  5867. callback && callback();
  5868. }), 1000);
  5869. this.setGlobalFont(this.ui);
  5870. }
  5871. }
  5872. UIMsg.uiName = "UIMsg";
  5873. class BallRodDisplay {
  5874. constructor(ui, index) {
  5875. this.index = 0;
  5876. this.uiIndex = 0;
  5877. this.ui = ui;
  5878. this.index = index;
  5879. this.initData();
  5880. }
  5881. initData() {
  5882. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5883. let data = cfgTable.ballrodData[this.index + 1];
  5884. this.ui.nameTxt.text = data.name;
  5885. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5886. this.ui.levelNode.c1.selectedIndex = data.quality;
  5887. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5888. if (data.spine) {
  5889. this.mySpine = new SpineMgr(data.spine, () => {
  5890. let xx = 150;
  5891. let yy = 70;
  5892. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5893. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5894. });
  5895. }
  5896. }
  5897. updateSelf() {
  5898. let get = DataMgr.getBallRod(this.index);
  5899. if (get == null)
  5900. get = 1;
  5901. let curUse = DataMgr.getCurBallRod();
  5902. if (get) {
  5903. if (curUse == this.index) {
  5904. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5905. }
  5906. else {
  5907. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5908. }
  5909. }
  5910. else {
  5911. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5912. }
  5913. }
  5914. buyBallRod() {
  5915. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5916. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5917. switch (selectedIndex) {
  5918. case 0:
  5919. break;
  5920. case 1:
  5921. console.log('zh:点击了 USE THIS');
  5922. DataMgr.setCurBallRod(this.index);
  5923. let curUse = DataMgr.getCurBallRod();
  5924. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5925. let ui = xGame.uiMgr.getUI(UIShop);
  5926. ui.updateBallRod();
  5927. break;
  5928. case 2:
  5929. let data = cfgTable.ballrodData[this.index + 1];
  5930. let need = data.price;
  5931. if (DataMgr.diamondEnough(need)) {
  5932. this.buyQiuGan(data);
  5933. DataMgr.setDiamond(-need);
  5934. DataMgr.setBallRod(this.index, 1);
  5935. DataMgr.setCurBallRod(this.index);
  5936. let ui = xGame.uiMgr.getUI(UIShop);
  5937. ui.updateBallRod();
  5938. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5939. }
  5940. else {
  5941. xGame.uiMgr.Show(UIAddProp, 1);
  5942. }
  5943. break;
  5944. default:
  5945. break;
  5946. }
  5947. }
  5948. buyQiuGan(qgItem) {
  5949. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5950. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5951. if (userInfo == null) {
  5952. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5953. return;
  5954. }
  5955. let reqData = xGame.httpMgr.getReqData();
  5956. let pd = JSON.parse(reqData);
  5957. pd.qiuGanData = qgItem;
  5958. reqData = JSON.stringify(pd);
  5959. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5960. try {
  5961. console.log('zh:buySp res = ' + JSON.stringify(res));
  5962. let code = res.code;
  5963. let msg = res.msg;
  5964. if (code == 401) {
  5965. Laya.LocalStorage.removeItem(keyForLoginInfo);
  5966. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.loginTimeOut);
  5967. return;
  5968. }
  5969. if (code == 200) {
  5970. xGame.uiMgr.Show(UIMsg, msg);
  5971. DataMgr.getUserZiChanInfo(false);
  5972. }
  5973. else {
  5974. xGame.uiMgr.Show(UIMsg, msg);
  5975. }
  5976. }
  5977. catch (error) {
  5978. console.log('error=' + error);
  5979. alert(error);
  5980. }
  5981. finally {
  5982. }
  5983. });
  5984. }
  5985. logEventForGouMaiGan(qiuGanName) {
  5986. const ev = {
  5987. value: qiuGanName
  5988. };
  5989. const jsonStr = JSON.stringify(ev);
  5990. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5991. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5992. }
  5993. }
  5994. class DaoJuDisplay {
  5995. constructor(ui, index) {
  5996. this.index = 0;
  5997. this.uiIndex = 0;
  5998. this.ggSpid = "";
  5999. this.spid = 0;
  6000. this.ui = ui;
  6001. this.index = index;
  6002. this.initData();
  6003. }
  6004. initData() {
  6005. this.ui.btn_buy.onClick(this, this.gotoBuy);
  6006. let data = cfgTable.daoJuData[this.index + 1];
  6007. this.ui.nameTxt.text = data.spbt;
  6008. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  6009. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  6010. this.ggSpid = data.ggSpid;
  6011. this.spid = data.spid;
  6012. let baseUrl = "asset/sound/ogg/";
  6013. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  6014. }
  6015. gotoBuy() {
  6016. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6017. if (userInfo != null) {
  6018. let token = userInfo.token;
  6019. let ggSpid = this.ggSpid;
  6020. let spid = this.spid;
  6021. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  6022. console.log('zh:gotoBuy1 spid =' + spid);
  6023. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  6024. return;
  6025. }
  6026. else {
  6027. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6028. }
  6029. }
  6030. gotoBuy1() {
  6031. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6032. let djItem = cfgTable.daoJuData[this.index + 1];
  6033. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  6034. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6035. if (userInfo == null) {
  6036. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6037. return;
  6038. }
  6039. let reqData = xGame.httpMgr.getReqData();
  6040. let pd = JSON.parse(reqData);
  6041. pd.spItem = djItem;
  6042. reqData = JSON.stringify(pd);
  6043. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  6044. try {
  6045. console.log('zh:buySp res = ' + JSON.stringify(res));
  6046. let code = res.code;
  6047. let msg = res.msg;
  6048. if (code == 401) {
  6049. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6050. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6051. return;
  6052. }
  6053. if (code == 200) {
  6054. xGame.uiMgr.Show(UIMsg, msg);
  6055. DataMgr.getUserZiChanInfo(false);
  6056. }
  6057. else {
  6058. xGame.uiMgr.Show(UIMsg, msg);
  6059. }
  6060. }
  6061. catch (error) {
  6062. console.log('error=' + error);
  6063. alert(error);
  6064. }
  6065. finally {
  6066. }
  6067. });
  6068. }
  6069. }
  6070. class UIShop extends UIBase {
  6071. constructor() {
  6072. super();
  6073. this.itemNums = 0;
  6074. this.itemNumsForDj = 0;
  6075. this.curType = "";
  6076. }
  6077. onConstructor() {
  6078. this.ui = ui_UIShop.createInstance();
  6079. this.contentPane = this.ui;
  6080. this.isEject = false;
  6081. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6082. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6083. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6084. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6085. this.addUIClick(this.ui, this.interuptSecretary);
  6086. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6087. this.ballRodArr = [];
  6088. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6089. this.ui.myNode.myList.numItems = this.itemNums;
  6090. this.loadDjdata_old();
  6091. }
  6092. loadDjdata_old() {
  6093. let fff = cfgTable.daoJuData;
  6094. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6095. this.daoJuArr = [];
  6096. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6097. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6098. }
  6099. getProductList() {
  6100. let reqData = xGame.httpMgr.getReqData();
  6101. let pd = JSON.parse(reqData);
  6102. pd.splx = "Consumable";
  6103. reqData = JSON.stringify(pd);
  6104. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6105. try {
  6106. let code = res.code;
  6107. let msg = res.msg;
  6108. if (code == 401) {
  6109. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6110. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6111. return;
  6112. }
  6113. if (code == 200) {
  6114. let data = res.data;
  6115. for (let index = 0; index < data.length; index++) {
  6116. let element = data[index];
  6117. cfgTable.daoJuData[element.spid] = element;
  6118. }
  6119. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6120. }
  6121. else {
  6122. xGame.uiMgr.Show(UIMsg, msg);
  6123. }
  6124. }
  6125. catch (error) {
  6126. console.log('error=' + error);
  6127. alert(error);
  6128. }
  6129. finally {
  6130. }
  6131. });
  6132. }
  6133. show(type) {
  6134. super.show();
  6135. this.curType = type == 0 ? "qiugan" : "daoju";
  6136. this.switchBtn("");
  6137. this.playSecretaryIdle();
  6138. this.updateBallRod();
  6139. this.setGlobalFont(this.ui);
  6140. }
  6141. test123() {
  6142. console.log('zh:test123 ');
  6143. }
  6144. switchBtn(type) {
  6145. console.log('zh:1111切換 sel type=' + type);
  6146. if (type == "") {
  6147. type = this.curType;
  6148. }
  6149. else {
  6150. if (this.curType == type) {
  6151. return;
  6152. }
  6153. else {
  6154. this.curType = type;
  6155. }
  6156. }
  6157. if (type == "qiugan") {
  6158. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6159. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6160. this.ui.myNode.c1.selectedIndex = 0;
  6161. this.ui.myNode.myList.visible = true;
  6162. this.ui.myNode.djList.visible = false;
  6163. }
  6164. else {
  6165. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6166. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6167. this.ui.myNode.c1.selectedIndex = 1;
  6168. this.ui.myNode.myList.visible = false;
  6169. this.ui.myNode.djList.visible = true;
  6170. }
  6171. }
  6172. updateBallRod() {
  6173. for (let index = 0; index < this.ballRodArr.length; index++) {
  6174. this.ballRodArr[index].updateSelf();
  6175. }
  6176. }
  6177. renderBallRod(sort, obj) {
  6178. let index = this.getIndexBySort(sort + 1) - 1;
  6179. let ballRod = new BallRodDisplay(obj, index);
  6180. this.ballRodArr.push(ballRod);
  6181. }
  6182. renderDaoJu(idx, obj) {
  6183. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6184. let b = new DaoJuDisplay(obj, index);
  6185. this.daoJuArr.push(b);
  6186. }
  6187. getIndexBySort(sort) {
  6188. let object = cfgTable.ballrodData;
  6189. for (const key in object) {
  6190. if (object[key].sort == sort) {
  6191. return parseInt(key);
  6192. }
  6193. }
  6194. }
  6195. getIndexBySortForDj(idx) {
  6196. let object = cfgTable.daoJuData;
  6197. for (const key in object) {
  6198. if (object[key].idx == idx) {
  6199. return parseInt(key);
  6200. }
  6201. }
  6202. }
  6203. playSecretaryIdle() {
  6204. let parent = this.ui.secretary.displayObject;
  6205. parent.destroyChildren();
  6206. let xx = this.ui.secretary.width / 2;
  6207. let yy = this.ui.secretary.height;
  6208. let scale = xGame.common.getSecretaryScale();
  6209. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6210. xGame.common.secretary.play(data, 0, true, parent);
  6211. }
  6212. interuptSecretary() {
  6213. Laya.timer.clearAll(this);
  6214. this.playSecretaryRandomSound();
  6215. }
  6216. playSecretaryRandomSound() {
  6217. if (this.isHide)
  6218. return;
  6219. let time = xGame.common.randomNum(45000, 60000);
  6220. Laya.timer.once(time, this, () => {
  6221. if (this.isHide)
  6222. return;
  6223. let index = xGame.common.randomNum(4, 7);
  6224. xGame.soundMgr.playSound("s_main0" + index);
  6225. let words = 1;
  6226. switch (index) {
  6227. case 4:
  6228. words = 5;
  6229. break;
  6230. case 5:
  6231. words = 3;
  6232. break;
  6233. case 6:
  6234. words = 6;
  6235. break;
  6236. case 7:
  6237. words = 7;
  6238. break;
  6239. default:
  6240. break;
  6241. }
  6242. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6243. this.playSecretaryRandomSound();
  6244. });
  6245. }
  6246. closeSelf() {
  6247. this.hide();
  6248. }
  6249. }
  6250. UIShop.uiName = "UIShop";
  6251. class ui_UISign extends fgui.GComponent {
  6252. static createInstance() {
  6253. return (fgui.UIPackage.createObject("game", "UISign"));
  6254. }
  6255. onConstruct() {
  6256. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  6257. this.n6 = (this.getChild("n6"));
  6258. this.closeNode = (this.getChild("closeNode"));
  6259. this.myNode = (this.getChild("myNode"));
  6260. this.moneyNode = (this.getChild("moneyNode"));
  6261. this.secretary = (this.getChild("secretary"));
  6262. this.talkNode = (this.getChild("talkNode"));
  6263. this.tripleBtn = (this.getChild("tripleBtn"));
  6264. this.normalBtn = (this.getChild("normalBtn"));
  6265. this.tipsNode = (this.getChild("tipsNode"));
  6266. this.againBtn = (this.getChild("againBtn"));
  6267. this.t0 = this.getTransition("t0");
  6268. }
  6269. }
  6270. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6271. class SignMax {
  6272. constructor(ui) {
  6273. this.ui = ui;
  6274. }
  6275. updateSelf(index, sameDay, curDayIndex) {
  6276. let data = cfgTable.signData[index + 1];
  6277. this.ui.titleTxt.text = data.title;
  6278. let arr1 = data.award[0].split('-');
  6279. let arr2 = data.award[1].split('-');
  6280. let num1 = parseInt(arr1[1]);
  6281. let num2 = parseInt(arr2[1]);
  6282. this.ui.numTxt1.text = num1 + "";
  6283. this.ui.numTxt2.text = num2 + "";
  6284. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6285. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6286. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6287. this.ui.numTxt1.visible = false;
  6288. }
  6289. else {
  6290. this.ui.numTxt1.visible = true;
  6291. }
  6292. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6293. this.ui.numTxt2.visible = false;
  6294. }
  6295. else {
  6296. this.ui.numTxt2.visible = true;
  6297. }
  6298. if (index < curDayIndex) {
  6299. this.ui.c1.selectedIndex = 1;
  6300. }
  6301. else if (index == curDayIndex) {
  6302. if (sameDay) {
  6303. this.ui.c1.selectedIndex = 2;
  6304. }
  6305. else {
  6306. this.ui.c1.selectedIndex = 2;
  6307. }
  6308. }
  6309. else {
  6310. this.ui.c1.selectedIndex = 0;
  6311. }
  6312. }
  6313. }
  6314. class SignNormal {
  6315. constructor(ui) {
  6316. this.ui = ui;
  6317. }
  6318. updateSelf(index, sameDay, curDayIndex) {
  6319. let data = cfgTable.signData[index + 1];
  6320. this.ui.titleTxt.text = data.title;
  6321. let arr = data.award[0].split('-');
  6322. let type = parseInt(arr[0]);
  6323. let num = parseInt(arr[1]);
  6324. this.ui.numTxt.text = num + "";
  6325. if (type > 2) {
  6326. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6327. this.ui.myIcon.rotation = 0;
  6328. }
  6329. else {
  6330. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6331. this.ui.myIcon.rotation = 0;
  6332. }
  6333. if (xGame.common.signAwardContainsRod(data.award)) {
  6334. this.ui.numTxt.visible = false;
  6335. }
  6336. else {
  6337. this.ui.numTxt.visible = true;
  6338. }
  6339. if (index < curDayIndex) {
  6340. this.ui.c1.selectedIndex = 1;
  6341. }
  6342. else if (index == curDayIndex) {
  6343. if (sameDay) {
  6344. this.ui.c1.selectedIndex = 2;
  6345. }
  6346. else {
  6347. this.ui.c1.selectedIndex = 2;
  6348. }
  6349. }
  6350. else {
  6351. this.ui.c1.selectedIndex = 0;
  6352. }
  6353. }
  6354. }
  6355. class UISign extends UIBase {
  6356. constructor() {
  6357. super();
  6358. this.curDayIndex = 0;
  6359. this.starX = 0;
  6360. }
  6361. onConstructor() {
  6362. this.ui = ui_UISign.createInstance();
  6363. this.contentPane = this.ui;
  6364. this.isEject = false;
  6365. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6366. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6367. this.initSignItem();
  6368. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6369. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6370. }
  6371. show() {
  6372. super.show();
  6373. this.ui.t0.play();
  6374. this.playSecretaryIdle();
  6375. this.updateSign();
  6376. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  6377. this.setGlobalFont(this.ui);
  6378. }
  6379. initSignItem() {
  6380. this.signArr = [];
  6381. for (let index = 0; index < 6; index++) {
  6382. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6383. this.signArr.push(temp);
  6384. }
  6385. this.signMax = new SignMax(this.ui.myNode.day7);
  6386. if (Moyu.isKs)
  6387. this.ui.closeNode.closeBtn.x += 100;
  6388. }
  6389. updateSign() {
  6390. let sameDay = xGame.common.judgeSameDay();
  6391. let max = 7;
  6392. this.curDayIndex = DataMgr.getSignData();
  6393. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6394. this.curDayIndex = 0;
  6395. if (!sameDay) {
  6396. this.ui.normalBtn.visible = true;
  6397. this.ui.tipsNode.visible = false;
  6398. this.ui.againBtn.visible = false;
  6399. }
  6400. else {
  6401. this.ui.normalBtn.visible = false;
  6402. let again = DataMgr.getExtraSign();
  6403. let isCurrency = false;
  6404. let index = this.curDayIndex;
  6405. if (index == 0)
  6406. index = 7;
  6407. let award = cfgTable.signData[index].award;
  6408. let num = award[0].split("-")[0];
  6409. if (num == "1" || num == "2")
  6410. isCurrency = true;
  6411. let showAgain = again == 0 && isCurrency;
  6412. this.ui.againBtn.visible = showAgain;
  6413. this.ui.tipsNode.visible = !showAgain;
  6414. }
  6415. for (let index = 0; index < this.signArr.length; index++) {
  6416. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6417. }
  6418. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6419. }
  6420. playSecretaryIdle() {
  6421. let parent = this.ui.secretary.displayObject;
  6422. parent.destroyChildren();
  6423. let xx = this.ui.secretary.width / 2;
  6424. let yy = this.ui.secretary.height;
  6425. let scale = xGame.common.getSecretaryScale();
  6426. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6427. xGame.common.secretary.play(data, 0, true, parent);
  6428. }
  6429. closeSelf() {
  6430. this.hide();
  6431. }
  6432. normalGetAward() {
  6433. let sameDay = xGame.common.judgeSameDay();
  6434. if (!sameDay) {
  6435. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6436. let temp;
  6437. let type;
  6438. let num;
  6439. let arr = [];
  6440. for (let index = 0; index < award.length; index++) {
  6441. temp = award[index].split("-");
  6442. type = parseInt(temp[0]);
  6443. num = parseInt(temp[1]);
  6444. let awardType = new AwardType();
  6445. awardType.num = num;
  6446. awardType.type = type;
  6447. arr.push(awardType);
  6448. }
  6449. xGame.common.getAward(arr, (watchVideo) => {
  6450. this.curDayIndex++;
  6451. if (this.curDayIndex > 7)
  6452. this.curDayIndex = 0;
  6453. DataMgr.setSignData(this.curDayIndex);
  6454. this.updateSignData2Server(this.curDayIndex);
  6455. DataMgr.setSignTime(new Date().getTime());
  6456. if (watchVideo) {
  6457. DataMgr.setExtraSign(1);
  6458. Moyu.sendDataEvent("signIn1");
  6459. }
  6460. this.updateSign();
  6461. });
  6462. }
  6463. }
  6464. againGetAward() {
  6465. Moyu.sendDataEvent("signIn2");
  6466. console.log('zh:qjff_AD_for_uisign');
  6467. if (Laya.Browser.onAndroid) {
  6468. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6469. if (!boo) {
  6470. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6471. return;
  6472. }
  6473. }
  6474. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6475. }
  6476. else {
  6477. console.log('zh:AD 失败,直接发放奖励');
  6478. this.qjff_AD_for_uisign();
  6479. }
  6480. }
  6481. qjff_AD_for_uisign() {
  6482. let index = this.curDayIndex;
  6483. if (index == 0)
  6484. index = 7;
  6485. let award = cfgTable.signData[index].award;
  6486. let temp;
  6487. let type;
  6488. let num;
  6489. for (let index = 0; index < award.length; index++) {
  6490. temp = award[index].split("-");
  6491. type = parseInt(temp[0]);
  6492. num = parseInt(temp[1]) * 3;
  6493. xGame.common.playObjFlyAnim(num, type);
  6494. }
  6495. DataMgr.setExtraSign(1);
  6496. this.updateSign();
  6497. }
  6498. updateSignData2Server(day) {
  6499. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6500. if (userInfo == null) {
  6501. return;
  6502. }
  6503. let reqData = xGame.httpMgr.getReqData();
  6504. let pd = JSON.parse(reqData);
  6505. pd.signData = day;
  6506. reqData = JSON.stringify(pd);
  6507. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  6508. try {
  6509. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  6510. let code = res.code;
  6511. let msg = res.msg;
  6512. if (code == 401) {
  6513. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6514. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6515. return;
  6516. }
  6517. if (code == 200) {
  6518. let data = res.data;
  6519. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  6520. }
  6521. else {
  6522. xGame.uiMgr.Show(UIMsg, msg);
  6523. }
  6524. }
  6525. catch (error) {
  6526. console.log('error=' + error);
  6527. alert(error);
  6528. }
  6529. finally {
  6530. }
  6531. });
  6532. }
  6533. }
  6534. UISign.uiName = "UISign";
  6535. class ui_UISkill extends fgui.GComponent {
  6536. static createInstance() {
  6537. return (fgui.UIPackage.createObject("game", "UISkill"));
  6538. }
  6539. onConstruct() {
  6540. this.n48 = (this.getChild("n48"));
  6541. this.n0 = (this.getChild("n0"));
  6542. this.secretary = (this.getChild("secretary"));
  6543. this.talkNode = (this.getChild("talkNode"));
  6544. this.closeNode = (this.getChild("closeNode"));
  6545. this.moneyNode = (this.getChild("moneyNode"));
  6546. this.skillNode = (this.getChild("skillNode"));
  6547. this.guideNode = (this.getChild("guideNode"));
  6548. }
  6549. }
  6550. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6551. class SkillDisplay {
  6552. constructor(ui, data, uiIndex) {
  6553. this.starX = 0;
  6554. this.starY = 0;
  6555. this.index = 0;
  6556. this.ui = ui;
  6557. this.data = data;
  6558. this.index = uiIndex;
  6559. this.initSelf();
  6560. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6561. }
  6562. initSelf() {
  6563. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6564. this.ui.nameTxt.text = this.data.name;
  6565. this.ui.describeTxt.text = this.data.describe;
  6566. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6567. this.ui.startBtn.onClick(this, this.startGame);
  6568. this.updateSelf();
  6569. }
  6570. updateSelf() {
  6571. this.checkTry();
  6572. let level = DataMgr.getBigSkillByIndex(this.index);
  6573. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6574. }
  6575. checkTry() {
  6576. let index = this.index;
  6577. let level = DataMgr.getBigSkillByIndex(index);
  6578. if (level == null) {
  6579. DataMgr.setBigSkill(index, 1, false);
  6580. level = 1;
  6581. }
  6582. this.ui.levelTxt.text = "LV." + level;
  6583. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6584. this.ui.tryNode.visible = true;
  6585. else
  6586. this.ui.tryNode.visible = false;
  6587. }
  6588. clickAddLevel() {
  6589. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6590. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6591. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6592. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6593. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6594. }
  6595. else {
  6596. console.log('zh:AD 失败,直接发放奖励');
  6597. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6598. }
  6599. }
  6600. qjff_AD_for_skilldisplay_clickAddLevel() {
  6601. DataMgr.setBigSkill(this.data.index, 1);
  6602. this.updateSelf();
  6603. xGame.common.upSkillLevel = true;
  6604. }
  6605. startGame() {
  6606. console.log('zh:rod skill startgame');
  6607. if (this.data.index == 3) {
  6608. alert('Coming soon!');
  6609. return;
  6610. }
  6611. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6612. let needCoin = xGame.common.bigMoveNeedCoin;
  6613. xGame.common.passAwardCoin = 2000;
  6614. let guide = DataMgr.getSkillGuide();
  6615. console.log('zh:startGame guide=' + guide);
  6616. xGame.common.temSelfLevel = 0;
  6617. if (guide == 0) {
  6618. needCoin = 0;
  6619. xGame.common.temSelfLevel = 100;
  6620. }
  6621. if (DataMgr.coinEnough(needCoin)) {
  6622. DataMgr.setCoin(-needCoin);
  6623. xGame.common.curPlayerSkillType = this.index;
  6624. if (guide == 0)
  6625. xGame.common.curPlayerSkillType = 0;
  6626. console.log('zh: skilldisplay 1');
  6627. xGame.uiMgr.Show(UIGame);
  6628. xGame.uiMgr.Hide(UIMain);
  6629. xGame.uiMgr.Show(UIMatching, () => {
  6630. xGame.common.gameUI.ui.alpha = 1;
  6631. xGame.common.gameUI.startGame();
  6632. xGame.uiMgr.Hide(UISkill);
  6633. });
  6634. this.logEventForRod_start();
  6635. }
  6636. else {
  6637. console.log('zh: skilldisplay 2');
  6638. xGame.uiMgr.Show(UIAddProp, 0);
  6639. Moyu.sendDataEvent("AddCoinVideo");
  6640. }
  6641. }
  6642. logEventForRod_start() {
  6643. let gfmsIdx = xGame.common.curPlayerSkillType;
  6644. console.log('zh:选择的技能=' + gfmsIdx);
  6645. let gfmc = 'Skyfall Shot';
  6646. if (gfmsIdx == 0) {
  6647. gfmc = 'Skyfall Shot';
  6648. }
  6649. if (gfmsIdx == 1) {
  6650. gfmc = 'Surging break';
  6651. }
  6652. if (gfmsIdx == 2) {
  6653. gfmc = 'Frost Lock';
  6654. }
  6655. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6656. let jsonStr = {
  6657. "count": 0,
  6658. "name": gfmc
  6659. };
  6660. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6661. const d = LocalStorageManager.getItem(keyStr);
  6662. jsonStr.count = d.count + 1;
  6663. LocalStorageManager.setItem(keyStr, jsonStr);
  6664. }
  6665. else {
  6666. LocalStorageManager.setItem(keyStr, jsonStr);
  6667. }
  6668. const reqStr = JSON.stringify(jsonStr);
  6669. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6670. }
  6671. }
  6672. class UISkill extends UIBase {
  6673. constructor() {
  6674. super();
  6675. this.skillData = [];
  6676. }
  6677. onConstructor() {
  6678. this.ui = ui_UISkill.createInstance();
  6679. this.contentPane = this.ui;
  6680. this.isEject = false;
  6681. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6682. this.initSkillData();
  6683. console.log('zh:aaaaaa1111111111');
  6684. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6685. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6686. console.log('zh:aaaaaa22222222');
  6687. this.displayList = [];
  6688. this.ui.skillNode.skillList.numItems = 3;
  6689. this.addUIClick(this.ui, this.interuptSecretary);
  6690. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6691. this.ui.talkNode.visible = false;
  6692. if (Moyu.isKs)
  6693. this.ui.closeNode.closeBtn.x += 100;
  6694. }
  6695. show() {
  6696. super.show();
  6697. this.playSecretaryIdle();
  6698. this.moneyNode.ui.c1.selectedIndex = 1;
  6699. Laya.timer.clearAll(this);
  6700. xGame.soundMgr.playSound("s_start");
  6701. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6702. let guide = DataMgr.getSkillGuide();
  6703. this.ui.guideNode.visible = guide == 0;
  6704. let item = this.getSkillItemByUIIndex(0);
  6705. if (guide == 0) {
  6706. item.ui.c1.selectedIndex = 1;
  6707. }
  6708. else {
  6709. item.ui.c1.selectedIndex = 0;
  6710. }
  6711. this.ui.guideNode.guideBtn.visible = guide == 0;
  6712. for (let index = 0; index < this.displayList.length; index++) {
  6713. this.displayList[index].checkTry();
  6714. }
  6715. this.setGlobalFont(this.ui);
  6716. }
  6717. getSkillItemByUIIndex(cur) {
  6718. for (let index = 0; index < this.displayList.length; index++) {
  6719. if (this.displayList[index].index == cur) {
  6720. return this.displayList[index];
  6721. }
  6722. }
  6723. }
  6724. enterGuideLevel() {
  6725. let item = this.getSkillItemByUIIndex(0);
  6726. item.startGame();
  6727. if (DataMgr.getNewUser())
  6728. Moyu.sendDataEvent("gameStart1");
  6729. }
  6730. initSkillData() {
  6731. this.skillData = [];
  6732. let nameList = xGame.common.skillNameList;
  6733. let iconList = xGame.common.skillIconList;
  6734. let describeList = [
  6735. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6736. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6737. "The power of frost descends—freezing the flow and taking full control of the game!"
  6738. ];
  6739. console.log('zh:initSkillData 111111111');
  6740. let data;
  6741. for (let index = 0; index < nameList.length; index++) {
  6742. data = {};
  6743. data.name = nameList[index];
  6744. data.icon = iconList[index];
  6745. data.describe = describeList[index];
  6746. data.index = index;
  6747. this.skillData.push(data);
  6748. }
  6749. }
  6750. updateSkillItem(index, target) {
  6751. if (this.displayList[index] == null) {
  6752. let uiIndex;
  6753. switch (index) {
  6754. case 0:
  6755. uiIndex = 1;
  6756. break;
  6757. case 1:
  6758. uiIndex = 0;
  6759. break;
  6760. case 2:
  6761. uiIndex = 2;
  6762. break;
  6763. case 3:
  6764. uiIndex = 3;
  6765. break;
  6766. default:
  6767. break;
  6768. }
  6769. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6770. this.displayList.push(temp);
  6771. }
  6772. }
  6773. playSecretaryIdle() {
  6774. let parent = this.ui.secretary.displayObject;
  6775. parent.destroyChildren();
  6776. let xx = this.ui.secretary.width / 2;
  6777. let yy = this.ui.secretary.height;
  6778. let scale = xGame.common.getSecretaryScale();
  6779. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6780. xGame.common.secretary.play(data, 0, true, parent);
  6781. }
  6782. returnUIMain() {
  6783. this.hide();
  6784. xGame.common.stopGirlPop(this.ui.talkNode);
  6785. xGame.uiMgr.Show(UIMain);
  6786. }
  6787. interuptSecretary() {
  6788. Laya.timer.clearAll(this);
  6789. this.playSecretaryRandomSound();
  6790. }
  6791. playSecretaryRandomSound() {
  6792. if (this.isHide)
  6793. return;
  6794. let time = xGame.common.randomNum(45000, 60000);
  6795. Laya.timer.once(time, this, () => {
  6796. if (this.isHide)
  6797. return;
  6798. let index = xGame.common.randomNum(4, 7);
  6799. xGame.soundMgr.playSound("s_main0" + index);
  6800. let words = 1;
  6801. switch (index) {
  6802. case 4:
  6803. words = 5;
  6804. break;
  6805. case 5:
  6806. words = 3;
  6807. break;
  6808. case 6:
  6809. words = 6;
  6810. break;
  6811. case 7:
  6812. words = 7;
  6813. break;
  6814. default:
  6815. break;
  6816. }
  6817. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6818. this.playSecretaryRandomSound();
  6819. });
  6820. }
  6821. }
  6822. UISkill.uiName = "UISkill";
  6823. class ui_UIModeSelection extends fgui.GComponent {
  6824. static createInstance() {
  6825. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6826. }
  6827. onConstruct() {
  6828. this.n19 = (this.getChild("n19"));
  6829. this.closeBtn = (this.getChild("closeBtn"));
  6830. this.myNode = (this.getChild("myNode"));
  6831. this.t0 = this.getTransition("t0");
  6832. }
  6833. }
  6834. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6835. class UIModeSelection extends UIBase {
  6836. constructor() {
  6837. super();
  6838. }
  6839. onConstructor() {
  6840. this.ui = ui_UIModeSelection.createInstance();
  6841. this.contentPane = this.ui;
  6842. this.isEject = false;
  6843. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6844. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6845. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6846. this.addUIClick(this.ui.closeBtn, this.hide);
  6847. this.peopleArr = [65, 990, 580];
  6848. this.peopleOffest = [5, 10, 10];
  6849. }
  6850. show(callback) {
  6851. this.updateSelf();
  6852. super.show();
  6853. this.ui.t0.play();
  6854. this.callback = callback;
  6855. this.setGlobalFont(this.ui);
  6856. }
  6857. updateSelf() {
  6858. let cfg = cfgTable.modeselectData;
  6859. for (let index = 1; index <= 3; index++) {
  6860. let node = this.ui.myNode["type" + index];
  6861. node.need.text = cfg[index].need;
  6862. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6863. node.peopleTxt.text = this.getRandPeople(index - 1);
  6864. }
  6865. }
  6866. enterGame(type) {
  6867. console.log('zh: 进入经典模式 type: ' + type);
  6868. xGame.common.classicRoomType = type;
  6869. let cfg = cfgTable.modeselectData[type];
  6870. let need = cfg.need;
  6871. xGame.common.passAwardCoin = cfg.award;
  6872. if (DataMgr.coinEnough(need)) {
  6873. DataMgr.setCoin(-need);
  6874. this.ui.myNode["type" + type].t0.play();
  6875. Laya.timer.once(200, this, () => {
  6876. this.callback && this.callback();
  6877. });
  6878. this.logEventForClassic_start();
  6879. }
  6880. else {
  6881. Moyu.sendDataEvent("AddCoinVideo");
  6882. xGame.uiMgr.Show(UIAddProp, 0);
  6883. }
  6884. }
  6885. getRandPeople(index) {
  6886. let rand = this.peopleOffest[index];
  6887. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6888. }
  6889. logEventForClassic_start() {
  6890. let rtype = xGame.common.classicRoomType;
  6891. let msmc = '';
  6892. if (rtype == 1) {
  6893. msmc = 'beginner';
  6894. }
  6895. if (rtype == 2) {
  6896. msmc = 'expert';
  6897. }
  6898. if (rtype == 3) {
  6899. msmc = 'master';
  6900. }
  6901. let keyStr = 'sjmd_classic_start_' + rtype;
  6902. let jsonStr = {
  6903. "difficulty": msmc,
  6904. "classic_count": 1,
  6905. "difficulty_count": 1
  6906. };
  6907. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6908. const d = LocalStorageManager.getItem(keyStr);
  6909. jsonStr.classic_count = d.classic_count + 1;
  6910. jsonStr.difficulty_count = d.difficulty_count + 1;
  6911. LocalStorageManager.setItem(keyStr, jsonStr);
  6912. }
  6913. else {
  6914. LocalStorageManager.setItem(keyStr, jsonStr);
  6915. }
  6916. const reqStr = JSON.stringify(jsonStr);
  6917. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6918. }
  6919. }
  6920. UIModeSelection.uiName = "UIModeSelection";
  6921. class ui_UIReg extends fgui.GComponent {
  6922. static createInstance() {
  6923. return (fgui.UIPackage.createObject("game", "UIReg"));
  6924. }
  6925. onConstruct() {
  6926. this.n38 = (this.getChild("n38"));
  6927. this.n9 = (this.getChild("n9"));
  6928. this.n14 = (this.getChild("n14"));
  6929. this.n15 = (this.getChild("n15"));
  6930. this.n34 = (this.getChild("n34"));
  6931. this.closeBtn = (this.getChild("closeBtn"));
  6932. this.lab_tip = (this.getChild("lab_tip"));
  6933. this.n43 = (this.getChild("n43"));
  6934. this.txt_ua = (this.getChild("txt_ua"));
  6935. this.n44 = (this.getChild("n44"));
  6936. this.txt_up1 = (this.getChild("txt_up1"));
  6937. this.n45 = (this.getChild("n45"));
  6938. this.txt_up2 = (this.getChild("txt_up2"));
  6939. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6940. this.btn_reg = (this.getChild("btn_reg"));
  6941. this.n50 = (this.getChild("n50"));
  6942. }
  6943. }
  6944. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6945. class ui_UILogin extends fgui.GComponent {
  6946. static createInstance() {
  6947. return (fgui.UIPackage.createObject("game", "UILogin"));
  6948. }
  6949. onConstruct() {
  6950. this.c1 = this.getController("c1");
  6951. this.n18 = (this.getChild("n18"));
  6952. this.n7 = (this.getChild("n7"));
  6953. this.n5 = (this.getChild("n5"));
  6954. this.n6 = (this.getChild("n6"));
  6955. this.closeBtn = (this.getChild("closeBtn"));
  6956. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6957. this.btn_login = (this.getChild("btn_login"));
  6958. this.n31 = (this.getChild("n31"));
  6959. this.txt_up = (this.getChild("txt_up"));
  6960. this.n32 = (this.getChild("n32"));
  6961. this.txt_ua = (this.getChild("txt_ua"));
  6962. this.n40 = (this.getChild("n40"));
  6963. }
  6964. }
  6965. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6966. class UILogin extends UIBase {
  6967. constructor() {
  6968. super();
  6969. }
  6970. onConstructor() {
  6971. this.ui = ui_UILogin.createInstance();
  6972. this.contentPane = this.ui;
  6973. this.isEject = false;
  6974. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6975. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6976. this.addUIClick(this.ui.btn_login, this.userLogin);
  6977. }
  6978. show() {
  6979. super.show();
  6980. this.x = (Laya.stage.width - this.width) / 2;
  6981. this.y = (Laya.stage.height - this.height) / 2;
  6982. this.setGlobalFont(this.ui);
  6983. }
  6984. closeSelf() {
  6985. this.hide();
  6986. }
  6987. userLogin() {
  6988. let ua = this.ui.txt_ua.text;
  6989. let up = this.ui.txt_up.text;
  6990. if (ua && up) {
  6991. let reqData = JSON.stringify({
  6992. username: ua.trim(),
  6993. password: up.trim(),
  6994. fromMark: 'app_game'
  6995. });
  6996. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6997. try {
  6998. console.log('zh:res = ' + JSON.stringify(res));
  6999. let code = res.code;
  7000. let msg = res.msg;
  7001. if (code == 200) {
  7002. let keyStr = keyForLoginInfo;
  7003. let jsonStr = {
  7004. "username": res.username,
  7005. "token": res.token,
  7006. "buySpids": { 1: false, 7: false }
  7007. };
  7008. LocalStorageManager.setItem(keyStr, jsonStr);
  7009. let myu = Moyu.getUserInfo();
  7010. console.log('zh:myu = ' + JSON.stringify(myu));
  7011. DataMgr.updateUserNickName(res.username);
  7012. Moyu.updateUserInfo(res.username);
  7013. xGame.uiMgr.Show(UIMsg, msg);
  7014. DataMgr.loadUserSpOrderForAd();
  7015. DataMgr.getUserZiChanInfo(false);
  7016. xGame.eventMgr.event(LOGIN_IN);
  7017. this.closeSelf();
  7018. }
  7019. else {
  7020. xGame.uiMgr.Show(UIMsg, msg);
  7021. }
  7022. }
  7023. catch (error) {
  7024. console.log('error=' + error);
  7025. alert(error);
  7026. }
  7027. finally {
  7028. }
  7029. });
  7030. }
  7031. else {
  7032. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7033. }
  7034. }
  7035. gotoRegPage() {
  7036. this.closeSelf();
  7037. xGame.uiMgr.Show(UIReg);
  7038. }
  7039. }
  7040. UILogin.uiName = "UILogin";
  7041. class UIReg extends UIBase {
  7042. constructor() {
  7043. super();
  7044. }
  7045. onConstructor() {
  7046. this.ui = ui_UIReg.createInstance();
  7047. this.contentPane = this.ui;
  7048. this.isEject = false;
  7049. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7050. this.addUIClick(this.ui.btn_reg, this.regUser);
  7051. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  7052. }
  7053. show() {
  7054. super.show();
  7055. this.x = (Laya.stage.width - this.width) / 2;
  7056. this.y = (Laya.stage.height - this.height) / 2;
  7057. this.setGlobalFont(this.ui);
  7058. }
  7059. closeSelf() {
  7060. this.hide();
  7061. }
  7062. regUser() {
  7063. this.ui.lab_tip.visible = false;
  7064. let ua = this.ui.txt_ua.text;
  7065. let up1 = this.ui.txt_up1.text;
  7066. let up2 = this.ui.txt_up2.text;
  7067. if (ua && up1 && up2 && up1 == up2) {
  7068. let reqData = JSON.stringify({
  7069. username: ua.trim(),
  7070. password: up1.trim(),
  7071. fromMark: 'app_game'
  7072. });
  7073. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  7074. try {
  7075. console.log('zh:res = ' + JSON.stringify(res));
  7076. let code = res.code;
  7077. let msg = res.msg;
  7078. xGame.uiMgr.Show(UIMsg, msg);
  7079. if (code == 200) {
  7080. this.ui.lab_tip.color = "#FFFFFF";
  7081. xGame.uiMgr.Show(UIMsg, msg);
  7082. this.closeSelf();
  7083. }
  7084. else {
  7085. this.ui.lab_tip.color = "#FF0000";
  7086. xGame.uiMgr.Show(UIMsg, msg);
  7087. }
  7088. }
  7089. catch (error) {
  7090. console.log('error=' + error);
  7091. alert(error);
  7092. }
  7093. finally {
  7094. }
  7095. });
  7096. }
  7097. else {
  7098. if (up1 != up2) {
  7099. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  7100. }
  7101. else {
  7102. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7103. }
  7104. }
  7105. }
  7106. gotoLogin() {
  7107. this.closeSelf();
  7108. xGame.uiMgr.Show(UILogin);
  7109. }
  7110. }
  7111. UIReg.uiName = "UIReg";
  7112. class ui_UIFuli1 extends fgui.GComponent {
  7113. static createInstance() {
  7114. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  7115. }
  7116. onConstruct() {
  7117. this.n1 = (this.getChild("n1"));
  7118. this.n2 = (this.getChild("n2"));
  7119. }
  7120. }
  7121. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  7122. class UIFuli1 extends UIBase {
  7123. constructor() {
  7124. super();
  7125. this.jiage = 4.99;
  7126. }
  7127. onConstructor() {
  7128. this.ui = ui_UIFuli1.createInstance();
  7129. this.contentPane = this.ui;
  7130. this.isEject = false;
  7131. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  7132. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  7133. }
  7134. show() {
  7135. super.show();
  7136. this.x = (Laya.stage.width - this.width) / 2;
  7137. this.y = (Laya.stage.height - this.height) / 2;
  7138. this.ui.n2.txt_price.text = "$" + this.jiage;
  7139. this.setGlobalFont(this.ui);
  7140. }
  7141. closeSelf() {
  7142. DataMgr.loadUserSpOrderForAd();
  7143. this.hide();
  7144. }
  7145. gotoBuy() {
  7146. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7147. if (userInfo != null) {
  7148. let token = userInfo.token;
  7149. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  7150. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  7151. DataMgr.loadUserSpOrderForAd();
  7152. return;
  7153. }
  7154. else {
  7155. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7156. }
  7157. }
  7158. gotoBuy2() {
  7159. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7160. if (userInfo == null) {
  7161. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7162. return;
  7163. }
  7164. let reqData = xGame.httpMgr.getReqData();
  7165. let pd = JSON.parse(reqData);
  7166. pd.productId = 1;
  7167. reqData = JSON.stringify(pd);
  7168. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7169. try {
  7170. console.log('zh:buySp res = ' + JSON.stringify(res));
  7171. let code = res.code;
  7172. let msg = res.msg;
  7173. if (code == 401) {
  7174. Laya.LocalStorage.removeItem(keyForLoginInfo);
  7175. alert(TIP_MSG_key.loginTimeOut);
  7176. xGame.uiMgr.Show(UIMsg, msg);
  7177. return;
  7178. }
  7179. if (code == 200) {
  7180. xGame.uiMgr.Show(UIMsg, msg);
  7181. DataMgr.loadUserSpOrderForAd();
  7182. DataMgr.getUserZiChanInfo(false);
  7183. this.closeSelf();
  7184. }
  7185. else {
  7186. xGame.uiMgr.Show(UIMsg, msg);
  7187. }
  7188. }
  7189. catch (error) {
  7190. console.log('error=' + error);
  7191. alert(error);
  7192. }
  7193. finally {
  7194. }
  7195. });
  7196. }
  7197. }
  7198. UIFuli1.uiName = "UIFuli1";
  7199. class ui_UIFuli2 extends fgui.GComponent {
  7200. static createInstance() {
  7201. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  7202. }
  7203. onConstruct() {
  7204. this.n1 = (this.getChild("n1"));
  7205. this.n2 = (this.getChild("n2"));
  7206. }
  7207. }
  7208. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  7209. class UIFuli2 extends UIBase {
  7210. constructor() {
  7211. super();
  7212. this.jiage = 14.99;
  7213. }
  7214. onConstructor() {
  7215. this.ui = ui_UIFuli2.createInstance();
  7216. this.contentPane = this.ui;
  7217. this.isEject = false;
  7218. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  7219. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  7220. }
  7221. show() {
  7222. super.show();
  7223. this.x = (Laya.stage.width - this.width) / 2;
  7224. this.y = (Laya.stage.height - this.height) / 2;
  7225. this.ui.n2.txt_price.text = "$" + this.jiage;
  7226. this.ui.n2.n_zzq_fl2.url = 'res/fuli2.png';
  7227. this.setGlobalFont(this.ui);
  7228. }
  7229. closeSelf() {
  7230. DataMgr.loadUserSpOrderForAd();
  7231. this.hide();
  7232. }
  7233. gotoBuy() {
  7234. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7235. if (userInfo != null) {
  7236. let token = userInfo.token;
  7237. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  7238. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  7239. DataMgr.loadUserSpOrderForAd();
  7240. return;
  7241. }
  7242. else {
  7243. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7244. }
  7245. }
  7246. gotoBuy1() {
  7247. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7248. if (userInfo == null) {
  7249. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7250. return;
  7251. }
  7252. let reqData = xGame.httpMgr.getReqData();
  7253. let pd = JSON.parse(reqData);
  7254. pd.productId = 2;
  7255. reqData = JSON.stringify(pd);
  7256. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7257. try {
  7258. console.log('zh:buySp res = ' + JSON.stringify(res));
  7259. let code = res.code;
  7260. let msg = res.msg;
  7261. if (code == 401) {
  7262. Laya.LocalStorage.removeItem(keyForLoginInfo);
  7263. alert(TIP_MSG_key.loginTimeOut);
  7264. xGame.uiMgr.Show(UIMsg, msg);
  7265. return;
  7266. }
  7267. if (code == 200) {
  7268. xGame.uiMgr.Show(UIMsg, msg);
  7269. DataMgr.loadUserSpOrderForAd();
  7270. DataMgr.getUserZiChanInfo(false);
  7271. this.closeSelf();
  7272. }
  7273. else {
  7274. xGame.uiMgr.Show(UIMsg, msg);
  7275. }
  7276. }
  7277. catch (error) {
  7278. console.log('error=' + error);
  7279. alert(error);
  7280. }
  7281. finally {
  7282. }
  7283. });
  7284. }
  7285. }
  7286. UIFuli2.uiName = "UIFuli2";
  7287. class ui_UIGetAward extends fgui.GComponent {
  7288. static createInstance() {
  7289. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7290. }
  7291. onConstruct() {
  7292. this.n4 = (this.getChild("n4"));
  7293. this.n0 = (this.getChild("n0"));
  7294. this.myList = (this.getChild("myList"));
  7295. this.n1 = (this.getChild("n1"));
  7296. this.eftNode = (this.getChild("eftNode"));
  7297. this.btnNode = (this.getChild("btnNode"));
  7298. this.t0 = this.getTransition("t0");
  7299. }
  7300. }
  7301. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7302. class UIGetAward extends UIBase {
  7303. constructor() {
  7304. super();
  7305. this.showTriple = true;
  7306. }
  7307. onConstructor() {
  7308. this.ui = ui_UIGetAward.createInstance();
  7309. this.contentPane = this.ui;
  7310. this.isEject = false;
  7311. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7312. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7313. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7314. }
  7315. show(arr, showTriple, callback) {
  7316. super.show();
  7317. this.ui.t0.play();
  7318. this.ui.eftNode.visible = true;
  7319. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7320. this.ui.eftNode.visible = false;
  7321. }), 1, 0, 0, 0.9);
  7322. this.awardArr = arr;
  7323. this.showTriple = showTriple;
  7324. this.callback = callback;
  7325. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7326. this.ui.myList.numItems = arr.length;
  7327. xGame.soundMgr.playSound("getaward");
  7328. this.setGlobalFont(this.ui);
  7329. }
  7330. updateSelf(index, obj) {
  7331. let temp = this.awardArr[index];
  7332. let icon = this.getIcon(temp.type);
  7333. let str = icon;
  7334. if (temp.type > 2) {
  7335. str = "s" + icon;
  7336. }
  7337. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7338. obj.myIcon.rotation = 0;
  7339. obj.numTxt.text = temp.num + "";
  7340. obj.numTxt.visible = temp.type > 2 ? false : true;
  7341. obj.nameTxt.text = this.getNameStr(temp.type);
  7342. }
  7343. renderItem(index, obj) {
  7344. this.updateSelf(index, obj);
  7345. }
  7346. tripleGetAward() {
  7347. console.log('zh:qjff_AD_for_uigetAward');
  7348. if (Laya.Browser.onAndroid) {
  7349. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7350. if (!boo) {
  7351. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7352. return;
  7353. }
  7354. }
  7355. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7356. }
  7357. else {
  7358. console.log('zh:AD 失败,直接发放奖励');
  7359. this.qjff_AD_for_uigetAward();
  7360. }
  7361. }
  7362. qjff_AD_for_uigetAward() {
  7363. this.getAward(3);
  7364. }
  7365. normalGetAward() {
  7366. if (PlatMgr.isMisVideo())
  7367. this.tripleGetAward();
  7368. else
  7369. this.getAward();
  7370. }
  7371. getAward(times = 1) {
  7372. this.hide();
  7373. for (let index = 0; index < this.awardArr.length; index++) {
  7374. this.awardArr[index].num *= times;
  7375. }
  7376. this.callback && this.callback(times != 1);
  7377. }
  7378. getIcon(type) {
  7379. switch (type) {
  7380. case Prop.diamond:
  7381. return "ty_zs";
  7382. case Prop.coin:
  7383. return "ty_jb";
  7384. case Prop.gan1:
  7385. return "qg1";
  7386. case Prop.gan2:
  7387. return "qg2";
  7388. case Prop.gan3:
  7389. return "qg3";
  7390. case Prop.gan4:
  7391. return "qg4";
  7392. default:
  7393. break;
  7394. }
  7395. }
  7396. getNameStr(type) {
  7397. switch (type) {
  7398. case Prop.diamond:
  7399. return "Diamond";
  7400. case Prop.coin:
  7401. return "Coins";
  7402. case Prop.gan1:
  7403. case Prop.gan2:
  7404. case Prop.gan3:
  7405. case Prop.gan4:
  7406. return cfgTable.ballrodData[type - 1].name;
  7407. default:
  7408. break;
  7409. }
  7410. }
  7411. }
  7412. UIGetAward.uiName = "UIGetAward";
  7413. class ui_UIRepentProp extends fgui.GComponent {
  7414. static createInstance() {
  7415. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7416. }
  7417. onConstruct() {
  7418. this.c1 = this.getController("c1");
  7419. this.n11 = (this.getChild("n11"));
  7420. this.regretNode = (this.getChild("regretNode"));
  7421. this.helpLineNode = (this.getChild("helpLineNode"));
  7422. this.t0 = this.getTransition("t0");
  7423. }
  7424. }
  7425. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7426. class UIRepentProp extends UIBase {
  7427. constructor() {
  7428. super();
  7429. this.viewType = 0;
  7430. this.regretType = 0;
  7431. }
  7432. onConstructor() {
  7433. this.ui = ui_UIRepentProp.createInstance();
  7434. this.contentPane = this.ui;
  7435. this.isEject = false;
  7436. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7437. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7438. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7439. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7440. }
  7441. show(viewType, regretType, callback) {
  7442. PlatMgr.showInsert(true);
  7443. this.viewType = viewType;
  7444. this.regretType = regretType;
  7445. this.callback = callback;
  7446. super.show();
  7447. this.ui.t0.play();
  7448. this.ui.c1.selectedIndex = this.viewType;
  7449. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7450. if (this.viewType == 0) {
  7451. let guide = DataMgr.getGuideHelpLine();
  7452. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7453. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7454. }
  7455. xGame.common.gameMgr.gamePause = true;
  7456. this.setGlobalFont(this.ui);
  7457. }
  7458. hideSelf() {
  7459. xGame.common.gameMgr.gamePause = false;
  7460. this.callback && this.callback(false);
  7461. this.hide();
  7462. }
  7463. videoRegret() {
  7464. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7465. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7466. }
  7467. else {
  7468. console.log('zh:AD 失败,直接发放奖励');
  7469. this.qjff_AD_for_UIrepentProp_videoRegret();
  7470. }
  7471. }
  7472. qjff_AD_for_UIrepentProp_videoRegret() {
  7473. this.callback && this.callback(true);
  7474. this.hideSelf();
  7475. }
  7476. videoAddHelpLine() {
  7477. let guide = DataMgr.getGuideHelpLine();
  7478. if (guide == 0) {
  7479. this.callback && this.callback(true);
  7480. this.hideSelf();
  7481. DataMgr.setGuideHelpLine();
  7482. xGame.common.gameUI.ui.guideNode.visible = false;
  7483. }
  7484. else {
  7485. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7486. if (Laya.Browser.onAndroid) {
  7487. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7488. if (!boo) {
  7489. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7490. return;
  7491. }
  7492. }
  7493. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7494. }
  7495. else {
  7496. console.log('zh:AD 失败,直接发放奖励');
  7497. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7498. }
  7499. }
  7500. }
  7501. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7502. this.callback && this.callback(true);
  7503. this.hideSelf();
  7504. }
  7505. }
  7506. UIRepentProp.uiName = "UIRepentProp";
  7507. class UIMain extends UIBase {
  7508. constructor() {
  7509. super();
  7510. this.firstEnter = true;
  7511. }
  7512. nativeCallJs(msg) {
  7513. let t = msg;
  7514. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7515. switch (t) {
  7516. case 'qjff_chouJiang':
  7517. let dui = xGame.uiMgr.getUI(UIDraw);
  7518. dui.qjff_chouJiang();
  7519. break;
  7520. case 'qjff_AD_for_uisign':
  7521. let dui2 = xGame.uiMgr.getUI(UISign);
  7522. dui2.qjff_AD_for_uisign();
  7523. break;
  7524. case 'qjff_AD_for_uitry':
  7525. let dui3 = xGame.uiMgr.getUI(UITry);
  7526. dui3.qjff_AD_for_uitry();
  7527. break;
  7528. case 'qjff_AD_for_uipower':
  7529. let dui4 = xGame.uiMgr.getUI(UIPower);
  7530. dui4.qjff_AD_for_uipower();
  7531. break;
  7532. case 'qjff_AD_for_uigetAward':
  7533. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7534. dui5.qjff_AD_for_uigetAward();
  7535. break;
  7536. case 'qjff_AD_for_uiGameEnd':
  7537. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7538. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7539. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7540. break;
  7541. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7542. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7543. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7544. break;
  7545. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7546. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7547. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7548. break;
  7549. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7550. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7551. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7552. break;
  7553. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7554. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7555. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7556. break;
  7557. case 'qjff_AD_for_UIBOX_onOpenBox':
  7558. let dui11 = xGame.uiMgr.getUI(UIBox);
  7559. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7560. break;
  7561. case 'qjff_AD_for_UIAddCoin':
  7562. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7563. dui12.qjff_AD_for_UIAddCoin();
  7564. break;
  7565. case 'app_sign_for_buyProduct_onSuccess':
  7566. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  7567. DataMgr.getUserZiChanInfo(false);
  7568. break;
  7569. case '222axxxxxx':
  7570. let dui15 = xGame.uiMgr.getUI(UISign);
  7571. dui15.qjff_AD_for_uisign();
  7572. break;
  7573. case '333axsxxxxxx':
  7574. let dui16 = xGame.uiMgr.getUI(UISign);
  7575. dui16.qjff_AD_for_uisign();
  7576. break;
  7577. default:
  7578. console.log('zh:未知的方法名字' + t);
  7579. break;
  7580. }
  7581. }
  7582. onConstructor() {
  7583. console.log('zh: UIMain onConstructor');
  7584. this.ui = ui_UIMain.createInstance();
  7585. this.contentPane = this.ui;
  7586. this.isEject = false;
  7587. this.addEvent();
  7588. this.addClickSpine();
  7589. this.settingNode = new SettingNode(this.ui.settingNode);
  7590. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7591. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7592. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7593. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7594. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7595. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7596. let curUse = DataMgr.getCurSecretary();
  7597. this.changeSecretary(curUse);
  7598. this.ui.talkNode.visible = false;
  7599. let guide = DataMgr.getSkillGuide();
  7600. if (xGame.common.isNewDay && guide == 1) {
  7601. xGame.common.isNewDay = false;
  7602. xGame.soundMgr.playSound("s_main01");
  7603. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7604. console.log("zh:播放小秘书每天语音");
  7605. }
  7606. this.onGetUserInfo();
  7607. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7608. DataMgr.getUserZiChanInfo(false);
  7609. }
  7610. this.ui.n83.visible = false;
  7611. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7612. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7613. let ua = d.username;
  7614. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7615. }
  7616. this.c_btn_for_user();
  7617. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7618. }
  7619. Logout() {
  7620. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7621. LocalStorageManager.removeItem(keyForLoginInfo);
  7622. this.freshUser();
  7623. }
  7624. JSBridgeUtils.instance.loginOutForApp();
  7625. this.setUserDefaultNickname();
  7626. DataMgr.setCoin2(4000);
  7627. DataMgr.setDiamond2(0);
  7628. this.setDefaultQiuGanInfo();
  7629. DataMgr.setPlaceBallLevelList("");
  7630. DataMgr.setChallengeMode_overLev(1);
  7631. this.setDefaultSignData();
  7632. }
  7633. setDefaultSignData() {
  7634. DataMgr.setSignData(1);
  7635. DataMgr.setSignTime(new Date().getTime());
  7636. }
  7637. setDefaultQiuGanInfo() {
  7638. DataMgr.setBallRod(0, 1);
  7639. DataMgr.setBallRod(1, 0);
  7640. DataMgr.setBallRod(2, 0);
  7641. DataMgr.setBallRod(3, 0);
  7642. DataMgr.setBallRod(4, 0);
  7643. DataMgr.setBallRod(5, 1);
  7644. }
  7645. setUserDefaultNickname() {
  7646. let defUsername = "player";
  7647. this.ui.headNode.nameTxt.text = defUsername;
  7648. DataMgr.updateUserNickName(defUsername);
  7649. Moyu.updateUserInfo(defUsername);
  7650. }
  7651. gotoLogin() {
  7652. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  7653. xGame.uiMgr.Show(UILogin);
  7654. }
  7655. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  7656. this.Logout();
  7657. }
  7658. }
  7659. gotoRegUser() {
  7660. xGame.uiMgr.Show(UIReg);
  7661. }
  7662. showFuLiSp1() {
  7663. console.log('zh:福利1');
  7664. this.checkForShowFuLi17(1);
  7665. }
  7666. showFuLiSp7() {
  7667. console.log('zh:福利7');
  7668. this.checkForShowFuLi17(7);
  7669. }
  7670. checkForShowFuLi17(spid) {
  7671. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7672. if (userInfo == null) {
  7673. if (spid === 1) {
  7674. xGame.uiMgr.Show(UIFuli1);
  7675. }
  7676. if (spid === 7) {
  7677. xGame.uiMgr.Show(UIFuli2);
  7678. }
  7679. return;
  7680. }
  7681. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  7682. let reqData = xGame.httpMgr.getReqData();
  7683. let pd = JSON.parse(reqData);
  7684. pd.productId = spid;
  7685. reqData = JSON.stringify(pd);
  7686. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  7687. try {
  7688. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  7689. let code = res.code;
  7690. let msg = res.msg;
  7691. if (code == 401) {
  7692. Laya.LocalStorage.removeItem(keyForLoginInfo);
  7693. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7694. return;
  7695. }
  7696. if (code == 200) {
  7697. let isBuyOk = res.data;
  7698. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  7699. if (isBuyOk === false) {
  7700. if (spid === 1) {
  7701. xGame.uiMgr.Show(UIFuli1);
  7702. }
  7703. if (spid === 7) {
  7704. xGame.uiMgr.Show(UIFuli2);
  7705. }
  7706. }
  7707. else {
  7708. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  7709. }
  7710. }
  7711. else {
  7712. xGame.uiMgr.Show(UIMsg, msg);
  7713. }
  7714. }
  7715. catch (error) {
  7716. console.log('error=' + error);
  7717. alert(error);
  7718. }
  7719. finally {
  7720. }
  7721. });
  7722. }
  7723. c_btn_for_user() {
  7724. this.ui.n_dengLu.c1.selectedIndex = 0;
  7725. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7726. this.ui.n_dengLu.c1.selectedIndex = 1;
  7727. }
  7728. else {
  7729. this.ui.n_dengLu.c1.selectedIndex = 0;
  7730. }
  7731. }
  7732. changeSecretary(curUse) {
  7733. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7734. xGame.common.secretary && xGame.common.secretary.dispose();
  7735. this.addSecretarySpine(name);
  7736. }
  7737. addSecretarySpine(name) {
  7738. let spine = new SpineMgr(name, () => {
  7739. this.playSecretaryIdle();
  7740. });
  7741. xGame.common.secretary = spine;
  7742. }
  7743. addClickSpine() {
  7744. let clickSpine = new SpineMgr("dianji", () => {
  7745. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7746. let parent = Laya.stage;
  7747. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7748. clickSpine.play(data, 0, false, parent, (spine) => {
  7749. spine.destroy(true);
  7750. });
  7751. });
  7752. });
  7753. }
  7754. addEvent() {
  7755. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7756. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7757. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  7758. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7759. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7760. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7761. this.addUIClick(this.ui, this.interuptSecretary);
  7762. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7763. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7764. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7765. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7766. this.addUIClick(this.ui.signBtn, this.openSignView);
  7767. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7768. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7769. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7770. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7771. }
  7772. show(showFailWords) {
  7773. super.show();
  7774. DataMgr.loadUserSpOrderForAd();
  7775. this.moneyNode.ui.c1.selectedIndex = 1;
  7776. this.playSecretaryIdle();
  7777. xGame.soundMgr.playMusic("caromhall01", 0);
  7778. Laya.timer.clearAll(this);
  7779. this.playSecretaryRandomSound();
  7780. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7781. if (showFailWords) {
  7782. console.log('zh:uimain.ts ');
  7783. setTimeout(() => {
  7784. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7785. let words = -1;
  7786. if (str == "s_main02") {
  7787. words = 2;
  7788. }
  7789. else {
  7790. words = 3;
  7791. }
  7792. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7793. xGame.soundMgr.playSound(str);
  7794. }, 300);
  7795. }
  7796. this.showGuide();
  7797. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7798. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7799. let guide = DataMgr.getSkillGuide();
  7800. if (guide == 1) {
  7801. let randTime = xGame.common.randomNum(300, 800);
  7802. if (this.firstEnter) {
  7803. console.log("zh: firstEnter");
  7804. this.firstEnter = false;
  7805. randTime += 900;
  7806. }
  7807. else {
  7808. console.log("zh: no firstEnter");
  7809. }
  7810. Laya.timer.once(randTime, this, () => {
  7811. });
  7812. Laya.timer.once(1000, this, () => {
  7813. console.log('zh: 1秒后 showFuLiSp1');
  7814. this.showFuLiSp1();
  7815. });
  7816. Laya.timer.once(10000, this, () => {
  7817. console.log('zh: 10秒后 showFuLiSp1');
  7818. this.showFuLiSp7();
  7819. });
  7820. }
  7821. this.setGlobalFont(this.ui);
  7822. }
  7823. checkActive(show) {
  7824. }
  7825. showGuide() {
  7826. let guide = DataMgr.getSkillGuide();
  7827. this.ui.guideBtn.visible = guide == 0;
  7828. this.ui.enterGuide.visible = false;
  7829. this.ui.secretaryGuide.visible = guide == 0;
  7830. if (guide == 0) {
  7831. console.log("zh:显示引导");
  7832. xGame.soundMgr.playSound("s_guide");
  7833. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7834. }
  7835. else {
  7836. console.log("zh:不需要显示引导");
  7837. }
  7838. }
  7839. ensureSecretary() {
  7840. console.log('zh: ensureSecretary ');
  7841. this.ui.secretaryGuide.visible = false;
  7842. this.ui.enterGuide.visible = true;
  7843. this.ui.wordsNode.t0.play();
  7844. if (DataMgr.getNewUser())
  7845. Moyu.sendDataEvent("gameReady");
  7846. }
  7847. playSecretaryIdle() {
  7848. let parent = this.ui.secretary.displayObject;
  7849. parent.destroyChildren();
  7850. let xx = this.ui.secretary.width / 2;
  7851. let yy = this.ui.secretary.height;
  7852. let scale = xGame.common.getSecretaryScale();
  7853. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7854. xGame.common.secretary.play(data, 0, true, parent);
  7855. }
  7856. startGame(type) {
  7857. if (!this.isReadyForLoadNetSource()) {
  7858. return;
  7859. }
  7860. xGame.common.gameMode = type;
  7861. Moyu.sendDataEvent("PlayGame", { type: type });
  7862. let gm = xGame.common.gameMode;
  7863. console.log('zh:进入游戏gameMode =' + gm);
  7864. switch (gm) {
  7865. case GameMode.classic:
  7866. console.log('zh:进入经典模式111111111');
  7867. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7868. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7869. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  7870. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7871. console.log('zh:判断是否可以玩该模式classic =NO');
  7872. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7873. xGame.uiMgr.Show(UIMsg, tipStr);
  7874. return;
  7875. }
  7876. else {
  7877. console.log('zh:可以玩该模式classic');
  7878. this.beginGame();
  7879. }
  7880. }
  7881. else {
  7882. console.log('zh:不需要判断是否可以玩该classic');
  7883. let challengeTimes = DataMgr.getChallengeTimes();
  7884. if (challengeTimes == 0) {
  7885. xGame.uiMgr.Show(UIInvitation);
  7886. }
  7887. else {
  7888. this.beginGame();
  7889. }
  7890. }
  7891. break;
  7892. case GameMode.bigMove:
  7893. console.info('zh:bigMove check 大招');
  7894. let guide = DataMgr.getSkillGuide();
  7895. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7896. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7897. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7898. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7899. console.log('zh:提示不可以玩');
  7900. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7901. xGame.uiMgr.Show(UIMsg, tipStr);
  7902. return;
  7903. }
  7904. else {
  7905. console.log('zh:可以玩该模式 bigMove');
  7906. this.beginGame();
  7907. if (DataMgr.getNewUser())
  7908. Moyu.sendDataEvent("gameStart0");
  7909. }
  7910. }
  7911. else {
  7912. this.beginGame();
  7913. if (DataMgr.getNewUser())
  7914. Moyu.sendDataEvent("gameStart0");
  7915. }
  7916. break;
  7917. default:
  7918. console.error('zh:未知错误!!!!');
  7919. break;
  7920. }
  7921. }
  7922. beginGame(isNice = false) {
  7923. console.log('zh:beginGame ');
  7924. let guide = DataMgr.getSkillGuide();
  7925. if (guide == 1) {
  7926. console.log('zh:非新手引导,showInternAd ');
  7927. JSBridgeUtils.instance.showInternAd('beginGame');
  7928. }
  7929. else {
  7930. console.log('zh:新手引导,不显示AD ');
  7931. }
  7932. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  7933. console.log('zh:beginGame 1');
  7934. if (xGame.common.gameMode == GameMode.classic) {
  7935. console.log('zh:beginGame 2');
  7936. if (isNice) {
  7937. console.log('zh:进入巅峰赛');
  7938. this.enterClassic();
  7939. }
  7940. else {
  7941. console.log('zh:beginGame 3-1');
  7942. xGame.uiMgr.Show(UIModeSelection, () => {
  7943. console.log('zh:beginGame 3-2');
  7944. this.enterClassic();
  7945. });
  7946. }
  7947. }
  7948. else if (xGame.common.gameMode == GameMode.bigMove) {
  7949. console.log('zh:beginGame 5');
  7950. this.ui.enterGuide.visible = false;
  7951. xGame.uiMgr.Show(UISkill);
  7952. }
  7953. }
  7954. enterClassic() {
  7955. console.log('zh:beginGame 7');
  7956. xGame.uiMgr.Show(UIGame);
  7957. xGame.uiMgr.Show(UIMatching, () => {
  7958. if (!this.isHide)
  7959. this.hide();
  7960. xGame.common.gameUI.ui.alpha = 1;
  7961. console.log('zh:beginGame 8');
  7962. xGame.common.gameUI.startGame();
  7963. xGame.uiMgr.Hide(UIGameEnd);
  7964. });
  7965. }
  7966. start_debug_for_moni_payOk() {
  7967. console.log('zh:start_debug_for_moni_payOk');
  7968. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7969. if (userInfo != null) {
  7970. let token = userInfo.token;
  7971. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7972. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  7973. alert('模拟支付OK');
  7974. return;
  7975. }
  7976. else {
  7977. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7978. }
  7979. }
  7980. startGlobal() {
  7981. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7982. }
  7983. startWeekly() {
  7984. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7985. }
  7986. zhouSaiMonth() {
  7987. console.log('zh: zhouSaiMonth 被调用');
  7988. }
  7989. isReadyForLoadNetSource() {
  7990. let reqCount = xGame.cfgMgr.httpReqCount;
  7991. let ok = xGame.cfgMgr.httpReqOkCount;
  7992. if (reqCount > ok) {
  7993. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7994. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7995. Laya.timer.once(5000, this, () => {
  7996. let retryCount = 0;
  7997. const maxRetries = 3;
  7998. const tryFetchConfig = () => {
  7999. try {
  8000. xGame.cfgMgr.getConfigFromServer();
  8001. }
  8002. catch (error) {
  8003. if (retryCount < maxRetries) {
  8004. retryCount++;
  8005. console.log(`🔄 第${retryCount}次重试获取配置...`);
  8006. Laya.timer.once(5000, this, tryFetchConfig);
  8007. }
  8008. else {
  8009. console.error("❌ 达到最大重试次数,配置获取失败");
  8010. }
  8011. }
  8012. };
  8013. tryFetchConfig();
  8014. });
  8015. return false;
  8016. }
  8017. return true;
  8018. }
  8019. startPlaceBall() {
  8020. if (!this.isReadyForLoadNetSource()) {
  8021. return;
  8022. }
  8023. xGame.uiMgr.Show(UILevelDisplay);
  8024. }
  8025. hide() {
  8026. console.log('zh:uimain hide ...');
  8027. super.hide();
  8028. xGame.common.stopGirlPop(this.ui.talkNode);
  8029. }
  8030. onGetUserInfo(force = false) {
  8031. if (Moyu.isWx) {
  8032. let info = Moyu.getSystemInfo();
  8033. if (info)
  8034. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  8035. }
  8036. else {
  8037. Moyu.initUser(this, this.freshUser, force);
  8038. }
  8039. this.freshUser();
  8040. console.log('zh:5秒后更新用户信息');
  8041. setTimeout(() => {
  8042. DataMgr.getUserZiChanInfo(true);
  8043. }, 5000);
  8044. }
  8045. event_login_in() {
  8046. console.log("zh:event_login_in被触发");
  8047. this.freshUser();
  8048. }
  8049. freshUser() {
  8050. let user = Moyu.getUserInfo();
  8051. if (!user.isAuth) {
  8052. user.headIcon = 'res/ty_touxiang.png';
  8053. }
  8054. else {
  8055. DataMgr.upRankData();
  8056. }
  8057. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  8058. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  8059. let keyStr = keyForLoginInfo;
  8060. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8061. const d = LocalStorageManager.getItem(keyStr);
  8062. let ua = d.username;
  8063. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  8064. }
  8065. else {
  8066. }
  8067. this.c_btn_for_user();
  8068. }
  8069. interuptSecretary() {
  8070. Laya.timer.clearAll(this);
  8071. this.playSecretaryRandomSound();
  8072. }
  8073. playSecretaryRandomSound() {
  8074. if (this.isHide)
  8075. return;
  8076. let time = xGame.common.randomNum(45000, 60000);
  8077. Laya.timer.once(time, this, () => {
  8078. if (this.isHide)
  8079. return;
  8080. let index = xGame.common.randomNum(4, 7);
  8081. xGame.soundMgr.playSound("s_main0" + index);
  8082. let words = 1;
  8083. switch (index) {
  8084. case 4:
  8085. words = 5;
  8086. break;
  8087. case 5:
  8088. words = 3;
  8089. break;
  8090. case 6:
  8091. words = 6;
  8092. break;
  8093. case 7:
  8094. words = 7;
  8095. break;
  8096. default:
  8097. break;
  8098. }
  8099. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8100. this.playSecretaryRandomSound();
  8101. });
  8102. }
  8103. openSecretaryView() {
  8104. xGame.uiMgr.Show(UISecretary);
  8105. Moyu.sendDataEvent("secretary");
  8106. }
  8107. openShopView() {
  8108. xGame.uiMgr.Show(UIShop, 1);
  8109. }
  8110. openShopView0() {
  8111. xGame.uiMgr.Show(UIShop, 0);
  8112. }
  8113. openSignView() {
  8114. xGame.uiMgr.Show(UISign);
  8115. }
  8116. openDrawView() {
  8117. xGame.uiMgr.Show(UIDraw);
  8118. }
  8119. openRanking() {
  8120. console.log('zh:phb openRanking');
  8121. xGame.uiMgr.Show(UIRanking);
  8122. Moyu.sendDataEvent("rankingList");
  8123. }
  8124. }
  8125. UIMain.uiName = "UIMain";
  8126. class UIGameEnd extends UIBase {
  8127. constructor() {
  8128. super();
  8129. this.success = false;
  8130. this.awardCoinNum = 1000;
  8131. this.awardDiamondNum = 10;
  8132. }
  8133. onConstructor() {
  8134. this.ui = ui_UIGameEnd.createInstance();
  8135. this.contentPane = this.ui;
  8136. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8137. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8138. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8139. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8140. this.ui.talkNode.visible = false;
  8141. if (Moyu.isKs)
  8142. this.ui.closeNode.closeBtn.x += 100;
  8143. }
  8144. updateType() {
  8145. switch (xGame.common.gameMode) {
  8146. case GameMode.classic:
  8147. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8148. this.ui.coinNode.visible = this.success;
  8149. if (!this.success) {
  8150. Laya.timer.once(500, this, () => {
  8151. xGame.uiMgr.Show(UIAddCoin);
  8152. });
  8153. }
  8154. else {
  8155. this.logEventForClassic_win();
  8156. }
  8157. this.logEventForClassic_complete();
  8158. this.ui.isGetAward.visible = false;
  8159. this.ui.leftBtn.c1.selectedIndex = 3;
  8160. this.ui.rightBtn.c1.selectedIndex = 0;
  8161. this.moneyNode.ui.c1.selectedIndex = 1;
  8162. break;
  8163. case GameMode.bigMove:
  8164. console.log('zh:招法模式 aaaaaa bigMove');
  8165. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8166. this.ui.coinNode.visible = this.success;
  8167. if (xGame.common.gameMode == GameMode.bigMove) {
  8168. if (this.success) {
  8169. DataMgr.setSkillSuccessTimes(1, true);
  8170. DataMgr.setSkillAccTimes(1);
  8171. }
  8172. else {
  8173. DataMgr.setSkillSuccessTimes(0, false);
  8174. }
  8175. }
  8176. this.logEventForRod_complete_N();
  8177. if (!this.success) {
  8178. Laya.timer.once(500, this, () => {
  8179. xGame.uiMgr.Show(UIAddCoin);
  8180. });
  8181. }
  8182. else {
  8183. this.logEventForRod_win();
  8184. }
  8185. this.ui.isGetAward.visible = false;
  8186. this.ui.leftBtn.c1.selectedIndex = 3;
  8187. this.ui.rightBtn.c1.selectedIndex = 0;
  8188. this.moneyNode.ui.c1.selectedIndex = 1;
  8189. break;
  8190. case GameMode.placeBall:
  8191. this.ui.coinNode.visible = false;
  8192. if (this.success) {
  8193. if (xGame.common.placeBallStarNum == 3) {
  8194. this.ui.c1.selectedIndex = 2;
  8195. }
  8196. else {
  8197. this.ui.c1.selectedIndex = 3;
  8198. }
  8199. let level = xGame.common.placeBallCurLevel;
  8200. if (level > 59) {
  8201. this.logEventForChallenge_level_complete(level);
  8202. }
  8203. else {
  8204. this.logEventForChallenge_level_N(level);
  8205. }
  8206. }
  8207. else {
  8208. this.ui.c1.selectedIndex = 4;
  8209. }
  8210. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8211. if (cfg.type == PlaceBallType.challenge) {
  8212. this.ui.c1.selectedIndex = 2;
  8213. }
  8214. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8215. this.updatePlaceBallBtn();
  8216. this.updatePlaceBallStarNum();
  8217. this.updatePlaceBallAwardState();
  8218. this.moneyNode.ui.c1.selectedIndex = 2;
  8219. this.moneyNode.checkPowerTime();
  8220. this.moneyNode.powerChange();
  8221. DataMgr.upRankData();
  8222. break;
  8223. default:
  8224. break;
  8225. }
  8226. }
  8227. logEventForRod_complete_N() {
  8228. let gfmsIdx = xGame.common.curPlayerSkillType;
  8229. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8230. let gfmc = 'Skyfall Shot';
  8231. if (gfmsIdx == 0) {
  8232. gfmc = 'Skyfall Shot';
  8233. }
  8234. if (gfmsIdx == 1) {
  8235. gfmc = 'Surging break';
  8236. }
  8237. if (gfmsIdx == 2) {
  8238. gfmc = 'Frost Lock';
  8239. }
  8240. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8241. console.log('zh:logEventForRod_complete_N level = ' + level);
  8242. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8243. let jsonStr = {
  8244. "count": 0,
  8245. "name": gfmc
  8246. };
  8247. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8248. const d = LocalStorageManager.getItem(keyStr);
  8249. jsonStr.count = d.count + 1;
  8250. LocalStorageManager.setItem(keyStr, jsonStr);
  8251. }
  8252. else {
  8253. LocalStorageManager.setItem(keyStr, jsonStr);
  8254. }
  8255. const d2 = LocalStorageManager.getItem(keyStr);
  8256. let count = d2.count;
  8257. console.log('zh:logEventForRod_complete_N count = ' + count);
  8258. if (count % 5 == 0) {
  8259. const reqStr = JSON.stringify(jsonStr);
  8260. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8261. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8262. }
  8263. }
  8264. logEventForRod_win() {
  8265. console.log('zh:logEventForRod_win,胜利');
  8266. let gfmsIdx = xGame.common.curPlayerSkillType;
  8267. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8268. let gfmc = 'Skyfall Shot';
  8269. if (gfmsIdx == 0) {
  8270. gfmc = 'Skyfall Shot';
  8271. }
  8272. if (gfmsIdx == 1) {
  8273. gfmc = 'Surging break';
  8274. }
  8275. if (gfmsIdx == 2) {
  8276. gfmc = 'Frost Lock';
  8277. }
  8278. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8279. console.log('zh:logEventForRod_win level = ' + level);
  8280. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8281. let jsonStr = {
  8282. "count": 1,
  8283. "name": gfmc + ' Lev' + level
  8284. };
  8285. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8286. const d = LocalStorageManager.getItem(keyStr);
  8287. jsonStr.count = d.count + 1;
  8288. LocalStorageManager.setItem(keyStr, jsonStr);
  8289. }
  8290. else {
  8291. LocalStorageManager.setItem(keyStr, jsonStr);
  8292. }
  8293. const reqStr = JSON.stringify(jsonStr);
  8294. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8295. }
  8296. logEventForClassic_win() {
  8297. console.log('zh:logEventForClassic_win,胜利');
  8298. let rtype = xGame.common.classicRoomType;
  8299. let msmc = '';
  8300. if (rtype == 1) {
  8301. msmc = 'beginner';
  8302. }
  8303. if (rtype == 2) {
  8304. msmc = 'expert';
  8305. }
  8306. if (rtype == 3) {
  8307. msmc = 'master';
  8308. }
  8309. let keyStr = 'sjmd_classic_win_' + rtype;
  8310. let jsonStr = {
  8311. "difficulty": msmc,
  8312. "classic_count": 1,
  8313. "difficulty_count": 1
  8314. };
  8315. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8316. const d = LocalStorageManager.getItem(keyStr);
  8317. jsonStr.classic_count = d.classic_count + 1;
  8318. jsonStr.difficulty_count = d.difficulty_count + 1;
  8319. LocalStorageManager.setItem(keyStr, jsonStr);
  8320. }
  8321. else {
  8322. LocalStorageManager.setItem(keyStr, jsonStr);
  8323. }
  8324. const reqStr = JSON.stringify(jsonStr);
  8325. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8326. }
  8327. logEventForClassic_complete() {
  8328. console.log('zh:logEventForClassic_complete,胜利');
  8329. let rtype = xGame.common.classicRoomType;
  8330. let msmc = '';
  8331. if (rtype == 1) {
  8332. msmc = 'beginner';
  8333. }
  8334. if (rtype == 2) {
  8335. msmc = 'expert';
  8336. }
  8337. if (rtype == 3) {
  8338. msmc = 'master';
  8339. }
  8340. let keyStr = 'sjmd_classic_complete_' + rtype;
  8341. let jsonStr = {
  8342. "msmc": msmc,
  8343. "count": 0
  8344. };
  8345. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8346. const d = LocalStorageManager.getItem(keyStr);
  8347. jsonStr.count = d.count + 1;
  8348. LocalStorageManager.setItem(keyStr, jsonStr);
  8349. }
  8350. else {
  8351. LocalStorageManager.setItem(keyStr, jsonStr);
  8352. }
  8353. if (jsonStr.count % 5 == 0) {
  8354. const reqStr = JSON.stringify(jsonStr);
  8355. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8356. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8357. }
  8358. }
  8359. updatePlaceBallBtn() {
  8360. this.ui.leftBtn.c1.selectedIndex = 5;
  8361. if (this.success) {
  8362. this.ui.rightBtn.c1.selectedIndex = 14;
  8363. }
  8364. else {
  8365. if (xGame.common.placeBallStarNum == 3) {
  8366. this.ui.rightBtn.c1.selectedIndex = 14;
  8367. }
  8368. else {
  8369. this.ui.rightBtn.c1.selectedIndex = 1;
  8370. }
  8371. }
  8372. }
  8373. updatePlaceBallStarNum() {
  8374. let starNum = xGame.common.placeBallStarNum;
  8375. if (starNum == 0)
  8376. this.ui.starNumNode.c1.selectedIndex = 3;
  8377. else {
  8378. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8379. }
  8380. }
  8381. updatePlaceBallAwardState() {
  8382. let level = xGame.common.placeBallCurLevel;
  8383. let starNum = xGame.common.placeBallStarNum;
  8384. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8385. let data = cfgTable.placeballData[level].award;
  8386. let cfg = cfgTable.placeballData[level];
  8387. this.awardDiamondNum = data[1];
  8388. this.awardCoinNum = data[0];
  8389. if (cfg.type == PlaceBallType.challenge) {
  8390. this.awardDiamondNum = 0;
  8391. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8392. }
  8393. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8394. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8395. if (cfg.type == PlaceBallType.challenge) {
  8396. this.ui.awardNode.coinNode.visible = true;
  8397. }
  8398. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8399. this.ui.awardNode.diamondNode.x = 265;
  8400. this.ui.awardNode.coinNode.x = 354;
  8401. }
  8402. else {
  8403. this.ui.awardNode.diamondNode.x = 291;
  8404. this.ui.awardNode.coinNode.x = 291;
  8405. }
  8406. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8407. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8408. if (this.awardCoinNum == 0) {
  8409. this.ui.awardNode.coinNode.numTxt.text = "";
  8410. }
  8411. if (getAward) {
  8412. this.ui.isGetAward.visible = true;
  8413. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8414. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8415. }
  8416. else {
  8417. this.ui.isGetAward.visible = false;
  8418. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8419. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8420. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8421. }
  8422. else {
  8423. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8424. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8425. }
  8426. }
  8427. }
  8428. show(success) {
  8429. super.show();
  8430. xGame.eventMgr.event(RESET_GAME);
  8431. this.success = success;
  8432. Laya.timer.clearAll(this);
  8433. this.playSecretaryAni();
  8434. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8435. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8436. offsetTime = Math.floor(offsetTime / 1000);
  8437. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8438. this.updateType();
  8439. Laya.timer.once(200, this, () => {
  8440. this.addAward(() => {
  8441. this.updateType();
  8442. Laya.timer.once(500, this, () => {
  8443. this.showChallengeLevel();
  8444. });
  8445. });
  8446. });
  8447. if (this.success) {
  8448. JSBridgeUtils.instance.showInternAd('gameend_success');
  8449. console.log('zh:game end 成功');
  8450. xGame.soundMgr.playSound('slots_roll01');
  8451. xGame.soundMgr.playSound("s_win");
  8452. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8453. this.diyGameDataUtilForGameWin();
  8454. this.updateGamePlaceBallData2Server();
  8455. }
  8456. else {
  8457. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8458. console.log('zh:game end失败');
  8459. xGame.soundMgr.playSound('matchwin01');
  8460. xGame.soundMgr.playSound("s_lose");
  8461. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8462. }
  8463. let challengeNum = DataMgr.getChallengeTimes();
  8464. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8465. DataMgr.setChallengeTimes(1);
  8466. }
  8467. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8468. DataMgr.setClassicTimes();
  8469. }
  8470. this.setGlobalFont(this.ui);
  8471. }
  8472. diyGameDataUtilForGameWin() {
  8473. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8474. switch (xGame.common.gameMode) {
  8475. case GameMode.classic:
  8476. console.log('zh:DiyGameDataUtilForGameWin 111');
  8477. case GameMode.bigMove:
  8478. console.log('zh:DiyGameDataUtilForGameWin 222');
  8479. this.restartGame();
  8480. break;
  8481. case GameMode.placeBall:
  8482. console.log('zh:DiyGameDataUtilForGameWin 333');
  8483. var level = xGame.common.placeBallCurLevel;
  8484. console.log('zh:练习模式 联系了多少LEV=' + level);
  8485. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8486. if (level > db_over_lev) {
  8487. DataMgr.setChallengeMode_overLev(level);
  8488. }
  8489. break;
  8490. default:
  8491. console.log('zh:DiyGameDataUtilForGameWin 444');
  8492. break;
  8493. }
  8494. }
  8495. updateGamePlaceBallData2Server() {
  8496. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8497. if (userInfo == null) {
  8498. return;
  8499. }
  8500. let pbdObj = DataMgr.getPlaceBallLevelList();
  8501. let reqData = xGame.httpMgr.getReqData();
  8502. let pd = JSON.parse(reqData);
  8503. pd.placeBallData = JSON.stringify(pbdObj);
  8504. reqData = JSON.stringify(pd);
  8505. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  8506. try {
  8507. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  8508. let code = res.code;
  8509. let msg = res.msg;
  8510. if (code == 401) {
  8511. Laya.LocalStorage.removeItem(keyForLoginInfo);
  8512. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8513. return;
  8514. }
  8515. if (code == 200) {
  8516. let data = res.data;
  8517. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  8518. }
  8519. else {
  8520. xGame.uiMgr.Show(UIMsg, msg);
  8521. }
  8522. }
  8523. catch (error) {
  8524. console.log('error=' + error);
  8525. alert(error);
  8526. }
  8527. finally {
  8528. }
  8529. });
  8530. }
  8531. showChallengeLevel() {
  8532. if (DataMgr.getChallengeTimes() != 0)
  8533. return;
  8534. let skill = DataMgr.getSkillAccTimes();
  8535. let put = DataMgr.getPlaceBallLevelList().length;
  8536. if (skill >= 3 || put >= 5) {
  8537. xGame.uiMgr.Show(UIInvitation);
  8538. this.hide();
  8539. }
  8540. }
  8541. addAward(callback) {
  8542. if (!this.success) {
  8543. callback && callback();
  8544. return;
  8545. }
  8546. switch (xGame.common.gameMode) {
  8547. case GameMode.classic:
  8548. this.awardCoinNum = xGame.common.passAwardCoin;
  8549. this.awardDiamondNum = 0;
  8550. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8551. break;
  8552. case GameMode.bigMove:
  8553. this.awardCoinNum = xGame.common.passAwardCoin;
  8554. this.awardDiamondNum = 0;
  8555. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8556. callback && callback();
  8557. break;
  8558. case GameMode.placeBall:
  8559. let level = xGame.common.placeBallCurLevel;
  8560. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8561. if (xGame.common.placeBallStarNum != 3) {
  8562. callback && callback();
  8563. return;
  8564. }
  8565. else {
  8566. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8567. if (getAward) {
  8568. callback && callback();
  8569. return;
  8570. }
  8571. }
  8572. let cfg = cfgTable.placeballData[level];
  8573. let data = cfgTable.placeballData[level].award;
  8574. this.awardCoinNum = data[0];
  8575. this.awardDiamondNum = data[1];
  8576. if (cfg.type == PlaceBallType.challenge) {
  8577. this.awardDiamondNum = 0;
  8578. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8579. }
  8580. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8581. let diamondAward;
  8582. if (this.awardDiamondNum > 0) {
  8583. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8584. xGame.common.getAward([diamondAward, coinAward], callback);
  8585. }
  8586. else {
  8587. xGame.common.getAward([coinAward], callback);
  8588. }
  8589. if (cfg.type == PlaceBallType.normal) {
  8590. DataMgr.setPlaceBallAward(level);
  8591. }
  8592. break;
  8593. default:
  8594. break;
  8595. }
  8596. }
  8597. playSecretaryAni_old() {
  8598. let parent = this.ui.secretary.displayObject;
  8599. parent.destroyChildren();
  8600. let xx = this.ui.secretary.width / 2;
  8601. let yy = this.ui.secretary.height;
  8602. let scale = xGame.common.getSecretaryScale();
  8603. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8604. if (this.success) {
  8605. let rand = Math.random() <= 0.5 ? 2 : 3;
  8606. xGame.common.secretary.play(data, rand, false, parent, () => {
  8607. xGame.common.secretary.play(data, 1, true, parent);
  8608. });
  8609. }
  8610. else {
  8611. xGame.common.secretary.play(data, 0, true, parent);
  8612. }
  8613. }
  8614. playSecretaryAni() {
  8615. let parent = this.ui.secretary.displayObject;
  8616. parent.destroyChildren();
  8617. let xx = this.ui.secretary.width / 2;
  8618. let yy = this.ui.secretary.height;
  8619. let scale = xGame.common.getSecretaryScale();
  8620. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8621. if (this.success) {
  8622. let rand = 0;
  8623. xGame.common.secretary.play(data, 0, true, parent);
  8624. }
  8625. else {
  8626. xGame.common.secretary.play(data, 0, true, parent);
  8627. }
  8628. }
  8629. restartGame() {
  8630. switch (xGame.common.gameMode) {
  8631. case GameMode.classic:
  8632. xGame.eventMgr.event(RESTART_GAME);
  8633. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8634. break;
  8635. case GameMode.bigMove:
  8636. this.hide();
  8637. xGame.eventMgr.event(RESTART_GAME);
  8638. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8639. break;
  8640. default:
  8641. break;
  8642. }
  8643. }
  8644. hide() {
  8645. super.hide();
  8646. xGame.common.stopGirlPop(this.ui.talkNode);
  8647. PlatMgr.showBanner(false);
  8648. }
  8649. returnHome() {
  8650. this.hide();
  8651. let showFailWords = !this.success;
  8652. xGame.uiMgr.Show(UIMain, showFailWords);
  8653. }
  8654. clickLeftBtn() {
  8655. switch (xGame.common.gameMode) {
  8656. case GameMode.classic:
  8657. case GameMode.bigMove:
  8658. this.returnHome();
  8659. break;
  8660. case GameMode.placeBall:
  8661. let level = xGame.common.placeBallCurLevel;
  8662. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8663. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8664. break;
  8665. default:
  8666. break;
  8667. }
  8668. }
  8669. powerStartPlaceBallLevel(level, btn) {
  8670. if (DataMgr.powerEnough()) {
  8671. btn.touchable = false;
  8672. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8673. btn.touchable = true;
  8674. DataMgr.setPower(-1);
  8675. xGame.eventMgr.event(POWER_TIME);
  8676. this.startPlaceBallLevel(level);
  8677. this.logEventForChallenge_level_start(level);
  8678. }));
  8679. }
  8680. else {
  8681. xGame.uiMgr.Show(UIPower, 0);
  8682. }
  8683. }
  8684. clickRightBtn() {
  8685. switch (xGame.common.gameMode) {
  8686. case GameMode.classic:
  8687. console.log('zh:clickRightBtn 111');
  8688. case GameMode.bigMove:
  8689. console.log('zh:clickRightBtn 222');
  8690. this.restartGame();
  8691. break;
  8692. case GameMode.placeBall:
  8693. console.log('zh:clickRightBtn 333');
  8694. let level = xGame.common.placeBallCurLevel;
  8695. let data = DataMgr.getPlaceBallLevel(level);
  8696. let curPss = data.play && !data.isCur;
  8697. if (curPss) {
  8698. console.log('zh:clickRightBtn 333-111');
  8699. console.log('zh:当前LV=' + level);
  8700. if (level == 60) {
  8701. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8702. Laya.timer.once(3000, this, () => {
  8703. this.returnHome();
  8704. });
  8705. }
  8706. else {
  8707. let lev = level + 1;
  8708. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8709. }
  8710. }
  8711. else {
  8712. console.log('zh:clickRightBtn 333-000');
  8713. Moyu.sendDataEvent("placeBallNextLevel");
  8714. console.log('zh:qjff_AD_for_uiGameEnd');
  8715. if (Laya.Browser.onAndroid) {
  8716. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8717. if (!boo) {
  8718. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8719. return;
  8720. }
  8721. }
  8722. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8723. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8724. }
  8725. else {
  8726. console.log('zh:AD 失败,直接发放奖励');
  8727. this.qjff_AD_for_uiGameEnd(level);
  8728. }
  8729. }
  8730. break;
  8731. default:
  8732. console.log('zh:clickRightBtn 444');
  8733. break;
  8734. }
  8735. }
  8736. logEventForChallenge_level_start(level) {
  8737. let keyStr = 'sjmd_challenge_level_start';
  8738. let jsonStr = {
  8739. "count": 0,
  8740. "gold_balance ": DataMgr.getCoin(),
  8741. "level": level,
  8742. "diamond_balance ": DataMgr.getDiamond()
  8743. };
  8744. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8745. const d = LocalStorageManager.getItem(keyStr);
  8746. if (level > d.level) {
  8747. jsonStr.count = d.count + 1;
  8748. LocalStorageManager.setItem(keyStr, jsonStr);
  8749. }
  8750. else {
  8751. }
  8752. }
  8753. else {
  8754. LocalStorageManager.setItem(keyStr, jsonStr);
  8755. }
  8756. const reqStr = JSON.stringify(jsonStr);
  8757. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8758. }
  8759. qjff_AD_for_uiGameEnd(level) {
  8760. DataMgr.setPlaceBallLevel(level, 1);
  8761. this.startPlaceBallLevel(level + 1);
  8762. }
  8763. startPlaceBallLevel(level) {
  8764. xGame.common.gameMode = GameMode.placeBall;
  8765. xGame.common.placeBallCurLevel = level;
  8766. xGame.uiMgr.Show(UIGame);
  8767. this.hide();
  8768. }
  8769. logEventForChallenge_level_complete(level) {
  8770. let keyStr = 'sjmd_challenge_level_complete';
  8771. let jsonStr = {
  8772. "count": 1,
  8773. "gold_balance ": DataMgr.getCoin(),
  8774. "level": level,
  8775. "diamond_balance ": DataMgr.getDiamond()
  8776. };
  8777. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8778. const d = LocalStorageManager.getItem(keyStr);
  8779. jsonStr.count = d.count + 1;
  8780. LocalStorageManager.setItem(keyStr, jsonStr);
  8781. }
  8782. else {
  8783. LocalStorageManager.setItem(keyStr, jsonStr);
  8784. }
  8785. const reqStr = JSON.stringify(jsonStr);
  8786. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8787. }
  8788. logEventForChallenge_level_N(level) {
  8789. console.log('zh:logEventForChallenge_level_N ' + level);
  8790. let keyStr = 'sjmd_challenge_level_N';
  8791. if (LocalStorageManager.hasKey(keyStr)) {
  8792. let lev = LocalStorageManager.getItem(keyStr);
  8793. if (level > lev) {
  8794. LocalStorageManager.setItem(keyStr, level);
  8795. }
  8796. if ((level) % 5 == 0) {
  8797. console.log('zh:每5关上报1次');
  8798. let sjmc = 'challenge_level_' + level;
  8799. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8800. let sjmcForFirebase = 'challenge_level_' + level;
  8801. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8802. }
  8803. else {
  8804. console.log('zh:5 no 上报');
  8805. }
  8806. }
  8807. else {
  8808. LocalStorageManager.setItem(keyStr, level);
  8809. }
  8810. }
  8811. }
  8812. UIGameEnd.uiName = "UIGameEnd";
  8813. class ui_UIVideoShare extends fgui.GComponent {
  8814. static createInstance() {
  8815. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8816. }
  8817. onConstruct() {
  8818. this.n10 = (this.getChild("n10"));
  8819. this.myNode = (this.getChild("myNode"));
  8820. this.t0 = this.getTransition("t0");
  8821. }
  8822. }
  8823. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8824. class UIVideoShare extends UIBase {
  8825. constructor() {
  8826. super();
  8827. this.success = false;
  8828. this.awardNum = 0;
  8829. this.isShared = true;
  8830. }
  8831. onConstructor() {
  8832. this.ui = ui_UIVideoShare.createInstance();
  8833. this.contentPane = this.ui;
  8834. this.isEject = false;
  8835. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8836. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8837. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8838. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8839. }
  8840. show(success) {
  8841. super.show();
  8842. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8843. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8844. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8845. this.success = success;
  8846. let time = xGame.common.randomNum(600, 1500);
  8847. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8848. if (success)
  8849. xGame.soundMgr.playSound("applause");
  8850. this.ui.t0.play();
  8851. this.checkShareState();
  8852. let times = DataMgr.getDailyVideoShareTimes();
  8853. this.awardNum = times == 0 ? 2000 : 200;
  8854. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8855. this.setGlobalFont(this.ui);
  8856. }
  8857. checkShareState() {
  8858. if (PlatMgr.forceShare == 0) {
  8859. this.ui.myNode.closeBtn.visible = true;
  8860. this.ui.myNode.tipsNode.visible = false;
  8861. this.ui.myNode.closeBtn.x = 90;
  8862. this.ui.myNode.shareBtn.x = 342;
  8863. }
  8864. else if (PlatMgr.forceShare == 1) {
  8865. this.ui.myNode.closeBtn.visible = false;
  8866. this.ui.myNode.tipsNode.visible = true;
  8867. this.ui.myNode.shareBtn.x = 218;
  8868. this.isShared = true;
  8869. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8870. }
  8871. }
  8872. checkForceShare() {
  8873. this.isShared = !this.isShared;
  8874. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8875. }
  8876. videoShare() {
  8877. if (PlatMgr.forceShare == 1) {
  8878. if (this.isShared) {
  8879. this.shareGame();
  8880. }
  8881. else {
  8882. this.hideSelf();
  8883. }
  8884. }
  8885. else {
  8886. this.shareGame();
  8887. }
  8888. }
  8889. shareGame() {
  8890. Moyu.sendDataEvent("VideoShare");
  8891. if (Moyu.canShare() > 100) {
  8892. Moyu.shareGame((success) => {
  8893. if (success) {
  8894. DataMgr.setDailyVideoShareTimes(1);
  8895. DataMgr.setCoin(this.awardNum);
  8896. }
  8897. this.hideSelf();
  8898. }, this);
  8899. }
  8900. else {
  8901. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8902. this.hideSelf();
  8903. }
  8904. }
  8905. hideSelf() {
  8906. this.hide();
  8907. xGame.uiMgr.Show(UIGameEnd, this.success);
  8908. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8909. xGame.common.screenImg.destroy();
  8910. xGame.common.screenImg = null;
  8911. }
  8912. }
  8913. }
  8914. UIVideoShare.uiName = "UIVideoShare";
  8915. class ui_UITips extends fgui.GComponent {
  8916. static createInstance() {
  8917. return (fgui.UIPackage.createObject("game", "UITips"));
  8918. }
  8919. onConstruct() {
  8920. this.n0 = (this.getChild("n0"));
  8921. this.myNode = (this.getChild("myNode"));
  8922. this.t0 = this.getTransition("t0");
  8923. }
  8924. }
  8925. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8926. class UITips extends UIBase {
  8927. constructor() {
  8928. super();
  8929. this.type = 0;
  8930. }
  8931. onConstructor() {
  8932. this.ui = ui_UITips.createInstance();
  8933. this.contentPane = this.ui;
  8934. this.isEject = false;
  8935. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8936. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8937. }
  8938. show(tipsTxt, womanTxt, type) {
  8939. super.show();
  8940. this.ui.t0.play();
  8941. this.ui.myNode.tipsTxt.text = tipsTxt;
  8942. this.ui.myNode.womanTxt.text = womanTxt;
  8943. PlatMgr.showInsert(true);
  8944. this.ui.myNode.c1.selectedIndex = type;
  8945. this.type = type;
  8946. switch (this.type) {
  8947. case TipsType.exitGame:
  8948. xGame.common.gameMgr.gamePause = true;
  8949. break;
  8950. case TipsType.foul:
  8951. Laya.timer.once(200, this, () => {
  8952. xGame.common.gameMgr.gamePause = true;
  8953. });
  8954. break;
  8955. default:
  8956. break;
  8957. }
  8958. this.setGlobalFont(this.ui);
  8959. }
  8960. clickLeftBtn() {
  8961. this.hide();
  8962. xGame.common.gameMgr.gamePause = false;
  8963. switch (this.type) {
  8964. case TipsType.exitGame:
  8965. break;
  8966. case TipsType.foul:
  8967. break;
  8968. default:
  8969. break;
  8970. }
  8971. }
  8972. clickRightBtn() {
  8973. this.hide();
  8974. switch (this.type) {
  8975. case TipsType.exitGame:
  8976. xGame.eventMgr.event(RESET_GAME);
  8977. xGame.uiMgr.Show(UIMain);
  8978. Moyu.recordEnd(this, null);
  8979. xGame.common.longHelpLine = false;
  8980. break;
  8981. case TipsType.foul:
  8982. xGame.common.gameMgr.gamePause = false;
  8983. Laya.timer.clearAll(this);
  8984. break;
  8985. default:
  8986. break;
  8987. }
  8988. }
  8989. }
  8990. UITips.uiName = "UITips";
  8991. class GameMgr {
  8992. constructor() {
  8993. this.selfCamp = "";
  8994. this.selfFoulNum = 0;
  8995. this.selfBallArr = [];
  8996. this.selfTimer = 0;
  8997. this.selfScore = 0;
  8998. this.aiCamp = "";
  8999. this.aiFoulNum = 0;
  9000. this.aiBallArr = [];
  9001. this.aiTimer = 0;
  9002. this.aiScore = 0;
  9003. this.aiSkillLevelNum = 1;
  9004. this.targertScore = 0;
  9005. this.setTime = 30;
  9006. this.selfTurnRate = 0.5;
  9007. this.accTime = 0;
  9008. this.curFoul = "";
  9009. this.maxFoulTimes = 3;
  9010. this.isFirstInGame = true;
  9011. this.firstColliObj = null;
  9012. this.inHoleBalls = [];
  9013. this.blackNum = 8;
  9014. this.success = false;
  9015. this.holePosList = [];
  9016. this.posObj = {};
  9017. this._selfTurn = false;
  9018. this.lastRootBallPos = new Laya.Vector2(311, 430);
  9019. this.ensureBallType = false;
  9020. this.isOpenBall = true;
  9021. this.finishOneShoot = true;
  9022. this.isEnd = false;
  9023. this.isChangeTurn = false;
  9024. this.isInterrupt = false;
  9025. this.aiPlayedBreakArmy = false;
  9026. this.isTouchedBall = false;
  9027. this.finishBalls = 0;
  9028. this.needBalls = 0;
  9029. this.allBallNum = 0;
  9030. this.placeBallPosData = {};
  9031. this.curHP = 0;
  9032. this.showLongView = false;
  9033. this.firstShoot = true;
  9034. this._gamePause = false;
  9035. this.trunCount = 0;
  9036. this.isBlackInHole = false;
  9037. this.isEnter = true;
  9038. xGame.eventMgr.offAll(ALL_BALL_STOP);
  9039. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  9040. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  9041. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  9042. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  9043. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  9044. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9045. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9046. }
  9047. get gamePause() {
  9048. return this._gamePause;
  9049. }
  9050. set gamePause(v) {
  9051. if (v) {
  9052. Laya.physicsTimer.pause();
  9053. }
  9054. else {
  9055. Laya.physicsTimer.resume();
  9056. }
  9057. this._gamePause = v;
  9058. }
  9059. get selfTurn() {
  9060. return this._selfTurn;
  9061. }
  9062. set selfTurn(val) {
  9063. this.trunCount++;
  9064. this._selfTurn = val;
  9065. if (val) {
  9066. xGame.common.d2World.d2Gan.ui.self.visible = true;
  9067. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9068. }
  9069. else {
  9070. xGame.common.d2World.d2Gan.ui.self.visible = false;
  9071. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  9072. if (this.trunCount > 1)
  9073. PlatMgr.openBox();
  9074. }
  9075. }
  9076. resetGame() {
  9077. this.inHoleBalls = [];
  9078. this.isFirstInGame = true;
  9079. this.firstColliObj = null;
  9080. this.aiCamp = "";
  9081. this.selfCamp = "";
  9082. this.aiFoulNum = 0;
  9083. this.selfFoulNum = 0;
  9084. this.selfBallArr = [];
  9085. this.aiBallArr = [];
  9086. this.gamePause = false;
  9087. this.ensureBallType = false;
  9088. this.isInterrupt = false;
  9089. this.updateLeftBall();
  9090. this.clearTime();
  9091. this.aiPlayedBreakArmy = false;
  9092. this.isBlackInHole = false;
  9093. this.placeBallPosData = {};
  9094. if (xGame.common.d3World.knifeRoot) {
  9095. xGame.common.d3World.knifeRoot.destroyChildren();
  9096. }
  9097. }
  9098. gameReady() {
  9099. this.trunCount = 0;
  9100. this.firstColliObj = null;
  9101. this.isFirstInGame = true;
  9102. this.selfTurn = Math.random() <= this.selfTurnRate;
  9103. let challengeNum = DataMgr.getChallengeTimes();
  9104. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9105. this.selfTurn = true;
  9106. }
  9107. if (xGame.common.gameMode == GameMode.placeBall)
  9108. this.selfTurn = true;
  9109. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  9110. this.selfTurn = true;
  9111. }
  9112. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  9113. this.checkGuide();
  9114. if (xGame.common.uiRodMethod)
  9115. xGame.common.uiRodMethod.resetRod();
  9116. xGame.common.d2World.getHelpLine();
  9117. this.isOpenBall = true;
  9118. this.isTouchedBall = false;
  9119. xGame.common.aiPlayer.stopRun();
  9120. this.setTime = 30;
  9121. let ui = xGame.common.gameUI.ui;
  9122. switch (xGame.common.gameMode) {
  9123. case GameMode.classic:
  9124. xGame.common.aiPlayer.init();
  9125. this.blackNum = 8;
  9126. this.placeRootBall();
  9127. this.peoplePlay(9, 10);
  9128. ui.wordsBtn.visible = true;
  9129. ui.aiWordsBtn.visible = true;
  9130. xGame.common.talkMgr.changeAIState(true);
  9131. DataMgr.gameData.gameCount++;
  9132. DataMgr.saveGameData();
  9133. break;
  9134. case GameMode.bigMove:
  9135. this.blackNum = -1;
  9136. this.selfScore = 0;
  9137. this.aiScore = 0;
  9138. xGame.common.aiPlayer.init();
  9139. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  9140. this.updateSelfScore();
  9141. this.updateAIScore();
  9142. this.updateTargetSroce();
  9143. this.placeRootBall();
  9144. this.peoplePlay(9, 10);
  9145. ui.wordsBtn.visible = true;
  9146. ui.aiWordsBtn.visible = true;
  9147. xGame.common.talkMgr.changeAIState(true);
  9148. if (DataMgr.getSkillGuide() < 1)
  9149. DataMgr.gameData.gameCount = 0;
  9150. else {
  9151. DataMgr.gameData.gameCount++;
  9152. DataMgr.saveGameData();
  9153. PlatMgr.openTry();
  9154. }
  9155. if (xGame.common.d3World.knifeRoot) {
  9156. xGame.common.d3World.knifeRoot.destroyChildren();
  9157. }
  9158. break;
  9159. case GameMode.placeBall:
  9160. this.blackNum = -1;
  9161. this.selfTurn = true;
  9162. this.setTime = 10000;
  9163. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9164. this.curHP = this.placeBallData.hp;
  9165. if (this.placeBallData.ball == -1)
  9166. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9167. else
  9168. this.needBalls = this.placeBallData.ball;
  9169. console.log("需要的进球数目", this.needBalls);
  9170. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9171. this.finishBalls = 0;
  9172. this.placeBallPosData = {};
  9173. this.updatePlaceBallPos();
  9174. this.updatePlaceBallState();
  9175. this.finishOneShoot = true;
  9176. xGame.common.gameUI.ui.moveNode.visible = false;
  9177. this.isOpenBall = false;
  9178. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9179. ui.wordsBtn.visible = false;
  9180. ui.aiWordsBtn.visible = false;
  9181. xGame.common.talkMgr.changeAIState(false);
  9182. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9183. PlatMgr.openBox();
  9184. });
  9185. break;
  9186. default:
  9187. break;
  9188. }
  9189. this.showLongView = false;
  9190. xGame.common.wordsMgr.comboTimes = 1;
  9191. let guide = DataMgr.getSkillGuide();
  9192. if (guide)
  9193. xGame.eventMgr.event(WAIT_SHOOT);
  9194. xGame.common.upSkillLevel = false;
  9195. xGame.common.gameStartTime = new Date().getTime();
  9196. this.firstShoot = true;
  9197. }
  9198. checkGuide() {
  9199. let guide = DataMgr.getSkillGuide();
  9200. let gameUI = xGame.common.gameUI.ui;
  9201. gameUI.guide1.visible = false;
  9202. gameUI.guide2.visible = false;
  9203. gameUI.guide3.visible = false;
  9204. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9205. this.selfTurn = true;
  9206. }
  9207. else {
  9208. return;
  9209. }
  9210. let oneBall = this.getOneBall();
  9211. gameUI.guide1.visible = true;
  9212. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9213. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9214. }
  9215. getOneBall() {
  9216. let arr = xGame.common.d2World.ballArr;
  9217. for (let index = 0; index < arr.length; index++) {
  9218. if (arr[index].number == 0)
  9219. continue;
  9220. return arr[index];
  9221. }
  9222. }
  9223. updateSelfScore() {
  9224. let ui = xGame.common.gameUI.ui.topNode;
  9225. ui.selfScoreTxt.text = this.selfScore + "";
  9226. }
  9227. updateAIScore() {
  9228. let ui = xGame.common.gameUI.ui.topNode;
  9229. ui.aiScoreTxt.text = this.aiScore + "";
  9230. }
  9231. updateTargetSroce() {
  9232. let ui = xGame.common.gameUI.ui.topNode;
  9233. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9234. }
  9235. updateLeftBall() {
  9236. let topUI = xGame.common.gameUI.ui.topNode;
  9237. topUI.selfBallList.numItems = this.selfBallArr.length;
  9238. topUI.aiBallList.numItems = this.aiBallArr.length;
  9239. }
  9240. ballShoot() {
  9241. this.clearTime();
  9242. this.finishOneShoot = false;
  9243. xGame.common.gameUI.ui.moveNode.visible = false;
  9244. if (xGame.common.gameUI.ui.guideNode.visible) {
  9245. xGame.common.gameUI.ui.guideNode.visible = false;
  9246. }
  9247. if (this.firstShoot) {
  9248. this.firstShoot = false;
  9249. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9250. }
  9251. }
  9252. ensureCamp(number) {
  9253. this.ensureBallType = true;
  9254. this.isOpenBall = false;
  9255. if (xGame.common.gameMode != GameMode.classic)
  9256. return;
  9257. let full = [1, 2, 3, 4, 5, 6, 7];
  9258. let flower = [9, 10, 11, 12, 13, 14, 15];
  9259. let sayWords = "";
  9260. if (this.selfTurn) {
  9261. if (number <= 7) {
  9262. this.selfCamp = ballCamp.full;
  9263. this.selfBallArr = full;
  9264. this.aiCamp = ballCamp.flower;
  9265. this.aiBallArr = flower;
  9266. sayWords = cfgTable.wordsData[3].msg;
  9267. }
  9268. else {
  9269. this.selfCamp = ballCamp.flower;
  9270. this.selfBallArr = flower;
  9271. this.aiCamp = ballCamp.full;
  9272. this.aiBallArr = full;
  9273. sayWords = cfgTable.wordsData[4].msg;
  9274. }
  9275. }
  9276. else {
  9277. if (number <= 7) {
  9278. this.selfCamp = ballCamp.flower;
  9279. this.selfBallArr = flower;
  9280. this.aiCamp = ballCamp.full;
  9281. this.aiBallArr = full;
  9282. sayWords = cfgTable.wordsData[2].msg;
  9283. }
  9284. else {
  9285. this.selfCamp = ballCamp.full;
  9286. this.selfBallArr = full;
  9287. this.aiCamp = ballCamp.flower;
  9288. this.aiBallArr = flower;
  9289. sayWords = cfgTable.wordsData[1].msg;
  9290. }
  9291. }
  9292. this.updateLeftBall();
  9293. xGame.uiMgr.Show(UIMsg, sayWords);
  9294. }
  9295. updatePlaceBallState() {
  9296. let ui = xGame.common.gameUI.ui;
  9297. switch (this.placeBallData.type) {
  9298. case PlaceBallType.normal:
  9299. let normal = ui.placeNormalNode;
  9300. normal.hpTxt.text = this.curHP + "";
  9301. this.updatePlaceBallStar(normal);
  9302. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9303. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9304. break;
  9305. case PlaceBallType.challenge:
  9306. let challenge = ui.placeChallengeNode;
  9307. challenge.hpTxt.text = "Shots:" + this.curHP;
  9308. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9309. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9310. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9311. break;
  9312. default:
  9313. break;
  9314. }
  9315. }
  9316. playSubHpAni() {
  9317. let ui = xGame.common.gameUI.ui;
  9318. switch (this.placeBallData.type) {
  9319. case PlaceBallType.normal:
  9320. let normal = ui.placeNormalNode;
  9321. normal.hpTxt.visible = false;
  9322. normal.starAni.c1.selectedIndex = 1;
  9323. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9324. normal.hpTxt.visible = true;
  9325. normal.starAni.c1.selectedIndex = 0;
  9326. }));
  9327. break;
  9328. default:
  9329. break;
  9330. }
  9331. }
  9332. getEndStarNum() {
  9333. let num;
  9334. let level = xGame.common.placeBallCurLevel;
  9335. if (this.curHP == this.placeBallData.hp) {
  9336. num = 3;
  9337. }
  9338. else if (this.curHP <= 1) {
  9339. num = 1;
  9340. }
  9341. else {
  9342. num = 2;
  9343. }
  9344. if (!this.success) {
  9345. num = 0;
  9346. }
  9347. else {
  9348. DataMgr.setPlaceBallLevel(level, num);
  9349. }
  9350. let myType = cfgTable.placeballData[level].type;
  9351. if (this.success && myType == 1) {
  9352. num = 3;
  9353. }
  9354. xGame.common.placeBallStarNum = num;
  9355. }
  9356. updatePlaceBallStar(node) {
  9357. let star = 0;
  9358. if (this.curHP == this.placeBallData.hp) {
  9359. star = 3;
  9360. }
  9361. else if (this.curHP >= 2) {
  9362. star = 2;
  9363. }
  9364. else if (this.curHP == 1) {
  9365. star = 1;
  9366. }
  9367. else {
  9368. star = 0;
  9369. }
  9370. let temp;
  9371. for (let index = 1; index <= 3; index++) {
  9372. temp = node["star" + index];
  9373. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9374. }
  9375. node.myProgress.value = (star / 3) * 100;
  9376. }
  9377. openRegretView(isFoul, GoalNum, challenge = false) {
  9378. let regretType = -1;
  9379. if (isFoul) {
  9380. regretType = 1;
  9381. }
  9382. else {
  9383. if (GoalNum <= 0) {
  9384. regretType = 0;
  9385. }
  9386. }
  9387. if (challenge) {
  9388. regretType = 1;
  9389. }
  9390. if (regretType != -1) {
  9391. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9392. if (success) {
  9393. this.curHP++;
  9394. this.updatePlaceBallState();
  9395. this.setPlaceBallAllPos();
  9396. xGame.common.gameUI.ui.moveNode.visible = false;
  9397. }
  9398. else {
  9399. if (this.curHP <= 0) {
  9400. this.success = false;
  9401. this.gameEnd();
  9402. }
  9403. this.playSubHpAni();
  9404. }
  9405. this.updatePlaceBallState();
  9406. this.updatePlaceBallPos();
  9407. });
  9408. }
  9409. }
  9410. setPlaceBallAllPos() {
  9411. let allBall = xGame.common.d2World.ballArr;
  9412. let cfgArr = this.placeBallPosData;
  9413. let temp;
  9414. let obj;
  9415. for (let index = 0; index < allBall.length; index++) {
  9416. temp = allBall[index];
  9417. if (temp.destroyed)
  9418. continue;
  9419. obj = cfgArr[temp.myUNID];
  9420. if (obj && obj.src && !obj.src.destroyed) {
  9421. temp.gameObj.x = obj.posX;
  9422. temp.gameObj.y = obj.posY;
  9423. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9424. }
  9425. }
  9426. xGame.common.d2World.getHelpLine();
  9427. }
  9428. updatePlaceBallPos() {
  9429. let arr = xGame.common.d2World.ballArr;
  9430. let temp;
  9431. for (let index = 0; index < arr.length; index++) {
  9432. temp = arr[index];
  9433. if (!this.placeBallPosData[temp.myUNID]) {
  9434. this.placeBallPosData[temp.myUNID] = {
  9435. src: temp,
  9436. posX: temp.gameObj.x,
  9437. posY: temp.gameObj.y
  9438. };
  9439. }
  9440. else {
  9441. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9442. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9443. }
  9444. }
  9445. let check;
  9446. for (const key in this.placeBallPosData) {
  9447. check = this.placeBallPosData[key];
  9448. if (check.src.destroyed) {
  9449. delete this.placeBallPosData[key];
  9450. }
  9451. }
  9452. }
  9453. gameRun(type) {
  9454. if (this.gamePause)
  9455. return;
  9456. this.curFoul = this.getFoulType();
  9457. if (type) {
  9458. xGame.common.d2World.d2Gan.shoot();
  9459. xGame.common.gameUI.forceCancel();
  9460. this.curFoul = type;
  9461. }
  9462. this.isEnd = false;
  9463. this.isChangeTurn = true;
  9464. if (xGame.common.gameMode == GameMode.classic) {
  9465. this.judgeClassic(this.curFoul);
  9466. this.checkClassicWords(() => {
  9467. xGame.common.destroyClassicEmotion();
  9468. if (this.isEnd) {
  9469. if (this.isBlackInHole) {
  9470. xGame.common.gameUI.ui.blackAni.visible = true;
  9471. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9472. xGame.common.gameUI.ui.blackAni.visible = false;
  9473. this.gameEnd();
  9474. }));
  9475. }
  9476. else {
  9477. this.gameEnd();
  9478. }
  9479. }
  9480. else {
  9481. this.waitShoot();
  9482. xGame.eventMgr.event(WAIT_SHOOT);
  9483. }
  9484. });
  9485. }
  9486. else if (xGame.common.gameMode == GameMode.bigMove) {
  9487. xGame.common.aiPlayer.stopRun();
  9488. let scoreArr = this.getScore(this.curFoul);
  9489. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9490. this.isEnd = true;
  9491. }
  9492. this.checkBigSkillWords(() => {
  9493. if (this.isEnd) {
  9494. this.gameEnd();
  9495. }
  9496. else {
  9497. this.waitShoot();
  9498. xGame.eventMgr.event(WAIT_SHOOT);
  9499. }
  9500. });
  9501. }
  9502. else if (xGame.common.gameMode == GameMode.placeBall) {
  9503. xGame.common.destroyAwardSpine();
  9504. let isFoul = this.curFoul == FoulType.rootHole;
  9505. let GoalNum = this.inHoleBalls.length;
  9506. if (this.inHoleBalls.indexOf(0) > -1)
  9507. GoalNum -= 1;
  9508. if (isFoul) {
  9509. this.placeRootBall();
  9510. }
  9511. console.log("neeballs", this.needBalls);
  9512. console.log("当前完成的goalNum", GoalNum);
  9513. this.finishBalls += GoalNum;
  9514. console.log("当前完成的finishballs", this.finishBalls);
  9515. let need = this.needBalls;
  9516. if (this.placeBallData.type == PlaceBallType.challenge) {
  9517. need += 100;
  9518. }
  9519. if (this.finishBalls >= need) {
  9520. this.success = true;
  9521. this.gameEnd();
  9522. }
  9523. else {
  9524. switch (this.placeBallData.type) {
  9525. case PlaceBallType.normal:
  9526. if (!isFoul && GoalNum > 0) {
  9527. this.updatePlaceBallPos();
  9528. this.updatePlaceBallState();
  9529. }
  9530. else {
  9531. this.curHP--;
  9532. this.openRegretView(isFoul, GoalNum);
  9533. }
  9534. this.waitShoot();
  9535. xGame.eventMgr.event(WAIT_SHOOT);
  9536. break;
  9537. case PlaceBallType.challenge:
  9538. this.curHP--;
  9539. this.updatePlaceBallState();
  9540. if (isFoul) {
  9541. this.openRegretView(isFoul, GoalNum, true);
  9542. }
  9543. else {
  9544. this.updatePlaceBallPos();
  9545. if (this.curHP <= 0) {
  9546. this.success = true;
  9547. this.gameEnd();
  9548. }
  9549. }
  9550. this.waitShoot();
  9551. xGame.eventMgr.event(WAIT_SHOOT);
  9552. break;
  9553. default:
  9554. break;
  9555. }
  9556. }
  9557. }
  9558. }
  9559. checkClassicWords(callback) {
  9560. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9561. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9562. let type = this.getClassicWordsType();
  9563. if (condition && type != -1) {
  9564. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9565. xGame.soundMgr.playSound(str);
  9566. xGame.common.wordsMgr.playClassicWords(type, callback);
  9567. }
  9568. else {
  9569. Laya.timer.once(300, this, () => {
  9570. callback && callback();
  9571. });
  9572. }
  9573. }
  9574. getClassicWordsType() {
  9575. let d2world = xGame.common.d2World;
  9576. let type = -1;
  9577. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9578. type = ClassicWordsType.perfectShow;
  9579. return type;
  9580. }
  9581. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9582. type = ClassicWordsType.directShoot;
  9583. return type;
  9584. }
  9585. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9586. type = ClassicWordsType.anotherShoot;
  9587. return type;
  9588. }
  9589. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9590. type = ClassicWordsType.bigPower;
  9591. return type;
  9592. }
  9593. let minSpeed = 1;
  9594. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9595. type = ClassicWordsType.hardShoot;
  9596. return type;
  9597. }
  9598. if (this.inHoleBalls.length > 0) {
  9599. type = ClassicWordsType.directShoot;
  9600. return type;
  9601. }
  9602. return type;
  9603. }
  9604. checkBigSkillWords(callback) {
  9605. if (this.curFoul == FoulType.timeOut) {
  9606. callback && callback();
  9607. }
  9608. else {
  9609. let playSkill = false;
  9610. if (this.selfTurn) {
  9611. playSkill = true;
  9612. }
  9613. else {
  9614. if (!this.aiPlayedBreakArmy) {
  9615. this.aiPlayedBreakArmy = true;
  9616. playSkill = true;
  9617. }
  9618. if (this.aiCurSkill != SkillType.breakArmy) {
  9619. playSkill = true;
  9620. }
  9621. }
  9622. if (xGame.common.skillMgr.playedLastSkill) {
  9623. xGame.common.skillMgr.playedLastSkill = false;
  9624. playSkill = false;
  9625. }
  9626. if (playSkill) {
  9627. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9628. let selfExtra = 0;
  9629. let aiExtra = 0;
  9630. if (this.selfTurn)
  9631. selfExtra += extraScore;
  9632. else
  9633. aiExtra += extraScore;
  9634. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9635. this.isEnd = true;
  9636. }
  9637. this.playBigSkillTimes(callback);
  9638. });
  9639. }
  9640. else {
  9641. this.playBigSkillTimes(callback);
  9642. }
  9643. }
  9644. }
  9645. playBigSkillTimes(callback) {
  9646. let length = this.inHoleBalls.length;
  9647. if (this.inHoleBalls.indexOf(0) > -1) {
  9648. length = this.inHoleBalls.length - 1;
  9649. }
  9650. if (length <= 0) {
  9651. callback && callback();
  9652. return;
  9653. }
  9654. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9655. callback && callback();
  9656. });
  9657. }
  9658. playSkillTips() {
  9659. let levelNum = 0;
  9660. let curType;
  9661. if (this.selfTurn) {
  9662. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9663. curType = this.selfCurSkill;
  9664. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9665. levelNum += 5;
  9666. }
  9667. }
  9668. else {
  9669. levelNum = this.aiSkillLevelNum;
  9670. curType = this.aiCurSkill;
  9671. }
  9672. let str = ``;
  9673. switch (curType) {
  9674. case SkillType.highSpace:
  9675. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9676. break;
  9677. case SkillType.breakArmy:
  9678. str = `You pocketed ${levelNum} extra balls`;
  9679. break;
  9680. case SkillType.ice:
  9681. str = `${levelNum * 2} extra balls were frozen`;
  9682. break;
  9683. case SkillType.fireworks:
  9684. str = `${levelNum} extra balls exploded `;
  9685. break;
  9686. case SkillType.GuanYu:
  9687. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9688. break;
  9689. default:
  9690. break;
  9691. }
  9692. xGame.uiMgr.Show(UIMsg, str);
  9693. }
  9694. getFoulType() {
  9695. let foulType = "";
  9696. if (this.firstColliObj == null) {
  9697. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9698. return FoulType.rootHole;
  9699. }
  9700. return FoulType.notTouch;
  9701. }
  9702. else {
  9703. if (this.selfTurn) {
  9704. if (this.selfBallArr.length > 0) {
  9705. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9706. foulType = FoulType.wrongTouch;
  9707. }
  9708. }
  9709. else {
  9710. if (this.ensureBallType) {
  9711. }
  9712. else {
  9713. if (this.firstColliObj == this.blackNum) {
  9714. foulType = FoulType.wrongTouch;
  9715. }
  9716. }
  9717. }
  9718. }
  9719. else {
  9720. if (this.aiBallArr.length > 0) {
  9721. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9722. foulType = FoulType.wrongTouch;
  9723. }
  9724. }
  9725. else {
  9726. if (this.ensureBallType) {
  9727. }
  9728. else {
  9729. if (this.firstColliObj == this.blackNum) {
  9730. foulType = FoulType.wrongTouch;
  9731. }
  9732. }
  9733. }
  9734. }
  9735. if (this.inHoleBalls.length <= 0) {
  9736. return foulType;
  9737. }
  9738. let temp;
  9739. if (this.inHoleBalls.indexOf(0) > -1) {
  9740. foulType = FoulType.rootHole;
  9741. }
  9742. else {
  9743. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9744. temp = this.inHoleBalls[index];
  9745. if (this.selfTurn) {
  9746. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9747. foulType = FoulType.wrongHole;
  9748. break;
  9749. }
  9750. }
  9751. else {
  9752. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9753. foulType = FoulType.wrongHole;
  9754. break;
  9755. }
  9756. }
  9757. }
  9758. }
  9759. let foo;
  9760. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9761. temp = this.inHoleBalls[index];
  9762. foo = this.selfBallArr.indexOf(temp);
  9763. if (foo > -1) {
  9764. this.selfBallArr.splice(foo, 1);
  9765. }
  9766. foo = this.aiBallArr.indexOf(temp);
  9767. if (foo > -1) {
  9768. this.aiBallArr.splice(foo, 1);
  9769. }
  9770. }
  9771. this.updateLeftBall();
  9772. }
  9773. return foulType;
  9774. }
  9775. judgeGameEndByBlack(arr) {
  9776. if (this.selfTurn) {
  9777. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9778. this.selfFoulNum = this.maxFoulTimes;
  9779. return true;
  9780. }
  9781. }
  9782. else {
  9783. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9784. this.aiFoulNum = this.maxFoulTimes;
  9785. return true;
  9786. }
  9787. }
  9788. }
  9789. judgeClassic(type) {
  9790. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9791. xGame.common.aiPlayer.stopRun();
  9792. if (this.judgeNormalSuccess()) {
  9793. this.isEnd = true;
  9794. return;
  9795. }
  9796. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9797. if (this.selfTurn) {
  9798. if (isFoul) {
  9799. this.selfFoulNum++;
  9800. }
  9801. if (this.selfFoulNum >= this.maxFoulTimes) {
  9802. this.success = false;
  9803. this.isEnd = true;
  9804. return;
  9805. }
  9806. }
  9807. else {
  9808. if (isFoul)
  9809. this.aiFoulNum++;
  9810. if (this.aiFoulNum >= this.maxFoulTimes) {
  9811. this.success = true;
  9812. this.isEnd = true;
  9813. return;
  9814. }
  9815. }
  9816. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9817. this.isChangeTurn = false;
  9818. }
  9819. else {
  9820. this.isInterrupt = true;
  9821. }
  9822. }
  9823. waitShoot() {
  9824. if (xGame.common.gameMode == GameMode.classic) {
  9825. switch (this.curFoul) {
  9826. case FoulType.timeOut:
  9827. case FoulType.rootHole:
  9828. this.selfTurn = !this.selfTurn;
  9829. this.peoplePlay(5, 6, true);
  9830. break;
  9831. case FoulType.notTouch:
  9832. this.selfTurn = !this.selfTurn;
  9833. this.peoplePlay(7, 7);
  9834. break;
  9835. case FoulType.wrongHole:
  9836. this.selfTurn = !this.selfTurn;
  9837. this.peoplePlay(11, 11);
  9838. break;
  9839. default:
  9840. if (this.inHoleBalls.length > 0) {
  9841. this.peoplePlay(0, 0, false, false);
  9842. }
  9843. else {
  9844. this.selfTurn = !this.selfTurn;
  9845. this.peoplePlay(7, 7);
  9846. }
  9847. break;
  9848. }
  9849. }
  9850. else if (xGame.common.gameMode == GameMode.bigMove) {
  9851. if (this.curFoul == FoulType.timeOut) {
  9852. this.selfTurn = !this.selfTurn;
  9853. this.peoplePlay(14, 15);
  9854. this.placeRootBall();
  9855. }
  9856. else {
  9857. this.selfTurn = !this.selfTurn;
  9858. if (this.curFoul == FoulType.rootHole) {
  9859. this.peoplePlay(12, 13);
  9860. this.placeRootBall();
  9861. }
  9862. else {
  9863. this.peoplePlay(0, 0, false, false);
  9864. }
  9865. }
  9866. }
  9867. else if (xGame.common.gameMode == GameMode.placeBall) {
  9868. this.finishOneShoot = true;
  9869. }
  9870. this.gameResult();
  9871. }
  9872. gameResult() {
  9873. this.firstColliObj = null;
  9874. this.inHoleBalls = [];
  9875. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9876. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9877. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9878. if (xGame.common.uiRodMethod)
  9879. xGame.common.uiRodMethod.resetRod();
  9880. xGame.common.d2World.rootBall.showSelf();
  9881. this.clearIceSkill();
  9882. if (this.selfTurn) {
  9883. PlatMgr.gameInsert();
  9884. }
  9885. xGame.common.d3World.knifeRoot.destroyChildren();
  9886. if (this.selfTurn) {
  9887. xGame.common.gameUI.showHelpLineGuide();
  9888. xGame.common.gameUI.setTurnAlpha(true);
  9889. }
  9890. else {
  9891. xGame.common.gameUI.setTurnAlpha(false);
  9892. }
  9893. }
  9894. getScore(type) {
  9895. let selfAdd = 0;
  9896. let aiAdd = 0;
  9897. if (type == FoulType.timeOut) {
  9898. if (this.selfTurn)
  9899. aiAdd += 3;
  9900. else
  9901. selfAdd += 3;
  9902. }
  9903. else {
  9904. if (this.inHoleBalls.length > 0) {
  9905. if (this.selfTurn) {
  9906. if (type == FoulType.rootHole) {
  9907. aiAdd += 3;
  9908. if (this.inHoleBalls.length - 1 > 0) {
  9909. selfAdd += this.inHoleBalls.length - 1;
  9910. }
  9911. }
  9912. else {
  9913. selfAdd += this.inHoleBalls.length;
  9914. }
  9915. }
  9916. else {
  9917. if (type == FoulType.rootHole) {
  9918. selfAdd += 3;
  9919. if (this.inHoleBalls.length - 1 > 0) {
  9920. aiAdd += this.inHoleBalls.length - 1;
  9921. }
  9922. }
  9923. else {
  9924. aiAdd += this.inHoleBalls.length;
  9925. }
  9926. }
  9927. }
  9928. }
  9929. return [selfAdd, aiAdd];
  9930. }
  9931. judgeScoreEnd(selfAdd, aiAdd) {
  9932. this.selfScore += selfAdd;
  9933. this.aiScore += aiAdd;
  9934. this.updateAIScore();
  9935. this.updateSelfScore();
  9936. if (this.selfScore >= this.targertScore) {
  9937. this.success = true;
  9938. return true;
  9939. }
  9940. if (this.aiScore >= this.targertScore) {
  9941. this.success = false;
  9942. return true;
  9943. }
  9944. let ballArr = xGame.common.d2World.ballArr;
  9945. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9946. if (this.selfScore > this.aiScore) {
  9947. this.success = true;
  9948. return true;
  9949. }
  9950. else if (this.selfScore < this.aiScore) {
  9951. this.success = false;
  9952. return true;
  9953. }
  9954. else {
  9955. if (this.selfTurn) {
  9956. this.success = false;
  9957. }
  9958. else {
  9959. this.success = true;
  9960. }
  9961. return true;
  9962. }
  9963. }
  9964. }
  9965. clearIceSkill() {
  9966. let arr = xGame.common.d2World.ballArr;
  9967. let temp;
  9968. if (this.selfTurn) {
  9969. if (this.selfCurSkill == SkillType.ice) {
  9970. for (let index = 0; index < arr.length; index++) {
  9971. temp = arr[index];
  9972. if (temp.ballFunc == "ice") {
  9973. temp.setBallFunc("normal", "self");
  9974. }
  9975. }
  9976. }
  9977. }
  9978. else {
  9979. if (this.aiCurSkill == SkillType.ice) {
  9980. for (let index = 0; index < arr.length; index++) {
  9981. temp = arr[index];
  9982. if (temp.ballFunc == "ice") {
  9983. temp.setBallFunc("normal", "ai");
  9984. }
  9985. }
  9986. }
  9987. }
  9988. }
  9989. judgeNormalSuccess() {
  9990. if (this.selfTurn) {
  9991. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9992. this.success = true;
  9993. return true;
  9994. }
  9995. }
  9996. else {
  9997. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9998. this.success = false;
  9999. return true;
  10000. }
  10001. }
  10002. }
  10003. gameEnd() {
  10004. if (Moyu.isTT) {
  10005. xGame.common.screenImg = getScreenImg();
  10006. }
  10007. console.log("游戏结束", this.success);
  10008. xGame.common.aiPlayer.stopRun();
  10009. if (xGame.common.gameMode == GameMode.placeBall) {
  10010. this.getEndStarNum();
  10011. this.updatePlaceBallState();
  10012. }
  10013. this.isEnter = false;
  10014. Moyu.recordEnd(this, () => {
  10015. if (this.isEnter)
  10016. return;
  10017. this.isEnter = true;
  10018. console.log("进入录结束回调");
  10019. this.enterNext();
  10020. });
  10021. Laya.timer.once(1000, this, () => {
  10022. if (this.isEnter)
  10023. return;
  10024. this.isEnter = true;
  10025. this.enterNext();
  10026. });
  10027. xGame.common.longHelpLine = false;
  10028. }
  10029. enterNext() {
  10030. Laya.timer.clearAll(this);
  10031. if (Moyu.canShare() > 100 || Moyu.isKs) {
  10032. xGame.uiMgr.Show(UIVideoShare, this.success);
  10033. }
  10034. else {
  10035. xGame.uiMgr.Show(UIGameEnd, this.success);
  10036. }
  10037. }
  10038. aiLeave() {
  10039. let ui = xGame.common.gameUI.ui;
  10040. ui.topNode.aiNameTxt.text = "offline";
  10041. }
  10042. aiGameEnd(suc) {
  10043. this.success = suc;
  10044. xGame.common.aiPlayer.stopRun();
  10045. if (this.success) {
  10046. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  10047. Laya.timer.once(1000, this, () => {
  10048. this.clearTime();
  10049. this.gameEnd();
  10050. });
  10051. }
  10052. }
  10053. openTimer() {
  10054. let src = xGame.common.gameUI;
  10055. if (this.selfTurn) {
  10056. src.ui.topNode.selfProgress.visible = true;
  10057. src.ui.topNode.aiProgress.visible = false;
  10058. this.curTimer = src.ui.topNode.selfProgress;
  10059. }
  10060. else {
  10061. src.ui.topNode.selfProgress.visible = false;
  10062. src.ui.topNode.aiProgress.visible = true;
  10063. this.curTimer = src.ui.topNode.aiProgress;
  10064. }
  10065. this.accTime = 0;
  10066. Laya.timer.clearAll(this);
  10067. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  10068. this.curTimer.value = 100;
  10069. }
  10070. updateTime(dt) {
  10071. if (this.gamePause)
  10072. return;
  10073. this.accTime += dt;
  10074. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  10075. if (this.accTime >= this.setTime) {
  10076. this.clearTime();
  10077. console.log("时钟进入了gameRun");
  10078. this.gameRun(FoulType.timeOut);
  10079. }
  10080. }
  10081. clearTime() {
  10082. let src = xGame.common.gameUI;
  10083. src.ui.topNode.selfProgress.visible = false;
  10084. src.ui.topNode.aiProgress.visible = false;
  10085. Laya.timer.clearAll(this);
  10086. }
  10087. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  10088. let ui = xGame.common.gameUI.ui;
  10089. let selfMsg, aiMsg;
  10090. if (sayWords) {
  10091. selfMsg = cfgTable.wordsData[selfIndex].msg;
  10092. aiMsg = cfgTable.wordsData[aiIndex].msg;
  10093. if (Foul) {
  10094. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  10095. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  10096. this.placeRootBall();
  10097. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  10098. if (this.curFoul == FoulType.rootHole) {
  10099. if (!DataMgr.getRootBallFoul()) {
  10100. DataMgr.setRootBallFoul();
  10101. aiMsg = "";
  10102. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  10103. let woman = "Boss, pay attention next time~";
  10104. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10105. }
  10106. }
  10107. else if (this.curFoul == FoulType.timeOut) {
  10108. if (!DataMgr.getTimeoutFoul()) {
  10109. DataMgr.setTimeoutFoul();
  10110. aiMsg = "";
  10111. let tips = "Game timeout, 3 fouls, this game failed.";
  10112. let woman = "Boss, pay attention to the timeline~";
  10113. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10114. }
  10115. }
  10116. }
  10117. }
  10118. }
  10119. if (this.selfTurn) {
  10120. if (sayWords) {
  10121. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  10122. ui.selfTurn.visible = true;
  10123. ui.aiTurn.visible = false;
  10124. ui.selfTurn.t0.play();
  10125. Moyu.vibration();
  10126. });
  10127. }
  10128. }
  10129. else {
  10130. let aiNum = xGame.tools.random(1, 11);
  10131. let challengeNum = DataMgr.getChallengeTimes();
  10132. let delay = false;
  10133. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  10134. aiNum = 9;
  10135. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  10136. aiNum = 3;
  10137. if (challengeNum == 3) {
  10138. if (!this.showLongView) {
  10139. this.showLongView = true;
  10140. delay = true;
  10141. }
  10142. }
  10143. }
  10144. }
  10145. if (delay) {
  10146. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10147. if (success) {
  10148. xGame.common.longHelpLine = true;
  10149. xGame.common.d2World.getHelpLine();
  10150. }
  10151. else {
  10152. aiNum = 10;
  10153. }
  10154. xGame.common.aiPlayer.setAiLevel(aiNum);
  10155. if (sayWords) {
  10156. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10157. xGame.common.aiPlayer.runAI();
  10158. ui.selfTurn.visible = false;
  10159. ui.aiTurn.visible = true;
  10160. ui.aiTurn.t0.play();
  10161. });
  10162. }
  10163. else {
  10164. xGame.common.aiPlayer.runAI();
  10165. }
  10166. this.openTimer();
  10167. this.finishOneShoot = true;
  10168. if (this.selfTurn) {
  10169. ui.topNode.selfKuang.visible = true;
  10170. ui.topNode.aiKuang.visible = false;
  10171. ui.topNode.selfTips.visible = true;
  10172. ui.topNode.aiTips.visible = false;
  10173. }
  10174. else {
  10175. ui.topNode.selfKuang.visible = false;
  10176. ui.topNode.aiKuang.visible = true;
  10177. ui.topNode.selfTips.visible = false;
  10178. ui.topNode.aiTips.visible = true;
  10179. }
  10180. });
  10181. return;
  10182. }
  10183. if (xGame.common.gameMode == GameMode.classic) {
  10184. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10185. if (cfg) {
  10186. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10187. aiNum = aiLevel;
  10188. }
  10189. }
  10190. xGame.common.aiPlayer.setAiLevel(aiNum);
  10191. if (sayWords) {
  10192. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10193. xGame.common.aiPlayer.runAI();
  10194. ui.selfTurn.visible = false;
  10195. ui.aiTurn.visible = true;
  10196. ui.aiTurn.t0.play();
  10197. });
  10198. }
  10199. else {
  10200. xGame.common.aiPlayer.runAI();
  10201. }
  10202. }
  10203. this.openTimer();
  10204. this.finishOneShoot = true;
  10205. if (this.selfTurn) {
  10206. ui.topNode.selfKuang.visible = true;
  10207. ui.topNode.aiKuang.visible = false;
  10208. ui.topNode.selfTips.visible = true;
  10209. ui.topNode.aiTips.visible = false;
  10210. }
  10211. else {
  10212. ui.topNode.selfKuang.visible = false;
  10213. ui.topNode.aiKuang.visible = true;
  10214. ui.topNode.selfTips.visible = false;
  10215. ui.topNode.aiTips.visible = true;
  10216. }
  10217. }
  10218. placeRootBall() {
  10219. let rootBall = xGame.common.d2World.rootBall;
  10220. if (!rootBall)
  10221. return;
  10222. rootBall.gameObj.x = this.lastRootBallPos.x;
  10223. rootBall.gameObj.y = this.lastRootBallPos.y;
  10224. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10225. let moveNode = xGame.common.gameUI.ui.moveNode;
  10226. moveNode.visible = true;
  10227. moveNode.x = this.lastRootBallPos.x;
  10228. moveNode.y = this.lastRootBallPos.y;
  10229. if (!this.selfTurn) {
  10230. xGame.common.aiPlayer.resetRoot();
  10231. }
  10232. }
  10233. }
  10234. class ui_guanyuAni extends fgui.GComponent {
  10235. static createInstance() {
  10236. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10237. }
  10238. onConstruct() {
  10239. this.n0 = (this.getChild("n0"));
  10240. }
  10241. }
  10242. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10243. class UIFireworks extends UIBase {
  10244. constructor() {
  10245. super();
  10246. }
  10247. onConstructor() {
  10248. this.isEject = false;
  10249. }
  10250. show(callback) {
  10251. super.show();
  10252. }
  10253. }
  10254. UIFireworks.uiName = "UIFireworks";
  10255. class ui_UIGuanYu extends fgui.GComponent {
  10256. static createInstance() {
  10257. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10258. }
  10259. onConstruct() {
  10260. this.n2 = (this.getChild("n2"));
  10261. this.n1 = (this.getChild("n1"));
  10262. this.n3 = (this.getChild("n3"));
  10263. this.n4 = (this.getChild("n4"));
  10264. this.n5 = (this.getChild("n5"));
  10265. this.n6 = (this.getChild("n6"));
  10266. this.n8 = (this.getChild("n8"));
  10267. this.n7 = (this.getChild("n7"));
  10268. this.t0 = this.getTransition("t0");
  10269. }
  10270. }
  10271. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10272. class UIGuanYu extends UIBase {
  10273. constructor() {
  10274. super();
  10275. }
  10276. onConstructor() {
  10277. this.ui = ui_UIGuanYu.createInstance();
  10278. this.contentPane = this.ui;
  10279. this.isEject = false;
  10280. }
  10281. show(callback) {
  10282. super.show();
  10283. this.ui.t0.play(Laya.Handler.create(this, () => {
  10284. callback && callback();
  10285. this.hide();
  10286. }));
  10287. this.setGlobalFont(this.ui);
  10288. }
  10289. }
  10290. UIGuanYu.uiName = "UIGuanYu";
  10291. class SkillMgr {
  10292. constructor() {
  10293. this.leveNum = 0;
  10294. this.extraScore = 0;
  10295. this.selfTurn = false;
  10296. this.playedLastSkill = false;
  10297. this.tweenArr = [];
  10298. this._finishNum = 0;
  10299. this._curFinish = 0;
  10300. this._rootX = 0;
  10301. this._rootY = 0;
  10302. this.knifeTimes = 0;
  10303. this.knifeV2 = new Laya.Vector2();
  10304. this.knifeV3 = new Laya.Vector3();
  10305. this.rtStarX = 0;
  10306. this.rtStarY = 0;
  10307. this.addBigSkillSpine();
  10308. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10309. }
  10310. addBigSkillSpine() {
  10311. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10312. console.log("extra2 success");
  10313. });
  10314. }
  10315. runBigSkill(callback) {
  10316. this.tweenArr = [];
  10317. this.callback = callback;
  10318. this.judgeSkill();
  10319. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10320. let guide = DataMgr.getSkillGuide();
  10321. if (!xGame.common.gameMgr.selfTurn) {
  10322. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10323. }
  10324. else {
  10325. if (xGame.common.temSelfLevel != 0) {
  10326. this.leveNum = xGame.common.temSelfLevel;
  10327. }
  10328. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10329. this.leveNum += 5;
  10330. }
  10331. }
  10332. if (guide == 0) {
  10333. DataMgr.setSkillGuide(1);
  10334. if (DataMgr.getNewUser()) {
  10335. Moyu.sendDataEvent("gameFirstPlay");
  10336. DataMgr.setNewUser();
  10337. }
  10338. }
  10339. this.playSpineAni(() => {
  10340. switch (this.curSkill) {
  10341. case SkillType.highSpace:
  10342. this.runHighSpace();
  10343. break;
  10344. case SkillType.breakArmy:
  10345. this.runBreakArmy();
  10346. break;
  10347. case SkillType.ice:
  10348. this.runIce();
  10349. break;
  10350. case SkillType.fireworks:
  10351. this.runFireworks();
  10352. break;
  10353. case SkillType.GuanYu:
  10354. this.runGuanYu();
  10355. break;
  10356. default:
  10357. break;
  10358. }
  10359. });
  10360. }
  10361. judgeSkill() {
  10362. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10363. let gameMgr = xGame.common.gameMgr;
  10364. let type;
  10365. for (let index = 0; index < typeArr.length; index++) {
  10366. type = typeArr[index];
  10367. if (gameMgr.selfTurn) {
  10368. if (gameMgr.selfCurSkill == type) {
  10369. this.selfTurn = true;
  10370. this.curSkill = type;
  10371. return;
  10372. }
  10373. }
  10374. else {
  10375. if (gameMgr.aiCurSkill == type) {
  10376. this.selfTurn = false;
  10377. this.curSkill = type;
  10378. return;
  10379. }
  10380. }
  10381. }
  10382. }
  10383. playSpineAni(callback) {
  10384. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10385. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10386. parent.destroyChildren();
  10387. let aniIndex = 0;
  10388. let skillSpine;
  10389. switch (this.curSkill) {
  10390. case SkillType.highSpace:
  10391. aniIndex = 1;
  10392. xGame.soundMgr.playSound("skill01");
  10393. skillSpine = this.skillSpine2;
  10394. data.scaleX = 0.5;
  10395. data.scaleY = 0.5;
  10396. skillSpine.play(data, 1, false, parent, () => {
  10397. callback && callback();
  10398. });
  10399. break;
  10400. case SkillType.breakArmy:
  10401. aniIndex = 2;
  10402. xGame.soundMgr.playSound("skill02");
  10403. skillSpine = this.skillSpine2;
  10404. data.scaleX = 0.5;
  10405. data.scaleY = 0.5;
  10406. skillSpine.play(data, 2, false, parent, () => {
  10407. callback && callback();
  10408. });
  10409. break;
  10410. case SkillType.ice:
  10411. aniIndex = 0;
  10412. xGame.soundMgr.playSound("skill03");
  10413. skillSpine = this.skillSpine2;
  10414. data.scaleX = 0.5;
  10415. data.scaleY = 0.5;
  10416. skillSpine.play(data, 0, false, parent, () => {
  10417. callback && callback();
  10418. });
  10419. break;
  10420. case SkillType.fireworks:
  10421. xGame.soundMgr.playSound("skill_04_01");
  10422. xGame.soundMgr.playSound("skill04");
  10423. xGame.uiMgr.Show(UIFireworks, callback);
  10424. break;
  10425. case SkillType.GuanYu:
  10426. xGame.soundMgr.playSound("skill05_1");
  10427. xGame.soundMgr.playSound("skill05");
  10428. xGame.uiMgr.Show(UIGuanYu, callback);
  10429. break;
  10430. default:
  10431. break;
  10432. }
  10433. }
  10434. getAllBallArr() {
  10435. let arr = xGame.common.d2World.ballArr;
  10436. let outArr = [];
  10437. for (let index = 0; index < arr.length; index++) {
  10438. if (arr[index] instanceof D2RootBallSrc)
  10439. continue;
  10440. if (arr[index].ballFunc == "ice")
  10441. continue;
  10442. if (arr[index].destroyed)
  10443. continue;
  10444. outArr.push(arr[index]);
  10445. }
  10446. return outArr;
  10447. }
  10448. getOneArr(deletObj) {
  10449. let allArr = this.getAllBallArr();
  10450. let temp;
  10451. for (let index = 0; index < allArr.length; index++) {
  10452. temp = allArr[index];
  10453. if (temp.id == deletObj.id) {
  10454. allArr.splice(index, 1);
  10455. break;
  10456. }
  10457. }
  10458. return allArr;
  10459. }
  10460. getNearBallBag(ball) {
  10461. let ui = xGame.common.gameUI.ui;
  10462. let circleArr = [];
  10463. for (let index = 1; index <= 6; index++) {
  10464. circleArr.push(ui.border["circle" + index]);
  10465. }
  10466. let outIndex = 0;
  10467. let temp;
  10468. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10469. ;
  10470. let dis = 0;
  10471. for (let index = 1; index < circleArr.length; index++) {
  10472. temp = circleArr[index];
  10473. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10474. if (dis < min) {
  10475. min = dis;
  10476. outIndex = index;
  10477. }
  10478. }
  10479. return [circleArr[outIndex], outIndex];
  10480. }
  10481. ballFlyToBag(ballArr, time = 300) {
  10482. let temp;
  10483. let hole;
  10484. this._finishNum = ballArr.length;
  10485. this._curFinish = 0;
  10486. let holeObj = {};
  10487. let holeCfg = {
  10488. "1": 0,
  10489. "2": 0,
  10490. "3": 0,
  10491. "4": 0,
  10492. "5": 0,
  10493. "6": 0
  10494. };
  10495. for (let index = 0; index < ballArr.length; index++) {
  10496. temp = ballArr[index];
  10497. temp.outColli.isSensor = true;
  10498. temp.innerColli.isSensor = true;
  10499. temp.isRunSkillAni = true;
  10500. let holeArr = this.getNearBallBag(temp);
  10501. hole = holeArr[0];
  10502. holeObj[index] = holeArr[1];
  10503. temp.d3BallSrc.scaleXYZ = 0.5;
  10504. this.tweenArr.push(temp.d3BallSrc, temp);
  10505. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10506. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10507. }));
  10508. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10509. let mIndex = holeObj[this._curFinish];
  10510. let isDone = holeCfg[mIndex];
  10511. if (isDone) {
  10512. ballArr[this._curFinish].checkWrongBall(false);
  10513. }
  10514. else {
  10515. holeCfg[mIndex] = 1;
  10516. ballArr[this._curFinish].checkWrongBall();
  10517. }
  10518. this._curFinish++;
  10519. if (this._curFinish >= this._finishNum) {
  10520. if (this.curSkill == SkillType.highSpace) {
  10521. }
  10522. else if (this.curSkill == SkillType.breakArmy) {
  10523. let rootBall = xGame.common.d2World.rootBall;
  10524. rootBall.gameObj.x = this._rootX;
  10525. rootBall.gameObj.y = this._rootY;
  10526. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10527. xGame.common.d2World.d2Gan.ui.visible = true;
  10528. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10529. xGame.common.d2World.getHelpLine();
  10530. this.callback && this.callback(this.extraScore);
  10531. }
  10532. }
  10533. }));
  10534. }
  10535. }
  10536. runHighSpace() {
  10537. let rootBall = xGame.common.d2World.rootBall;
  10538. rootBall.showSelf();
  10539. let d3Src = rootBall.d3BallSrc;
  10540. let allArr = this.getAllBallArr();
  10541. if (allArr.length <= 0) {
  10542. this.callback && this.callback(0);
  10543. return;
  10544. }
  10545. let selectBall = xGame.common.d2World.targetBall;
  10546. let wrong = selectBall && selectBall.destroyed;
  10547. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10548. selectBall = xGame.common.getRandArrEle(allArr);
  10549. }
  10550. let targetD3Src = selectBall.d3BallSrc;
  10551. xGame.common.d2World.d2Gan.ui.visible = false;
  10552. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10553. d3Src.scaleXYZ = 0.5;
  10554. this.tweenArr.push(d3Src);
  10555. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10556. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10557. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10558. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10559. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10560. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10561. let outArr = [selectBall];
  10562. let other = this.leveNum - 1;
  10563. if (other > 0) {
  10564. let nearArr = this.getOneArr(selectBall);
  10565. if (nearArr.length > 0) {
  10566. xGame.common.botherArr(nearArr);
  10567. if (other >= nearArr.length)
  10568. other = nearArr.length;
  10569. for (let index = 0; index < other; index++) {
  10570. outArr.push(nearArr[index]);
  10571. }
  10572. }
  10573. }
  10574. xGame.common.extraMoveNum = other + 1;
  10575. this.extraScore = other + 1;
  10576. this._rootX = selectBall.gameObj.x;
  10577. this._rootY = selectBall.gameObj.y;
  10578. rootBall.gameObj.x = this._rootX;
  10579. rootBall.gameObj.y = this._rootY;
  10580. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10581. Laya.Tween.clearAll(d3Src);
  10582. this.addRandomForce(outArr);
  10583. }));
  10584. }));
  10585. }
  10586. addRandomForce(outArr) {
  10587. if (outArr.length > 0) {
  10588. xGame.common.d2World.openCheckStill = true;
  10589. this.playedLastSkill = true;
  10590. }
  10591. let temp;
  10592. for (let index = 0; index < outArr.length; index++) {
  10593. let angle = xGame.common.randomNum(0, 360);
  10594. let linearPercent = xGame.common.randomNum(65, 100);
  10595. temp = outArr[index];
  10596. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10597. }
  10598. }
  10599. setLinearSpeed(angle, rigy, linearPercent) {
  10600. let sin = Math.sin(angle * Math.PI / 180);
  10601. let cos = Math.cos(angle * Math.PI / 180);
  10602. let maxSpeed = 4;
  10603. let speed = new Laya.Vector2();
  10604. speed.x = maxSpeed * linearPercent * sin;
  10605. speed.y = -maxSpeed * linearPercent * cos;
  10606. rigy.applyLinearImpulseToCenter(speed);
  10607. }
  10608. runBreakArmy() {
  10609. xGame.common.d2World.d2Gan.ui.visible = false;
  10610. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10611. let gameUI = xGame.common.gameUI.ui;
  10612. gameUI.skillRod.visible = true;
  10613. gameUI.skillRod.rotation = 110;
  10614. let outArr = this.getAllBallArr();
  10615. if (outArr.length <= 0) {
  10616. gameUI.skillRod.visible = false;
  10617. this.callback && this.callback(0);
  10618. return;
  10619. }
  10620. xGame.common.botherArr(outArr);
  10621. if (this.leveNum >= outArr.length)
  10622. this.leveNum = outArr.length;
  10623. let deleteNum = outArr.length - this.leveNum;
  10624. outArr.splice(0, deleteNum);
  10625. this.extraScore = this.leveNum;
  10626. let potX = gameUI.skillRod.x;
  10627. let potY = gameUI.skillRod.y;
  10628. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10629. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10630. let disArr = [];
  10631. for (let index = 0; index < outArr.length; index++) {
  10632. let obj = outArr[index];
  10633. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10634. dis = Math.pow(dis, 0.5);
  10635. disArr.push(dis);
  10636. }
  10637. this.tweenArr.push(gameUI.skillRod);
  10638. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10639. })).update = Laya.Handler.create(this, (e, t, c) => {
  10640. let angle = gameUI.skillRod.rotation;
  10641. let xx;
  10642. let yy;
  10643. let temp;
  10644. for (let index = 0; index < outArr.length; index++) {
  10645. temp = outArr[index];
  10646. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10647. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10648. yy -= 20;
  10649. temp.gameObj.x = xx;
  10650. temp.gameObj.y = yy;
  10651. temp.d3BallSrc.setTransPos(xx, yy);
  10652. }
  10653. if (angle <= 60) {
  10654. Laya.Tween.clearAll(gameUI.skillRod);
  10655. this.ballFlyToBag(outArr, 150);
  10656. gameUI.skillRod.visible = false;
  10657. }
  10658. }, null, false);
  10659. }
  10660. runIce() {
  10661. let ballArr = xGame.common.d2World.ballArr;
  10662. this.leveNum *= 2;
  10663. if (this.leveNum >= ballArr.length - 1)
  10664. this.leveNum = ballArr.length - 1;
  10665. let tempArr = [];
  10666. let outArr = [];
  10667. for (let index = 0; index < ballArr.length; index++) {
  10668. if (ballArr[index] instanceof D2RootBallSrc)
  10669. continue;
  10670. tempArr.push(ballArr[index]);
  10671. }
  10672. if (tempArr.length <= 0) {
  10673. this.callback && this.callback(0);
  10674. return;
  10675. }
  10676. xGame.common.botherArr(tempArr);
  10677. for (let index = 0; index < this.leveNum; index++) {
  10678. outArr.push(tempArr[index]);
  10679. }
  10680. this.extraScore = this.leveNum;
  10681. let temp;
  10682. for (let index = 0; index < outArr.length; index++) {
  10683. temp = outArr[index];
  10684. temp.d3BallSrc.playIceEft();
  10685. }
  10686. Laya.timer.once(2000, this, () => {
  10687. for (let index = 0; index < outArr.length; index++) {
  10688. temp = outArr[index];
  10689. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10690. temp.setBallFunc("ice", str);
  10691. }
  10692. this.callback && this.callback(0);
  10693. });
  10694. }
  10695. runFireworks() {
  10696. let allArr = this.getAllBallArr();
  10697. if (allArr.length <= 0) {
  10698. this.callback && this.callback(0);
  10699. return;
  10700. }
  10701. xGame.common.d2World.d2Gan.ui.visible = false;
  10702. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10703. let outArr = [];
  10704. let other = this.leveNum;
  10705. if (other > 0) {
  10706. if (allArr.length > 0) {
  10707. xGame.common.botherArr(allArr);
  10708. if (other >= allArr.length)
  10709. other = allArr.length;
  10710. for (let index = 0; index < other; index++) {
  10711. outArr.push(allArr[index]);
  10712. }
  10713. }
  10714. }
  10715. xGame.common.extraMoveNum = other;
  10716. this.extraScore = other;
  10717. this.addRandmomFireworks(outArr);
  10718. }
  10719. addRandmomFireworks(outArr) {
  10720. Laya.timer.once(1100, this, () => {
  10721. if (outArr.length > 0) {
  10722. xGame.common.d2World.openCheckStill = true;
  10723. this.playedLastSkill = true;
  10724. }
  10725. });
  10726. xGame.soundMgr.playSound("skill_04_02");
  10727. let temp;
  10728. let delay = -200;
  10729. for (let index = 0; index < outArr.length; index++) {
  10730. temp = outArr[index];
  10731. delay += 200;
  10732. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10733. let angle = xGame.common.randomNum(0, 360);
  10734. angle = this.getFireworksAngle(obj);
  10735. let linearPercent = xGame.common.randomNum(45, 80);
  10736. if (!obj.destroyed)
  10737. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10738. });
  10739. }
  10740. }
  10741. getFireworksAngle(obj) {
  10742. let rootBall = xGame.common.d2World.rootBall;
  10743. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10744. }
  10745. resetGame() {
  10746. Laya.timer.clearAll(this);
  10747. if (this.tweenArr) {
  10748. for (let index = 0; index < this.tweenArr.length; index++) {
  10749. Laya.Tween.clearAll(this.tweenArr[index]);
  10750. }
  10751. }
  10752. this.tweenArr = null;
  10753. }
  10754. runGuanYu() {
  10755. xGame.common.d2World.d2Gan.ui.visible = false;
  10756. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10757. let rootBall = xGame.common.d2World.rootBall;
  10758. if (rootBall.isInHole) {
  10759. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10760. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10761. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10762. rootBall.showSelf();
  10763. }
  10764. this.rtStarX = rootBall.gameObj.x;
  10765. this.rtStarY = rootBall.gameObj.y;
  10766. this.knifeTimes = 0;
  10767. this.playedLastSkill = true;
  10768. rootBall.forceRun = true;
  10769. rootBall.rigy.type = "static";
  10770. xGame.common.d2World.openCheckStill = true;
  10771. this.guanyuRandomKnife();
  10772. }
  10773. guanyuRandomKnife() {
  10774. let rootBall = xGame.common.d2World.rootBall;
  10775. let dir = this.getRandDir();
  10776. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10777. console.log("当前angle", angle);
  10778. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10779. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10780. let dis = 324;
  10781. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10782. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10783. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10784. this.rtStarX = rootBall.gameObj.x;
  10785. this.rtStarY = rootBall.gameObj.y;
  10786. this.knifeTimes++;
  10787. let skillLevel;
  10788. if (xGame.common.gameMgr.selfTurn) {
  10789. skillLevel = DataMgr.getBigSkillByIndex(4);
  10790. }
  10791. else {
  10792. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10793. }
  10794. if (!skillLevel)
  10795. skillLevel = 1;
  10796. skillLevel += 2;
  10797. if (this.knifeTimes < skillLevel) {
  10798. Laya.timer.once(400, this, () => {
  10799. this.guanyuRandomKnife();
  10800. });
  10801. }
  10802. else {
  10803. rootBall.forceRun = false;
  10804. rootBall.rigy.type = "dynamic";
  10805. xGame.common.extraMoveNum = skillLevel;
  10806. }
  10807. }));
  10808. }
  10809. getRandDir() {
  10810. let rootBall = xGame.common.d2World.rootBall;
  10811. let allBall = this.getAllBallArr();
  10812. let target = xGame.common.getRandArrEle(allBall);
  10813. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10814. return this.knifeV2;
  10815. }
  10816. cloneKnife(x, y, rotation) {
  10817. let parent = xGame.common.d3World.knifeRoot;
  10818. let prefab = xGame.common.d3World.knife;
  10819. let clone = prefab.clone();
  10820. parent.addChild(clone);
  10821. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10822. clone.transform.localPositionX = this.knifeV3.x;
  10823. clone.transform.localPositionY = 0;
  10824. clone.transform.localPositionZ = this.knifeV3.z;
  10825. clone.transform.localRotationEulerX = 0;
  10826. clone.transform.localRotationEulerY = rotation;
  10827. clone.transform.localRotationEulerZ = 0;
  10828. clone.active = true;
  10829. return clone;
  10830. }
  10831. cloneGuanYuEft(x, y, angle) {
  10832. return;
  10833. let parent = xGame.common.gameUI.ui.guanyuNode;
  10834. let eft = new ui_guanyuAni();
  10835. eft.parent = parent;
  10836. eft.x = x;
  10837. eft.y = y;
  10838. eft.rotation = angle;
  10839. }
  10840. }
  10841. class ui_UIWordsList extends fgui.GComponent {
  10842. static createInstance() {
  10843. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10844. }
  10845. onConstruct() {
  10846. this.c1 = this.getController("c1");
  10847. this.n74 = (this.getChild("n74"));
  10848. this.clickNode = (this.getChild("clickNode"));
  10849. this.myNode = (this.getChild("myNode"));
  10850. this.n68 = (this.getChild("n68"));
  10851. this.n66 = (this.getChild("n66"));
  10852. this.n55 = (this.getChild("n55"));
  10853. this.wordsBtn = (this.getChild("wordsBtn"));
  10854. this.emotionBtn = (this.getChild("emotionBtn"));
  10855. this.mybggg = (this.getChild("mybggg"));
  10856. this.wordsList = (this.getChild("wordsList"));
  10857. this.emotionList = (this.getChild("emotionList"));
  10858. this.myRoot = (this.getChild("myRoot"));
  10859. }
  10860. }
  10861. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10862. class EmotionDisplay {
  10863. constructor(index, ui) {
  10864. this.ui = ui;
  10865. this.index = index;
  10866. this.ui.onClick(this, this.clickSelf);
  10867. this.updateSelf();
  10868. }
  10869. updateSelf() {
  10870. let data = cfgTable.emotionData[this.index + 1];
  10871. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10872. }
  10873. clickSelf() {
  10874. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10875. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10876. xGame.common.talkMgr.closeTalkView();
  10877. }
  10878. }
  10879. class WordsDisplay {
  10880. constructor(index, ui) {
  10881. this.ui = ui;
  10882. this.index = index;
  10883. this.ui.onClick(this, this.clickSelf);
  10884. this.updateSelf();
  10885. }
  10886. updateSelf() {
  10887. let data = cfgTable.talkwordsData[this.index + 1];
  10888. this.ui.txt.text = data.msg;
  10889. }
  10890. clickSelf() {
  10891. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10892. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10893. xGame.common.talkMgr.closeTalkView();
  10894. }
  10895. }
  10896. class UIWordsList extends UIBase {
  10897. constructor() {
  10898. super();
  10899. }
  10900. onConstructor() {
  10901. this.ui = ui_UIWordsList.createInstance();
  10902. this.contentPane = this.ui;
  10903. this.isEject = false;
  10904. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10905. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10906. this.addUIClick(this.ui.clickNode, this.hide);
  10907. this.initTalkList();
  10908. this.initEmotionList();
  10909. }
  10910. show() {
  10911. super.show();
  10912. this.setGlobalFont(this.ui);
  10913. }
  10914. initTalkList() {
  10915. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10916. let data = cfgTable.talkwordsData;
  10917. let length = Object.keys(data).length;
  10918. this.ui.wordsList.numItems = length;
  10919. }
  10920. initEmotionList() {
  10921. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10922. let data = cfgTable.emotionData;
  10923. let length = Object.keys(data).length;
  10924. this.ui.emotionList.numItems = length;
  10925. }
  10926. renderTalkItem(index, obj) {
  10927. let temp = new WordsDisplay(index, obj);
  10928. }
  10929. renderEmotionItem(index, obj) {
  10930. let temp = new EmotionDisplay(index, obj);
  10931. }
  10932. openTalkList() {
  10933. this.ui.c1.selectedIndex = 0;
  10934. }
  10935. openEmotionList() {
  10936. this.ui.c1.selectedIndex = 1;
  10937. }
  10938. }
  10939. UIWordsList.uiName = "UIWordsList";
  10940. class TalkMgr {
  10941. constructor() {
  10942. this.aiSpeak = true;
  10943. this.emotionList = [];
  10944. this.talkList = [];
  10945. this.addEvent();
  10946. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10947. this.emotionList = [];
  10948. this.talkList = [];
  10949. for (let k in cfgTable.emotionData) {
  10950. this.emotionList.push(cfgTable.emotionData[k].id);
  10951. }
  10952. for (let k in cfgTable.talkwordsData) {
  10953. this.talkList.push(cfgTable.talkwordsData[k].id);
  10954. }
  10955. }
  10956. addEvent() {
  10957. let ui = xGame.common.gameUI.ui;
  10958. ui.wordsBtn.visible = true;
  10959. ui.wordsBtn.onClick(this, this.openTalkView);
  10960. ui.aiWordsBtn.visible = true;
  10961. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10962. }
  10963. openTalkView() {
  10964. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10965. xGame.uiMgr.Show(UIWordsList);
  10966. }
  10967. closeTalkView() {
  10968. xGame.uiMgr.Hide(UIWordsList);
  10969. }
  10970. clickAIState() {
  10971. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10972. this.aiSpeak = !this.aiSpeak;
  10973. this.changeAIState(this.aiSpeak);
  10974. }
  10975. changeAIState(speak) {
  10976. this.aiSpeak = speak;
  10977. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10978. if (speak) {
  10979. btn.c1.selectedIndex = 0;
  10980. }
  10981. else {
  10982. btn.c1.selectedIndex = 1;
  10983. }
  10984. }
  10985. showSelfTalk(wordsId) {
  10986. let ui = xGame.common.gameUI.ui;
  10987. ui.selfTalk.visible = true;
  10988. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10989. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10990. ui.selfTalk.t0.play();
  10991. }
  10992. showSelfEmotion(emotionId) {
  10993. let ui = xGame.common.gameUI.ui;
  10994. ui.selfTalk.visible = true;
  10995. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10996. this.selfSpine && this.selfSpine.dispose();
  10997. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10998. let spineData = cfgTable.emotionData[emotionId].spine;
  10999. this.selfSpine = new SpineMgr(spineData, () => {
  11000. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  11001. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  11002. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  11003. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  11004. });
  11005. ui.selfTalk.t0.play();
  11006. }
  11007. showAITalk(wordsId) {
  11008. if (!this.aiSpeak)
  11009. return;
  11010. if (DataMgr.gameData.gameCount < 2)
  11011. return;
  11012. if (wordsId < 1)
  11013. wordsId = this.getRandTalk();
  11014. let ui = xGame.common.gameUI.ui;
  11015. ui.aiTalk.visible = true;
  11016. ui.aiTalk.myNode.c1.selectedIndex = 1;
  11017. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  11018. ui.aiTalk.t0.play();
  11019. }
  11020. getRandTalk() {
  11021. let rand = xGame.tools.random(0, this.talkList.length);
  11022. return this.emotionList[rand];
  11023. }
  11024. getRandEmotion() {
  11025. let rand = xGame.tools.random(0, this.emotionList.length);
  11026. return this.emotionList[rand];
  11027. }
  11028. showAIEmotion(emotionId) {
  11029. if (!this.aiSpeak)
  11030. return;
  11031. if (DataMgr.gameData.gameCount < 2)
  11032. return;
  11033. if (emotionId < 1)
  11034. emotionId = this.getRandEmotion();
  11035. let ui = xGame.common.gameUI.ui;
  11036. ui.aiTalk.visible = true;
  11037. ui.aiTalk.myNode.c1.selectedIndex = 0;
  11038. this.aiSpine && this.aiSpine.dispose();
  11039. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11040. let spineData = cfgTable.emotionData[emotionId].spine;
  11041. this.aiSpine = new SpineMgr(spineData, () => {
  11042. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  11043. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  11044. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  11045. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  11046. });
  11047. ui.aiTalk.t0.play();
  11048. }
  11049. resetGame() {
  11050. let ui = xGame.common.gameUI.ui;
  11051. ui.aiTalk.visible = false;
  11052. ui.selfTalk.visible = false;
  11053. this.aiSpine && this.aiSpine.dispose();
  11054. this.selfSpine && this.selfSpine.dispose();
  11055. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11056. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  11057. this.closeTalkView();
  11058. }
  11059. }
  11060. class WordsMgr {
  11061. constructor() {
  11062. this.comboTimes = 1;
  11063. this.skillTimes = 0;
  11064. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  11065. this.comboSpine = new SpineMgr("yxz_liangan");
  11066. this.skillSpine = new SpineMgr("yiganxqiu");
  11067. this.scoreSpine = new SpineMgr("defen");
  11068. }
  11069. setClassicCombo(isInterrupt) {
  11070. if (isInterrupt) {
  11071. this.comboTimes = 0;
  11072. }
  11073. }
  11074. playClassicWords(type, callback) {
  11075. this.callback = callback;
  11076. let aniIndex = type;
  11077. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11078. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11079. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  11080. mySpine.destroy(true);
  11081. this.playClassicTimes();
  11082. });
  11083. }
  11084. playClassicTimes() {
  11085. this.comboTimes++;
  11086. if (this.comboTimes <= 1) {
  11087. this.callback && this.callback();
  11088. }
  11089. else {
  11090. let aniIndex = this.comboTimes - 1;
  11091. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11092. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11093. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  11094. mySpine.destroy(true);
  11095. this.callback && this.callback();
  11096. });
  11097. }
  11098. }
  11099. playBigSkillTimes(times, callback) {
  11100. if (times <= 0) {
  11101. callback && callback();
  11102. return;
  11103. }
  11104. this.callback = callback;
  11105. let pre = "sz_0";
  11106. let aniIndex = 0;
  11107. this.getWordsImg(times, pre, () => {
  11108. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11109. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11110. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  11111. let r1 = ``;
  11112. let r2 = ``;
  11113. if (times <= 9) {
  11114. r1 = `res/d2Res/${pre}${times}.png`;
  11115. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11116. aniIndex = 0;
  11117. }
  11118. else {
  11119. r1 = `res/d2Res/${pre}${times % 10}.png`;
  11120. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  11121. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  11122. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  11123. aniIndex = 1;
  11124. }
  11125. this.skillSpine.play(data, aniIndex, false, parent, () => {
  11126. mySpine.destroy(true);
  11127. xGame.common.gameMgr.playSkillTips();
  11128. this.playScore(times);
  11129. xGame.common.playRandomMutiBallBigSkillSound();
  11130. }, mySpine);
  11131. });
  11132. }
  11133. playScore(score) {
  11134. let pre = "sz_";
  11135. let aniIndex = 0;
  11136. this.getWordsImg(score, pre, () => {
  11137. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11138. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11139. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  11140. let r1 = ``;
  11141. let r2 = ``;
  11142. if (score <= 9) {
  11143. r1 = `res/d2Res/${pre}${score}.png`;
  11144. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11145. aniIndex = 0;
  11146. }
  11147. else {
  11148. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11149. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11150. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11151. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11152. aniIndex = 1;
  11153. }
  11154. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11155. mySpine.destroy(true);
  11156. this.callback && this.callback();
  11157. }, mySpine);
  11158. });
  11159. }
  11160. getWordsImg(number, pre = "", callback) {
  11161. let arr = [];
  11162. if (number <= 9) {
  11163. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11164. }
  11165. else {
  11166. 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 });
  11167. }
  11168. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11169. callback && callback();
  11170. }));
  11171. }
  11172. }
  11173. class ui_UIRodMethod extends fgui.GComponent {
  11174. static createInstance() {
  11175. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11176. }
  11177. onConstruct() {
  11178. this.n24 = (this.getChild("n24"));
  11179. this.white = (this.getChild("white"));
  11180. this.dot = (this.getChild("dot"));
  11181. this.sureBtn = (this.getChild("sureBtn"));
  11182. this.n20 = (this.getChild("n20"));
  11183. this.n21 = (this.getChild("n21"));
  11184. this.n22 = (this.getChild("n22"));
  11185. this.n23 = (this.getChild("n23"));
  11186. this.n5 = (this.getChild("n5"));
  11187. this.n14 = (this.getChild("n14"));
  11188. this.t0 = this.getTransition("t0");
  11189. }
  11190. }
  11191. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11192. class UIRodMethod extends UIBase {
  11193. constructor() {
  11194. super();
  11195. this.isPressd = false;
  11196. }
  11197. onConstructor() {
  11198. this.ui = ui_UIRodMethod.createInstance();
  11199. this.contentPane = this.ui;
  11200. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11201. this.moveDir = new Laya.Vector2();
  11202. this.moveDest = new Laya.Vector2();
  11203. this.centerPos = new Laya.Vector2();
  11204. xGame.common.uiRodMethod = this;
  11205. }
  11206. show() {
  11207. super.show();
  11208. xGame.common.gameMgr.gamePause = true;
  11209. this.openPressDotEvent();
  11210. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11211. this.centerPos.x = this.ui.white.x;
  11212. this.centerPos.y = this.ui.white.y;
  11213. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11214. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11215. this.setDot();
  11216. this.setGlobalFont(this.ui);
  11217. }
  11218. setDot() {
  11219. this.ui.dot.x = this.moveDest.x;
  11220. this.ui.dot.y = this.moveDest.y;
  11221. }
  11222. closeSelf() {
  11223. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11224. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11225. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11226. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11227. xGame.common.gameMgr.gamePause = false;
  11228. this.hide();
  11229. }
  11230. openPressDotEvent() {
  11231. this.closePressDotEvent();
  11232. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11233. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11234. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11235. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11236. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11237. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11238. }
  11239. closePressDotEvent() {
  11240. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11241. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11242. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11243. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11244. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11245. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11246. }
  11247. onDown(e) {
  11248. if (e.type == Laya.Event.MOUSE_DOWN)
  11249. this.isPressd = true;
  11250. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11251. this.isPressd = false;
  11252. if (!this.isPressd)
  11253. return;
  11254. this.moveDest.x = e.stageX;
  11255. this.moveDest.y = e.stageY;
  11256. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11257. if (dis > 6724) {
  11258. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11259. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11260. }
  11261. this.setDot();
  11262. }
  11263. resetRod() {
  11264. this.ui.dot.x = this.ui.white.x;
  11265. this.ui.dot.y = this.ui.white.y;
  11266. this.gameRod.dot.x = this.gameRod.bg.x;
  11267. this.gameRod.dot.y = this.gameRod.bg.y;
  11268. xGame.common.rodOffest.x = 0;
  11269. xGame.common.rodOffest.y = 0;
  11270. }
  11271. }
  11272. UIRodMethod.uiName = "UIRodMethod";
  11273. class UIGame extends UIBase {
  11274. constructor() {
  11275. super();
  11276. this.powerNum = 0;
  11277. this.isD3Inited = false;
  11278. this.isPrePlay = false;
  11279. this.isMoveRod = false;
  11280. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11281. this.rulerDis = 20;
  11282. this.rulerOffset = 0;
  11283. }
  11284. onConstructor() {
  11285. this.ui = ui_UIGame.createInstance();
  11286. this.contentPane = this.ui;
  11287. this.ui.x += xGame.common.sysOffestNum;
  11288. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11289. this.isEject = false;
  11290. xGame.common.gameUI = this;
  11291. this.initSelf();
  11292. }
  11293. isTurnSelf() {
  11294. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11295. return true;
  11296. }
  11297. }
  11298. initSelf() {
  11299. let topUI = this.ui.topNode;
  11300. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11301. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11302. this.barInfo = {};
  11303. this.barInfo.curY = 0;
  11304. this.barInfo.height = this.ui.powerNode.height;
  11305. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11306. this.barInfo.powerStartY = this.ui.powerNode.y;
  11307. xGame.common.aiPlayer = new AIPlayer();
  11308. xGame.common.gameMgr = new GameMgr();
  11309. xGame.common.skillMgr = new SkillMgr();
  11310. xGame.common.wordsMgr = new WordsMgr();
  11311. xGame.common.talkMgr = new TalkMgr();
  11312. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11313. });
  11314. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11315. });
  11316. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11317. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11318. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11319. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11320. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11321. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11322. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11323. }
  11324. getGanZiImg() {
  11325. let index = DataMgr.getCurBallRod();
  11326. let data = cfgTable.ballrodData[index + 1];
  11327. let gan_url = xGame.common.getGameIconUrl(data.img);
  11328. this.ui.powerNode.showImg.url = gan_url;
  11329. }
  11330. returnHome() {
  11331. let tips = "Are you sure to exit the game?";
  11332. let woman = "Boss, why don't you play for a while longer?";
  11333. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11334. }
  11335. addRodMethodClick() {
  11336. if (this.isTurnSelf()) {
  11337. xGame.uiMgr.Show(UIRodMethod);
  11338. }
  11339. }
  11340. clickHelpLineBtn(force = false) {
  11341. if (!this.isTurnSelf())
  11342. return;
  11343. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11344. if (success) {
  11345. xGame.common.longHelpLine = true;
  11346. xGame.common.d2World.getHelpLine();
  11347. Moyu.sendDataEvent("guideNum");
  11348. }
  11349. else {
  11350. }
  11351. });
  11352. }
  11353. renderSelfDisplayBalls(index, target) {
  11354. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11355. target.myImg.url = xGame.common.getGameIconUrl(str);
  11356. }
  11357. renderAIDisplayBalls(index, target) {
  11358. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11359. target.myImg.url = xGame.common.getGameIconUrl(str);
  11360. ;
  11361. }
  11362. updateMode() {
  11363. if (xGame.common.gameMode == GameMode.classic) {
  11364. this.ui.topNode.scoreNode.visible = false;
  11365. }
  11366. else if (xGame.common.gameMode == GameMode.bigMove) {
  11367. this.ui.topNode.scoreNode.visible = true;
  11368. }
  11369. }
  11370. show() {
  11371. super.show();
  11372. this.ui.alpha = 0;
  11373. this.updateSelf();
  11374. xGame.common.gameMgr.gamePause = false;
  11375. xGame.common.gameUI.ui.blackAni.visible = false;
  11376. xGame.common.gameUI.ui.whiteAni.visible = false;
  11377. this.ui.powerEft.visible = false;
  11378. this.ui.colorNode.visible = false;
  11379. this.updateHead();
  11380. let curUse = DataMgr.getCurBallRod();
  11381. this.getGanZiImg();
  11382. this.setGlobalFont(this.ui);
  11383. }
  11384. updateSelf() {
  11385. if (xGame.common.gameMode == GameMode.classic) {
  11386. this.ui.c1.selectedIndex = 0;
  11387. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11388. this.ui.topNode.middleNode.visible = true;
  11389. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11390. }
  11391. else if (xGame.common.gameMode == GameMode.bigMove) {
  11392. this.ui.c1.selectedIndex = 0;
  11393. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11394. this.ui.topNode.middleNode.visible = false;
  11395. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11396. let rand = xGame.common.randomNum(1, max);
  11397. let guide = DataMgr.getSkillGuide();
  11398. if (guide == 0)
  11399. rand = 1;
  11400. xGame.common.bigMoveLevelIndex = rand;
  11401. }
  11402. else if (xGame.common.gameMode == GameMode.placeBall) {
  11403. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11404. this.ui.c1.selectedIndex = 1 + data.type;
  11405. this.ui.alpha = 1;
  11406. this.startGame();
  11407. }
  11408. this.updateMode();
  11409. this.initD3world();
  11410. this.initD2world();
  11411. }
  11412. startGame() {
  11413. this.ui.snowNode.visible = Math.random() <= 0.1;
  11414. this.ui.d2Node.visible = false;
  11415. xGame.common.d3World.d3Hand.gameObj.active = false;
  11416. xGame.common.d3World.tableSrc.init();
  11417. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11418. this.cameraViewChange(() => {
  11419. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11420. switch (xGame.common.gameMode) {
  11421. case GameMode.classic:
  11422. xGame.common.d3World.d3Hand.gameObj.active = true;
  11423. this.playPutBallD3Ani();
  11424. break;
  11425. case GameMode.bigMove:
  11426. this.enterGame();
  11427. Laya.timer.once(500, this, () => {
  11428. this.ui.topNode.middleNode.visible = true;
  11429. this.ui.topNode.middleNode.t0.play();
  11430. });
  11431. break;
  11432. case GameMode.placeBall:
  11433. this.enterGame();
  11434. break;
  11435. default:
  11436. break;
  11437. }
  11438. });
  11439. PlatMgr.showBanner(false);
  11440. }
  11441. enterGame() {
  11442. this.ui.d2Node.visible = true;
  11443. xGame.common.d3World.d3Hand.gameObj.active = false;
  11444. xGame.common.showOneCamera("mainCamera");
  11445. Moyu.recordGame(30, true);
  11446. if (!this.isPrePlay) {
  11447. this.isPrePlay = true;
  11448. xGame.common.d3World.prePlayEft();
  11449. }
  11450. xGame.common.gameMgr.gameReady();
  11451. this.openAllEvent();
  11452. this.ui.snowNode.visible = false;
  11453. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11454. this.ui.helpBtn.visible = condition;
  11455. }
  11456. showHelpLineGuide() {
  11457. let longGuide = DataMgr.getGuideHelpLine();
  11458. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11459. this.ui.helpBtn.visible = true;
  11460. this.ui.guideNode.visible = true;
  11461. }
  11462. }
  11463. setTurnAlpha(alpha) {
  11464. this.ui.keduNode.alpha = alpha;
  11465. this.ui.ganNode.alpha = alpha;
  11466. this.ui.rodMethodNode.alpha = alpha;
  11467. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11468. }
  11469. cameraViewChange(callback) {
  11470. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11471. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11472. xGame.common.showOneCamera("visitAngle");
  11473. cameraSrc.localRotationEulerY = 180;
  11474. cameraSrc.localRotationEulerZ = 0;
  11475. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11476. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11477. callback && callback();
  11478. }));
  11479. }));
  11480. }
  11481. playPutBallD3Ani() {
  11482. xGame.common.showOneCamera("mainCamera");
  11483. let handSrc = xGame.common.d3World.d3Hand;
  11484. handSrc.gameObj.active = true;
  11485. handSrc.transform.localPositionZ = 3;
  11486. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11487. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11488. handSrc.gameObj.active = false;
  11489. this.enterGame();
  11490. }), 400);
  11491. }));
  11492. }
  11493. updateHead() {
  11494. let user = Moyu.getUserInfo();
  11495. this.ui.topNode.selfNameTxt.text = user.nickName;
  11496. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11497. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11498. if (DataMgr.getSkillGuide() < 1) {
  11499. this.ui.topNode.aiNameTxt.text = 'billiards';
  11500. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11501. }
  11502. else {
  11503. this.ui.topNode.aiNameTxt.text = aiData.name;
  11504. let randNo = Math.floor(Math.random() * 10) + 1;
  11505. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11506. }
  11507. }
  11508. initD2world() {
  11509. let node = this.ui.d2Root.displayObject;
  11510. let src = node.getComponent(D2World);
  11511. if (!src) {
  11512. xGame.common.d2World = node.addComponent(D2World);
  11513. }
  11514. xGame.common.d2World.initSelf();
  11515. }
  11516. initD3world() {
  11517. if (this.isD3Inited)
  11518. return;
  11519. this.isD3Inited = true;
  11520. let scene3D = xGame.common.d3Scene;
  11521. this.ui.d3Root.displayObject.addChild(scene3D);
  11522. scene3D.active = true;
  11523. xGame.common.d3World.tableSrc.setBorderPos();
  11524. }
  11525. onRootMove(e) {
  11526. let rootBall = xGame.common.d2World.rootBall;
  11527. this.ui.moveNode.x = e.x;
  11528. this.ui.moveNode.y = e.y;
  11529. rootBall.gameObj.x = e.x;
  11530. rootBall.gameObj.y = e.y;
  11531. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11532. }
  11533. aiRootMove(move) {
  11534. if (move)
  11535. this.hideBallUI();
  11536. else {
  11537. this.showBallUI();
  11538. xGame.common.d2World.getHelpLine();
  11539. }
  11540. }
  11541. aiForce(type, force = 0) {
  11542. this.pressTarget = PressType.powerNode;
  11543. if (type == 1)
  11544. this.onEventUp({ force: true });
  11545. else if (type == 2)
  11546. this.onEventMove({ stageY: force, force: true });
  11547. }
  11548. onEventPress(e) {
  11549. if (e.stopPropagation)
  11550. e.stopPropagation();
  11551. if (!this.isTurnSelf())
  11552. return;
  11553. let target = e.target;
  11554. switch (target) {
  11555. case this.ui.myPowerNode.displayObject:
  11556. this.pressTarget = PressType.powerNode;
  11557. this.barInfo.curY = e.stageY;
  11558. this.updateBarInfo();
  11559. break;
  11560. case this.ui.moveNode.displayObject:
  11561. this.pressTarget = PressType.moveNode;
  11562. this.hideBallUI();
  11563. this.eventObj.curX = this.ui.moveNode.x;
  11564. this.eventObj.curY = this.ui.moveNode.y;
  11565. this.ui.moveNode.finger.visible = false;
  11566. this.eventObj.lastX = e.stageX;
  11567. this.eventObj.lastY = e.stageY;
  11568. break;
  11569. case this.ui.rulerClickNode.displayObject:
  11570. this.pressTarget = PressType.rulerNode;
  11571. this.eventObj.lastY = e.stageY;
  11572. break;
  11573. case this.ui.d2Root.displayObject:
  11574. this.pressTarget = PressType.d2Root;
  11575. this.eventObj.lastX = e.stageX;
  11576. this.eventObj.lastY = e.stageY;
  11577. this.eventObj.starX = e.stageX;
  11578. this.eventObj.starY = e.stageY;
  11579. this.eventObj.curX = 0;
  11580. this.eventObj.curY = 0;
  11581. xGame.common.d2World.d2Gan.setGanLastInfo();
  11582. this.rulerOffset = 0;
  11583. break;
  11584. default:
  11585. break;
  11586. }
  11587. }
  11588. onEventMove(e) {
  11589. if (e.stopPropagation)
  11590. e.stopPropagation();
  11591. if (e && e.force) {
  11592. }
  11593. else {
  11594. if (!this.isTurnSelf())
  11595. return;
  11596. }
  11597. switch (this.pressTarget) {
  11598. case PressType.powerNode:
  11599. this.barInfo.curY = e.stageY;
  11600. this.updateBarInfo();
  11601. this.isMoveRod = true;
  11602. break;
  11603. case PressType.moveNode:
  11604. let rootBall = xGame.common.d2World.rootBall;
  11605. let radius = rootBall.gameObj.width / 2;
  11606. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11607. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11608. let border = xGame.common.d2World.borderRect;
  11609. if (curX <= border.x + radius)
  11610. curX = border.x + radius;
  11611. else if (curX >= border.x + border.width - radius)
  11612. curX = border.x + border.width - radius;
  11613. if (curY <= border.y + radius)
  11614. curY = border.y + radius;
  11615. else if (curY >= border.y + border.height - radius)
  11616. curY = border.y + border.height - radius;
  11617. if (xGame.common.gameMgr.isOpenBall) {
  11618. if (curX >= border.x + border.openBallW - radius)
  11619. curX = border.x + border.openBallW - radius;
  11620. }
  11621. this.ui.moveNode.x = curX;
  11622. this.ui.moveNode.y = curY;
  11623. rootBall.gameObj.x = curX;
  11624. rootBall.gameObj.y = curY;
  11625. rootBall.d3BallSrc.setTransPos(curX, curY);
  11626. this.isMoveRod = true;
  11627. break;
  11628. case PressType.rulerNode:
  11629. let yy = e.stageY - this.eventObj.lastY;
  11630. this.eventObj.lastY = e.stageY;
  11631. let ruler1 = this.ui.rulerNode.img1;
  11632. let ruler2 = this.ui.rulerNode.img2;
  11633. ruler1.y += yy;
  11634. ruler2.y += yy;
  11635. this.rulerOffset += yy;
  11636. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11637. this.rulerOffset = 0;
  11638. xGame.soundMgr.playSound("inch", 1, 10);
  11639. }
  11640. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11641. let h = ruler1.height;
  11642. this.checkGuide();
  11643. this.isMoveRod = true;
  11644. if (ruler1.y >= h) {
  11645. ruler1.y = -h;
  11646. ruler2.y = 0;
  11647. return;
  11648. }
  11649. else if (ruler1.y <= -h) {
  11650. ruler1.y = h;
  11651. ruler2.y = 0;
  11652. return;
  11653. }
  11654. if (ruler2.y >= h) {
  11655. ruler2.y = -h;
  11656. ruler1.y = 0;
  11657. return;
  11658. }
  11659. else if (ruler2.y <= -h) {
  11660. ruler2.y = h;
  11661. ruler1.y = 0;
  11662. return;
  11663. }
  11664. break;
  11665. case PressType.d2Root:
  11666. this.eventObj.curX = e.stageX;
  11667. this.eventObj.curY = e.stageY;
  11668. let offset = this.checkRodMoveDir();
  11669. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11670. this.eventObj.lastX = e.stageX;
  11671. this.eventObj.lastY = e.stageY;
  11672. break;
  11673. default:
  11674. break;
  11675. }
  11676. }
  11677. onEventUp(e) {
  11678. if (e.stopPropagation)
  11679. e.stopPropagation();
  11680. if (e && e.force) {
  11681. }
  11682. else {
  11683. if (!this.isTurnSelf())
  11684. return;
  11685. }
  11686. switch (this.pressTarget) {
  11687. case PressType.powerNode:
  11688. this.ui.powerNode.value = 0;
  11689. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11690. this.ui.powerTxt.text = "";
  11691. if (this.powerNum > 0) {
  11692. xGame.eventMgr.event(BALL_SHOOT);
  11693. xGame.common.d2World.shoot(this.powerNum);
  11694. xGame.common.d2World.d2Gan.shoot();
  11695. xGame.common.d2World.d2HelpLine.shoot();
  11696. this.finishGuide();
  11697. this.ui.powerEft.visible = false;
  11698. this.ui.colorNode.visible = false;
  11699. let ganStr = "";
  11700. if (this.powerNum <= 30) {
  11701. ganStr = "gan_30";
  11702. }
  11703. else if (this.powerNum <= 60) {
  11704. ganStr = "gan_50";
  11705. }
  11706. else {
  11707. ganStr = "gan_80";
  11708. }
  11709. xGame.soundMgr.playSound(ganStr);
  11710. }
  11711. break;
  11712. case PressType.moveNode:
  11713. let rootBall = xGame.common.d2World.rootBall;
  11714. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11715. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11716. let isIntersect = this.judgeBallIntersect();
  11717. if (isIntersect) {
  11718. this.ui.moveNode.x = lastX;
  11719. this.ui.moveNode.y = lastY;
  11720. rootBall.gameObj.x = lastX;
  11721. rootBall.gameObj.y = lastY;
  11722. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11723. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11724. }
  11725. else {
  11726. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11727. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11728. }
  11729. this.showBallUI();
  11730. this.ui.moveNode.finger.visible = true;
  11731. xGame.common.d2World.getHelpLine();
  11732. break;
  11733. case PressType.rulerNode:
  11734. break;
  11735. case PressType.d2Root:
  11736. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11737. if (dis <= 25) {
  11738. this.moveToClickDot(e);
  11739. }
  11740. break;
  11741. default:
  11742. break;
  11743. }
  11744. this.pressTarget = -1;
  11745. }
  11746. checkGuide() {
  11747. let guide = DataMgr.getSkillGuide();
  11748. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11749. xGame.common.guideStep++;
  11750. xGame.common.gameUI.ui.guide2.visible = false;
  11751. xGame.common.gameUI.ui.guide3.visible = true;
  11752. }
  11753. }
  11754. finishGuide() {
  11755. let guide = DataMgr.getSkillGuide();
  11756. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11757. xGame.common.guideStep = 10;
  11758. this.closeAllGuide();
  11759. console.log('zh: 新手引导完毕');
  11760. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11761. }
  11762. }
  11763. closeAllGuide() {
  11764. xGame.common.gameUI.ui.guide1.visible = false;
  11765. xGame.common.gameUI.ui.guide2.visible = false;
  11766. xGame.common.gameUI.ui.guide3.visible = false;
  11767. }
  11768. updateBarInfo() {
  11769. let star = this.ui.powerNode.y;
  11770. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11771. if (rate >= 1)
  11772. rate = 1;
  11773. if (rate <= 0)
  11774. rate = 0;
  11775. this.powerNum = Math.ceil(rate * 100);
  11776. this.ui.powerNode.value = this.powerNum;
  11777. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11778. this.ui.colorNode.value = this.powerNum;
  11779. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11780. this.ui.powerEft.visible = this.powerNum != 0;
  11781. this.ui.colorNode.visible = this.powerNum != 0;
  11782. this.ui.powerTxt.text = this.powerNum + "";
  11783. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11784. }
  11785. forceCancel() {
  11786. this.ui.powerNode.value = 0;
  11787. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11788. this.ui.powerTxt.text = "";
  11789. }
  11790. checkRodMoveDir() {
  11791. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11792. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11793. if (tempX >= 0 && tempY <= 0) {
  11794. return this.checkDir();
  11795. }
  11796. else if (tempX < 0 && tempY < 0) {
  11797. return this.checkDir(1, -1);
  11798. }
  11799. else if (tempX < 0 && tempY > 0) {
  11800. return this.checkDir(-1, -1);
  11801. }
  11802. else {
  11803. return this.checkDir(-1, 1);
  11804. }
  11805. }
  11806. checkDir(flagX = 1, flagY = 1) {
  11807. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11808. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11809. if (offsetY == 0) {
  11810. return offsetX * flagX;
  11811. }
  11812. if (offsetX == 0) {
  11813. return offsetY * flagY;
  11814. }
  11815. let angle = offsetY / offsetX;
  11816. if (Math.abs(angle) >= 1) {
  11817. return offsetY * flagY;
  11818. }
  11819. else {
  11820. return offsetX * flagX;
  11821. }
  11822. }
  11823. judgeBallIntersect() {
  11824. let rootBall = xGame.common.d2World.rootBall;
  11825. let ballArr = xGame.common.d2World.ballArr;
  11826. let radius = rootBall.gameObj.width / 2;
  11827. let temp;
  11828. let isIntersect = false;
  11829. for (let index = 0; index < ballArr.length; index++) {
  11830. temp = ballArr[index];
  11831. if (temp.number == rootBall.number)
  11832. continue;
  11833. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11834. if (isIntersect) {
  11835. break;
  11836. }
  11837. }
  11838. return isIntersect;
  11839. }
  11840. hideBallUI() {
  11841. let d2Gan = xGame.common.d2World.d2Gan;
  11842. if (!d2Gan.ui.isDisposed)
  11843. d2Gan.ui.visible = false;
  11844. let d2Help = xGame.common.d2World.d2HelpLine;
  11845. if (!d2Help.ui.isDisposed)
  11846. d2Help.ui.visible = false;
  11847. let rootBall = xGame.common.d2World.rootBall;
  11848. if (!rootBall.destroyed) {
  11849. rootBall.gameObj.active = false;
  11850. }
  11851. }
  11852. showBallUI() {
  11853. let d2Gan = xGame.common.d2World.d2Gan;
  11854. if (!d2Gan.ui.isDisposed)
  11855. d2Gan.ui.visible = true;
  11856. let d2Help = xGame.common.d2World.d2HelpLine;
  11857. if (!d2Help.ui.isDisposed)
  11858. d2Help.ui.visible = true;
  11859. let rootBall = xGame.common.d2World.rootBall;
  11860. if (!rootBall.destroyed) {
  11861. rootBall.gameObj.active = true;
  11862. }
  11863. }
  11864. moveToClickDot(e) {
  11865. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11866. let root = xGame.common.d2World.rootBall.gameObj;
  11867. let xx = e.stageX - xGame.common.sysOffestNum;
  11868. let yy = e.stageY;
  11869. let x = xx - root.x;
  11870. let y = yy - root.y;
  11871. let angle = xGame.common.getfguiRotation(x, y);
  11872. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11873. xGame.common.d2World.getHelpLine();
  11874. }
  11875. this.isMoveRod = false;
  11876. xGame.common.clickedBall = false;
  11877. }
  11878. openAllEvent() {
  11879. this.closeAllEvent();
  11880. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11881. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11882. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11883. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11884. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11885. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11886. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11887. }
  11888. closeAllEvent() {
  11889. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11890. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11891. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11892. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11893. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11894. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11895. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11896. }
  11897. resetGame() {
  11898. this.closeAllEvent();
  11899. this.hideBallUI();
  11900. xGame.common.gameMgr.gamePause = true;
  11901. }
  11902. }
  11903. UIGame.uiName = "UIGame";
  11904. class UIAddProp extends UIBase {
  11905. constructor() {
  11906. super();
  11907. this.curType = "";
  11908. }
  11909. onConstructor() {
  11910. this.ui = ui_UIAddProp.createInstance();
  11911. this.contentPane = this.ui;
  11912. this.isEject = false;
  11913. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11914. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11915. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11916. this.updateUI();
  11917. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11918. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11919. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11920. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11921. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11922. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11923. }
  11924. show(type) {
  11925. super.show();
  11926. this.curType = type == 0 ? "coin" : "diamond";
  11927. this.switchBtn("");
  11928. this.ui.t0.play();
  11929. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11930. PlatMgr.showInsert(true);
  11931. this.setGlobalFont(this.ui);
  11932. }
  11933. closeSelf() {
  11934. this.hide();
  11935. }
  11936. updateUI() {
  11937. let data = cfgTable.moneyData;
  11938. let temp;
  11939. let obj;
  11940. for (const key in data) {
  11941. temp = data[key];
  11942. obj = this.ui.myNode["node" + key];
  11943. if (parseInt(key) <= 2) {
  11944. obj.diamondTxt.text = "+" + temp.num;
  11945. }
  11946. else {
  11947. obj.coinTxt.text = temp.num;
  11948. obj.diamondTxt.text = temp.get.split('_')[1];
  11949. }
  11950. }
  11951. this.updateDiamondShare();
  11952. }
  11953. updateDiamondShare() {
  11954. let data = DataMgr.getShareDiamondTimes();
  11955. if (data >= xGame.common.maxShareDiamondTimes) {
  11956. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11957. this.ui.myNode.node1.touchable = false;
  11958. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11959. }
  11960. else {
  11961. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11962. this.ui.myNode.node1.touchable = true;
  11963. }
  11964. }
  11965. switchBtn(type) {
  11966. if (type == "")
  11967. type = this.curType;
  11968. else {
  11969. if (this.curType == type) {
  11970. return;
  11971. }
  11972. else {
  11973. this.curType = type;
  11974. }
  11975. }
  11976. if (type == "coin") {
  11977. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11978. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11979. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11980. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11981. this.ui.myNode.c1.selectedIndex = 0;
  11982. }
  11983. else {
  11984. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11985. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11986. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11987. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11988. this.ui.myNode.c1.selectedIndex = 1;
  11989. }
  11990. }
  11991. convertCoin(index) {
  11992. let data = cfgTable.moneyData[index];
  11993. let coinNum = data.num;
  11994. let str = data.get.split('_')[1];
  11995. let needDiamond = parseInt(str);
  11996. if (DataMgr.diamondEnough(needDiamond)) {
  11997. DataMgr.setDiamond(-needDiamond);
  11998. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11999. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  12000. }
  12001. else {
  12002. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  12003. this.switchBtn("diamond");
  12004. }
  12005. }
  12006. videoGetDiamond() {
  12007. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  12008. if (Laya.Browser.onAndroid) {
  12009. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12010. if (!boo) {
  12011. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12012. return;
  12013. }
  12014. }
  12015. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  12016. }
  12017. else {
  12018. console.log('zh:AD 失败,直接发放奖励');
  12019. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  12020. }
  12021. }
  12022. qjff_AD_for_uiAddProp_videoGetDiamond() {
  12023. let num = cfgTable.moneyData[2].num;
  12024. xGame.common.playObjFlyAnim(num, Prop.diamond);
  12025. this.closeSelf();
  12026. }
  12027. videoGetCoin() {
  12028. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  12029. if (Laya.Browser.onAndroid) {
  12030. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12031. if (!boo) {
  12032. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12033. return;
  12034. }
  12035. }
  12036. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  12037. }
  12038. else {
  12039. console.log('zh:AD 失败,直接发放奖励');
  12040. this.qjff_AD_for_uiAddProp_videoGetCoin();
  12041. }
  12042. }
  12043. qjff_AD_for_uiAddProp_videoGetCoin() {
  12044. xGame.common.playObjFlyAnim(2000, Prop.coin);
  12045. this.closeSelf();
  12046. }
  12047. shareGetDiamond() {
  12048. let times = DataMgr.getShareDiamondTimes();
  12049. if (times >= xGame.common.maxShareDiamondTimes) {
  12050. console.log('zh: 233333333333 maxShareDiamondTimes');
  12051. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  12052. }
  12053. else {
  12054. console.log('zh:33333333333333ad');
  12055. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  12056. if (Laya.Browser.onAndroid) {
  12057. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12058. if (!boo) {
  12059. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12060. return;
  12061. }
  12062. }
  12063. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  12064. }
  12065. else {
  12066. console.log('zh:AD 失败,直接发放奖励');
  12067. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  12068. }
  12069. }
  12070. }
  12071. qjff_AD_for_uiAddProp_shareGetDiamond() {
  12072. let diamond = xGame.common.randomNum(50, 100);
  12073. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  12074. DataMgr.setShareDiamondTimes(1);
  12075. this.updateDiamondShare();
  12076. }
  12077. openPutBallView() {
  12078. let end = xGame.uiMgr.getUI(UIGameEnd);
  12079. let skill = xGame.uiMgr.getUI(UISkill);
  12080. let level = xGame.uiMgr.getUI(UILevelDisplay);
  12081. let uigame = xGame.uiMgr.getUI(UIGame);
  12082. if (end && !end.isHide) {
  12083. xGame.uiMgr.Hide(UIGameEnd);
  12084. xGame.uiMgr.Show(UIMain);
  12085. }
  12086. if (skill && !skill.isHide)
  12087. xGame.uiMgr.Hide(UISkill);
  12088. if (uigame && !uigame.isHide)
  12089. xGame.uiMgr.Hide(UIGame);
  12090. if (level && !level.isHide) {
  12091. }
  12092. else {
  12093. xGame.uiMgr.Show(UILevelDisplay);
  12094. }
  12095. this.closeSelf();
  12096. }
  12097. }
  12098. UIAddProp.uiName = "UIAddProp";
  12099. class MoneyNode {
  12100. constructor(ui) {
  12101. this.leftTime = 0;
  12102. this.ui = ui;
  12103. this.ui.addCoinBtn.onClick(this, this.addCoin);
  12104. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  12105. this.ui.addPowerBtn.onClick(this, this.addPower);
  12106. this.ui.c1.selectedIndex = 1;
  12107. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  12108. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  12109. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  12110. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  12111. this.coinChange();
  12112. this.diamondChange();
  12113. this.powerChange();
  12114. }
  12115. addPower() {
  12116. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12117. xGame.uiMgr.Show(UIPower);
  12118. }
  12119. powerChange() {
  12120. let powerNum = DataMgr.getPower();
  12121. this.ui.powerTxt.text = powerNum + "";
  12122. }
  12123. checkPowerTime() {
  12124. let cur = new Date().getTime();
  12125. let last = DataMgr.getPowerTime();
  12126. if (last == 0) {
  12127. last = cur;
  12128. DataMgr.setPowerTime(cur);
  12129. }
  12130. let power = DataMgr.getPower();
  12131. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  12132. Laya.timer.clearAll(this);
  12133. if (power >= xGame.common.natureMaxPower) {
  12134. this.ui.powerTimeTxt.text = "";
  12135. DataMgr.setPowerTime(cur);
  12136. return;
  12137. }
  12138. if (power + offset >= xGame.common.natureMaxPower) {
  12139. DataMgr.setPower(xGame.common.natureMaxPower, false);
  12140. this.ui.powerTimeTxt.text = "";
  12141. DataMgr.setPowerTime(cur);
  12142. }
  12143. else {
  12144. if (offset > 0) {
  12145. DataMgr.setPower(offset);
  12146. DataMgr.setPowerTime(cur);
  12147. }
  12148. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12149. this.leftTime = xGame.common.powerRecoverNum - time;
  12150. if (this.leftTime <= 0)
  12151. this.leftTime = 0;
  12152. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12153. Laya.timer.loop(1000, this, this.updatePowerTime);
  12154. }
  12155. }
  12156. updatePowerTime() {
  12157. this.leftTime -= 1;
  12158. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12159. if (this.leftTime <= 0) {
  12160. this.checkPowerTime();
  12161. }
  12162. }
  12163. coinChange() {
  12164. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12165. }
  12166. diamondChange() {
  12167. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12168. }
  12169. addCoin() {
  12170. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12171. Moyu.sendDataEvent("AddCoinBtn");
  12172. xGame.uiMgr.Show(UIAddProp, 0);
  12173. }
  12174. addDiamond() {
  12175. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12176. Moyu.sendDataEvent("AddDiamondBtn");
  12177. xGame.uiMgr.Show(UIAddProp, 1);
  12178. }
  12179. }
  12180. class UIDraw extends UIBase {
  12181. constructor() {
  12182. super();
  12183. this.curKey = 0;
  12184. }
  12185. onConstructor() {
  12186. this.ui = ui_UIDraw.createInstance();
  12187. this.contentPane = this.ui;
  12188. this.isEject = false;
  12189. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12190. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12191. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12192. this.initDraw();
  12193. this.initUI();
  12194. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12195. }
  12196. show() {
  12197. super.show();
  12198. this.ui.t0.play();
  12199. this.playSecretaryIdle();
  12200. this.updateDraw();
  12201. this.checkFree();
  12202. if (PlatMgr.bannerDelay > 0) {
  12203. this.ui.closeNode.closeBtn.visible = false;
  12204. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12205. this.ui.closeNode.closeBtn.visible = true;
  12206. });
  12207. }
  12208. PlatMgr.showRateBanner();
  12209. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12210. this.setGlobalFont(this.ui);
  12211. }
  12212. hide() {
  12213. Laya.timer.clearAll(this);
  12214. super.hide();
  12215. }
  12216. checkFree() {
  12217. let isFree = DataMgr.getDailyfreeDrawTimes();
  12218. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12219. }
  12220. initDraw() {
  12221. this.drawObj = [];
  12222. let data = cfgTable.drawData;
  12223. let temp;
  12224. let weight = 0;
  12225. for (const key in data) {
  12226. temp = data[key];
  12227. weight += temp.weight;
  12228. this.drawObj.push(weight);
  12229. }
  12230. this.allWeight = weight;
  12231. }
  12232. initUI() {
  12233. let data = cfgTable.drawData;
  12234. let temp;
  12235. let img;
  12236. let txt;
  12237. for (const key in data) {
  12238. temp = data[key];
  12239. img = this.ui.myNode.rotNode["img" + key];
  12240. txt = this.ui.myNode.rotNode["txt" + key];
  12241. img.url = xGame.common.getGameIconUrl(temp.icon);
  12242. txt.visible = true;
  12243. if (temp.award > 2) {
  12244. img.rotation = 0;
  12245. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12246. }
  12247. else {
  12248. img.rotation = temp.rotation;
  12249. txt.text = temp.num;
  12250. }
  12251. }
  12252. }
  12253. getCurkey() {
  12254. let rand = Math.random() * this.allWeight;
  12255. let temp;
  12256. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12257. temp = this.drawObj[index];
  12258. if (index == 0) {
  12259. if (rand < temp) {
  12260. return index + 1;
  12261. }
  12262. }
  12263. else {
  12264. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12265. return index + 1;
  12266. }
  12267. }
  12268. }
  12269. return 2;
  12270. }
  12271. startDraw() {
  12272. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12273. if (freeTimes > 0) {
  12274. this.beginDraw();
  12275. DataMgr.setDailyfreeDrawTimes(0);
  12276. this.checkFree();
  12277. }
  12278. else {
  12279. if (Laya.Browser.onAndroid) {
  12280. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12281. if (!boo) {
  12282. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12283. return;
  12284. }
  12285. }
  12286. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12287. }
  12288. else {
  12289. console.log('zh:AD 失败,直接发放奖励');
  12290. this.qjff_chouJiang();
  12291. }
  12292. }
  12293. }
  12294. qjff_chouJiang() {
  12295. this.beginDraw();
  12296. }
  12297. beginDraw() {
  12298. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12299. this.ui.drawBtn.touchable = false;
  12300. this.curKey = this.getCurkey();
  12301. console.log("当前key", this.curKey);
  12302. let cell = 60;
  12303. let lap = 3;
  12304. let angle = cell * (this.curKey - 1) + lap * 360;
  12305. let target = this.ui.myNode.rotNode;
  12306. target.rotation = 0;
  12307. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12308. console.log("旋转完成");
  12309. this.ui.drawBtn.touchable = true;
  12310. this.getAward();
  12311. }));
  12312. }
  12313. getAward() {
  12314. let data = cfgTable.drawData[this.curKey];
  12315. let temp = new AwardType();
  12316. temp.type = data.award;
  12317. temp.num = data.num;
  12318. xGame.common.getAward([temp], () => {
  12319. DataMgr.setDrawTimes(1);
  12320. this.updateDraw();
  12321. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12322. });
  12323. }
  12324. updateDraw() {
  12325. let drawTimes = DataMgr.getDrawTimes();
  12326. let awardTimes = DataMgr.getDrawAwardTimes();
  12327. if (Math.floor(drawTimes / 3) > awardTimes) {
  12328. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12329. this.ui.extraNode.boxBtn.touchable = true;
  12330. this.ui.extraNode.tipsTxt.text = "3/3";
  12331. this.ui.extraNode.barNode.width = 265;
  12332. this.getExtraAward();
  12333. }
  12334. else {
  12335. this.ui.extraNode.boxBtn.t0.stop();
  12336. this.ui.extraNode.boxBtn.touchable = false;
  12337. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12338. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12339. }
  12340. let data = cfgTable.drawData[1];
  12341. if (awardTimes == 0) {
  12342. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12343. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12344. this.ui.myNode.rotNode.img1.rotation = 0;
  12345. }
  12346. else {
  12347. let award = data.nextid;
  12348. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12349. this.ui.myNode.rotNode.txt1.text = award[1];
  12350. this.ui.myNode.rotNode.img1.rotation = 0;
  12351. }
  12352. }
  12353. getExtraAward() {
  12354. let drawTimes = DataMgr.getDrawTimes();
  12355. let awardTimes = DataMgr.getDrawAwardTimes();
  12356. let data = cfgTable.drawData[1];
  12357. let award = new AwardType();
  12358. if (awardTimes == 0) {
  12359. award.num = data.num;
  12360. award.type = data.award;
  12361. xGame.common.getAward([award], () => {
  12362. let all = Math.floor(drawTimes / 3);
  12363. DataMgr.setDrawAwardTimes(all);
  12364. this.updateDraw();
  12365. });
  12366. }
  12367. else {
  12368. award.num = parseInt(data.nextid[1]);
  12369. award.type = parseInt(data.nextid[0]);
  12370. xGame.common.getAward([award], () => {
  12371. let all = Math.floor(drawTimes / 3);
  12372. DataMgr.setDrawAwardTimes(all);
  12373. this.updateDraw();
  12374. });
  12375. }
  12376. }
  12377. closeSelf() {
  12378. this.hide();
  12379. }
  12380. playSecretaryIdle() {
  12381. let parent = this.ui.secretary.displayObject;
  12382. parent.destroyChildren();
  12383. let xx = this.ui.secretary.width / 2;
  12384. let yy = this.ui.secretary.height;
  12385. let scale = xGame.common.getSecretaryScale();
  12386. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12387. xGame.common.secretary.play(data, 0, true, parent);
  12388. }
  12389. }
  12390. UIDraw.uiName = "UIDraw";
  12391. class ui_UIFlyEft extends fgui.GComponent {
  12392. static createInstance() {
  12393. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12394. }
  12395. onConstruct() {
  12396. this.n0 = (this.getChild("n0"));
  12397. this.n1 = (this.getChild("n1"));
  12398. this.n2 = (this.getChild("n2"));
  12399. this.n3 = (this.getChild("n3"));
  12400. this.n4 = (this.getChild("n4"));
  12401. this.n5 = (this.getChild("n5"));
  12402. this.n6 = (this.getChild("n6"));
  12403. this.n7 = (this.getChild("n7"));
  12404. this.iconNode = (this.getChild("iconNode"));
  12405. this.txt = (this.getChild("txt"));
  12406. this.txtNode = (this.getChild("txtNode"));
  12407. }
  12408. }
  12409. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12410. class UIFlyEft extends UIBase {
  12411. constructor() {
  12412. super();
  12413. this.max = 8;
  12414. this.delay = 0;
  12415. }
  12416. onConstructor() {
  12417. this.ui = ui_UIFlyEft.createInstance();
  12418. this.contentPane = this.ui;
  12419. this.isEject = false;
  12420. this.isMuti = true;
  12421. this.ui.x += xGame.common.sysOffestNum;
  12422. }
  12423. getArrPos() {
  12424. if (this.iconPos && this.iconPos.length > 0)
  12425. return;
  12426. this.iconPos = [];
  12427. let temp;
  12428. for (let index = 0; index < this.max; index++) {
  12429. temp = this.ui["n" + index];
  12430. this.iconPos.push([temp.x, temp.y]);
  12431. }
  12432. }
  12433. show(stPos, edPos, num, type, callback) {
  12434. super.show();
  12435. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12436. this.getArrPos();
  12437. this.updateUI(type);
  12438. this.updatePos();
  12439. this.runFly(edPos, callback);
  12440. this.runWorlds(stPos, num);
  12441. this.setGlobalFont(this.ui);
  12442. }
  12443. updateUI(type) {
  12444. let temp;
  12445. let str;
  12446. for (let index = 0; index < this.max; index++) {
  12447. temp = this.ui["n" + index];
  12448. str = this.getIconStr(type);
  12449. temp.url = xGame.common.getGameIconUrl(str);
  12450. }
  12451. }
  12452. getIconStr(type) {
  12453. switch (type) {
  12454. case Prop.diamond:
  12455. return "ty_zs";
  12456. case Prop.coin:
  12457. return "ty_jb";
  12458. default:
  12459. break;
  12460. }
  12461. }
  12462. updatePos() {
  12463. let temp;
  12464. for (let index = 0; index < this.max; index++) {
  12465. temp = this.ui["n" + index];
  12466. temp.x = this.iconPos[index][0];
  12467. temp.y = this.iconPos[index][1];
  12468. }
  12469. }
  12470. runFly(endPos, callback) {
  12471. let all = 0;
  12472. let temp;
  12473. for (let index = 0; index < this.max; index++) {
  12474. temp = this.ui["n" + index];
  12475. temp.visible = true;
  12476. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12477. temp.visible = false;
  12478. all++;
  12479. if (all >= this.max) {
  12480. callback && callback();
  12481. }
  12482. }), 20 * index);
  12483. }
  12484. }
  12485. runWorlds(stPos, num) {
  12486. let str = "+" + num;
  12487. this.ui.txt.text = str;
  12488. let starX = stPos.x;
  12489. let starY = stPos.y + 50;
  12490. this.ui.txt.x = starX;
  12491. this.ui.txt.y = starY;
  12492. this.ui.txt.visible = true;
  12493. this.ui.txt.alpha = 1;
  12494. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12495. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12496. this.ui.txt.visible = false;
  12497. this.hide();
  12498. }));
  12499. }));
  12500. }
  12501. }
  12502. UIFlyEft.uiName = "UIFlyEft";
  12503. class Common {
  12504. constructor() {
  12505. this.convertNum = 0.025;
  12506. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12507. this.scaleV3One = new Laya.Vector3();
  12508. this.scaleV3Two = new Laya.Vector3();
  12509. this.posV4 = new Laya.Vector4();
  12510. this.showDebug = false;
  12511. this.openGuide = true;
  12512. this.rodOffest = new Laya.Vector2(0, 0);
  12513. this.rodAngle = 0;
  12514. this.gameMode = GameMode.classic;
  12515. this.bigMoveLevelIndex = 1;
  12516. this.bigMoveNeedCoin = 1000;
  12517. this.classicNiceNeddCoin = 1000;
  12518. this.passAwardCoin = 2000;
  12519. this.classicRoomType = 1;
  12520. this.maxPower = 20;
  12521. this.natureMaxPower = 5;
  12522. this.videoPower = 2;
  12523. this.powerRecoverNum = 900;
  12524. this.curPlayerSkillType = 0;
  12525. this.isNewDay = false;
  12526. this.clickedBall = false;
  12527. this.placeBallCurLevel = 0;
  12528. this.placeBallStarNum = 0;
  12529. this.longHelpLine = false;
  12530. this.maxShareDiamondTimes = 3;
  12531. this.guideStep = 0;
  12532. this.temSelfLevel = 0;
  12533. this.extraMoveNum = 0;
  12534. this.curRankID = 0;
  12535. this.rankID = {
  12536. normalStar: 12000,
  12537. wxStar: 12001
  12538. };
  12539. this.skillNameList = ["Skyfall Shot", "Surging Break", "Frost Lock"];
  12540. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12541. this.btnClickStr = "buttonclick";
  12542. this.maxSkillLevel = 10;
  12543. this.upSkillLevel = false;
  12544. this.gameStartTime = 0;
  12545. this._sysOffestNum = 0;
  12546. this.angleV2 = new Laya.Vector2();
  12547. this.rootV = new Laya.Vector2(0, 1);
  12548. this.tempDir1 = new Laya.Vector2();
  12549. this.tempDir2 = new Laya.Vector2();
  12550. this.ballSize = 33;
  12551. this.stPos = new Laya.Point();
  12552. this.edPos = new Laya.Point();
  12553. Common._instance = this;
  12554. window["common"] = this;
  12555. }
  12556. static getInstance() {
  12557. if (!this._instance) {
  12558. this._instance = new Common();
  12559. }
  12560. return this._instance;
  12561. }
  12562. get sysOffestNum() {
  12563. if (this._sysOffestNum == 0) {
  12564. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12565. }
  12566. return this._sysOffestNum;
  12567. }
  12568. testShader() {
  12569. let test = new LightShader();
  12570. test.texture = "res/d3Res/ballTexture/ball1.png";
  12571. Laya.stage.addChild(test);
  12572. }
  12573. playScale(node) {
  12574. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12575. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12576. }));
  12577. }));
  12578. }
  12579. setGroup(colli, ...group) {
  12580. let out = 0;
  12581. for (let index = 0; index < group.length; index++) {
  12582. if (index == 0) {
  12583. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12584. }
  12585. else {
  12586. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12587. }
  12588. }
  12589. colli.collisionGroup = out;
  12590. }
  12591. setCanGroupWith(colli, ...group) {
  12592. let out = 0;
  12593. for (let index = 0; index < group.length; index++) {
  12594. if (index == 0) {
  12595. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12596. }
  12597. else {
  12598. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12599. }
  12600. }
  12601. colli.canCollideWith = out;
  12602. }
  12603. loadPrefab(name, callback) {
  12604. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12605. let prefab = new Laya.Prefab();
  12606. prefab.json = obj;
  12607. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12608. callback && callback(img);
  12609. }));
  12610. }
  12611. pos2to3Convert(x, y, d3Pos) {
  12612. x = x + this.sysOffestNum;
  12613. d3Pos.setValue(x, y, 0);
  12614. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12615. if (success) {
  12616. }
  12617. else {
  12618. console.error("转换出错了。。。。。。。。");
  12619. }
  12620. }
  12621. scale2to3Convert(num) {
  12622. this.scaleV3One.setValue(0, 0, 0);
  12623. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12624. this.scaleV3Two.setValue(0, num, 0);
  12625. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12626. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12627. return outNum;
  12628. }
  12629. pos3to2Convert(d3Pos) {
  12630. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12631. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12632. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12633. d3Pos.x -= this.sysOffestNum;
  12634. }
  12635. scale3to2Convert(num) {
  12636. let scale = this.scale2to3Convert(1);
  12637. let d2Out = num / scale;
  12638. return d2Out;
  12639. }
  12640. getCollider(type, restitution = 0.9, density = 10) {
  12641. let colli;
  12642. if (type == "box")
  12643. colli = new Laya.BoxCollider();
  12644. else
  12645. colli = new Laya.CircleCollider();
  12646. colli.friction = 0;
  12647. colli.restitution = restitution;
  12648. colli.density = density;
  12649. return colli;
  12650. }
  12651. getRigbody() {
  12652. let rigy = new Laya.RigidBody();
  12653. rigy.bullet = true;
  12654. rigy.allowRotation = false;
  12655. rigy.allowSleep = false;
  12656. rigy.gravityScale = 0;
  12657. return rigy;
  12658. }
  12659. getfguiRotation(x, y) {
  12660. this.angleV2.setValue(x, y);
  12661. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12662. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12663. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12664. angle = -angle;
  12665. }
  12666. return 180 + angle;
  12667. }
  12668. getAngle(x, y) {
  12669. this.angleV2.setValue(x, y);
  12670. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12671. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12672. return angle;
  12673. }
  12674. randomNum(a, b) {
  12675. return a + Math.floor((b - a + 1) * Math.random());
  12676. }
  12677. getRandArrEle(arr) {
  12678. return arr[Math.floor(arr.length * Math.random())];
  12679. }
  12680. getSign(val) {
  12681. return val >= 0 ? 1 : -1;
  12682. }
  12683. botherArr(arr) {
  12684. let times = arr.length + 2;
  12685. let length = arr.length;
  12686. let a;
  12687. let b;
  12688. let temp;
  12689. for (let index = 0; index < times; index++) {
  12690. a = Math.floor(Math.random() * length);
  12691. b = Math.floor(Math.random() * length);
  12692. temp = arr[a];
  12693. arr[a] = arr[b];
  12694. arr[b] = temp;
  12695. }
  12696. }
  12697. getGameIconUrl(id) {
  12698. return "ui://game/" + id;
  12699. }
  12700. getComponentUrl(id) {
  12701. return "ui://game/" + id;
  12702. }
  12703. getAnimation() {
  12704. }
  12705. judgeSkillType(type = SkillType.highSpace) {
  12706. if (this.gameMode == GameMode.classic)
  12707. return;
  12708. let gameMgr = this.gameMgr;
  12709. if (gameMgr.selfTurn) {
  12710. if (gameMgr.selfCurSkill == type) {
  12711. return true;
  12712. }
  12713. }
  12714. else {
  12715. if (gameMgr.aiCurSkill == type) {
  12716. return true;
  12717. }
  12718. }
  12719. }
  12720. ballColliHole(collider) {
  12721. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12722. xGame.common.gameMgr.isFirstInGame = false;
  12723. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12724. }
  12725. collider.owner.mySrc.checkWrongBall();
  12726. }
  12727. getArrMaxEle(arr) {
  12728. let max = -Infinity;
  12729. for (let index = 0; index < arr.length; index++) {
  12730. max = Math.max(arr[index], max);
  12731. }
  12732. return max;
  12733. }
  12734. getArrMinEle(arr) {
  12735. let min = Infinity;
  12736. for (let index = 0; index < arr.length; index++) {
  12737. min = Math.min(arr[index], min);
  12738. }
  12739. return min;
  12740. }
  12741. playRandomMutiBallBigSkillSound() {
  12742. if (Math.random() <= 0.5)
  12743. return;
  12744. let rand = this.randomNum(1, 6);
  12745. let str = "ganfa0" + rand;
  12746. xGame.soundMgr.playSound(str);
  12747. }
  12748. showOneCamera(type) {
  12749. let object = xGame.common.d3World.cameraObj;
  12750. for (const key in object) {
  12751. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12752. object[key].init();
  12753. object[key].owner.active = key == type;
  12754. }
  12755. }
  12756. }
  12757. checkBallOverBorder(x, y) {
  12758. let radius = 17;
  12759. let condition = this._checkBorder(x + radius, y) ||
  12760. this._checkBorder(x - radius, y) ||
  12761. this._checkBorder(x, y + radius) ||
  12762. this._checkBorder(x, y - radius);
  12763. if (condition) {
  12764. return true;
  12765. }
  12766. }
  12767. _checkBorder(x, y) {
  12768. let borderRect = this.d2World.borderRect;
  12769. let xOffest = 20;
  12770. let yOffest = 20;
  12771. if (y <= borderRect.y - yOffest) {
  12772. return true;
  12773. }
  12774. if (y >= borderRect.y + borderRect.height + yOffest) {
  12775. return true;
  12776. }
  12777. if (x <= borderRect.x - xOffest) {
  12778. return true;
  12779. }
  12780. if (x >= borderRect.x + borderRect.width + xOffest) {
  12781. return true;
  12782. }
  12783. }
  12784. initWeight(cfg) {
  12785. let allCfgData = { data: {}, allWeightNum: 0 };
  12786. let weightCfg = allCfgData.data;
  12787. let weight = 0;
  12788. for (const key in cfg) {
  12789. weightCfg[key] = {};
  12790. weightCfg[key].id = cfg[key].id;
  12791. weightCfg[key].minWeight = weight;
  12792. weight += cfg[key].weight;
  12793. weightCfg[key].maxWeight = weight;
  12794. }
  12795. allCfgData.allWeightNum = weight;
  12796. return allCfgData;
  12797. }
  12798. getRandomWeightData(cfg) {
  12799. let weightCfg = cfg.data;
  12800. let allWeightNum = cfg.allWeightNum;
  12801. let rand = Math.floor(Math.random() * allWeightNum);
  12802. for (const key in weightCfg) {
  12803. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12804. return weightCfg[key];
  12805. }
  12806. }
  12807. return weightCfg[1];
  12808. }
  12809. showGirlTalkPop(wordsIndex, node, msgNode) {
  12810. node.visible = true;
  12811. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12812. node.t0.play(Laya.Handler.create(this, () => {
  12813. node.visible = false;
  12814. }));
  12815. }
  12816. stopGirlPop(node) {
  12817. node.t0.stop();
  12818. node.visible = false;
  12819. }
  12820. createHead(loader, url, size = 107) {
  12821. if (Laya.Browser.name == "Browser") {
  12822. loader.url = url;
  12823. return;
  12824. }
  12825. else {
  12826. console.log('zh:url=', url);
  12827. loader.url = url;
  12828. }
  12829. }
  12830. addTestCoin(num) {
  12831. DataMgr.setCoin(num);
  12832. }
  12833. addTestDiamond(num) {
  12834. DataMgr.setDiamond(num);
  12835. }
  12836. addTestSkill() {
  12837. DataMgr.setBigSkill(0, 99);
  12838. DataMgr.setBigSkill(1, 99);
  12839. DataMgr.setBigSkill(2, 99);
  12840. }
  12841. playClassicEmotion(number, x, y) {
  12842. if (this.gameMode == GameMode.bigMove)
  12843. return;
  12844. let randIndex = this.randomNum(0, 2);
  12845. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12846. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12847. if (this.gameMgr.selfTurn) {
  12848. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12849. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12850. }
  12851. else {
  12852. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12853. }
  12854. else {
  12855. if (number == this.gameMgr.blackNum) {
  12856. if (this.gameMgr.selfBallArr.length == 0) {
  12857. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12858. }
  12859. else {
  12860. }
  12861. }
  12862. else {
  12863. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12864. }
  12865. }
  12866. }
  12867. }
  12868. else {
  12869. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12870. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12871. }
  12872. else {
  12873. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12874. }
  12875. else {
  12876. if (number == this.gameMgr.blackNum) {
  12877. if (this.gameMgr.aiBallArr.length == 0) {
  12878. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12879. }
  12880. else {
  12881. }
  12882. }
  12883. else {
  12884. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12885. }
  12886. }
  12887. }
  12888. }
  12889. }
  12890. playHappySound(number) {
  12891. if (this.gameMode != GameMode.classic)
  12892. return;
  12893. if (number == 8)
  12894. return;
  12895. let play = false;
  12896. if (this.gameMgr.selfTurn) {
  12897. if (this.gameMgr.ensureBallType) {
  12898. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12899. play = true;
  12900. }
  12901. }
  12902. else {
  12903. play = true;
  12904. }
  12905. }
  12906. else {
  12907. if (this.gameMgr.ensureBallType) {
  12908. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12909. play = true;
  12910. }
  12911. }
  12912. else {
  12913. play = true;
  12914. }
  12915. }
  12916. if (play)
  12917. xGame.soundMgr.playSound("applause");
  12918. }
  12919. destroyClassicEmotion() {
  12920. if (this.gameMode == GameMode.bigMove)
  12921. return;
  12922. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12923. parent.destroyChildren();
  12924. }
  12925. playAwardSpine(x, y) {
  12926. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12927. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12928. this.awardSpine.play(data, 0, false, parent);
  12929. }
  12930. destroyAwardSpine() {
  12931. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12932. parent.destroyChildren();
  12933. }
  12934. isBlock(bx, by, hx, hy, except = null) {
  12935. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12936. let balls = xGame.common.d2World.ballArr;
  12937. let outArr = [];
  12938. for (let index = 0; index < balls.length; index++) {
  12939. let obj = balls[index];
  12940. if (obj.number == 0)
  12941. continue;
  12942. if (obj == except)
  12943. continue;
  12944. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12945. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12946. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12947. if (num >= 1)
  12948. num = 1;
  12949. if (num < 0)
  12950. continue;
  12951. let gap = Math.sin(Math.acos(num)) * dis;
  12952. if (gap < this.ballSize) {
  12953. outArr.push({
  12954. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12955. disHon: Math.cos(Math.acos(num)) * dis,
  12956. disVer: Math.sin(Math.acos(num)) * dis,
  12957. src: balls[index],
  12958. dir: this.tempDir1
  12959. });
  12960. }
  12961. }
  12962. if (outArr.length > 0) {
  12963. outArr.sort((a, b) => { return a.dis - b.dis; });
  12964. return outArr[0];
  12965. }
  12966. }
  12967. AngleBetween(vector1, vector2) {
  12968. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12969. return rad * (180 / Math.PI);
  12970. }
  12971. getSecretaryScale() {
  12972. if (this.secretary.spineName == "mishu") {
  12973. return 1.28;
  12974. }
  12975. else {
  12976. return 1.024;
  12977. }
  12978. }
  12979. signAwardContainsRod(arr) {
  12980. let temp;
  12981. for (let index = 0; index < arr.length; index++) {
  12982. temp = arr[index].split('-')[0];
  12983. if (parseInt(temp) > 2) {
  12984. return true;
  12985. }
  12986. }
  12987. }
  12988. judgeSameDay() {
  12989. let lastTime = DataMgr.getSignTime();
  12990. let curTime = new Date().getTime();
  12991. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12992. return true;
  12993. }
  12994. return false;
  12995. }
  12996. getAward(arr, callback) {
  12997. let showTriple = arr[0].type <= 2;
  12998. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12999. let temp;
  13000. for (let index = 0; index < arr.length; index++) {
  13001. temp = arr[index];
  13002. switch (temp.type) {
  13003. case 1:
  13004. this.playObjFlyAnim(temp.num, temp.type);
  13005. break;
  13006. case 2:
  13007. this.playObjFlyAnim(temp.num, temp.type);
  13008. break;
  13009. case 3:
  13010. case 4:
  13011. case 5:
  13012. case 6:
  13013. DataMgr.setBallRod(temp.type - 2, 1);
  13014. DataMgr.setCurBallRod(temp.type - 2);
  13015. break;
  13016. default:
  13017. break;
  13018. }
  13019. }
  13020. callback && callback(watchVideo);
  13021. });
  13022. }
  13023. getMoneyNode() {
  13024. let moneyNode;
  13025. let sign = xGame.uiMgr.getUI(UISign);
  13026. let draw = xGame.uiMgr.getUI(UIDraw);
  13027. let end = xGame.uiMgr.getUI(UIGameEnd);
  13028. let skill = xGame.uiMgr.getUI(UISkill);
  13029. if (sign && !sign.isHide)
  13030. moneyNode = sign.ui.moneyNode;
  13031. if (draw && !draw.isHide)
  13032. moneyNode = draw.ui.moneyNode;
  13033. if (end && !end.isHide)
  13034. moneyNode = end.ui.moneyNode;
  13035. if (skill && !skill.isHide)
  13036. moneyNode = skill.ui.moneyNode;
  13037. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  13038. let main = xGame.uiMgr.getUI(UIMain);
  13039. if (condition1 && main && !main.isHide) {
  13040. moneyNode = main.ui.moneyNode;
  13041. }
  13042. return moneyNode;
  13043. }
  13044. playObjFlyAnim(num, type, callback = null) {
  13045. this.stPos.x = Laya.stage.width / 2;
  13046. this.stPos.y = Laya.stage.height / 2;
  13047. let moneyNode = this.getMoneyNode();
  13048. switch (type) {
  13049. case Prop.diamond:
  13050. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  13051. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  13052. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  13053. this.edPos.x /= 2;
  13054. this.edPos.y /= 2;
  13055. break;
  13056. case Prop.coin:
  13057. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  13058. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  13059. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  13060. this.edPos.x /= 2;
  13061. this.edPos.y /= 2;
  13062. break;
  13063. default:
  13064. break;
  13065. }
  13066. xGame.soundMgr.playSound("coinbag");
  13067. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  13068. switch (type) {
  13069. case Prop.diamond:
  13070. DataMgr.setDiamond(num);
  13071. break;
  13072. case Prop.coin:
  13073. DataMgr.setCoin(num);
  13074. break;
  13075. default:
  13076. break;
  13077. }
  13078. callback && callback();
  13079. });
  13080. }
  13081. autoPopUIView() {
  13082. let arr = [];
  13083. let sign = this.judgeSameDay() ? false : true;
  13084. if (sign)
  13085. arr.push("sign");
  13086. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  13087. if (draw)
  13088. arr.push("draw");
  13089. if (arr.length <= 0)
  13090. return;
  13091. let str = this.getRandArrEle(arr);
  13092. switch (str) {
  13093. case "sign":
  13094. xGame.uiMgr.Show(UISign);
  13095. break;
  13096. case "draw":
  13097. xGame.uiMgr.Show(UIDraw);
  13098. break;
  13099. default:
  13100. break;
  13101. }
  13102. }
  13103. getMSTime(time) {
  13104. let min = Math.floor(time / 60);
  13105. let sec = Math.floor((time - min * 60));
  13106. if (sec < 10)
  13107. sec = "0" + sec;
  13108. if (min < 10)
  13109. min = "0" + min;
  13110. return `${min}:${sec}`;
  13111. }
  13112. testPower() {
  13113. DataMgr.setPower(0, false);
  13114. }
  13115. getAllStarNum() {
  13116. let data = DataMgr.getPlaceBallLevelList();
  13117. let out = 0;
  13118. for (let index = 0; index < data.length; index++) {
  13119. out += data[index].star;
  13120. }
  13121. return out;
  13122. }
  13123. recoverCameraView() {
  13124. Laya.timer.once(900, this, () => {
  13125. xGame.common.showOneCamera("mainCamera");
  13126. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  13127. xGame.common.gameUI.ui.d2Node.alpha = 1;
  13128. xGame.common.gameUI.ui.border.alpha = 0;
  13129. if (Laya.physicsTimer.scale < 1) {
  13130. Laya.physicsTimer.scale = 1;
  13131. }
  13132. }
  13133. });
  13134. }
  13135. getClassicLevel() {
  13136. let successTimes = DataMgr.getClassicTimes();
  13137. let needKey = "";
  13138. let lastKey = "";
  13139. let cfg = cfgTable.classictimesData;
  13140. let data;
  13141. for (const key in cfg) {
  13142. data = cfg[key];
  13143. if (successTimes <= data.times) {
  13144. needKey = key;
  13145. }
  13146. lastKey = key;
  13147. }
  13148. if (needKey == "")
  13149. needKey = lastKey;
  13150. return cfg[needKey];
  13151. }
  13152. }
  13153. Common._instance = null;
  13154. class ui_Component92 extends fgui.GComponent {
  13155. static createInstance() {
  13156. return (fgui.UIPackage.createObject("game", "Component92"));
  13157. }
  13158. onConstruct() {
  13159. this.n0 = (this.getChild("n0"));
  13160. }
  13161. }
  13162. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13163. class ui_Component129 extends fgui.GProgressBar {
  13164. static createInstance() {
  13165. return (fgui.UIPackage.createObject("game", "Component129"));
  13166. }
  13167. onConstruct() {
  13168. this.bar_v = (this.getChild("bar_v"));
  13169. this.n84 = (this.getChild("n84"));
  13170. }
  13171. }
  13172. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13173. class ui_Component130 extends fgui.GComponent {
  13174. static createInstance() {
  13175. return (fgui.UIPackage.createObject("game", "Component130"));
  13176. }
  13177. onConstruct() {
  13178. this.ani = (this.getChild("ani"));
  13179. this.t0 = this.getTransition("t0");
  13180. }
  13181. }
  13182. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13183. class ui_powerEft extends fgui.GComponent {
  13184. static createInstance() {
  13185. return (fgui.UIPackage.createObject("game", "powerEft"));
  13186. }
  13187. onConstruct() {
  13188. this.ani = (this.getChild("ani"));
  13189. this.n88 = (this.getChild("n88"));
  13190. this.n89 = (this.getChild("n89"));
  13191. }
  13192. }
  13193. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13194. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13195. static createInstance() {
  13196. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13197. }
  13198. onConstruct() {
  13199. this.c1 = this.getController("c1");
  13200. this.n2 = (this.getChild("n2"));
  13201. this.n22 = (this.getChild("n22"));
  13202. this.n23 = (this.getChild("n23"));
  13203. this.n15 = (this.getChild("n15"));
  13204. this.challenge = (this.getChild("challenge"));
  13205. this.n17 = (this.getChild("n17"));
  13206. this.n3 = (this.getChild("n3"));
  13207. this.starNode = (this.getChild("starNode"));
  13208. this.levelTxt = (this.getChild("levelTxt"));
  13209. this.n14 = (this.getChild("n14"));
  13210. this.n19 = (this.getChild("n19"));
  13211. this.n20 = (this.getChild("n20"));
  13212. this.n21 = (this.getChild("n21"));
  13213. this.special = (this.getChild("special"));
  13214. }
  13215. }
  13216. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13217. class ui_Component79 extends fgui.GComponent {
  13218. static createInstance() {
  13219. return (fgui.UIPackage.createObject("game", "Component79"));
  13220. }
  13221. onConstruct() {
  13222. this.c1 = this.getController("c1");
  13223. this.n7 = (this.getChild("n7"));
  13224. this.n8 = (this.getChild("n8"));
  13225. this.n9 = (this.getChild("n9"));
  13226. this.n10 = (this.getChild("n10"));
  13227. this.n11 = (this.getChild("n11"));
  13228. this.n12 = (this.getChild("n12"));
  13229. }
  13230. }
  13231. ui_Component79.URL = "ui://isxx5ak7avag477";
  13232. class ui_Component80 extends fgui.GComponent {
  13233. static createInstance() {
  13234. return (fgui.UIPackage.createObject("game", "Component80"));
  13235. }
  13236. onConstruct() {
  13237. this.n0 = (this.getChild("n0"));
  13238. this.n1 = (this.getChild("n1"));
  13239. this.myList = (this.getChild("myList"));
  13240. this.t0 = this.getTransition("t0");
  13241. }
  13242. }
  13243. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13244. class ui_SignNormal extends fgui.GComponent {
  13245. static createInstance() {
  13246. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13247. }
  13248. onConstruct() {
  13249. this.c1 = this.getController("c1");
  13250. this.n7 = (this.getChild("n7"));
  13251. this.n15 = (this.getChild("n15"));
  13252. this.titleTxt = (this.getChild("titleTxt"));
  13253. this.n8 = (this.getChild("n8"));
  13254. this.myIcon = (this.getChild("myIcon"));
  13255. this.numTxt = (this.getChild("numTxt"));
  13256. this.n12 = (this.getChild("n12"));
  13257. this.n13 = (this.getChild("n13"));
  13258. this.n17 = (this.getChild("n17"));
  13259. this.n14 = (this.getChild("n14"));
  13260. }
  13261. }
  13262. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13263. class ui_Button_reg extends fgui.GButton {
  13264. static createInstance() {
  13265. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13266. }
  13267. onConstruct() {
  13268. this.button = this.getController("button");
  13269. this.n6 = (this.getChild("n6"));
  13270. this.n4 = (this.getChild("n4"));
  13271. }
  13272. }
  13273. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13274. class ui_screenNode extends fgui.GComponent {
  13275. static createInstance() {
  13276. return (fgui.UIPackage.createObject("game", "screenNode"));
  13277. }
  13278. onConstruct() {
  13279. this.n9 = (this.getChild("n9"));
  13280. this.screenImg = (this.getChild("screenImg"));
  13281. }
  13282. }
  13283. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13284. class ui_GetAwrad_com1 extends fgui.GComponent {
  13285. static createInstance() {
  13286. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13287. }
  13288. onConstruct() {
  13289. this.n38 = (this.getChild("n38"));
  13290. this.n39 = (this.getChild("n39"));
  13291. this.n40 = (this.getChild("n40"));
  13292. this.t0 = this.getTransition("t0");
  13293. this.t1 = this.getTransition("t1");
  13294. }
  13295. }
  13296. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13297. class ui_GetAwrad_com2 extends fgui.GComponent {
  13298. static createInstance() {
  13299. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13300. }
  13301. onConstruct() {
  13302. this.n39 = (this.getChild("n39"));
  13303. this.n40 = (this.getChild("n40"));
  13304. this.t0 = this.getTransition("t0");
  13305. }
  13306. }
  13307. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13308. class ui_Component128 extends fgui.GComponent {
  13309. static createInstance() {
  13310. return (fgui.UIPackage.createObject("game", "Component128"));
  13311. }
  13312. onConstruct() {
  13313. this.n38 = (this.getChild("n38"));
  13314. this.n40 = (this.getChild("n40"));
  13315. }
  13316. }
  13317. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13318. class ui_Component100_1 extends fgui.GComponent {
  13319. static createInstance() {
  13320. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13321. }
  13322. onConstruct() {
  13323. this.myNode = (this.getChild("myNode"));
  13324. this.t0 = this.getTransition("t0");
  13325. }
  13326. }
  13327. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13328. class ui_Component142 extends fgui.GComponent {
  13329. static createInstance() {
  13330. return (fgui.UIPackage.createObject("game", "Component142"));
  13331. }
  13332. onConstruct() {
  13333. this.n41 = (this.getChild("n41"));
  13334. this.n42 = (this.getChild("n42"));
  13335. }
  13336. }
  13337. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13338. class ui_main_guang extends fgui.GComponent {
  13339. static createInstance() {
  13340. return (fgui.UIPackage.createObject("game", "main_guang"));
  13341. }
  13342. onConstruct() {
  13343. this.n1 = (this.getChild("n1"));
  13344. this.n2 = (this.getChild("n2"));
  13345. this.n3 = (this.getChild("n3"));
  13346. this.n4 = (this.getChild("n4"));
  13347. this.n5 = (this.getChild("n5"));
  13348. this.n6 = (this.getChild("n6"));
  13349. this.n8 = (this.getChild("n8"));
  13350. this.t0 = this.getTransition("t0");
  13351. }
  13352. }
  13353. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13354. class ui_try_com1 extends fgui.GComponent {
  13355. static createInstance() {
  13356. return (fgui.UIPackage.createObject("game", "try_com1"));
  13357. }
  13358. onConstruct() {
  13359. this.c1 = this.getController("c1");
  13360. this.n0 = (this.getChild("n0"));
  13361. this.n2 = (this.getChild("n2"));
  13362. this.cancelBtn = (this.getChild("cancelBtn"));
  13363. this.videoBtn = (this.getChild("videoBtn"));
  13364. this.n9 = (this.getChild("n9"));
  13365. this.n24 = (this.getChild("n24"));
  13366. this.titleTxt = (this.getChild("titleTxt"));
  13367. this.n32 = (this.getChild("n32"));
  13368. this.n29 = (this.getChild("n29"));
  13369. this.n36 = (this.getChild("n36"));
  13370. this.txtTime = (this.getChild("txtTime"));
  13371. this.t0 = this.getTransition("t0");
  13372. }
  13373. }
  13374. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13375. class ui_try_com2 extends fgui.GComponent {
  13376. static createInstance() {
  13377. return (fgui.UIPackage.createObject("game", "try_com2"));
  13378. }
  13379. onConstruct() {
  13380. this.skillicon = (this.getChild("skillicon"));
  13381. this.n35 = (this.getChild("n35"));
  13382. this.n31 = (this.getChild("n31"));
  13383. this.n32 = (this.getChild("n32"));
  13384. this.n33 = (this.getChild("n33"));
  13385. this.n34 = (this.getChild("n34"));
  13386. }
  13387. }
  13388. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13389. class ui_try_com3 extends fgui.GComponent {
  13390. static createInstance() {
  13391. return (fgui.UIPackage.createObject("game", "try_com3"));
  13392. }
  13393. onConstruct() {
  13394. this.n33 = (this.getChild("n33"));
  13395. this.n34 = (this.getChild("n34"));
  13396. this.n35 = (this.getChild("n35"));
  13397. this.t0 = this.getTransition("t0");
  13398. }
  13399. }
  13400. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13401. class ui_huihe1 extends fgui.GComponent {
  13402. static createInstance() {
  13403. return (fgui.UIPackage.createObject("game", "huihe1"));
  13404. }
  13405. onConstruct() {
  13406. this.n0 = (this.getChild("n0"));
  13407. this.n1 = (this.getChild("n1"));
  13408. this.t0 = this.getTransition("t0");
  13409. }
  13410. }
  13411. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13412. class ui_huihe2 extends fgui.GComponent {
  13413. static createInstance() {
  13414. return (fgui.UIPackage.createObject("game", "huihe2"));
  13415. }
  13416. onConstruct() {
  13417. this.n0 = (this.getChild("n0"));
  13418. this.n1 = (this.getChild("n1"));
  13419. this.t0 = this.getTransition("t0");
  13420. }
  13421. }
  13422. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13423. class ui_Component143 extends fgui.GComponent {
  13424. static createInstance() {
  13425. return (fgui.UIPackage.createObject("game", "Component143"));
  13426. }
  13427. onConstruct() {
  13428. this.n3 = (this.getChild("n3"));
  13429. this.n4 = (this.getChild("n4"));
  13430. this.n5 = (this.getChild("n5"));
  13431. this.n6 = (this.getChild("n6"));
  13432. this.n7 = (this.getChild("n7"));
  13433. this.n8 = (this.getChild("n8"));
  13434. this.n9 = (this.getChild("n9"));
  13435. this.n10 = (this.getChild("n10"));
  13436. this.t0 = this.getTransition("t0");
  13437. }
  13438. }
  13439. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13440. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13441. static createInstance() {
  13442. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13443. }
  13444. onConstruct() {
  13445. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13446. }
  13447. }
  13448. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13449. class ui_dh_jingbi2 extends fgui.GComponent {
  13450. static createInstance() {
  13451. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13452. }
  13453. onConstruct() {
  13454. this.n0 = (this.getChild("n0"));
  13455. this.n1 = (this.getChild("n1"));
  13456. this.n2 = (this.getChild("n2"));
  13457. this.n3 = (this.getChild("n3"));
  13458. this.n4 = (this.getChild("n4"));
  13459. this.n5 = (this.getChild("n5"));
  13460. this.n6 = (this.getChild("n6"));
  13461. this.n8 = (this.getChild("n8"));
  13462. this.n10 = (this.getChild("n10"));
  13463. this.t0 = this.getTransition("t0");
  13464. }
  13465. }
  13466. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13467. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13468. static createInstance() {
  13469. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13470. }
  13471. onConstruct() {
  13472. this.n1 = (this.getChild("n1"));
  13473. this.n4 = (this.getChild("n4"));
  13474. this.t0 = this.getTransition("t0");
  13475. }
  13476. }
  13477. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13478. class ui_dh_jingbi3 extends fgui.GComponent {
  13479. static createInstance() {
  13480. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13481. }
  13482. onConstruct() {
  13483. this.n0 = (this.getChild("n0"));
  13484. this.n1 = (this.getChild("n1"));
  13485. this.n2 = (this.getChild("n2"));
  13486. this.n3 = (this.getChild("n3"));
  13487. this.n4 = (this.getChild("n4"));
  13488. this.n5 = (this.getChild("n5"));
  13489. this.n6 = (this.getChild("n6"));
  13490. this.n8 = (this.getChild("n8"));
  13491. this.n10 = (this.getChild("n10"));
  13492. this.t0 = this.getTransition("t0");
  13493. }
  13494. }
  13495. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13496. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13497. static createInstance() {
  13498. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13499. }
  13500. onConstruct() {
  13501. this.n3 = (this.getChild("n3"));
  13502. this.n1 = (this.getChild("n1"));
  13503. this.t0 = this.getTransition("t0");
  13504. }
  13505. }
  13506. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13507. class ui_hb_jinbi1 extends fgui.GButton {
  13508. static createInstance() {
  13509. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13510. }
  13511. onConstruct() {
  13512. this.n20 = (this.getChild("n20"));
  13513. this.n25 = (this.getChild("n25"));
  13514. this.coinTxt = (this.getChild("coinTxt"));
  13515. this.n28 = (this.getChild("n28"));
  13516. this.n32 = (this.getChild("n32"));
  13517. this.n38 = (this.getChild("n38"));
  13518. this.n45 = (this.getChild("n45"));
  13519. this.getTips = (this.getChild("getTips"));
  13520. this.n39 = (this.getChild("n39"));
  13521. this.diamondTxt = (this.getChild("diamondTxt"));
  13522. this.n41 = (this.getChild("n41"));
  13523. this.n42 = (this.getChild("n42"));
  13524. this.n46 = (this.getChild("n46"));
  13525. this.n47 = (this.getChild("n47"));
  13526. this.n48 = (this.getChild("n48"));
  13527. this.t0 = this.getTransition("t0");
  13528. }
  13529. }
  13530. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13531. class ui_hb_jinbi2 extends fgui.GButton {
  13532. static createInstance() {
  13533. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13534. }
  13535. onConstruct() {
  13536. this.n20 = (this.getChild("n20"));
  13537. this.n25 = (this.getChild("n25"));
  13538. this.coinTxt = (this.getChild("coinTxt"));
  13539. this.n28 = (this.getChild("n28"));
  13540. this.n32 = (this.getChild("n32"));
  13541. this.n38 = (this.getChild("n38"));
  13542. this.n39 = (this.getChild("n39"));
  13543. this.diamondTxt = (this.getChild("diamondTxt"));
  13544. this.n41 = (this.getChild("n41"));
  13545. this.n42 = (this.getChild("n42"));
  13546. this.n43 = (this.getChild("n43"));
  13547. this.n44 = (this.getChild("n44"));
  13548. this.n45 = (this.getChild("n45"));
  13549. this.t0 = this.getTransition("t0");
  13550. }
  13551. }
  13552. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13553. class ui_hb_jinbi3 extends fgui.GButton {
  13554. static createInstance() {
  13555. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13556. }
  13557. onConstruct() {
  13558. this.n20 = (this.getChild("n20"));
  13559. this.n25 = (this.getChild("n25"));
  13560. this.coinTxt = (this.getChild("coinTxt"));
  13561. this.n28 = (this.getChild("n28"));
  13562. this.n32 = (this.getChild("n32"));
  13563. this.n38 = (this.getChild("n38"));
  13564. this.n39 = (this.getChild("n39"));
  13565. this.diamondTxt = (this.getChild("diamondTxt"));
  13566. this.n41 = (this.getChild("n41"));
  13567. this.n42 = (this.getChild("n42"));
  13568. this.n43 = (this.getChild("n43"));
  13569. this.n44 = (this.getChild("n44"));
  13570. this.n45 = (this.getChild("n45"));
  13571. this.t0 = this.getTransition("t0");
  13572. }
  13573. }
  13574. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13575. class ui_Component104 extends fgui.GComponent {
  13576. static createInstance() {
  13577. return (fgui.UIPackage.createObject("game", "Component104"));
  13578. }
  13579. onConstruct() {
  13580. this.c1 = this.getController("c1");
  13581. this.n12 = (this.getChild("n12"));
  13582. this.coinBtn = (this.getChild("coinBtn"));
  13583. this.diamondBtn = (this.getChild("diamondBtn"));
  13584. this.node3 = (this.getChild("node3"));
  13585. this.node4 = (this.getChild("node4"));
  13586. this.node5 = (this.getChild("node5"));
  13587. this.node1 = (this.getChild("node1"));
  13588. this.node2 = (this.getChild("node2"));
  13589. this.node6 = (this.getChild("node6"));
  13590. this.t0 = this.getTransition("t0");
  13591. }
  13592. }
  13593. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13594. class ui_Component105 extends fgui.GButton {
  13595. static createInstance() {
  13596. return (fgui.UIPackage.createObject("game", "Component105"));
  13597. }
  13598. onConstruct() {
  13599. this.c1 = this.getController("c1");
  13600. this.n49 = (this.getChild("n49"));
  13601. this.n18 = (this.getChild("n18"));
  13602. this.n46 = (this.getChild("n46"));
  13603. this.n48 = (this.getChild("n48"));
  13604. }
  13605. }
  13606. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13607. class ui_Component106 extends fgui.GButton {
  13608. static createInstance() {
  13609. return (fgui.UIPackage.createObject("game", "Component106"));
  13610. }
  13611. onConstruct() {
  13612. this.c1 = this.getController("c1");
  13613. this.n49 = (this.getChild("n49"));
  13614. this.n18 = (this.getChild("n18"));
  13615. this.n46 = (this.getChild("n46"));
  13616. this.n48 = (this.getChild("n48"));
  13617. }
  13618. }
  13619. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13620. class ui_hb_zs1 extends fgui.GButton {
  13621. static createInstance() {
  13622. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13623. }
  13624. onConstruct() {
  13625. this.c1 = this.getController("c1");
  13626. this.n20 = (this.getChild("n20"));
  13627. this.n21 = (this.getChild("n21"));
  13628. this.n26 = (this.getChild("n26"));
  13629. this.n27 = (this.getChild("n27"));
  13630. this.shareTxt = (this.getChild("shareTxt"));
  13631. this.n32 = (this.getChild("n32"));
  13632. this.n38 = (this.getChild("n38"));
  13633. this.n39 = (this.getChild("n39"));
  13634. this.n44 = (this.getChild("n44"));
  13635. this.diamondTxt = (this.getChild("diamondTxt"));
  13636. this.n41 = (this.getChild("n41"));
  13637. this.n45 = (this.getChild("n45"));
  13638. this.n47 = (this.getChild("n47"));
  13639. this.n48 = (this.getChild("n48"));
  13640. this.randTxt = (this.getChild("randTxt"));
  13641. this.n50 = (this.getChild("n50"));
  13642. this.t0 = this.getTransition("t0");
  13643. }
  13644. }
  13645. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13646. class ui_dh_zs1 extends fgui.GComponent {
  13647. static createInstance() {
  13648. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13649. }
  13650. onConstruct() {
  13651. this.n10 = (this.getChild("n10"));
  13652. this.n9 = (this.getChild("n9"));
  13653. this.n1 = (this.getChild("n1"));
  13654. this.n2 = (this.getChild("n2"));
  13655. this.n3 = (this.getChild("n3"));
  13656. this.n4 = (this.getChild("n4"));
  13657. this.n5 = (this.getChild("n5"));
  13658. this.n6 = (this.getChild("n6"));
  13659. this.n8 = (this.getChild("n8"));
  13660. this.n11 = (this.getChild("n11"));
  13661. this.t0 = this.getTransition("t0");
  13662. }
  13663. }
  13664. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13665. class ui_dh_zs1_1 extends fgui.GComponent {
  13666. static createInstance() {
  13667. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13668. }
  13669. onConstruct() {
  13670. this.n3 = (this.getChild("n3"));
  13671. this.n1 = (this.getChild("n1"));
  13672. this.t0 = this.getTransition("t0");
  13673. }
  13674. }
  13675. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13676. class ui_hb_zs2 extends fgui.GButton {
  13677. static createInstance() {
  13678. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13679. }
  13680. onConstruct() {
  13681. this.n20 = (this.getChild("n20"));
  13682. this.n21 = (this.getChild("n21"));
  13683. this.n26 = (this.getChild("n26"));
  13684. this.n27 = (this.getChild("n27"));
  13685. this.n32 = (this.getChild("n32"));
  13686. this.n38 = (this.getChild("n38"));
  13687. this.n39 = (this.getChild("n39"));
  13688. this.n44 = (this.getChild("n44"));
  13689. this.diamondTxt = (this.getChild("diamondTxt"));
  13690. this.n41 = (this.getChild("n41"));
  13691. this.n45 = (this.getChild("n45"));
  13692. this.t0 = this.getTransition("t0");
  13693. }
  13694. }
  13695. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13696. class ui_hb_zs3 extends fgui.GButton {
  13697. static createInstance() {
  13698. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13699. }
  13700. onConstruct() {
  13701. this.n20 = (this.getChild("n20"));
  13702. this.n21 = (this.getChild("n21"));
  13703. this.n26 = (this.getChild("n26"));
  13704. this.n27 = (this.getChild("n27"));
  13705. this.n32 = (this.getChild("n32"));
  13706. this.n38 = (this.getChild("n38"));
  13707. this.n47 = (this.getChild("n47"));
  13708. this.t0 = this.getTransition("t0");
  13709. }
  13710. }
  13711. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13712. class ui_dh_zs2 extends fgui.GComponent {
  13713. static createInstance() {
  13714. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13715. }
  13716. onConstruct() {
  13717. this.n10 = (this.getChild("n10"));
  13718. this.n9 = (this.getChild("n9"));
  13719. this.n1 = (this.getChild("n1"));
  13720. this.n2 = (this.getChild("n2"));
  13721. this.n3 = (this.getChild("n3"));
  13722. this.n4 = (this.getChild("n4"));
  13723. this.n5 = (this.getChild("n5"));
  13724. this.n6 = (this.getChild("n6"));
  13725. this.n8 = (this.getChild("n8"));
  13726. this.n11 = (this.getChild("n11"));
  13727. this.t0 = this.getTransition("t0");
  13728. }
  13729. }
  13730. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13731. class ui_dh_zs2_1 extends fgui.GComponent {
  13732. static createInstance() {
  13733. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13734. }
  13735. onConstruct() {
  13736. this.n3 = (this.getChild("n3"));
  13737. this.n1 = (this.getChild("n1"));
  13738. this.t0 = this.getTransition("t0");
  13739. }
  13740. }
  13741. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13742. class ui_dh_zs3 extends fgui.GComponent {
  13743. static createInstance() {
  13744. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13745. }
  13746. onConstruct() {
  13747. this.n10 = (this.getChild("n10"));
  13748. this.n9 = (this.getChild("n9"));
  13749. this.n1 = (this.getChild("n1"));
  13750. this.n2 = (this.getChild("n2"));
  13751. this.n3 = (this.getChild("n3"));
  13752. this.n4 = (this.getChild("n4"));
  13753. this.n5 = (this.getChild("n5"));
  13754. this.n6 = (this.getChild("n6"));
  13755. this.n8 = (this.getChild("n8"));
  13756. this.n11 = (this.getChild("n11"));
  13757. this.t0 = this.getTransition("t0");
  13758. }
  13759. }
  13760. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13761. class ui_dh_zs3_1 extends fgui.GComponent {
  13762. static createInstance() {
  13763. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13764. }
  13765. onConstruct() {
  13766. this.n3 = (this.getChild("n3"));
  13767. this.n1 = (this.getChild("n1"));
  13768. this.t0 = this.getTransition("t0");
  13769. }
  13770. }
  13771. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13772. class ui_Component107 extends fgui.GComponent {
  13773. static createInstance() {
  13774. return (fgui.UIPackage.createObject("game", "Component107"));
  13775. }
  13776. onConstruct() {
  13777. this.n18 = (this.getChild("n18"));
  13778. this.n19 = (this.getChild("n19"));
  13779. this.n20 = (this.getChild("n20"));
  13780. this.n21 = (this.getChild("n21"));
  13781. this.n22 = (this.getChild("n22"));
  13782. this.levelTxt = (this.getChild("levelTxt"));
  13783. this.t0 = this.getTransition("t0");
  13784. }
  13785. }
  13786. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13787. class ui_box_com1 extends fgui.GComponent {
  13788. static createInstance() {
  13789. return (fgui.UIPackage.createObject("game", "box_com1"));
  13790. }
  13791. onConstruct() {
  13792. this.n14 = (this.getChild("n14"));
  13793. this.n6 = (this.getChild("n6"));
  13794. this.t0 = this.getTransition("t0");
  13795. }
  13796. }
  13797. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13798. class ui_box_com2 extends fgui.GProgressBar {
  13799. static createInstance() {
  13800. return (fgui.UIPackage.createObject("game", "box_com2"));
  13801. }
  13802. onConstruct() {
  13803. this.bg0 = (this.getChild("bg0"));
  13804. this.bg = (this.getChild("bg"));
  13805. this.bar = (this.getChild("bar"));
  13806. this.n7 = (this.getChild("n7"));
  13807. this.n8 = (this.getChild("n8"));
  13808. this.n10 = (this.getChild("n10"));
  13809. this.n11 = (this.getChild("n11"));
  13810. this.n12 = (this.getChild("n12"));
  13811. }
  13812. }
  13813. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13814. class ui_box_com4 extends fgui.GComponent {
  13815. static createInstance() {
  13816. return (fgui.UIPackage.createObject("game", "box_com4"));
  13817. }
  13818. onConstruct() {
  13819. this.n8 = (this.getChild("n8"));
  13820. this.t0 = this.getTransition("t0");
  13821. }
  13822. }
  13823. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13824. class ui_box_com3 extends fgui.GComponent {
  13825. static createInstance() {
  13826. return (fgui.UIPackage.createObject("game", "box_com3"));
  13827. }
  13828. onConstruct() {
  13829. this.n2 = (this.getChild("n2"));
  13830. this.n3 = (this.getChild("n3"));
  13831. this.n4 = (this.getChild("n4"));
  13832. this.n5 = (this.getChild("n5"));
  13833. this.t0 = this.getTransition("t0");
  13834. this.t1 = this.getTransition("t1");
  13835. }
  13836. }
  13837. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13838. class ui_Component97 extends fgui.GComponent {
  13839. static createInstance() {
  13840. return (fgui.UIPackage.createObject("game", "Component97"));
  13841. }
  13842. onConstruct() {
  13843. this.c1 = this.getController("c1");
  13844. this.n46 = (this.getChild("n46"));
  13845. this.diamondNode = (this.getChild("diamondNode"));
  13846. this.coinNode = (this.getChild("coinNode"));
  13847. this.t0 = this.getTransition("t0");
  13848. }
  13849. }
  13850. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13851. class ui_Component98 extends fgui.GButton {
  13852. static createInstance() {
  13853. return (fgui.UIPackage.createObject("game", "Component98"));
  13854. }
  13855. onConstruct() {
  13856. this.n8 = (this.getChild("n8"));
  13857. this.n40 = (this.getChild("n40"));
  13858. }
  13859. }
  13860. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13861. class ui_Component28_11 extends fgui.GButton {
  13862. static createInstance() {
  13863. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13864. }
  13865. onConstruct() {
  13866. this.c1 = this.getController("c1");
  13867. this.n12 = (this.getChild("n12"));
  13868. this.n17 = (this.getChild("n17"));
  13869. this.n13 = (this.getChild("n13"));
  13870. this.diamondTxt = (this.getChild("diamondTxt"));
  13871. this.n15 = (this.getChild("n15"));
  13872. this.n16 = (this.getChild("n16"));
  13873. }
  13874. }
  13875. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13876. class ui_Component58_11 extends fgui.GComponent {
  13877. static createInstance() {
  13878. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13879. }
  13880. onConstruct() {
  13881. this.c1 = this.getController("c1");
  13882. this.n23 = (this.getChild("n23"));
  13883. this.n41 = (this.getChild("n41"));
  13884. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13885. this.n_daoju = (this.getChild("n_daoju"));
  13886. this.myList = (this.getChild("myList"));
  13887. this.djList = (this.getChild("djList"));
  13888. this.t0 = this.getTransition("t0");
  13889. }
  13890. }
  13891. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13892. class ui_Component100 extends fgui.GComponent {
  13893. static createInstance() {
  13894. return (fgui.UIPackage.createObject("game", "Component100"));
  13895. }
  13896. onConstruct() {
  13897. this.c1 = this.getController("c1");
  13898. this.n75 = (this.getChild("n75"));
  13899. this.n76 = (this.getChild("n76"));
  13900. this.n80 = (this.getChild("n80"));
  13901. this.txt = (this.getChild("txt"));
  13902. this.spineRoot = (this.getChild("spineRoot"));
  13903. }
  13904. }
  13905. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13906. class ui_Component101 extends fgui.GComponent {
  13907. static createInstance() {
  13908. return (fgui.UIPackage.createObject("game", "Component101"));
  13909. }
  13910. onConstruct() {
  13911. this.c1 = this.getController("c1");
  13912. this.n36 = (this.getChild("n36"));
  13913. this.n35 = (this.getChild("n35"));
  13914. this.n33 = (this.getChild("n33"));
  13915. this.n34 = (this.getChild("n34"));
  13916. }
  13917. }
  13918. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13919. class ui_Component53 extends fgui.GComponent {
  13920. static createInstance() {
  13921. return (fgui.UIPackage.createObject("game", "Component53"));
  13922. }
  13923. onConstruct() {
  13924. this.n0 = (this.getChild("n0"));
  13925. this.n1 = (this.getChild("n1"));
  13926. this.n2 = (this.getChild("n2"));
  13927. this.n3 = (this.getChild("n3"));
  13928. this.n4 = (this.getChild("n4"));
  13929. this.n5 = (this.getChild("n5"));
  13930. this.n6 = (this.getChild("n6"));
  13931. this.n7 = (this.getChild("n7"));
  13932. this.n8 = (this.getChild("n8"));
  13933. this.n9 = (this.getChild("n9"));
  13934. this.n10 = (this.getChild("n10"));
  13935. this.n11 = (this.getChild("n11"));
  13936. this.n12 = (this.getChild("n12"));
  13937. this.n13 = (this.getChild("n13"));
  13938. this.n14 = (this.getChild("n14"));
  13939. this.n15 = (this.getChild("n15"));
  13940. this.n16 = (this.getChild("n16"));
  13941. this.n19 = (this.getChild("n19"));
  13942. this.n20 = (this.getChild("n20"));
  13943. this.n21 = (this.getChild("n21"));
  13944. this.n22 = (this.getChild("n22"));
  13945. this.n23 = (this.getChild("n23"));
  13946. this.n24 = (this.getChild("n24"));
  13947. this.n25 = (this.getChild("n25"));
  13948. this.n26 = (this.getChild("n26"));
  13949. this.n27 = (this.getChild("n27"));
  13950. this.n28 = (this.getChild("n28"));
  13951. this.n29 = (this.getChild("n29"));
  13952. this.n30 = (this.getChild("n30"));
  13953. this.n31 = (this.getChild("n31"));
  13954. this.n32 = (this.getChild("n32"));
  13955. this.n33 = (this.getChild("n33"));
  13956. this.n34 = (this.getChild("n34"));
  13957. this.n35 = (this.getChild("n35"));
  13958. this.t0 = this.getTransition("t0");
  13959. }
  13960. }
  13961. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13962. class ui_Component58 extends fgui.GComponent {
  13963. static createInstance() {
  13964. return (fgui.UIPackage.createObject("game", "Component58"));
  13965. }
  13966. onConstruct() {
  13967. this.n23 = (this.getChild("n23"));
  13968. this.n41 = (this.getChild("n41"));
  13969. this.n8 = (this.getChild("n8"));
  13970. this.skillList = (this.getChild("skillList"));
  13971. this.t0 = this.getTransition("t0");
  13972. }
  13973. }
  13974. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13975. class ui_Component59 extends fgui.GComponent {
  13976. static createInstance() {
  13977. return (fgui.UIPackage.createObject("game", "Component59"));
  13978. }
  13979. onConstruct() {
  13980. this.n3 = (this.getChild("n3"));
  13981. this.msgTxt = (this.getChild("msgTxt"));
  13982. this.t0 = this.getTransition("t0");
  13983. }
  13984. }
  13985. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13986. class ui_RulerNode extends fgui.GComponent {
  13987. static createInstance() {
  13988. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13989. }
  13990. onConstruct() {
  13991. this.n6 = (this.getChild("n6"));
  13992. this.n4 = (this.getChild("n4"));
  13993. this.img1 = (this.getChild("img1"));
  13994. this.img2 = (this.getChild("img2"));
  13995. }
  13996. }
  13997. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13998. class ui_Component108 extends fgui.GComponent {
  13999. static createInstance() {
  14000. return (fgui.UIPackage.createObject("game", "Component108"));
  14001. }
  14002. onConstruct() {
  14003. this.n19 = (this.getChild("n19"));
  14004. this.t0 = this.getTransition("t0");
  14005. }
  14006. }
  14007. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  14008. class ui_Component63 extends fgui.GComponent {
  14009. static createInstance() {
  14010. return (fgui.UIPackage.createObject("game", "Component63"));
  14011. }
  14012. onConstruct() {
  14013. this.n66 = (this.getChild("n66"));
  14014. this.n56 = (this.getChild("n56"));
  14015. this.n63 = (this.getChild("n63"));
  14016. this.n65 = (this.getChild("n65"));
  14017. this.t0 = this.getTransition("t0");
  14018. }
  14019. }
  14020. ui_Component63.URL = "ui://isxx5ak7h657452";
  14021. class ui_topNode extends fgui.GComponent {
  14022. static createInstance() {
  14023. return (fgui.UIPackage.createObject("game", "topNode"));
  14024. }
  14025. onConstruct() {
  14026. this.selfProgress = (this.getChild("selfProgress"));
  14027. this.aiProgress = (this.getChild("aiProgress"));
  14028. this.selfKuang = (this.getChild("selfKuang"));
  14029. this.aiKuang = (this.getChild("aiKuang"));
  14030. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  14031. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  14032. this.n33 = (this.getChild("n33"));
  14033. this.n34 = (this.getChild("n34"));
  14034. this.selfNameTxt = (this.getChild("selfNameTxt"));
  14035. this.aiNameTxt = (this.getChild("aiNameTxt"));
  14036. this.selfBallList = (this.getChild("selfBallList"));
  14037. this.aiBallList = (this.getChild("aiBallList"));
  14038. this.middleNode = (this.getChild("middleNode"));
  14039. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  14040. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  14041. this.scoreNode = (this.getChild("scoreNode"));
  14042. this.selfTips = (this.getChild("selfTips"));
  14043. this.aiTips = (this.getChild("aiTips"));
  14044. }
  14045. }
  14046. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  14047. class ui_selfProgress extends fgui.GProgressBar {
  14048. static createInstance() {
  14049. return (fgui.UIPackage.createObject("game", "selfProgress"));
  14050. }
  14051. onConstruct() {
  14052. this.n3 = (this.getChild("n3"));
  14053. this.bar = (this.getChild("bar"));
  14054. }
  14055. }
  14056. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  14057. class ui_aiProgress extends fgui.GProgressBar {
  14058. static createInstance() {
  14059. return (fgui.UIPackage.createObject("game", "aiProgress"));
  14060. }
  14061. onConstruct() {
  14062. this.n3 = (this.getChild("n3"));
  14063. this.bar = (this.getChild("bar"));
  14064. }
  14065. }
  14066. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  14067. class ui_ballDisplay extends fgui.GComponent {
  14068. static createInstance() {
  14069. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  14070. }
  14071. onConstruct() {
  14072. this.myImg = (this.getChild("myImg"));
  14073. }
  14074. }
  14075. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  14076. class ui_moveNode extends fgui.GComponent {
  14077. static createInstance() {
  14078. return (fgui.UIPackage.createObject("game", "moveNode"));
  14079. }
  14080. onConstruct() {
  14081. this.n8 = (this.getChild("n8"));
  14082. this.finger = (this.getChild("finger"));
  14083. }
  14084. }
  14085. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  14086. class ui_cancelBtn extends fgui.GButton {
  14087. static createInstance() {
  14088. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  14089. }
  14090. onConstruct() {
  14091. this.c1 = this.getController("c1");
  14092. this.n0 = (this.getChild("n0"));
  14093. this.n1 = (this.getChild("n1"));
  14094. }
  14095. }
  14096. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  14097. class ui_shareBtn extends fgui.GButton {
  14098. static createInstance() {
  14099. return (fgui.UIPackage.createObject("game", "shareBtn"));
  14100. }
  14101. onConstruct() {
  14102. this.c1 = this.getController("c1");
  14103. this.n2 = (this.getChild("n2"));
  14104. this.n1 = (this.getChild("n1"));
  14105. this.n3 = (this.getChild("n3"));
  14106. this.n4 = (this.getChild("n4"));
  14107. this.n5 = (this.getChild("n5"));
  14108. this.n6 = (this.getChild("n6"));
  14109. }
  14110. }
  14111. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  14112. class ui_share2Btn extends fgui.GButton {
  14113. static createInstance() {
  14114. return (fgui.UIPackage.createObject("game", "share2Btn"));
  14115. }
  14116. onConstruct() {
  14117. this.n3 = (this.getChild("n3"));
  14118. }
  14119. }
  14120. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  14121. class ui_rodMethodNode extends fgui.GComponent {
  14122. static createInstance() {
  14123. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  14124. }
  14125. onConstruct() {
  14126. this.bg = (this.getChild("bg"));
  14127. this.dot = (this.getChild("dot"));
  14128. }
  14129. }
  14130. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  14131. class ui_sureBtn extends fgui.GButton {
  14132. static createInstance() {
  14133. return (fgui.UIPackage.createObject("game", "sureBtn"));
  14134. }
  14135. onConstruct() {
  14136. this.n2 = (this.getChild("n2"));
  14137. this.n1 = (this.getChild("n1"));
  14138. }
  14139. }
  14140. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  14141. class ui_Component18 extends fgui.GComponent {
  14142. static createInstance() {
  14143. return (fgui.UIPackage.createObject("game", "Component18"));
  14144. }
  14145. onConstruct() {
  14146. this.c1 = this.getController("c1");
  14147. this.nameTxt = (this.getChild("nameTxt"));
  14148. this.headImg = (this.getChild("headImg"));
  14149. this.n24 = (this.getChild("n24"));
  14150. this.skillImg = (this.getChild("skillImg"));
  14151. this.skillTxt = (this.getChild("skillTxt"));
  14152. }
  14153. }
  14154. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14155. class ui_Component45 extends fgui.GComponent {
  14156. static createInstance() {
  14157. return (fgui.UIPackage.createObject("game", "Component45"));
  14158. }
  14159. onConstruct() {
  14160. this.c1 = this.getController("c1");
  14161. this.n40 = (this.getChild("n40"));
  14162. this.n41 = (this.getChild("n41"));
  14163. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14164. this.n42 = (this.getChild("n42"));
  14165. this.awardTxt = (this.getChild("awardTxt"));
  14166. this.n44 = (this.getChild("n44"));
  14167. this.t0 = this.getTransition("t0");
  14168. }
  14169. }
  14170. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14171. class ui_emotionDisplay extends fgui.GButton {
  14172. static createInstance() {
  14173. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14174. }
  14175. onConstruct() {
  14176. this.myIcon = (this.getChild("myIcon"));
  14177. }
  14178. }
  14179. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14180. class ui_Component49 extends fgui.GButton {
  14181. static createInstance() {
  14182. return (fgui.UIPackage.createObject("game", "Component49"));
  14183. }
  14184. onConstruct() {
  14185. this.n69 = (this.getChild("n69"));
  14186. this.n56 = (this.getChild("n56"));
  14187. }
  14188. }
  14189. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14190. class ui_Component50 extends fgui.GButton {
  14191. static createInstance() {
  14192. return (fgui.UIPackage.createObject("game", "Component50"));
  14193. }
  14194. onConstruct() {
  14195. this.n54 = (this.getChild("n54"));
  14196. this.n65 = (this.getChild("n65"));
  14197. }
  14198. }
  14199. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14200. class ui_Component51 extends fgui.GButton {
  14201. static createInstance() {
  14202. return (fgui.UIPackage.createObject("game", "Component51"));
  14203. }
  14204. onConstruct() {
  14205. this.c1 = this.getController("c1");
  14206. this.n51 = (this.getChild("n51"));
  14207. this.n54 = (this.getChild("n54"));
  14208. }
  14209. }
  14210. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14211. class ui_Button5 extends fgui.GButton {
  14212. static createInstance() {
  14213. return (fgui.UIPackage.createObject("game", "Button5"));
  14214. }
  14215. onConstruct() {
  14216. this.c1 = this.getController("c1");
  14217. this.n0 = (this.getChild("n0"));
  14218. this.n2 = (this.getChild("n2"));
  14219. }
  14220. }
  14221. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14222. class ui_Component124 extends fgui.GComponent {
  14223. static createInstance() {
  14224. return (fgui.UIPackage.createObject("game", "Component124"));
  14225. }
  14226. onConstruct() {
  14227. this.n22 = (this.getChild("n22"));
  14228. this.shareNode = (this.getChild("shareNode"));
  14229. }
  14230. }
  14231. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14232. class ui_Component125 extends fgui.GComponent {
  14233. static createInstance() {
  14234. return (fgui.UIPackage.createObject("game", "Component125"));
  14235. }
  14236. onConstruct() {
  14237. this.n29 = (this.getChild("n29"));
  14238. this.coinTxt = (this.getChild("coinTxt"));
  14239. }
  14240. }
  14241. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14242. class ui_Component52 extends fgui.GButton {
  14243. static createInstance() {
  14244. return (fgui.UIPackage.createObject("game", "Component52"));
  14245. }
  14246. onConstruct() {
  14247. this.n35 = (this.getChild("n35"));
  14248. this.n36 = (this.getChild("n36"));
  14249. }
  14250. }
  14251. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14252. class ui_Component_denglu extends fgui.GComponent {
  14253. static createInstance() {
  14254. return (fgui.UIPackage.createObject("game", "Component_denglu"));
  14255. }
  14256. onConstruct() {
  14257. this.c1 = this.getController("c1");
  14258. this.n102 = (this.getChild("n102"));
  14259. this.n103 = (this.getChild("n103"));
  14260. }
  14261. }
  14262. ui_Component_denglu.URL = "ui://isxx5ak7ijwrv5a0";
  14263. class ui_Component_fl_1 extends fgui.GComponent {
  14264. static createInstance() {
  14265. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14266. }
  14267. onConstruct() {
  14268. this.n_zzq_fl1 = (this.getChild("n_zzq_fl1"));
  14269. this.txt_price = (this.getChild("txt_price"));
  14270. this.n_no = (this.getChild("n_no"));
  14271. this.n_buy = (this.getChild("n_buy"));
  14272. }
  14273. }
  14274. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14275. class ui_Component_fl_2 extends fgui.GComponent {
  14276. static createInstance() {
  14277. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14278. }
  14279. onConstruct() {
  14280. this.n_zzq_fl2 = (this.getChild("n_zzq_fl2"));
  14281. this.txt_price = (this.getChild("txt_price"));
  14282. this.n_no = (this.getChild("n_no"));
  14283. this.n_buy = (this.getChild("n_buy"));
  14284. }
  14285. }
  14286. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14287. class ui_drawBtn extends fgui.GButton {
  14288. static createInstance() {
  14289. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14290. }
  14291. onConstruct() {
  14292. this.c1 = this.getController("c1");
  14293. this.n2 = (this.getChild("n2"));
  14294. this.n1 = (this.getChild("n1"));
  14295. this.n5 = (this.getChild("n5"));
  14296. }
  14297. }
  14298. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14299. class ui_Component43 extends fgui.GButton {
  14300. static createInstance() {
  14301. return (fgui.UIPackage.createObject("game", "Component43"));
  14302. }
  14303. onConstruct() {
  14304. this.n49 = (this.getChild("n49"));
  14305. }
  14306. }
  14307. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14308. class ui_wordsDisplay extends fgui.GComponent {
  14309. static createInstance() {
  14310. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14311. }
  14312. onConstruct() {
  14313. this.txt = (this.getChild("txt"));
  14314. this.n63 = (this.getChild("n63"));
  14315. }
  14316. }
  14317. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14318. class ui_Component_phb extends fgui.GComponent {
  14319. static createInstance() {
  14320. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14321. }
  14322. onConstruct() {
  14323. this.n3 = (this.getChild("n3"));
  14324. this.n4 = (this.getChild("n4"));
  14325. }
  14326. }
  14327. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14328. class ui_Component3 extends fgui.GComponent {
  14329. static createInstance() {
  14330. return (fgui.UIPackage.createObject("game", "Component3"));
  14331. }
  14332. onConstruct() {
  14333. this.n26 = (this.getChild("n26"));
  14334. this.n24 = (this.getChild("n24"));
  14335. this.nameTxt = (this.getChild("nameTxt"));
  14336. this.headRoot = (this.getChild("headRoot"));
  14337. }
  14338. }
  14339. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14340. class ui_Component4 extends fgui.GComponent {
  14341. static createInstance() {
  14342. return (fgui.UIPackage.createObject("game", "Component4"));
  14343. }
  14344. onConstruct() {
  14345. this.headImg = (this.getChild("headImg"));
  14346. }
  14347. }
  14348. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14349. class ui_Component7 extends fgui.GButton {
  14350. static createInstance() {
  14351. return (fgui.UIPackage.createObject("game", "Component7"));
  14352. }
  14353. onConstruct() {
  14354. this.n17 = (this.getChild("n17"));
  14355. }
  14356. }
  14357. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14358. class ui_Component8 extends fgui.GButton {
  14359. static createInstance() {
  14360. return (fgui.UIPackage.createObject("game", "Component8"));
  14361. }
  14362. onConstruct() {
  14363. this.n19 = (this.getChild("n19"));
  14364. }
  14365. }
  14366. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14367. class ui_Component10 extends fgui.GButton {
  14368. static createInstance() {
  14369. return (fgui.UIPackage.createObject("game", "Component10"));
  14370. }
  14371. onConstruct() {
  14372. this.c1 = this.getController("c1");
  14373. this.n40 = (this.getChild("n40"));
  14374. }
  14375. }
  14376. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14377. class ui_Component11 extends fgui.GButton {
  14378. static createInstance() {
  14379. return (fgui.UIPackage.createObject("game", "Component11"));
  14380. }
  14381. onConstruct() {
  14382. this.n34 = (this.getChild("n34"));
  14383. }
  14384. }
  14385. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14386. class ui_Component12 extends fgui.GButton {
  14387. static createInstance() {
  14388. return (fgui.UIPackage.createObject("game", "Component12"));
  14389. }
  14390. onConstruct() {
  14391. this.n35 = (this.getChild("n35"));
  14392. }
  14393. }
  14394. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14395. class ui_Component13 extends fgui.GButton {
  14396. static createInstance() {
  14397. return (fgui.UIPackage.createObject("game", "Component13"));
  14398. }
  14399. onConstruct() {
  14400. this.n27 = (this.getChild("n27"));
  14401. this.n36 = (this.getChild("n36"));
  14402. }
  14403. }
  14404. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14405. class ui_dh_js_tuowei extends fgui.GComponent {
  14406. static createInstance() {
  14407. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14408. }
  14409. onConstruct() {
  14410. this.n19 = (this.getChild("n19"));
  14411. this.n18 = (this.getChild("n18"));
  14412. this.n0 = (this.getChild("n0"));
  14413. this.n3 = (this.getChild("n3"));
  14414. this.n4 = (this.getChild("n4"));
  14415. this.n5 = (this.getChild("n5"));
  14416. this.n6 = (this.getChild("n6"));
  14417. this.n8 = (this.getChild("n8"));
  14418. this.n9 = (this.getChild("n9"));
  14419. this.n10 = (this.getChild("n10"));
  14420. this.n11 = (this.getChild("n11"));
  14421. this.n12 = (this.getChild("n12"));
  14422. this.n13 = (this.getChild("n13"));
  14423. this.n14 = (this.getChild("n14"));
  14424. this.n15 = (this.getChild("n15"));
  14425. this.n20 = (this.getChild("n20"));
  14426. this.t0 = this.getTransition("t0");
  14427. this.t1 = this.getTransition("t1");
  14428. }
  14429. }
  14430. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14431. class ui_dh_js_tw_g extends fgui.GComponent {
  14432. static createInstance() {
  14433. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14434. }
  14435. onConstruct() {
  14436. this.n0 = (this.getChild("n0"));
  14437. this.n1 = (this.getChild("n1"));
  14438. this.t0 = this.getTransition("t0");
  14439. }
  14440. }
  14441. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14442. class ui_dh_js_xingxing extends fgui.GComponent {
  14443. static createInstance() {
  14444. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14445. }
  14446. onConstruct() {
  14447. this.n1 = (this.getChild("n1"));
  14448. this.n2 = (this.getChild("n2"));
  14449. this.n3 = (this.getChild("n3"));
  14450. this.n4 = (this.getChild("n4"));
  14451. this.n0 = (this.getChild("n0"));
  14452. this.t2 = this.getTransition("t2");
  14453. this.t1 = this.getTransition("t1");
  14454. }
  14455. }
  14456. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14457. class ui_dh_zy_jiazai extends fgui.GComponent {
  14458. static createInstance() {
  14459. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14460. }
  14461. onConstruct() {
  14462. this.c1 = this.getController("c1");
  14463. this.n0 = (this.getChild("n0"));
  14464. this.n1 = (this.getChild("n1"));
  14465. this.n2 = (this.getChild("n2"));
  14466. this.n4 = (this.getChild("n4"));
  14467. this.n5 = (this.getChild("n5"));
  14468. this.n6 = (this.getChild("n6"));
  14469. this.n8 = (this.getChild("n8"));
  14470. this.n7 = (this.getChild("n7"));
  14471. this.t0 = this.getTransition("t0");
  14472. }
  14473. }
  14474. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14475. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14476. static createInstance() {
  14477. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14478. }
  14479. onConstruct() {
  14480. this.c1 = this.getController("c1");
  14481. this.n3 = (this.getChild("n3"));
  14482. this.n5 = (this.getChild("n5"));
  14483. this.n4 = (this.getChild("n4"));
  14484. this.n0 = (this.getChild("n0"));
  14485. this.n1 = (this.getChild("n1"));
  14486. this.n2 = (this.getChild("n2"));
  14487. }
  14488. }
  14489. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14490. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14491. static createInstance() {
  14492. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14493. }
  14494. onConstruct() {
  14495. this.n19 = (this.getChild("n19"));
  14496. this.n21 = (this.getChild("n21"));
  14497. this.n0 = (this.getChild("n0"));
  14498. this.n3 = (this.getChild("n3"));
  14499. this.n4 = (this.getChild("n4"));
  14500. this.n5 = (this.getChild("n5"));
  14501. this.n6 = (this.getChild("n6"));
  14502. this.n8 = (this.getChild("n8"));
  14503. this.n9 = (this.getChild("n9"));
  14504. this.n10 = (this.getChild("n10"));
  14505. this.n11 = (this.getChild("n11"));
  14506. this.n12 = (this.getChild("n12"));
  14507. this.n13 = (this.getChild("n13"));
  14508. this.n14 = (this.getChild("n14"));
  14509. this.n15 = (this.getChild("n15"));
  14510. this.n23 = (this.getChild("n23"));
  14511. this.t0 = this.getTransition("t0");
  14512. this.t1 = this.getTransition("t1");
  14513. }
  14514. }
  14515. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14516. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14517. static createInstance() {
  14518. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14519. }
  14520. onConstruct() {
  14521. this.n1 = (this.getChild("n1"));
  14522. this.n2 = (this.getChild("n2"));
  14523. this.t0 = this.getTransition("t0");
  14524. }
  14525. }
  14526. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14527. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14528. static createInstance() {
  14529. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14530. }
  14531. onConstruct() {
  14532. this.n4 = (this.getChild("n4"));
  14533. this.n2 = (this.getChild("n2"));
  14534. this.n3 = (this.getChild("n3"));
  14535. this.idle = this.getTransition("idle");
  14536. this.attack = this.getTransition("attack");
  14537. }
  14538. }
  14539. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14540. class ui_special extends fgui.GComponent {
  14541. static createInstance() {
  14542. return (fgui.UIPackage.createObject("game", "special"));
  14543. }
  14544. onConstruct() {
  14545. this.n18 = (this.getChild("n18"));
  14546. this.n19 = (this.getChild("n19"));
  14547. this.n20 = (this.getChild("n20"));
  14548. this.n21 = (this.getChild("n21"));
  14549. this.n22 = (this.getChild("n22"));
  14550. this.levelTxt = (this.getChild("levelTxt"));
  14551. this.n24 = (this.getChild("n24"));
  14552. this.n25 = (this.getChild("n25"));
  14553. this.t0 = this.getTransition("t0");
  14554. }
  14555. }
  14556. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14557. class ui_Component145 extends fgui.GComponent {
  14558. static createInstance() {
  14559. return (fgui.UIPackage.createObject("game", "Component145"));
  14560. }
  14561. onConstruct() {
  14562. this.guanyuNode = (this.getChild("guanyuNode"));
  14563. }
  14564. }
  14565. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14566. class ui_longBtn extends fgui.GButton {
  14567. static createInstance() {
  14568. return (fgui.UIPackage.createObject("game", "longBtn"));
  14569. }
  14570. onConstruct() {
  14571. this.c1 = this.getController("c1");
  14572. this.n2 = (this.getChild("n2"));
  14573. this.n1 = (this.getChild("n1"));
  14574. this.n4 = (this.getChild("n4"));
  14575. }
  14576. }
  14577. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14578. class ui_Component146 extends fgui.GComponent {
  14579. static createInstance() {
  14580. return (fgui.UIPackage.createObject("game", "Component146"));
  14581. }
  14582. onConstruct() {
  14583. this.n89 = (this.getChild("n89"));
  14584. this.n90 = (this.getChild("n90"));
  14585. this.guideBtn = (this.getChild("guideBtn"));
  14586. }
  14587. }
  14588. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14589. class ui_Component146_11 extends fgui.GComponent {
  14590. static createInstance() {
  14591. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14592. }
  14593. onConstruct() {
  14594. this.n89 = (this.getChild("n89"));
  14595. this.n90 = (this.getChild("n90"));
  14596. this.guideBtn = (this.getChild("guideBtn"));
  14597. }
  14598. }
  14599. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14600. class ui_Component111_1 extends fgui.GComponent {
  14601. static createInstance() {
  14602. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14603. }
  14604. onConstruct() {
  14605. this.n68 = (this.getChild("n68"));
  14606. this.myMask = (this.getChild("myMask"));
  14607. }
  14608. }
  14609. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14610. class ui_Component64_1 extends fgui.GComponent {
  14611. static createInstance() {
  14612. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14613. }
  14614. onConstruct() {
  14615. this.n57 = (this.getChild("n57"));
  14616. this.n54 = (this.getChild("n54"));
  14617. this.n55 = (this.getChild("n55"));
  14618. this.n56 = (this.getChild("n56"));
  14619. this.t1 = this.getTransition("t1");
  14620. }
  14621. }
  14622. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14623. class ui_ModeSelection_com123 extends fgui.GComponent {
  14624. static createInstance() {
  14625. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14626. }
  14627. onConstruct() {
  14628. this.type1 = (this.getChild("type1"));
  14629. this.type2 = (this.getChild("type2"));
  14630. this.type3 = (this.getChild("type3"));
  14631. this.n38 = (this.getChild("n38"));
  14632. this.t0 = this.getTransition("t0");
  14633. }
  14634. }
  14635. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14636. class ui_Component132_2 extends fgui.GComponent {
  14637. static createInstance() {
  14638. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14639. }
  14640. onConstruct() {
  14641. this.n25 = (this.getChild("n25"));
  14642. this.n26 = (this.getChild("n26"));
  14643. this.n27 = (this.getChild("n27"));
  14644. this.t0 = this.getTransition("t0");
  14645. }
  14646. }
  14647. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14648. class ui_UIPower$1 extends fgui.GComponent {
  14649. static createInstance() {
  14650. return (fgui.UIPackage.createObject("game", "UIPower"));
  14651. }
  14652. onConstruct() {
  14653. this.n11 = (this.getChild("n11"));
  14654. this.myNode = (this.getChild("myNode"));
  14655. this.t0 = this.getTransition("t0");
  14656. }
  14657. }
  14658. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14659. class ui_Component133 extends fgui.GComponent {
  14660. static createInstance() {
  14661. return (fgui.UIPackage.createObject("game", "Component133"));
  14662. }
  14663. onConstruct() {
  14664. this.n29 = (this.getChild("n29"));
  14665. this.n30 = (this.getChild("n30"));
  14666. }
  14667. }
  14668. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14669. class ui_Component134 extends fgui.GComponent {
  14670. static createInstance() {
  14671. return (fgui.UIPackage.createObject("game", "Component134"));
  14672. }
  14673. onConstruct() {
  14674. this.n30 = (this.getChild("n30"));
  14675. this.n31 = (this.getChild("n31"));
  14676. this.t0 = this.getTransition("t0");
  14677. }
  14678. }
  14679. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14680. class ui_Component135 extends fgui.GComponent {
  14681. static createInstance() {
  14682. return (fgui.UIPackage.createObject("game", "Component135"));
  14683. }
  14684. onConstruct() {
  14685. this.n30 = (this.getChild("n30"));
  14686. this.t0 = this.getTransition("t0");
  14687. }
  14688. }
  14689. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14690. class ui_Component137 extends fgui.GComponent {
  14691. static createInstance() {
  14692. return (fgui.UIPackage.createObject("game", "Component137"));
  14693. }
  14694. onConstruct() {
  14695. this.n28 = (this.getChild("n28"));
  14696. this.n29 = (this.getChild("n29"));
  14697. this.n30 = (this.getChild("n30"));
  14698. this.n32 = (this.getChild("n32"));
  14699. }
  14700. }
  14701. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14702. class ui_dh_zuanshi extends fgui.GButton {
  14703. static createInstance() {
  14704. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14705. }
  14706. onConstruct() {
  14707. this.n1 = (this.getChild("n1"));
  14708. this.n2 = (this.getChild("n2"));
  14709. this.n0 = (this.getChild("n0"));
  14710. this.n3 = (this.getChild("n3"));
  14711. this.n4 = (this.getChild("n4"));
  14712. }
  14713. }
  14714. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14715. class ui_Component138 extends fgui.GComponent {
  14716. static createInstance() {
  14717. return (fgui.UIPackage.createObject("game", "Component138"));
  14718. }
  14719. onConstruct() {
  14720. this.n1 = (this.getChild("n1"));
  14721. this.n2 = (this.getChild("n2"));
  14722. this.t0 = this.getTransition("t0");
  14723. }
  14724. }
  14725. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14726. class ui_Component139 extends fgui.GComponent {
  14727. static createInstance() {
  14728. return (fgui.UIPackage.createObject("game", "Component139"));
  14729. }
  14730. onConstruct() {
  14731. this.n0 = (this.getChild("n0"));
  14732. this.t0 = this.getTransition("t0");
  14733. }
  14734. }
  14735. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14736. class ui_Component140 extends fgui.GComponent {
  14737. static createInstance() {
  14738. return (fgui.UIPackage.createObject("game", "Component140"));
  14739. }
  14740. onConstruct() {
  14741. this.n2 = (this.getChild("n2"));
  14742. this.n3 = (this.getChild("n3"));
  14743. this.t0 = this.getTransition("t0");
  14744. }
  14745. }
  14746. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14747. class ui_Component141 extends fgui.GComponent {
  14748. static createInstance() {
  14749. return (fgui.UIPackage.createObject("game", "Component141"));
  14750. }
  14751. onConstruct() {
  14752. this.n0 = (this.getChild("n0"));
  14753. this.t0 = this.getTransition("t0");
  14754. }
  14755. }
  14756. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14757. class ui_powerNode extends fgui.GProgressBar {
  14758. static createInstance() {
  14759. return (fgui.UIPackage.createObject("game", "powerNode"));
  14760. }
  14761. onConstruct() {
  14762. this.n2 = (this.getChild("n2"));
  14763. this.bar_v = (this.getChild("bar_v"));
  14764. this.showImg = (this.getChild("showImg"));
  14765. this.n12 = (this.getChild("n12"));
  14766. }
  14767. }
  14768. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14769. class ui_dh_jingbi1 extends fgui.GComponent {
  14770. static createInstance() {
  14771. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14772. }
  14773. onConstruct() {
  14774. this.n0 = (this.getChild("n0"));
  14775. this.n1 = (this.getChild("n1"));
  14776. this.n2 = (this.getChild("n2"));
  14777. this.n3 = (this.getChild("n3"));
  14778. this.n4 = (this.getChild("n4"));
  14779. this.n5 = (this.getChild("n5"));
  14780. this.n6 = (this.getChild("n6"));
  14781. this.n8 = (this.getChild("n8"));
  14782. this.t0 = this.getTransition("t0");
  14783. }
  14784. }
  14785. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14786. class ui_Component94 extends fgui.GButton {
  14787. static createInstance() {
  14788. return (fgui.UIPackage.createObject("game", "Component94"));
  14789. }
  14790. onConstruct() {
  14791. this.n77 = (this.getChild("n77"));
  14792. }
  14793. }
  14794. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14795. class ui_Component95 extends fgui.GButton {
  14796. static createInstance() {
  14797. return (fgui.UIPackage.createObject("game", "Component95"));
  14798. }
  14799. onConstruct() {
  14800. this.n77 = (this.getChild("n77"));
  14801. }
  14802. }
  14803. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14804. class ui_Component126 extends fgui.GComponent {
  14805. static createInstance() {
  14806. return (fgui.UIPackage.createObject("game", "Component126"));
  14807. }
  14808. onConstruct() {
  14809. this.c1 = this.getController("c1");
  14810. this.normalBtn = (this.getChild("normalBtn"));
  14811. this.tripleBtn = (this.getChild("tripleBtn"));
  14812. }
  14813. }
  14814. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14815. class ui_Component60 extends fgui.GComponent {
  14816. static createInstance() {
  14817. return (fgui.UIPackage.createObject("game", "Component60"));
  14818. }
  14819. onConstruct() {
  14820. this.c1 = this.getController("c1");
  14821. this.n48 = (this.getChild("n48"));
  14822. this.womanTxt = (this.getChild("womanTxt"));
  14823. this.t0 = this.getTransition("t0");
  14824. }
  14825. }
  14826. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14827. class ui_Button_h extends fgui.GButton {
  14828. static createInstance() {
  14829. return (fgui.UIPackage.createObject("game", "Button_h"));
  14830. }
  14831. onConstruct() {
  14832. this.button = this.getController("button");
  14833. this.n0 = (this.getChild("n0"));
  14834. }
  14835. }
  14836. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14837. class ui_Button_lv extends fgui.GButton {
  14838. static createInstance() {
  14839. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14840. }
  14841. onConstruct() {
  14842. this.button = this.getController("button");
  14843. this.n0 = (this.getChild("n0"));
  14844. }
  14845. }
  14846. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14847. class ui_Component98_3 extends fgui.GButton {
  14848. static createInstance() {
  14849. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14850. }
  14851. onConstruct() {
  14852. this.c1 = this.getController("c1");
  14853. this.n8 = (this.getChild("n8"));
  14854. this.n41 = (this.getChild("n41"));
  14855. this.n40 = (this.getChild("n40"));
  14856. }
  14857. }
  14858. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14859. class ui_ModeSelection_com1 extends fgui.GButton {
  14860. static createInstance() {
  14861. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14862. }
  14863. onConstruct() {
  14864. this.n34 = (this.getChild("n34"));
  14865. this.n36 = (this.getChild("n36"));
  14866. this.n22 = (this.getChild("n22"));
  14867. this.n20 = (this.getChild("n20"));
  14868. this.n23 = (this.getChild("n23"));
  14869. this.n24 = (this.getChild("n24"));
  14870. this.n26 = (this.getChild("n26"));
  14871. this.n33 = (this.getChild("n33"));
  14872. this.coinImg = (this.getChild("coinImg"));
  14873. this.need = (this.getChild("need"));
  14874. this.n35 = (this.getChild("n35"));
  14875. this.n29 = (this.getChild("n29"));
  14876. this.tipsTxt = (this.getChild("tipsTxt"));
  14877. this.n30 = (this.getChild("n30"));
  14878. this.peopleTxt = (this.getChild("peopleTxt"));
  14879. this.t0 = this.getTransition("t0");
  14880. }
  14881. }
  14882. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14883. class ui_ModeSelection_com2 extends fgui.GButton {
  14884. static createInstance() {
  14885. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14886. }
  14887. onConstruct() {
  14888. this.n36 = (this.getChild("n36"));
  14889. this.n34 = (this.getChild("n34"));
  14890. this.n22 = (this.getChild("n22"));
  14891. this.n20 = (this.getChild("n20"));
  14892. this.n23 = (this.getChild("n23"));
  14893. this.n24 = (this.getChild("n24"));
  14894. this.n26 = (this.getChild("n26"));
  14895. this.n33 = (this.getChild("n33"));
  14896. this.coinImg = (this.getChild("coinImg"));
  14897. this.need = (this.getChild("need"));
  14898. this.n35 = (this.getChild("n35"));
  14899. this.n29 = (this.getChild("n29"));
  14900. this.tipsTxt = (this.getChild("tipsTxt"));
  14901. this.n30 = (this.getChild("n30"));
  14902. this.peopleTxt = (this.getChild("peopleTxt"));
  14903. this.t0 = this.getTransition("t0");
  14904. }
  14905. }
  14906. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14907. class ui_ModeSelection_com3 extends fgui.GButton {
  14908. static createInstance() {
  14909. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14910. }
  14911. onConstruct() {
  14912. this.n34 = (this.getChild("n34"));
  14913. this.n36 = (this.getChild("n36"));
  14914. this.n22 = (this.getChild("n22"));
  14915. this.n20 = (this.getChild("n20"));
  14916. this.n23 = (this.getChild("n23"));
  14917. this.n24 = (this.getChild("n24"));
  14918. this.n26 = (this.getChild("n26"));
  14919. this.n33 = (this.getChild("n33"));
  14920. this.coinImg = (this.getChild("coinImg"));
  14921. this.need = (this.getChild("need"));
  14922. this.n35 = (this.getChild("n35"));
  14923. this.n29 = (this.getChild("n29"));
  14924. this.tipsTxt = (this.getChild("tipsTxt"));
  14925. this.n30 = (this.getChild("n30"));
  14926. this.peopleTxt = (this.getChild("peopleTxt"));
  14927. this.t0 = this.getTransition("t0");
  14928. }
  14929. }
  14930. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14931. class ui_Invitation_com1 extends fgui.GComponent {
  14932. static createInstance() {
  14933. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14934. }
  14935. onConstruct() {
  14936. this.n14 = (this.getChild("n14"));
  14937. this.n13 = (this.getChild("n13"));
  14938. this.n3 = (this.getChild("n3"));
  14939. this.n1 = (this.getChild("n1"));
  14940. this.n6 = (this.getChild("n6"));
  14941. this.n7 = (this.getChild("n7"));
  14942. this.enterBtn = (this.getChild("enterBtn"));
  14943. this.n11 = (this.getChild("n11"));
  14944. this.n12 = (this.getChild("n12"));
  14945. this.n15 = (this.getChild("n15"));
  14946. this.t0 = this.getTransition("t0");
  14947. this.t1 = this.getTransition("t1");
  14948. }
  14949. }
  14950. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14951. class ui_Component87_1 extends fgui.GComponent {
  14952. static createInstance() {
  14953. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14954. }
  14955. onConstruct() {
  14956. this.n74 = (this.getChild("n74"));
  14957. this.n73 = (this.getChild("n73"));
  14958. this.ballTxt = (this.getChild("ballTxt"));
  14959. this.n76 = (this.getChild("n76"));
  14960. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14961. this.levelTxt = (this.getChild("levelTxt"));
  14962. this.n87 = (this.getChild("n87"));
  14963. this.n84 = (this.getChild("n84"));
  14964. this.hpTxt = (this.getChild("hpTxt"));
  14965. this.n89 = (this.getChild("n89"));
  14966. this.tipsTxt = (this.getChild("tipsTxt"));
  14967. }
  14968. }
  14969. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14970. class ui_sqg1 extends fgui.GComponent {
  14971. static createInstance() {
  14972. return (fgui.UIPackage.createObject("game", "sqg1"));
  14973. }
  14974. onConstruct() {
  14975. this.n1 = (this.getChild("n1"));
  14976. this.n0 = (this.getChild("n0"));
  14977. }
  14978. }
  14979. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14980. class ui_sqg2 extends fgui.GComponent {
  14981. static createInstance() {
  14982. return (fgui.UIPackage.createObject("game", "sqg2"));
  14983. }
  14984. onConstruct() {
  14985. this.n1 = (this.getChild("n1"));
  14986. this.n0 = (this.getChild("n0"));
  14987. }
  14988. }
  14989. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14990. class ui_sqg3 extends fgui.GComponent {
  14991. static createInstance() {
  14992. return (fgui.UIPackage.createObject("game", "sqg3"));
  14993. }
  14994. onConstruct() {
  14995. this.n1 = (this.getChild("n1"));
  14996. this.n0 = (this.getChild("n0"));
  14997. }
  14998. }
  14999. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  15000. class ui_sqg4 extends fgui.GComponent {
  15001. static createInstance() {
  15002. return (fgui.UIPackage.createObject("game", "sqg4"));
  15003. }
  15004. onConstruct() {
  15005. this.n1 = (this.getChild("n1"));
  15006. this.n0 = (this.getChild("n0"));
  15007. }
  15008. }
  15009. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  15010. class ui_Component36 extends fgui.GButton {
  15011. static createInstance() {
  15012. return (fgui.UIPackage.createObject("game", "Component36"));
  15013. }
  15014. onConstruct() {
  15015. this.c1 = this.getController("c1");
  15016. this.n53 = (this.getChild("n53"));
  15017. this.n56 = (this.getChild("n56"));
  15018. }
  15019. }
  15020. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  15021. class ui_Component37 extends fgui.GButton {
  15022. static createInstance() {
  15023. return (fgui.UIPackage.createObject("game", "Component37"));
  15024. }
  15025. onConstruct() {
  15026. this.c1 = this.getController("c1");
  15027. this.n52 = (this.getChild("n52"));
  15028. this.n54 = (this.getChild("n54"));
  15029. }
  15030. }
  15031. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  15032. class ui_UISetting extends fgui.GComponent {
  15033. static createInstance() {
  15034. return (fgui.UIPackage.createObject("game", "UISetting"));
  15035. }
  15036. onConstruct() {
  15037. this.c1 = this.getController("c1");
  15038. this.n4 = (this.getChild("n4"));
  15039. this.soundBtn = (this.getChild("soundBtn"));
  15040. this.shakeBtn = (this.getChild("shakeBtn"));
  15041. this.clickNode = (this.getChild("clickNode"));
  15042. this.xyBtn = (this.getChild("xyBtn"));
  15043. }
  15044. }
  15045. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  15046. class ui_Component39 extends fgui.GComponent {
  15047. static createInstance() {
  15048. return (fgui.UIPackage.createObject("game", "Component39"));
  15049. }
  15050. onConstruct() {
  15051. this.n5 = (this.getChild("n5"));
  15052. this.n6 = (this.getChild("n6"));
  15053. this.n7 = (this.getChild("n7"));
  15054. this.t0 = this.getTransition("t0");
  15055. }
  15056. }
  15057. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  15058. class ui_Component40 extends fgui.GButton {
  15059. static createInstance() {
  15060. return (fgui.UIPackage.createObject("game", "Component40"));
  15061. }
  15062. onConstruct() {
  15063. this.n46 = (this.getChild("n46"));
  15064. this.n47 = (this.getChild("n47"));
  15065. }
  15066. }
  15067. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  15068. class ui_Component41 extends fgui.GComponent {
  15069. static createInstance() {
  15070. return (fgui.UIPackage.createObject("game", "Component41"));
  15071. }
  15072. onConstruct() {
  15073. this.c1 = this.getController("c1");
  15074. this.n0 = (this.getChild("n0"));
  15075. this.titleTxt = (this.getChild("titleTxt"));
  15076. this.n2 = (this.getChild("n2"));
  15077. this.msgTips = (this.getChild("msgTips"));
  15078. this.numTxt = (this.getChild("numTxt"));
  15079. this.n18 = (this.getChild("n18"));
  15080. this.cancelBtn = (this.getChild("cancelBtn"));
  15081. this.videoBtn = (this.getChild("videoBtn"));
  15082. this.n10 = (this.getChild("n10"));
  15083. }
  15084. }
  15085. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  15086. class ui_Component42 extends fgui.GComponent {
  15087. static createInstance() {
  15088. return (fgui.UIPackage.createObject("game", "Component42"));
  15089. }
  15090. onConstruct() {
  15091. this.c1 = this.getController("c1");
  15092. this.n1 = (this.getChild("n1"));
  15093. this.n2 = (this.getChild("n2"));
  15094. this.n3 = (this.getChild("n3"));
  15095. this.tipsTxt = (this.getChild("tipsTxt"));
  15096. this.cancelBtn = (this.getChild("cancelBtn"));
  15097. this.sureBtn = (this.getChild("sureBtn"));
  15098. this.n11 = (this.getChild("n11"));
  15099. this.n13 = (this.getChild("n13"));
  15100. this.n14 = (this.getChild("n14"));
  15101. this.womanTxt = (this.getChild("womanTxt"));
  15102. this.t0 = this.getTransition("t0");
  15103. }
  15104. }
  15105. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  15106. class ui_dh_js_shengli extends fgui.GComponent {
  15107. static createInstance() {
  15108. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  15109. }
  15110. onConstruct() {
  15111. this.n3 = (this.getChild("n3"));
  15112. this.n4 = (this.getChild("n4"));
  15113. this.n1 = (this.getChild("n1"));
  15114. this.n2 = (this.getChild("n2"));
  15115. this.n5 = (this.getChild("n5"));
  15116. this.n6 = (this.getChild("n6"));
  15117. this.n7 = (this.getChild("n7"));
  15118. this.n8 = (this.getChild("n8"));
  15119. this.attack = this.getTransition("attack");
  15120. this.idle = this.getTransition("idle");
  15121. }
  15122. }
  15123. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  15124. class ui_dh_js_shengli_g extends fgui.GComponent {
  15125. static createInstance() {
  15126. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  15127. }
  15128. onConstruct() {
  15129. this.n3 = (this.getChild("n3"));
  15130. this.n1 = (this.getChild("n1"));
  15131. this.t0 = this.getTransition("t0");
  15132. }
  15133. }
  15134. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15135. class ui_dh_js_shibai extends fgui.GComponent {
  15136. static createInstance() {
  15137. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15138. }
  15139. onConstruct() {
  15140. this.n0 = (this.getChild("n0"));
  15141. this.n1 = (this.getChild("n1"));
  15142. this.n2 = (this.getChild("n2"));
  15143. this.n3 = (this.getChild("n3"));
  15144. this.idle = this.getTransition("idle");
  15145. this.attack = this.getTransition("attack");
  15146. }
  15147. }
  15148. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15149. class ui_dh_zy_ganfa extends fgui.GButton {
  15150. static createInstance() {
  15151. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15152. }
  15153. onConstruct() {
  15154. this.n0 = (this.getChild("n0"));
  15155. }
  15156. }
  15157. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15158. class ui_dh_zy_sc_guang extends fgui.GButton {
  15159. static createInstance() {
  15160. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15161. }
  15162. onConstruct() {
  15163. this.n0 = (this.getChild("n0"));
  15164. this.n2 = (this.getChild("n2"));
  15165. }
  15166. }
  15167. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15168. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15169. static createInstance() {
  15170. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15171. }
  15172. onConstruct() {
  15173. this.n0 = (this.getChild("n0"));
  15174. this.n3 = (this.getChild("n3"));
  15175. }
  15176. }
  15177. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15178. class ui_dh_zy_wanfa extends fgui.GButton {
  15179. static createInstance() {
  15180. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15181. }
  15182. onConstruct() {
  15183. this.n0 = (this.getChild("n0"));
  15184. }
  15185. }
  15186. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15187. class ui_Button_login extends fgui.GButton {
  15188. static createInstance() {
  15189. return (fgui.UIPackage.createObject("game", "Button_login"));
  15190. }
  15191. onConstruct() {
  15192. this.button = this.getController("button");
  15193. this.n5 = (this.getChild("n5"));
  15194. this.n3 = (this.getChild("n3"));
  15195. }
  15196. }
  15197. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15198. class ui_Component53_1 extends fgui.GComponent {
  15199. static createInstance() {
  15200. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15201. }
  15202. onConstruct() {
  15203. this.n0 = (this.getChild("n0"));
  15204. this.n1 = (this.getChild("n1"));
  15205. this.n2 = (this.getChild("n2"));
  15206. this.n3 = (this.getChild("n3"));
  15207. this.n4 = (this.getChild("n4"));
  15208. this.n5 = (this.getChild("n5"));
  15209. this.n6 = (this.getChild("n6"));
  15210. this.n7 = (this.getChild("n7"));
  15211. this.n8 = (this.getChild("n8"));
  15212. this.n9 = (this.getChild("n9"));
  15213. this.n10 = (this.getChild("n10"));
  15214. this.n11 = (this.getChild("n11"));
  15215. this.n12 = (this.getChild("n12"));
  15216. this.n13 = (this.getChild("n13"));
  15217. this.n14 = (this.getChild("n14"));
  15218. this.n15 = (this.getChild("n15"));
  15219. this.n16 = (this.getChild("n16"));
  15220. this.n19 = (this.getChild("n19"));
  15221. this.n20 = (this.getChild("n20"));
  15222. this.n21 = (this.getChild("n21"));
  15223. this.n22 = (this.getChild("n22"));
  15224. this.n23 = (this.getChild("n23"));
  15225. this.n24 = (this.getChild("n24"));
  15226. this.n25 = (this.getChild("n25"));
  15227. this.n26 = (this.getChild("n26"));
  15228. this.n27 = (this.getChild("n27"));
  15229. this.n28 = (this.getChild("n28"));
  15230. this.n29 = (this.getChild("n29"));
  15231. this.n30 = (this.getChild("n30"));
  15232. this.n31 = (this.getChild("n31"));
  15233. this.n32 = (this.getChild("n32"));
  15234. this.n33 = (this.getChild("n33"));
  15235. this.n34 = (this.getChild("n34"));
  15236. this.n35 = (this.getChild("n35"));
  15237. this.t0 = this.getTransition("t0");
  15238. }
  15239. }
  15240. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15241. class ui_Component30 extends fgui.GComponent {
  15242. static createInstance() {
  15243. return (fgui.UIPackage.createObject("game", "Component30"));
  15244. }
  15245. onConstruct() {
  15246. this.c1 = this.getController("c1");
  15247. this.n46 = (this.getChild("n46"));
  15248. this.n47 = (this.getChild("n47"));
  15249. this.numTxt = (this.getChild("numTxt"));
  15250. this.n50 = (this.getChild("n50"));
  15251. this.n53 = (this.getChild("n53"));
  15252. this.n54 = (this.getChild("n54"));
  15253. this.n55 = (this.getChild("n55"));
  15254. this.n56 = (this.getChild("n56"));
  15255. }
  15256. }
  15257. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15258. class ui_Component30_1 extends fgui.GComponent {
  15259. static createInstance() {
  15260. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15261. }
  15262. onConstruct() {
  15263. this.c1 = this.getController("c1");
  15264. this.n46 = (this.getChild("n46"));
  15265. this.n47 = (this.getChild("n47"));
  15266. this.numTxt = (this.getChild("numTxt"));
  15267. this.n50 = (this.getChild("n50"));
  15268. this.n51 = (this.getChild("n51"));
  15269. this.n52 = (this.getChild("n52"));
  15270. this.n53 = (this.getChild("n53"));
  15271. this.n54 = (this.getChild("n54"));
  15272. }
  15273. }
  15274. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15275. class ui_Component31 extends fgui.GComponent {
  15276. static createInstance() {
  15277. return (fgui.UIPackage.createObject("game", "Component31"));
  15278. }
  15279. onConstruct() {
  15280. this.n55 = (this.getChild("n55"));
  15281. this.n54 = (this.getChild("n54"));
  15282. this.conditionTxt = (this.getChild("conditionTxt"));
  15283. this.n57 = (this.getChild("n57"));
  15284. this.t0 = this.getTransition("t0");
  15285. }
  15286. }
  15287. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15288. class ui_Component32 extends fgui.GComponent {
  15289. static createInstance() {
  15290. return (fgui.UIPackage.createObject("game", "Component32"));
  15291. }
  15292. onConstruct() {
  15293. this.n5 = (this.getChild("n5"));
  15294. this.n6 = (this.getChild("n6"));
  15295. this.n7 = (this.getChild("n7"));
  15296. this.t0 = this.getTransition("t0");
  15297. }
  15298. }
  15299. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15300. class ui_AwardItem extends fgui.GComponent {
  15301. static createInstance() {
  15302. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15303. }
  15304. onConstruct() {
  15305. this.n9 = (this.getChild("n9"));
  15306. this.myIcon = (this.getChild("myIcon"));
  15307. this.numTxt = (this.getChild("numTxt"));
  15308. this.nameTxt = (this.getChild("nameTxt"));
  15309. this.n16 = (this.getChild("n16"));
  15310. this.n17 = (this.getChild("n17"));
  15311. }
  15312. }
  15313. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15314. class ui_ranking_com1 extends fgui.GButton {
  15315. static createInstance() {
  15316. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15317. }
  15318. onConstruct() {
  15319. this.c1 = this.getController("c1");
  15320. this.n49 = (this.getChild("n49"));
  15321. this.n18 = (this.getChild("n18"));
  15322. this.n46 = (this.getChild("n46"));
  15323. this.n48 = (this.getChild("n48"));
  15324. this.n50 = (this.getChild("n50"));
  15325. }
  15326. }
  15327. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15328. class ui_ranking_com2 extends fgui.GButton {
  15329. static createInstance() {
  15330. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15331. }
  15332. onConstruct() {
  15333. this.c1 = this.getController("c1");
  15334. this.n49 = (this.getChild("n49"));
  15335. this.n18 = (this.getChild("n18"));
  15336. this.n46 = (this.getChild("n46"));
  15337. this.n48 = (this.getChild("n48"));
  15338. this.n50 = (this.getChild("n50"));
  15339. }
  15340. }
  15341. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15342. class ui_ranking_com3 extends fgui.GComponent {
  15343. static createInstance() {
  15344. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15345. }
  15346. onConstruct() {
  15347. this.n17 = (this.getChild("n17"));
  15348. this.myIcon = (this.getChild("myIcon"));
  15349. }
  15350. }
  15351. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15352. class ui_ranking_com4 extends fgui.GComponent {
  15353. static createInstance() {
  15354. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15355. }
  15356. onConstruct() {
  15357. this.n16 = (this.getChild("n16"));
  15358. this.head = (this.getChild("head"));
  15359. }
  15360. }
  15361. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15362. class ui_ranking_com5 extends fgui.GComponent {
  15363. static createInstance() {
  15364. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15365. }
  15366. onConstruct() {
  15367. this.c1 = this.getController("c1");
  15368. this.c2 = this.getController("c2");
  15369. this.n2 = (this.getChild("n2"));
  15370. this.n3 = (this.getChild("n3"));
  15371. this.levelBtn = (this.getChild("levelBtn"));
  15372. this.starBtn = (this.getChild("starBtn"));
  15373. this.n23 = (this.getChild("n23"));
  15374. this.n24 = (this.getChild("n24"));
  15375. this.n25 = (this.getChild("n25"));
  15376. this.myList = (this.getChild("myList"));
  15377. this.selfNode = (this.getChild("selfNode"));
  15378. this.n9 = (this.getChild("n9"));
  15379. this.n12 = (this.getChild("n12"));
  15380. this.n13 = (this.getChild("n13"));
  15381. this.n14 = (this.getChild("n14"));
  15382. this.n39 = (this.getChild("n39"));
  15383. this.n41 = (this.getChild("n41"));
  15384. this.n42 = (this.getChild("n42"));
  15385. this.n45 = (this.getChild("n45"));
  15386. this.changeBtn = (this.getChild("changeBtn"));
  15387. this.closeBtn = (this.getChild("closeBtn"));
  15388. this.t0 = this.getTransition("t0");
  15389. }
  15390. }
  15391. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15392. class ui_RankItem extends fgui.GComponent {
  15393. static createInstance() {
  15394. return (fgui.UIPackage.createObject("game", "RankItem"));
  15395. }
  15396. onConstruct() {
  15397. this.n10 = (this.getChild("n10"));
  15398. this.n11 = (this.getChild("n11"));
  15399. this.rankTxt = (this.getChild("rankTxt"));
  15400. this.headNode = (this.getChild("headNode"));
  15401. this.nameTxt = (this.getChild("nameTxt"));
  15402. this.n19 = (this.getChild("n19"));
  15403. this.valueTxt = (this.getChild("valueTxt"));
  15404. this.img1 = (this.getChild("img1"));
  15405. this.img2 = (this.getChild("img2"));
  15406. this.img3 = (this.getChild("img3"));
  15407. }
  15408. }
  15409. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15410. class ui_ranking_com9 extends fgui.GComponent {
  15411. static createInstance() {
  15412. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15413. }
  15414. onConstruct() {
  15415. this.c1 = this.getController("c1");
  15416. this.n27 = (this.getChild("n27"));
  15417. this.n28 = (this.getChild("n28"));
  15418. this.headNode = (this.getChild("headNode"));
  15419. this.rankTxt = (this.getChild("rankTxt"));
  15420. this.nameTxt = (this.getChild("nameTxt"));
  15421. this.n34 = (this.getChild("n34"));
  15422. this.valueTxt = (this.getChild("valueTxt"));
  15423. this.n36 = (this.getChild("n36"));
  15424. this.n37 = (this.getChild("n37"));
  15425. this.n38 = (this.getChild("n38"));
  15426. this.n39 = (this.getChild("n39"));
  15427. this.n40 = (this.getChild("n40"));
  15428. }
  15429. }
  15430. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15431. class ui_ranking_com10 extends fgui.GComponent {
  15432. static createInstance() {
  15433. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15434. }
  15435. onConstruct() {
  15436. this.n23 = (this.getChild("n23"));
  15437. this.n24 = (this.getChild("n24"));
  15438. }
  15439. }
  15440. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15441. class ui_ranking_com11 extends fgui.GComponent {
  15442. static createInstance() {
  15443. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15444. }
  15445. onConstruct() {
  15446. this.n24 = (this.getChild("n24"));
  15447. this.n25 = (this.getChild("n25"));
  15448. this.t0 = this.getTransition("t0");
  15449. }
  15450. }
  15451. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15452. class ui_ranking_com13 extends fgui.GButton {
  15453. static createInstance() {
  15454. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15455. }
  15456. onConstruct() {
  15457. this.c1 = this.getController("c1");
  15458. this.n44 = (this.getChild("n44"));
  15459. this.n45 = (this.getChild("n45"));
  15460. this.n46 = (this.getChild("n46"));
  15461. }
  15462. }
  15463. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15464. class ui_Component122 extends fgui.GComponent {
  15465. static createInstance() {
  15466. return (fgui.UIPackage.createObject("game", "Component122"));
  15467. }
  15468. onConstruct() {
  15469. this.gameNode3 = (this.getChild("gameNode3"));
  15470. }
  15471. }
  15472. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15473. class ui_skillItem extends fgui.GComponent {
  15474. static createInstance() {
  15475. return (fgui.UIPackage.createObject("game", "skillItem"));
  15476. }
  15477. onConstruct() {
  15478. this.c1 = this.getController("c1");
  15479. this.n31 = (this.getChild("n31"));
  15480. this.n6 = (this.getChild("n6"));
  15481. this.skillImg = (this.getChild("skillImg"));
  15482. this.nameTxt = (this.getChild("nameTxt"));
  15483. this.levelTxt = (this.getChild("levelTxt"));
  15484. this.n28 = (this.getChild("n28"));
  15485. this.describeTxt = (this.getChild("describeTxt"));
  15486. this.n32 = (this.getChild("n32"));
  15487. this.mutiBtn = (this.getChild("mutiBtn"));
  15488. this.tryNode = (this.getChild("tryNode"));
  15489. this.normalBtn = (this.getChild("normalBtn"));
  15490. this.startBtn = (this.getChild("startBtn"));
  15491. this.n42 = (this.getChild("n42"));
  15492. this.n43 = (this.getChild("n43"));
  15493. this.n44 = (this.getChild("n44"));
  15494. }
  15495. }
  15496. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15497. class ui_Component26 extends fgui.GButton {
  15498. static createInstance() {
  15499. return (fgui.UIPackage.createObject("game", "Component26"));
  15500. }
  15501. onConstruct() {
  15502. this.n11 = (this.getChild("n11"));
  15503. this.n30 = (this.getChild("n30"));
  15504. this.n34 = (this.getChild("n34"));
  15505. }
  15506. }
  15507. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15508. class ui_Component28 extends fgui.GButton {
  15509. static createInstance() {
  15510. return (fgui.UIPackage.createObject("game", "Component28"));
  15511. }
  15512. onConstruct() {
  15513. this.n12 = (this.getChild("n12"));
  15514. this.n31 = (this.getChild("n31"));
  15515. this.curTxt = (this.getChild("curTxt"));
  15516. this.n33 = (this.getChild("n33"));
  15517. }
  15518. }
  15519. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15520. class ui_Component1302 extends fgui.GComponent {
  15521. static createInstance() {
  15522. return (fgui.UIPackage.createObject("game", "Component1302"));
  15523. }
  15524. onConstruct() {
  15525. this.n2 = (this.getChild("n2"));
  15526. this.n3 = (this.getChild("n3"));
  15527. }
  15528. }
  15529. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15530. class ui_Component113 extends fgui.GComponent {
  15531. static createInstance() {
  15532. return (fgui.UIPackage.createObject("game", "Component113"));
  15533. }
  15534. onConstruct() {
  15535. this.n85 = (this.getChild("n85"));
  15536. this.n86 = (this.getChild("n86"));
  15537. this.n77 = (this.getChild("n77"));
  15538. this.n79 = (this.getChild("n79"));
  15539. this.n80 = (this.getChild("n80"));
  15540. this.n81 = (this.getChild("n81"));
  15541. this.n82 = (this.getChild("n82"));
  15542. this.n84 = (this.getChild("n84"));
  15543. this.n87 = (this.getChild("n87"));
  15544. this.t0 = this.getTransition("t0");
  15545. }
  15546. }
  15547. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15548. class ui_Component114 extends fgui.GComponent {
  15549. static createInstance() {
  15550. return (fgui.UIPackage.createObject("game", "Component114"));
  15551. }
  15552. onConstruct() {
  15553. this.n77 = (this.getChild("n77"));
  15554. this.t0 = this.getTransition("t0");
  15555. }
  15556. }
  15557. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15558. class ui_Component115 extends fgui.GComponent {
  15559. static createInstance() {
  15560. return (fgui.UIPackage.createObject("game", "Component115"));
  15561. }
  15562. onConstruct() {
  15563. this.n83 = (this.getChild("n83"));
  15564. this.fingerNode = (this.getChild("fingerNode"));
  15565. this.n84 = (this.getChild("n84"));
  15566. }
  15567. }
  15568. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15569. class ui_Component117 extends fgui.GComponent {
  15570. static createInstance() {
  15571. return (fgui.UIPackage.createObject("game", "Component117"));
  15572. }
  15573. onConstruct() {
  15574. this.n87 = (this.getChild("n87"));
  15575. this.n88 = (this.getChild("n88"));
  15576. this.n84 = (this.getChild("n84"));
  15577. this.n85 = (this.getChild("n85"));
  15578. this.n86 = (this.getChild("n86"));
  15579. this.t0 = this.getTransition("t0");
  15580. }
  15581. }
  15582. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15583. class ui_Component98_1 extends fgui.GButton {
  15584. static createInstance() {
  15585. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15586. }
  15587. onConstruct() {
  15588. this.c1 = this.getController("c1");
  15589. this.n8 = (this.getChild("n8"));
  15590. this.n41 = (this.getChild("n41"));
  15591. this.n40 = (this.getChild("n40"));
  15592. }
  15593. }
  15594. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15595. class ui_Component61 extends fgui.GComponent {
  15596. static createInstance() {
  15597. return (fgui.UIPackage.createObject("game", "Component61"));
  15598. }
  15599. onConstruct() {
  15600. this.n14 = (this.getChild("n14"));
  15601. this.n6 = (this.getChild("n6"));
  15602. this.t0 = this.getTransition("t0");
  15603. }
  15604. }
  15605. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15606. class ui_Component62 extends fgui.GComponent {
  15607. static createInstance() {
  15608. return (fgui.UIPackage.createObject("game", "Component62"));
  15609. }
  15610. onConstruct() {
  15611. this.n66 = (this.getChild("n66"));
  15612. this.n56 = (this.getChild("n56"));
  15613. this.n63 = (this.getChild("n63"));
  15614. this.n65 = (this.getChild("n65"));
  15615. this.t0 = this.getTransition("t0");
  15616. }
  15617. }
  15618. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15619. class ui_d3Root extends fgui.GComponent {
  15620. static createInstance() {
  15621. return (fgui.UIPackage.createObject("game", "d3Root"));
  15622. }
  15623. onConstruct() {
  15624. }
  15625. }
  15626. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15627. class ui_d2Root extends fgui.GComponent {
  15628. static createInstance() {
  15629. return (fgui.UIPackage.createObject("game", "d2Root"));
  15630. }
  15631. onConstruct() {
  15632. }
  15633. }
  15634. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15635. class ui_ballNode extends fgui.GComponent {
  15636. static createInstance() {
  15637. return (fgui.UIPackage.createObject("game", "ballNode"));
  15638. }
  15639. onConstruct() {
  15640. }
  15641. }
  15642. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15643. class ui_border extends fgui.GComponent {
  15644. static createInstance() {
  15645. return (fgui.UIPackage.createObject("game", "border"));
  15646. }
  15647. onConstruct() {
  15648. this.bar1 = (this.getChild("bar1"));
  15649. this.bar2 = (this.getChild("bar2"));
  15650. this.bar3 = (this.getChild("bar3"));
  15651. this.bar4 = (this.getChild("bar4"));
  15652. this.bar5 = (this.getChild("bar5"));
  15653. this.bar6 = (this.getChild("bar6"));
  15654. this.circle1 = (this.getChild("circle1"));
  15655. this.circle2 = (this.getChild("circle2"));
  15656. this.circle3 = (this.getChild("circle3"));
  15657. this.circle4 = (this.getChild("circle4"));
  15658. this.circle5 = (this.getChild("circle5"));
  15659. this.circle6 = (this.getChild("circle6"));
  15660. this.n28 = (this.getChild("n28"));
  15661. }
  15662. }
  15663. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15664. class ui_btn_buy extends fgui.GButton {
  15665. static createInstance() {
  15666. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15667. }
  15668. onConstruct() {
  15669. this.button = this.getController("button");
  15670. this.n0 = (this.getChild("n0"));
  15671. this.n1 = (this.getChild("n1"));
  15672. this.n2 = (this.getChild("n2"));
  15673. }
  15674. }
  15675. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15676. class ui_Component41_2 extends fgui.GComponent {
  15677. static createInstance() {
  15678. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15679. }
  15680. onConstruct() {
  15681. this.c1 = this.getController("c1");
  15682. this.n0 = (this.getChild("n0"));
  15683. this.n2 = (this.getChild("n2"));
  15684. this.n19 = (this.getChild("n19"));
  15685. this.cancelBtn = (this.getChild("cancelBtn"));
  15686. this.videoBtn = (this.getChild("videoBtn"));
  15687. this.n9 = (this.getChild("n9"));
  15688. this.n22 = (this.getChild("n22"));
  15689. this.tipsTxt = (this.getChild("tipsTxt"));
  15690. this.n23 = (this.getChild("n23"));
  15691. this.n24 = (this.getChild("n24"));
  15692. this.n26 = (this.getChild("n26"));
  15693. this.n27 = (this.getChild("n27"));
  15694. this.titleTxt = (this.getChild("titleTxt"));
  15695. }
  15696. }
  15697. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15698. class ui_Component41_1 extends fgui.GComponent {
  15699. static createInstance() {
  15700. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15701. }
  15702. onConstruct() {
  15703. this.c1 = this.getController("c1");
  15704. this.n0 = (this.getChild("n0"));
  15705. this.n2 = (this.getChild("n2"));
  15706. this.cancelBtn = (this.getChild("cancelBtn"));
  15707. this.videoBtn = (this.getChild("videoBtn"));
  15708. this.n27 = (this.getChild("n27"));
  15709. this.n30 = (this.getChild("n30"));
  15710. this.n31 = (this.getChild("n31"));
  15711. this.n32 = (this.getChild("n32"));
  15712. this.n33 = (this.getChild("n33"));
  15713. this.n34 = (this.getChild("n34"));
  15714. this.n35 = (this.getChild("n35"));
  15715. this.n36 = (this.getChild("n36"));
  15716. this.n1 = (this.getChild("n1"));
  15717. this.n37 = (this.getChild("n37"));
  15718. this.t0 = this.getTransition("t0");
  15719. this.t1 = this.getTransition("t1");
  15720. this.t2 = this.getTransition("t2");
  15721. this.t3 = this.getTransition("t3");
  15722. }
  15723. }
  15724. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15725. class ui_againBtn extends fgui.GButton {
  15726. static createInstance() {
  15727. return (fgui.UIPackage.createObject("game", "againBtn"));
  15728. }
  15729. onConstruct() {
  15730. this.n2 = (this.getChild("n2"));
  15731. this.n1 = (this.getChild("n1"));
  15732. this.n5 = (this.getChild("n5"));
  15733. }
  15734. }
  15735. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15736. class ui_Component118 extends fgui.GButton {
  15737. static createInstance() {
  15738. return (fgui.UIPackage.createObject("game", "Component118"));
  15739. }
  15740. onConstruct() {
  15741. this.c1 = this.getController("c1");
  15742. this.n14 = (this.getChild("n14"));
  15743. this.n9 = (this.getChild("n9"));
  15744. this.n10 = (this.getChild("n10"));
  15745. this.diamondTxt = (this.getChild("diamondTxt"));
  15746. this.n13 = (this.getChild("n13"));
  15747. this.n15 = (this.getChild("n15"));
  15748. }
  15749. }
  15750. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15751. class ui_Component119 extends fgui.GComponent {
  15752. static createInstance() {
  15753. return (fgui.UIPackage.createObject("game", "Component119"));
  15754. }
  15755. onConstruct() {
  15756. this.n1 = (this.getChild("n1"));
  15757. this.n2 = (this.getChild("n2"));
  15758. this.n13 = (this.getChild("n13"));
  15759. this.n6 = (this.getChild("n6"));
  15760. this.screenNode = (this.getChild("screenNode"));
  15761. this.n15 = (this.getChild("n15"));
  15762. this.closeBtn = (this.getChild("closeBtn"));
  15763. this.share2Btn = (this.getChild("share2Btn"));
  15764. this.shareBtn = (this.getChild("shareBtn"));
  15765. this.tipsNode = (this.getChild("tipsNode"));
  15766. this.awardNode = (this.getChild("awardNode"));
  15767. }
  15768. }
  15769. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15770. class ui_daoJuDisplay extends fgui.GComponent {
  15771. static createInstance() {
  15772. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15773. }
  15774. onConstruct() {
  15775. this.n6 = (this.getChild("n6"));
  15776. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15777. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15778. this.btn_buy = (this.getChild("btn_buy"));
  15779. this.nameTxt = (this.getChild("nameTxt"));
  15780. this.zsImg = (this.getChild("zsImg"));
  15781. }
  15782. }
  15783. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15784. class ui_Component132_1 extends fgui.GComponent {
  15785. static createInstance() {
  15786. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15787. }
  15788. onConstruct() {
  15789. this.n25 = (this.getChild("n25"));
  15790. this.n26 = (this.getChild("n26"));
  15791. this.n27 = (this.getChild("n27"));
  15792. this.t0 = this.getTransition("t0");
  15793. }
  15794. }
  15795. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15796. class ui_SecretaryDisplay extends fgui.GComponent {
  15797. static createInstance() {
  15798. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15799. }
  15800. onConstruct() {
  15801. this.n2 = (this.getChild("n2"));
  15802. this.levelTxt = (this.getChild("levelTxt"));
  15803. this.n4 = (this.getChild("n4"));
  15804. this.secretary = (this.getChild("secretary"));
  15805. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15806. this.n16 = (this.getChild("n16"));
  15807. this.n37 = (this.getChild("n37"));
  15808. this.n41 = (this.getChild("n41"));
  15809. this.n14 = (this.getChild("n14"));
  15810. this.n17 = (this.getChild("n17"));
  15811. this.heightTxt = (this.getChild("heightTxt"));
  15812. this.n46 = (this.getChild("n46"));
  15813. this.n36 = (this.getChild("n36"));
  15814. this.n38 = (this.getChild("n38"));
  15815. this.foodTxt = (this.getChild("foodTxt"));
  15816. this.n47 = (this.getChild("n47"));
  15817. this.n40 = (this.getChild("n40"));
  15818. this.n42 = (this.getChild("n42"));
  15819. this.historyTxt = (this.getChild("historyTxt"));
  15820. this.n48 = (this.getChild("n48"));
  15821. this.nameImg = (this.getChild("nameImg"));
  15822. this.n12 = (this.getChild("n12"));
  15823. this.n49 = (this.getChild("n49"));
  15824. this.t0 = this.getTransition("t0");
  15825. }
  15826. }
  15827. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15828. class ui_BallRodDisplay extends fgui.GComponent {
  15829. static createInstance() {
  15830. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15831. }
  15832. onConstruct() {
  15833. this.c1 = this.getController("c1");
  15834. this.n31 = (this.getChild("n31"));
  15835. this.n6 = (this.getChild("n6"));
  15836. this.nameTxt = (this.getChild("nameTxt"));
  15837. this.rodImg = (this.getChild("rodImg"));
  15838. this.eftRod = (this.getChild("eftRod"));
  15839. this.levelNode = (this.getChild("levelNode"));
  15840. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15841. }
  15842. }
  15843. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15844. class ui_Component111_11 extends fgui.GComponent {
  15845. static createInstance() {
  15846. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15847. }
  15848. onConstruct() {
  15849. this.n68 = (this.getChild("n68"));
  15850. this.n69 = (this.getChild("n69"));
  15851. }
  15852. }
  15853. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15854. class ui_Component112 extends fgui.GComponent {
  15855. static createInstance() {
  15856. return (fgui.UIPackage.createObject("game", "Component112"));
  15857. }
  15858. onConstruct() {
  15859. this.n68 = (this.getChild("n68"));
  15860. this.n70 = (this.getChild("n70"));
  15861. this.myMask = (this.getChild("myMask"));
  15862. }
  15863. }
  15864. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15865. class ui_Component111 extends fgui.GComponent {
  15866. static createInstance() {
  15867. return (fgui.UIPackage.createObject("game", "Component111"));
  15868. }
  15869. onConstruct() {
  15870. this.n68 = (this.getChild("n68"));
  15871. this.myMask = (this.getChild("myMask"));
  15872. }
  15873. }
  15874. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15875. class ui_Component144 extends fgui.GButton {
  15876. static createInstance() {
  15877. return (fgui.UIPackage.createObject("game", "Component144"));
  15878. }
  15879. onConstruct() {
  15880. this.n8 = (this.getChild("n8"));
  15881. }
  15882. }
  15883. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15884. class ui_Sign_com2 extends fgui.GComponent {
  15885. static createInstance() {
  15886. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15887. }
  15888. onConstruct() {
  15889. this.n0 = (this.getChild("n0"));
  15890. this.n1 = (this.getChild("n1"));
  15891. this.t0 = this.getTransition("t0");
  15892. }
  15893. }
  15894. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15895. class ui_Sign_guang extends fgui.GComponent {
  15896. static createInstance() {
  15897. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15898. }
  15899. onConstruct() {
  15900. this.n1 = (this.getChild("n1"));
  15901. this.n2 = (this.getChild("n2"));
  15902. this.n3 = (this.getChild("n3"));
  15903. this.n4 = (this.getChild("n4"));
  15904. this.n5 = (this.getChild("n5"));
  15905. this.n6 = (this.getChild("n6"));
  15906. this.n8 = (this.getChild("n8"));
  15907. }
  15908. }
  15909. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15910. class ui_SignMax extends fgui.GComponent {
  15911. static createInstance() {
  15912. return (fgui.UIPackage.createObject("game", "SignMax"));
  15913. }
  15914. onConstruct() {
  15915. this.c1 = this.getController("c1");
  15916. this.n7 = (this.getChild("n7"));
  15917. this.n15 = (this.getChild("n15"));
  15918. this.n8 = (this.getChild("n8"));
  15919. this.titleTxt = (this.getChild("titleTxt"));
  15920. this.myIcon1 = (this.getChild("myIcon1"));
  15921. this.numTxt1 = (this.getChild("numTxt1"));
  15922. this.myIcon2 = (this.getChild("myIcon2"));
  15923. this.n20 = (this.getChild("n20"));
  15924. this.n17 = (this.getChild("n17"));
  15925. this.numTxt2 = (this.getChild("numTxt2"));
  15926. this.n12 = (this.getChild("n12"));
  15927. this.n13 = (this.getChild("n13"));
  15928. this.n21 = (this.getChild("n21"));
  15929. this.n14 = (this.getChild("n14"));
  15930. }
  15931. }
  15932. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15933. class ui_Sign_com2_1 extends fgui.GComponent {
  15934. static createInstance() {
  15935. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15936. }
  15937. onConstruct() {
  15938. this.n0 = (this.getChild("n0"));
  15939. this.n1 = (this.getChild("n1"));
  15940. this.t0 = this.getTransition("t0");
  15941. }
  15942. }
  15943. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15944. class ui_Sign_com5 extends fgui.GComponent {
  15945. static createInstance() {
  15946. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15947. }
  15948. onConstruct() {
  15949. this.n3 = (this.getChild("n3"));
  15950. this.n29 = (this.getChild("n29"));
  15951. this.n4 = (this.getChild("n4"));
  15952. this.day1 = (this.getChild("day1"));
  15953. this.day2 = (this.getChild("day2"));
  15954. this.day3 = (this.getChild("day3"));
  15955. this.day4 = (this.getChild("day4"));
  15956. this.day5 = (this.getChild("day5"));
  15957. this.day6 = (this.getChild("day6"));
  15958. this.day7 = (this.getChild("day7"));
  15959. this.t0 = this.getTransition("t0");
  15960. }
  15961. }
  15962. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15963. class ui_Sign_com8 extends fgui.GComponent {
  15964. static createInstance() {
  15965. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15966. }
  15967. onConstruct() {
  15968. this.n48 = (this.getChild("n48"));
  15969. this.womanTxt = (this.getChild("womanTxt"));
  15970. this.t0 = this.getTransition("t0");
  15971. }
  15972. }
  15973. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15974. class ui_Sign_com6 extends fgui.GComponent {
  15975. static createInstance() {
  15976. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15977. }
  15978. onConstruct() {
  15979. this.n2 = (this.getChild("n2"));
  15980. this.n3 = (this.getChild("n3"));
  15981. this.t0 = this.getTransition("t0");
  15982. }
  15983. }
  15984. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15985. class ui_Sign_com7 extends fgui.GComponent {
  15986. static createInstance() {
  15987. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15988. }
  15989. onConstruct() {
  15990. this.n29 = (this.getChild("n29"));
  15991. this.n2 = (this.getChild("n2"));
  15992. }
  15993. }
  15994. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15995. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15996. static createInstance() {
  15997. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15998. }
  15999. onConstruct() {
  16000. this.n5 = (this.getChild("n5"));
  16001. this.n4 = (this.getChild("n4"));
  16002. this.t0 = this.getTransition("t0");
  16003. }
  16004. }
  16005. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  16006. class ui_UITurntable_com2 extends fgui.GComponent {
  16007. static createInstance() {
  16008. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  16009. }
  16010. onConstruct() {
  16011. this.c1 = this.getController("c1");
  16012. this.n4 = (this.getChild("n4"));
  16013. this.n6 = (this.getChild("n6"));
  16014. this.n10 = (this.getChild("n10"));
  16015. this.n11 = (this.getChild("n11"));
  16016. this.n12 = (this.getChild("n12"));
  16017. this.n13 = (this.getChild("n13"));
  16018. this.n14 = (this.getChild("n14"));
  16019. this.n15 = (this.getChild("n15"));
  16020. this.n16 = (this.getChild("n16"));
  16021. this.n17 = (this.getChild("n17"));
  16022. this.n18 = (this.getChild("n18"));
  16023. this.n19 = (this.getChild("n19"));
  16024. this.n20 = (this.getChild("n20"));
  16025. this.n21 = (this.getChild("n21"));
  16026. this.n22 = (this.getChild("n22"));
  16027. this.n23 = (this.getChild("n23"));
  16028. this.n24 = (this.getChild("n24"));
  16029. this.n25 = (this.getChild("n25"));
  16030. this.n26 = (this.getChild("n26"));
  16031. this.n27 = (this.getChild("n27"));
  16032. this.n28 = (this.getChild("n28"));
  16033. this.n29 = (this.getChild("n29"));
  16034. this.n30 = (this.getChild("n30"));
  16035. this.n31 = (this.getChild("n31"));
  16036. this.n32 = (this.getChild("n32"));
  16037. this.n33 = (this.getChild("n33"));
  16038. }
  16039. }
  16040. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  16041. class ui_UITurntable_com1_1 extends fgui.GComponent {
  16042. static createInstance() {
  16043. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  16044. }
  16045. onConstruct() {
  16046. this.n5 = (this.getChild("n5"));
  16047. this.n4 = (this.getChild("n4"));
  16048. this.t0 = this.getTransition("t0");
  16049. }
  16050. }
  16051. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  16052. class ui_UITurntable_com5 extends fgui.GComponent {
  16053. static createInstance() {
  16054. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  16055. }
  16056. onConstruct() {
  16057. this.flashNode = (this.getChild("flashNode"));
  16058. this.rotNode = (this.getChild("rotNode"));
  16059. this.n3 = (this.getChild("n3"));
  16060. this.n21 = (this.getChild("n21"));
  16061. this.t0 = this.getTransition("t0");
  16062. }
  16063. }
  16064. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  16065. class ui_UITurntable_com7 extends fgui.GComponent {
  16066. static createInstance() {
  16067. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  16068. }
  16069. onConstruct() {
  16070. this.n2 = (this.getChild("n2"));
  16071. this.n35 = (this.getChild("n35"));
  16072. this.img1 = (this.getChild("img1"));
  16073. this.img2 = (this.getChild("img2"));
  16074. this.img3 = (this.getChild("img3"));
  16075. this.img4 = (this.getChild("img4"));
  16076. this.img6 = (this.getChild("img6"));
  16077. this.img5 = (this.getChild("img5"));
  16078. this.txt1 = (this.getChild("txt1"));
  16079. this.txt2 = (this.getChild("txt2"));
  16080. this.txt3 = (this.getChild("txt3"));
  16081. this.txt4 = (this.getChild("txt4"));
  16082. this.txt5 = (this.getChild("txt5"));
  16083. this.txt6 = (this.getChild("txt6"));
  16084. }
  16085. }
  16086. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  16087. class ui_UITurntable_com9 extends fgui.GComponent {
  16088. static createInstance() {
  16089. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  16090. }
  16091. onConstruct() {
  16092. this.n38 = (this.getChild("n38"));
  16093. this.n39 = (this.getChild("n39"));
  16094. }
  16095. }
  16096. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  16097. class ui_UITurntable_com10 extends fgui.GComponent {
  16098. static createInstance() {
  16099. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  16100. }
  16101. onConstruct() {
  16102. this.n39 = (this.getChild("n39"));
  16103. this.n40 = (this.getChild("n40"));
  16104. this.t0 = this.getTransition("t0");
  16105. }
  16106. }
  16107. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  16108. class ui_UITurntable_com11 extends fgui.GComponent {
  16109. static createInstance() {
  16110. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  16111. }
  16112. onConstruct() {
  16113. this.n38 = (this.getChild("n38"));
  16114. this.n39 = (this.getChild("n39"));
  16115. this.n40 = (this.getChild("n40"));
  16116. this.t0 = this.getTransition("t0");
  16117. }
  16118. }
  16119. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  16120. class ui_UITurntable_com12 extends fgui.GComponent {
  16121. static createInstance() {
  16122. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16123. }
  16124. onConstruct() {
  16125. this.n43 = (this.getChild("n43"));
  16126. this.barNode = (this.getChild("barNode"));
  16127. this.tipsTxt = (this.getChild("tipsTxt"));
  16128. this.n45 = (this.getChild("n45"));
  16129. this.boxBtn = (this.getChild("boxBtn"));
  16130. }
  16131. }
  16132. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16133. class ui_UITurntable_com1 extends fgui.GButton {
  16134. static createInstance() {
  16135. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16136. }
  16137. onConstruct() {
  16138. this.n41 = (this.getChild("n41"));
  16139. this.n42 = (this.getChild("n42"));
  16140. this.t0 = this.getTransition("t0");
  16141. }
  16142. }
  16143. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16144. class ui_UITurntable_com3 extends fgui.GComponent {
  16145. static createInstance() {
  16146. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16147. }
  16148. onConstruct() {
  16149. this.n48 = (this.getChild("n48"));
  16150. this.womanTxt = (this.getChild("womanTxt"));
  16151. this.t0 = this.getTransition("t0");
  16152. }
  16153. }
  16154. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16155. class ui_cancelBtn2 extends fgui.GButton {
  16156. static createInstance() {
  16157. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16158. }
  16159. onConstruct() {
  16160. this.c1 = this.getController("c1");
  16161. this.n0 = (this.getChild("n0"));
  16162. this.n1 = (this.getChild("n1"));
  16163. this.n2 = (this.getChild("n2"));
  16164. this.n3 = (this.getChild("n3"));
  16165. this.n4 = (this.getChild("n4"));
  16166. this.n5 = (this.getChild("n5"));
  16167. this.n6 = (this.getChild("n6"));
  16168. this.n7 = (this.getChild("n7"));
  16169. this.n8 = (this.getChild("n8"));
  16170. this.powerEft = (this.getChild("powerEft"));
  16171. }
  16172. }
  16173. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16174. class ui_shareBtn2 extends fgui.GButton {
  16175. static createInstance() {
  16176. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16177. }
  16178. onConstruct() {
  16179. this.c1 = this.getController("c1");
  16180. this.n2 = (this.getChild("n2"));
  16181. this.n24 = (this.getChild("n24"));
  16182. this.n1 = (this.getChild("n1"));
  16183. this.n3 = (this.getChild("n3"));
  16184. this.n23 = (this.getChild("n23"));
  16185. this.n4 = (this.getChild("n4"));
  16186. this.n5 = (this.getChild("n5"));
  16187. this.n6 = (this.getChild("n6"));
  16188. this.n20 = (this.getChild("n20"));
  16189. this.n21 = (this.getChild("n21"));
  16190. this.n22 = (this.getChild("n22"));
  16191. this.powerEft = (this.getChild("powerEft"));
  16192. }
  16193. }
  16194. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16195. class ui_UIMoney extends fgui.GComponent {
  16196. static createInstance() {
  16197. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16198. }
  16199. onConstruct() {
  16200. this.c1 = this.getController("c1");
  16201. this.n4 = (this.getChild("n4"));
  16202. this.coinImg = (this.getChild("coinImg"));
  16203. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16204. this.coinTxt = (this.getChild("coinTxt"));
  16205. this.n7 = (this.getChild("n7"));
  16206. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16207. this.diamondTxt = (this.getChild("diamondTxt"));
  16208. this.diamondImg = (this.getChild("diamondImg"));
  16209. this.n12 = (this.getChild("n12"));
  16210. this.powerImg = (this.getChild("powerImg"));
  16211. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16212. this.powerTxt = (this.getChild("powerTxt"));
  16213. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16214. }
  16215. }
  16216. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16217. class ui_backBtn extends fgui.GButton {
  16218. static createInstance() {
  16219. return (fgui.UIPackage.createObject("game", "backBtn"));
  16220. }
  16221. onConstruct() {
  16222. this.n0 = (this.getChild("n0"));
  16223. this.t0 = this.getTransition("t0");
  16224. this.t1 = this.getTransition("t1");
  16225. }
  16226. }
  16227. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16228. class ui_MoneyBtn extends fgui.GButton {
  16229. static createInstance() {
  16230. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16231. }
  16232. onConstruct() {
  16233. this.button = this.getController("button");
  16234. this.n0 = (this.getChild("n0"));
  16235. }
  16236. }
  16237. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16238. class ui_UIMoneyBtn extends fgui.GComponent {
  16239. static createInstance() {
  16240. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16241. }
  16242. onConstruct() {
  16243. this.n1 = (this.getChild("n1"));
  16244. this.closeBtn = (this.getChild("closeBtn"));
  16245. }
  16246. }
  16247. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16248. class ui_Component64 extends fgui.GComponent {
  16249. static createInstance() {
  16250. return (fgui.UIPackage.createObject("game", "Component64"));
  16251. }
  16252. onConstruct() {
  16253. this.n57 = (this.getChild("n57"));
  16254. this.n54 = (this.getChild("n54"));
  16255. this.n55 = (this.getChild("n55"));
  16256. this.n56 = (this.getChild("n56"));
  16257. this.t1 = this.getTransition("t1");
  16258. }
  16259. }
  16260. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16261. class ui_Component41_3 extends fgui.GComponent {
  16262. static createInstance() {
  16263. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16264. }
  16265. onConstruct() {
  16266. this.c1 = this.getController("c1");
  16267. this.n0 = (this.getChild("n0"));
  16268. this.n2 = (this.getChild("n2"));
  16269. this.cancelBtn = (this.getChild("cancelBtn"));
  16270. this.videoBtn = (this.getChild("videoBtn"));
  16271. this.n9 = (this.getChild("n9"));
  16272. this.n24 = (this.getChild("n24"));
  16273. this.n27 = (this.getChild("n27"));
  16274. this.titleTxt = (this.getChild("titleTxt"));
  16275. this.n28 = (this.getChild("n28"));
  16276. this.t0 = this.getTransition("t0");
  16277. }
  16278. }
  16279. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16280. class ui_dh_zs_4 extends fgui.GComponent {
  16281. static createInstance() {
  16282. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16283. }
  16284. onConstruct() {
  16285. this.n1 = (this.getChild("n1"));
  16286. this.n2 = (this.getChild("n2"));
  16287. this.n3 = (this.getChild("n3"));
  16288. this.n4 = (this.getChild("n4"));
  16289. this.n5 = (this.getChild("n5"));
  16290. this.n6 = (this.getChild("n6"));
  16291. this.n8 = (this.getChild("n8"));
  16292. this.t0 = this.getTransition("t0");
  16293. }
  16294. }
  16295. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16296. class ui_Component71_1 extends fgui.GButton {
  16297. static createInstance() {
  16298. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16299. }
  16300. onConstruct() {
  16301. this.n17 = (this.getChild("n17"));
  16302. this.t0 = this.getTransition("t0");
  16303. }
  16304. }
  16305. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16306. class ui_Component83 extends fgui.GComponent {
  16307. static createInstance() {
  16308. return (fgui.UIPackage.createObject("game", "Component83"));
  16309. }
  16310. onConstruct() {
  16311. this.c1 = this.getController("c1");
  16312. this.n17 = (this.getChild("n17"));
  16313. this.n19 = (this.getChild("n19"));
  16314. this.n20 = (this.getChild("n20"));
  16315. }
  16316. }
  16317. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16318. class ui_Component84 extends fgui.GComponent {
  16319. static createInstance() {
  16320. return (fgui.UIPackage.createObject("game", "Component84"));
  16321. }
  16322. onConstruct() {
  16323. this.c1 = this.getController("c1");
  16324. this.n4 = (this.getChild("n4"));
  16325. this.n22 = (this.getChild("n22"));
  16326. this.n23 = (this.getChild("n23"));
  16327. this.numTxt = (this.getChild("numTxt"));
  16328. this.n25 = (this.getChild("n25"));
  16329. this.n26 = (this.getChild("n26"));
  16330. }
  16331. }
  16332. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16333. class ui_Component84_1 extends fgui.GComponent {
  16334. static createInstance() {
  16335. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16336. }
  16337. onConstruct() {
  16338. this.c1 = this.getController("c1");
  16339. this.n4 = (this.getChild("n4"));
  16340. this.n22 = (this.getChild("n22"));
  16341. this.n23 = (this.getChild("n23"));
  16342. this.numTxt = (this.getChild("numTxt"));
  16343. this.n25 = (this.getChild("n25"));
  16344. this.n26 = (this.getChild("n26"));
  16345. }
  16346. }
  16347. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16348. class ui_Component85 extends fgui.GComponent {
  16349. static createInstance() {
  16350. return (fgui.UIPackage.createObject("game", "Component85"));
  16351. }
  16352. onConstruct() {
  16353. this.n1 = (this.getChild("n1"));
  16354. this.n6 = (this.getChild("n6"));
  16355. this.n2 = (this.getChild("n2"));
  16356. this.n3 = (this.getChild("n3"));
  16357. this.levelTxt = (this.getChild("levelTxt"));
  16358. this.n10 = (this.getChild("n10"));
  16359. this.n11 = (this.getChild("n11"));
  16360. this.n12 = (this.getChild("n12"));
  16361. this.n13 = (this.getChild("n13"));
  16362. this.n14 = (this.getChild("n14"));
  16363. this.modeNode = (this.getChild("modeNode"));
  16364. this.n18 = (this.getChild("n18"));
  16365. this.conditionTxt = (this.getChild("conditionTxt"));
  16366. this.diamondNode = (this.getChild("diamondNode"));
  16367. this.coinNode = (this.getChild("coinNode"));
  16368. this.startBtn = (this.getChild("startBtn"));
  16369. this.n28 = (this.getChild("n28"));
  16370. this.displayRoot = (this.getChild("displayRoot"));
  16371. this.t0 = this.getTransition("t0");
  16372. }
  16373. }
  16374. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16375. class ui_Component86 extends fgui.GButton {
  16376. static createInstance() {
  16377. return (fgui.UIPackage.createObject("game", "Component86"));
  16378. }
  16379. onConstruct() {
  16380. this.n15 = (this.getChild("n15"));
  16381. this.t0 = this.getTransition("t0");
  16382. }
  16383. }
  16384. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16385. class ui_Component87 extends fgui.GComponent {
  16386. static createInstance() {
  16387. return (fgui.UIPackage.createObject("game", "Component87"));
  16388. }
  16389. onConstruct() {
  16390. this.n66 = (this.getChild("n66"));
  16391. this.myProgress = (this.getChild("myProgress"));
  16392. this.starAni = (this.getChild("starAni"));
  16393. this.hpTxt = (this.getChild("hpTxt"));
  16394. this.n74 = (this.getChild("n74"));
  16395. this.n73 = (this.getChild("n73"));
  16396. this.ballTxt = (this.getChild("ballTxt"));
  16397. this.n76 = (this.getChild("n76"));
  16398. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16399. this.levelTxt = (this.getChild("levelTxt"));
  16400. this.star1 = (this.getChild("star1"));
  16401. this.star2 = (this.getChild("star2"));
  16402. this.star3 = (this.getChild("star3"));
  16403. }
  16404. }
  16405. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16406. class ui_Component88 extends fgui.GProgressBar {
  16407. static createInstance() {
  16408. return (fgui.UIPackage.createObject("game", "Component88"));
  16409. }
  16410. onConstruct() {
  16411. this.n68 = (this.getChild("n68"));
  16412. this.bar = (this.getChild("bar"));
  16413. }
  16414. }
  16415. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16416. class ui_Component89 extends fgui.GComponent {
  16417. static createInstance() {
  16418. return (fgui.UIPackage.createObject("game", "Component89"));
  16419. }
  16420. onConstruct() {
  16421. this.c1 = this.getController("c1");
  16422. this.n71 = (this.getChild("n71"));
  16423. this.n72 = (this.getChild("n72"));
  16424. }
  16425. }
  16426. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16427. class ui_Component90 extends fgui.GComponent {
  16428. static createInstance() {
  16429. return (fgui.UIPackage.createObject("game", "Component90"));
  16430. }
  16431. onConstruct() {
  16432. this.c1 = this.getController("c1");
  16433. this.n64 = (this.getChild("n64"));
  16434. this.n65 = (this.getChild("n65"));
  16435. this.n66 = (this.getChild("n66"));
  16436. this.t0 = this.getTransition("t0");
  16437. }
  16438. }
  16439. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16440. class ui_Component127 extends fgui.GButton {
  16441. static createInstance() {
  16442. return (fgui.UIPackage.createObject("game", "Component127"));
  16443. }
  16444. onConstruct() {
  16445. this.n5 = (this.getChild("n5"));
  16446. }
  16447. }
  16448. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16449. class gameBinder {
  16450. static bindAll() {
  16451. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16452. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16453. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16454. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16455. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16456. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16457. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16458. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16459. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16460. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16461. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16462. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16463. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16464. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16465. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16466. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16467. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16468. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16469. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16470. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16471. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16472. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16473. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16474. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16475. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16476. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16477. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16478. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16479. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16480. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16481. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16482. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16483. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16484. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16485. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16486. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16487. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16488. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16489. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16490. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16491. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16492. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16493. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16494. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16495. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16496. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16497. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16498. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16499. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16500. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16501. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16502. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16503. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16504. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16505. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16506. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16507. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16508. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16509. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16510. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16511. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16512. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16513. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16514. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16515. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16516. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16517. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16518. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16519. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16520. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16521. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16522. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16523. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16524. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16525. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16526. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16527. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16528. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16529. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16530. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16531. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16532. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16533. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16534. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16535. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16536. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16537. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16538. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16539. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16540. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16541. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16542. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16543. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16544. fgui.UIObjectFactory.setExtension(ui_Component_denglu.URL, ui_Component_denglu);
  16545. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16546. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16547. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16548. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16549. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16550. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16551. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16552. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16553. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16554. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16555. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16556. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16557. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16558. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16559. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16560. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16561. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16562. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16563. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16564. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16565. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16566. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16567. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16568. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16569. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16570. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16571. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16572. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16573. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16574. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16575. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16576. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16577. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16578. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16579. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16580. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16581. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16582. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16583. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16584. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16585. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16586. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16587. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16588. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16589. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16590. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16591. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16592. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16593. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16594. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16595. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16596. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16597. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16598. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16599. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16600. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16601. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16602. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16603. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16604. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16605. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16606. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16607. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16608. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16609. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16610. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16611. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16612. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16613. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16614. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16615. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16616. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16617. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16618. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16619. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16620. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16621. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16622. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16623. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16624. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16625. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16626. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16627. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16628. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16629. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16630. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16631. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16632. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16633. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16634. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16635. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16636. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16637. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16638. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16639. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16640. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16641. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16642. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16643. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16644. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16645. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16646. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16647. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16648. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16649. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16650. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16651. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16652. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16653. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16654. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16655. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16656. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16657. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16658. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16659. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16660. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16661. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16662. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16663. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16664. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16665. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16666. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16667. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16668. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16669. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16670. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16671. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16672. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16673. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16674. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16675. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16676. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16677. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16678. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16679. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16680. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16681. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16682. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16683. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16684. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16685. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16686. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16687. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16688. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16689. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16690. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16691. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16692. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16693. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16694. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16695. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16696. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16697. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16698. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16699. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16700. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16701. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16702. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16703. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16704. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16705. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16706. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16707. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16708. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16709. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16710. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16711. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16712. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16713. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16714. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16715. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16716. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16717. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16718. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16719. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16720. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16721. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16722. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16723. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16724. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16725. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16726. }
  16727. }
  16728. class ui_btn6 extends fgui.GButton {
  16729. static createInstance() {
  16730. return (fgui.UIPackage.createObject("loading", "btn6"));
  16731. }
  16732. onConstruct() {
  16733. this.n6 = (this.getChild("n6"));
  16734. this.n1 = (this.getChild("n1"));
  16735. }
  16736. }
  16737. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16738. class ui_xyItem extends fgui.GComponent {
  16739. static createInstance() {
  16740. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16741. }
  16742. onConstruct() {
  16743. this.xyItem = (this.getChild("xyItem"));
  16744. }
  16745. }
  16746. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16747. class ui_loadinfo extends fgui.GProgressBar {
  16748. static createInstance() {
  16749. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16750. }
  16751. onConstruct() {
  16752. this.bg = (this.getChild("bg"));
  16753. this.bar = (this.getChild("bar"));
  16754. this.title = (this.getChild("title"));
  16755. this.ani = (this.getChild("ani"));
  16756. }
  16757. }
  16758. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16759. class ui_xyNode extends fgui.GComponent {
  16760. static createInstance() {
  16761. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16762. }
  16763. onConstruct() {
  16764. this.n0 = (this.getChild("n0"));
  16765. this.btnYes = (this.getChild("btnYes"));
  16766. this.btnNo = (this.getChild("btnNo"));
  16767. this.btnKnown = (this.getChild("btnKnown"));
  16768. this.btnSure = (this.getChild("btnSure"));
  16769. this.txtWelcom = (this.getChild("txtWelcom"));
  16770. this.txtXy = (this.getChild("txtXy"));
  16771. this.n75 = (this.getChild("n75"));
  16772. this.btnXy1 = (this.getChild("btnXy1"));
  16773. this.btnXy3 = (this.getChild("btnXy3"));
  16774. this.btnXy2 = (this.getChild("btnXy2"));
  16775. this.n74 = (this.getChild("n74"));
  16776. this.xy1 = (this.getChild("xy1"));
  16777. this.txtTitle = (this.getChild("txtTitle"));
  16778. this.btnBack = (this.getChild("btnBack"));
  16779. this.xyList = (this.getChild("xyList"));
  16780. this.xy2 = (this.getChild("xy2"));
  16781. this.xyNode = (this.getChild("xyNode"));
  16782. }
  16783. }
  16784. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16785. class ui_ageNode extends fgui.GComponent {
  16786. static createInstance() {
  16787. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16788. }
  16789. onConstruct() {
  16790. this.n3 = (this.getChild("n3"));
  16791. this.n7 = (this.getChild("n7"));
  16792. this.n4 = (this.getChild("n4"));
  16793. this.btnAge = (this.getChild("btnAge"));
  16794. this.ageNode = (this.getChild("ageNode"));
  16795. }
  16796. }
  16797. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16798. class ui_rnNode extends fgui.GComponent {
  16799. static createInstance() {
  16800. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16801. }
  16802. onConstruct() {
  16803. this.n28 = (this.getChild("n28"));
  16804. this.n30 = (this.getChild("n30"));
  16805. this.n33 = (this.getChild("n33"));
  16806. this.rn1 = (this.getChild("rn1"));
  16807. this.n40 = (this.getChild("n40"));
  16808. this.n41 = (this.getChild("n41"));
  16809. this.rn3 = (this.getChild("rn3"));
  16810. this.n37 = (this.getChild("n37"));
  16811. this.n39 = (this.getChild("n39"));
  16812. this.rn2 = (this.getChild("rn2"));
  16813. this.n47 = (this.getChild("n47"));
  16814. this.n49 = (this.getChild("n49"));
  16815. this.n44 = (this.getChild("n44"));
  16816. this.inputCode = (this.getChild("inputCode"));
  16817. this.inputName = (this.getChild("inputName"));
  16818. this.n48 = (this.getChild("n48"));
  16819. this.n50 = (this.getChild("n50"));
  16820. this.rn4 = (this.getChild("rn4"));
  16821. this.btnCheck = (this.getChild("btnCheck"));
  16822. this.btnExit = (this.getChild("btnExit"));
  16823. this.btnDone = (this.getChild("btnDone"));
  16824. this.rnNode = (this.getChild("rnNode"));
  16825. }
  16826. }
  16827. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16828. class ui_tipNode extends fgui.GComponent {
  16829. static createInstance() {
  16830. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16831. }
  16832. onConstruct() {
  16833. this.bg = (this.getChild("bg"));
  16834. this.n55 = (this.getChild("n55"));
  16835. this.n56 = (this.getChild("n56"));
  16836. this.tipNode = (this.getChild("tipNode"));
  16837. }
  16838. }
  16839. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16840. class ui_fcmNode extends fgui.GComponent {
  16841. static createInstance() {
  16842. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16843. }
  16844. onConstruct() {
  16845. this.n63 = (this.getChild("n63"));
  16846. this.n62 = (this.getChild("n62"));
  16847. this.btnRn = (this.getChild("btnRn"));
  16848. this.n61 = (this.getChild("n61"));
  16849. this.n58 = (this.getChild("n58"));
  16850. this.fcmNode = (this.getChild("fcmNode"));
  16851. }
  16852. }
  16853. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16854. class ui_msgNode extends fgui.GComponent {
  16855. static createInstance() {
  16856. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16857. }
  16858. onConstruct() {
  16859. this.n69 = (this.getChild("n69"));
  16860. this.txtMsg = (this.getChild("txtMsg"));
  16861. this.msgNode = (this.getChild("msgNode"));
  16862. }
  16863. }
  16864. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16865. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16866. static createInstance() {
  16867. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16868. }
  16869. onConstruct() {
  16870. this.n1 = (this.getChild("n1"));
  16871. this.n13 = (this.getChild("n13"));
  16872. this.n14 = (this.getChild("n14"));
  16873. this.n15 = (this.getChild("n15"));
  16874. this.n3 = (this.getChild("n3"));
  16875. this.n4 = (this.getChild("n4"));
  16876. this.n5 = (this.getChild("n5"));
  16877. this.n6 = (this.getChild("n6"));
  16878. this.n7 = (this.getChild("n7"));
  16879. this.n8 = (this.getChild("n8"));
  16880. this.n9 = (this.getChild("n9"));
  16881. this.n10 = (this.getChild("n10"));
  16882. this.n12 = (this.getChild("n12"));
  16883. this.n11 = (this.getChild("n11"));
  16884. this.n16 = (this.getChild("n16"));
  16885. this.n17 = (this.getChild("n17"));
  16886. this.n18 = (this.getChild("n18"));
  16887. this.n20 = (this.getChild("n20"));
  16888. this.n21 = (this.getChild("n21"));
  16889. this.t0 = this.getTransition("t0");
  16890. }
  16891. }
  16892. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16893. class ui_btn5 extends fgui.GButton {
  16894. static createInstance() {
  16895. return (fgui.UIPackage.createObject("loading", "btn5"));
  16896. }
  16897. onConstruct() {
  16898. this.n9 = (this.getChild("n9"));
  16899. this.n1 = (this.getChild("n1"));
  16900. }
  16901. }
  16902. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16903. class ui_UILoading extends fgui.GComponent {
  16904. static createInstance() {
  16905. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16906. }
  16907. onConstruct() {
  16908. this.n12 = (this.getChild("n12"));
  16909. this.loadinfo = (this.getChild("loadinfo"));
  16910. this.n13 = (this.getChild("n13"));
  16911. this.txtLoad = (this.getChild("txtLoad"));
  16912. this.n18 = (this.getChild("n18"));
  16913. }
  16914. }
  16915. ui_UILoading.URL = "ui://37nctnhwphc33";
  16916. class ui_AgeItem extends fgui.GComponent {
  16917. static createInstance() {
  16918. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16919. }
  16920. onConstruct() {
  16921. this.txtAge = (this.getChild("txtAge"));
  16922. }
  16923. }
  16924. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16925. class ui_btn1 extends fgui.GButton {
  16926. static createInstance() {
  16927. return (fgui.UIPackage.createObject("loading", "btn1"));
  16928. }
  16929. onConstruct() {
  16930. this.n6 = (this.getChild("n6"));
  16931. this.n1 = (this.getChild("n1"));
  16932. }
  16933. }
  16934. ui_btn1.URL = "ui://37nctnhwxe622p";
  16935. class ui_btn3 extends fgui.GButton {
  16936. static createInstance() {
  16937. return (fgui.UIPackage.createObject("loading", "btn3"));
  16938. }
  16939. onConstruct() {
  16940. this.n9 = (this.getChild("n9"));
  16941. this.n1 = (this.getChild("n1"));
  16942. }
  16943. }
  16944. ui_btn3.URL = "ui://37nctnhwxe622s";
  16945. class ui_btn2 extends fgui.GButton {
  16946. static createInstance() {
  16947. return (fgui.UIPackage.createObject("loading", "btn2"));
  16948. }
  16949. onConstruct() {
  16950. this.n6 = (this.getChild("n6"));
  16951. this.n1 = (this.getChild("n1"));
  16952. }
  16953. }
  16954. ui_btn2.URL = "ui://37nctnhwxe622t";
  16955. class ui_btnBack extends fgui.GButton {
  16956. static createInstance() {
  16957. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16958. }
  16959. onConstruct() {
  16960. this.n6 = (this.getChild("n6"));
  16961. this.n7 = (this.getChild("n7"));
  16962. }
  16963. }
  16964. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16965. class ui_btnXy1 extends fgui.GButton {
  16966. static createInstance() {
  16967. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16968. }
  16969. onConstruct() {
  16970. this.n1 = (this.getChild("n1"));
  16971. }
  16972. }
  16973. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16974. class ui_btnXy2 extends fgui.GButton {
  16975. static createInstance() {
  16976. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16977. }
  16978. onConstruct() {
  16979. this.n1 = (this.getChild("n1"));
  16980. }
  16981. }
  16982. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16983. class ui_btnXy3 extends fgui.GButton {
  16984. static createInstance() {
  16985. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16986. }
  16987. onConstruct() {
  16988. this.n1 = (this.getChild("n1"));
  16989. }
  16990. }
  16991. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16992. class ui_btn4 extends fgui.GButton {
  16993. static createInstance() {
  16994. return (fgui.UIPackage.createObject("loading", "btn4"));
  16995. }
  16996. onConstruct() {
  16997. this.n9 = (this.getChild("n9"));
  16998. this.n1 = (this.getChild("n1"));
  16999. }
  17000. }
  17001. ui_btn4.URL = "ui://37nctnhwxe622z";
  17002. class loadingBinder {
  17003. static bindAll() {
  17004. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  17005. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  17006. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  17007. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  17008. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  17009. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  17010. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  17011. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  17012. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  17013. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  17014. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  17015. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  17016. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  17017. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  17018. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  17019. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  17020. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  17021. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  17022. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  17023. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  17024. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  17025. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  17026. }
  17027. }
  17028. class UIMgr {
  17029. constructor() {
  17030. this._stage = null;
  17031. this._uiList = [];
  17032. this._showList = [];
  17033. this._bindPkgList = [];
  17034. this.uiIndex = 0;
  17035. }
  17036. static get inst() {
  17037. if (UIMgr._inst == null) {
  17038. UIMgr._inst = new UIMgr();
  17039. }
  17040. return UIMgr._inst;
  17041. }
  17042. setStage(s) {
  17043. if (this._stage) {
  17044. console.log("ViewMgr::Stage->舞台不可赋值两次");
  17045. return;
  17046. }
  17047. this._stage = s;
  17048. }
  17049. clearTempData() {
  17050. console.log('zh:clearTempData start');
  17051. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  17052. console.log('zh:clearTempData end');
  17053. }
  17054. init() {
  17055. this.setStage(Laya.stage);
  17056. fairygui.UIConfig.defaultFont = "arial";
  17057. fairygui.UIConfig.modalLayerColor = "rgba(29, 22, 22, 0.9)";
  17058. fairygui.UIConfig.packageFileExtension = "obj";
  17059. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  17060. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  17061. fairygui.GRoot.inst.width = Laya.stage.width;
  17062. fairygui.GRoot.inst.height = Laya.stage.height;
  17063. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  17064. }
  17065. addAllUpdate() {
  17066. this.uiIndex = 0;
  17067. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  17068. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  17069. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  17070. }
  17071. }
  17072. }
  17073. bindFUI(pkgname) {
  17074. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  17075. return;
  17076. }
  17077. switch (pkgname) {
  17078. case fguiRes.loading:
  17079. fairygui.UIPackage.addPackage(pkgname);
  17080. loadingBinder.bindAll();
  17081. this._bindPkgList.push(pkgname);
  17082. break;
  17083. case fguiRes.game:
  17084. fairygui.UIPackage.addPackage(pkgname);
  17085. gameBinder.bindAll();
  17086. this._bindPkgList.push(pkgname);
  17087. break;
  17088. default:
  17089. break;
  17090. }
  17091. }
  17092. Show(cls, ...param) {
  17093. let nameStr = cls.uiName;
  17094. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17095. let temp = this._uiList[i];
  17096. let str = temp.className;
  17097. if (str == nameStr) {
  17098. if (temp.isMuti) {
  17099. if (temp.isHide) {
  17100. temp.show(...param);
  17101. this._uiList.splice(i, 1);
  17102. this._uiList.push(temp);
  17103. return temp;
  17104. }
  17105. }
  17106. else {
  17107. temp.show(...param);
  17108. this._uiList.splice(i, 1);
  17109. this._uiList.push(temp);
  17110. return temp;
  17111. }
  17112. }
  17113. }
  17114. let ui = new cls();
  17115. ui.className = nameStr;
  17116. this._showUI(ui, param);
  17117. return ui;
  17118. }
  17119. destroyUI(ui) {
  17120. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17121. let temp = this._uiList[i].className;
  17122. if (temp == ui.className) {
  17123. this._uiList.splice(i, 1);
  17124. break;
  17125. }
  17126. }
  17127. this.checkUIState();
  17128. }
  17129. _showUI(ui, param) {
  17130. this._uiList.push(ui);
  17131. ui.show(...param);
  17132. }
  17133. Hide(uiClass) {
  17134. let ui = this.getUI(uiClass);
  17135. if (ui && !ui.isHide) {
  17136. ui.hide();
  17137. }
  17138. }
  17139. getUI(ui) {
  17140. let nameStr = ui.uiName;
  17141. for (let index = 0; index < this._uiList.length; index++) {
  17142. let temp = this._uiList[index];
  17143. if (temp.className == nameStr) {
  17144. return temp;
  17145. }
  17146. }
  17147. return null;
  17148. }
  17149. isShow(cls) {
  17150. for (var i of this._uiList) {
  17151. if (i instanceof cls) {
  17152. return i.isShowing;
  17153. }
  17154. }
  17155. return false;
  17156. }
  17157. showUINum() {
  17158. let num = 0;
  17159. for (var i of this._uiList) {
  17160. if (i.isShowing) {
  17161. num++;
  17162. }
  17163. }
  17164. return num;
  17165. }
  17166. checkUIState() {
  17167. Laya.timer.clear(this, this._uiCheck);
  17168. Laya.timer.once(400, this, this._uiCheck);
  17169. }
  17170. _uiCheck() {
  17171. let showList = [];
  17172. for (var i of this._uiList) {
  17173. if (!i.isHide) {
  17174. showList.push(i);
  17175. }
  17176. }
  17177. for (let index = 0; index < showList.length; index++) {
  17178. if (index == showList.length - 1) {
  17179. showList[index].checkActive(true);
  17180. }
  17181. else {
  17182. showList[index].checkActive(false);
  17183. }
  17184. }
  17185. }
  17186. showTip(msg, time = 600, size = 30) {
  17187. }
  17188. }
  17189. class UIShowList {
  17190. }
  17191. class SoundMgr {
  17192. constructor() {
  17193. this.soundMax = 4;
  17194. this.isLoad = false;
  17195. this.soundMap = {};
  17196. this.isSound = true;
  17197. this.openShake = true;
  17198. SoundMgr._instance = this;
  17199. }
  17200. static getInstance() {
  17201. if (!this._instance) {
  17202. this._instance = new SoundMgr();
  17203. }
  17204. return this._instance;
  17205. }
  17206. init() {
  17207. console.log('zh:sm init 1');
  17208. Laya.SoundManager.autoReleaseSound = true;
  17209. Laya.SoundManager.autoStopMusic = true;
  17210. Laya.SoundManager.musicVolume = 0.3;
  17211. Laya.SoundManager.soundVolume = 0.5;
  17212. this.musicPlayed = false;
  17213. this.audioUrl = "asset/sound/ogg/";
  17214. console.log('zh:sm init 2');
  17215. console.log('zh:dev type ');
  17216. if (Laya.Browser.onAndroid) {
  17217. console.log('zh:dev type android');
  17218. this.audioUrl = "asset/sound/ogg/";
  17219. this.isLoad = true;
  17220. }
  17221. else {
  17222. console.log('zh:dev type not android');
  17223. this.audioUrl = "asset/sound/mp3/";
  17224. this.isLoad = true;
  17225. }
  17226. }
  17227. onSetting(isS) {
  17228. this.isSound = isS;
  17229. this.mute(!this.isSound);
  17230. }
  17231. clearCount() {
  17232. for (var key in this.soundMap) {
  17233. delete this.soundMap[key];
  17234. }
  17235. }
  17236. playMusic(path, loop = 0) {
  17237. console.log('zh:playMusic 1 PATH=' + path);
  17238. this.musicPath = path;
  17239. if (!this.isLoad) {
  17240. return;
  17241. }
  17242. if (!path || path == "") {
  17243. return;
  17244. }
  17245. if (!this.isSound) {
  17246. return;
  17247. }
  17248. this.musicPlayed = true;
  17249. let url = this.getUrl(path);
  17250. if (!Laya.Browser.onAndroid) {
  17251. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17252. this.play(url, loop);
  17253. }));
  17254. }
  17255. else {
  17256. this.play(url, loop);
  17257. }
  17258. }
  17259. play(url, loop) {
  17260. Laya.SoundManager.playMusic(url, loop);
  17261. }
  17262. getUrl(path) {
  17263. let url = this.audioUrl + path;
  17264. if (Laya.Browser.onAndroid) {
  17265. url += ".ogg";
  17266. }
  17267. else {
  17268. url += ".mp3";
  17269. }
  17270. return url;
  17271. }
  17272. pauseMusic(pause) {
  17273. if (pause) {
  17274. this.mute(true);
  17275. }
  17276. else if (this.isSound)
  17277. this.mute(false);
  17278. }
  17279. stopMusic() {
  17280. Laya.SoundManager.stopMusic();
  17281. if (Moyu.isNeedPlatAudio) {
  17282. Moyu.stopMusic();
  17283. }
  17284. }
  17285. mute(mute) {
  17286. if (Moyu.isNeedPlatAudio) {
  17287. Moyu.pauseMusic(mute);
  17288. }
  17289. else {
  17290. Laya.SoundManager.musicMuted = mute;
  17291. if (!mute && !this.musicPlayed && this.musicPath) {
  17292. this.playMusic(this.musicPath);
  17293. }
  17294. }
  17295. }
  17296. stopSound(path) {
  17297. let url = this.getUrl(path);
  17298. Laya.SoundManager.stopSound(url);
  17299. }
  17300. playSound(path, loop = 1, soundMax = this.soundMax) {
  17301. if (!this.isLoad)
  17302. return;
  17303. if (!this.isSound)
  17304. return;
  17305. if (!path || path == "")
  17306. return;
  17307. let url = this.getUrl(path);
  17308. if (Moyu.isNeedPlatAudio) {
  17309. Moyu.playSound(path, loop == 0);
  17310. }
  17311. else {
  17312. let count = 1;
  17313. if (this.soundMap[path])
  17314. count = this.soundMap[path] + 1;
  17315. if (count > soundMax)
  17316. return;
  17317. this.soundMap[path] = count;
  17318. Laya.SoundManager.playSound(url, loop);
  17319. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17320. }
  17321. }
  17322. removePath(path) {
  17323. if (this.soundMap[path]) {
  17324. let count = this.soundMap[path];
  17325. count--;
  17326. if (count < 1)
  17327. delete this.soundMap[path];
  17328. else
  17329. this.soundMap[path] = count;
  17330. }
  17331. }
  17332. playBtnSound() {
  17333. this.playSound("btn");
  17334. }
  17335. playGetSound() {
  17336. }
  17337. playCloseUISound() {
  17338. }
  17339. }
  17340. SoundMgr._instance = null;
  17341. var Handler$1 = Laya.Handler;
  17342. var EResType;
  17343. (function (EResType) {
  17344. EResType[EResType["none"] = 0] = "none";
  17345. EResType[EResType["nromal"] = 1] = "nromal";
  17346. EResType[EResType["td"] = 2] = "td";
  17347. EResType[EResType["sk"] = 3] = "sk";
  17348. })(EResType || (EResType = {}));
  17349. class CResLoader {
  17350. constructor(doneCall, proCall) {
  17351. this.completrCall = doneCall;
  17352. this.progressCall = proCall;
  17353. this.progressHander = new Handler$1(this, this.onProgress);
  17354. this.tdResMap = {};
  17355. }
  17356. load(resList) {
  17357. this.resCount = 0;
  17358. this.loadCount = 0;
  17359. for (let i = 0; i < resList.length; i++) {
  17360. let path = resList[i];
  17361. if (!path)
  17362. continue;
  17363. this.resCount++;
  17364. let type = this.getResType(path);
  17365. if (type == EResType.nromal)
  17366. this.loadNromal(path);
  17367. else if (type == EResType.td)
  17368. this.loadTd(path);
  17369. }
  17370. }
  17371. getRes(path) {
  17372. let type = this.getResType(path);
  17373. if (type == EResType.nromal)
  17374. return Laya.loader.getRes(path);
  17375. else if (type == EResType.td) {
  17376. let res = this.tdResMap[path];
  17377. if (res)
  17378. return res.clone();
  17379. return null;
  17380. }
  17381. }
  17382. destroy() {
  17383. this.progressHander.clear();
  17384. this.progressHander = null;
  17385. }
  17386. clearRes(path) {
  17387. let type = this.getResType(path);
  17388. if (type == EResType.nromal)
  17389. Laya.loader.clearRes(path);
  17390. else if (type == EResType.td) {
  17391. let obj = this.tdResMap[path];
  17392. if (obj)
  17393. obj.destroy();
  17394. delete this.tdResMap[path];
  17395. }
  17396. }
  17397. getResType(path) {
  17398. let exs = this.getExtension(path);
  17399. if (exs == "sk")
  17400. return EResType.sk;
  17401. if (exs == "ls" || exs == "lh" || exs == "lm")
  17402. return EResType.td;
  17403. else
  17404. return EResType.nromal;
  17405. }
  17406. getExtension(res) {
  17407. var index = res.lastIndexOf(".");
  17408. return res.substr(index + 1);
  17409. }
  17410. loadNromal(path) {
  17411. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17412. if (res) {
  17413. this.onLoad();
  17414. }
  17415. else
  17416. console.log("load res fail:" + path);
  17417. }), this.progressHander);
  17418. }
  17419. loadSk() {
  17420. }
  17421. loadTd(path) {
  17422. if (this.tdResMap[path]) {
  17423. this.onLoad();
  17424. return;
  17425. }
  17426. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17427. if (res) {
  17428. this.tdResMap[path] = res;
  17429. this.onLoad();
  17430. }
  17431. else
  17432. console.log("load res fail:" + path);
  17433. }));
  17434. }
  17435. onLoad() {
  17436. this.loadCount++;
  17437. this.onProgress(1);
  17438. if (this.loadCount >= this.resCount) {
  17439. this.completrCall.run();
  17440. }
  17441. }
  17442. onProgress(pro) {
  17443. let progress = (this.loadCount + pro) / this.resCount;
  17444. this.progressCall.runWith(progress);
  17445. }
  17446. }
  17447. var Handler$2 = Laya.Handler;
  17448. class ResInfo {
  17449. constructor() {
  17450. this.index = 0;
  17451. }
  17452. }
  17453. class ResMgr {
  17454. constructor() {
  17455. this.resList = [];
  17456. this.doneList = [];
  17457. this.resMap = {};
  17458. this.currentLoad = null;
  17459. this.completeHandler = new Handler$2(this, this.onComplete);
  17460. this.progressHandler = new Handler$2(this, this.onProgress);
  17461. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17462. }
  17463. static getInstance() {
  17464. if (ResMgr._instance == null) {
  17465. ResMgr._instance = new ResMgr();
  17466. }
  17467. return ResMgr._instance;
  17468. }
  17469. loadList(list, completeHandler, progressHandler) {
  17470. if (list.length < 1) {
  17471. completeHandler.run();
  17472. return;
  17473. }
  17474. let info = this.getResInfo();
  17475. info.resList = list;
  17476. info.completeHandler = completeHandler;
  17477. info.progressHandler = progressHandler;
  17478. this.resList.push(info);
  17479. this.startLoad();
  17480. }
  17481. loadFguiRes(list, completeHandler, progressHandler) {
  17482. Laya.loader.load(list, completeHandler, progressHandler);
  17483. }
  17484. loadAny(list, completeHandler, progressHandler) {
  17485. Laya.loader.load(list, completeHandler, progressHandler);
  17486. }
  17487. load(path, completeHandler, progressHandler) {
  17488. let count = this.resMap[path];
  17489. if (count && count > 0) {
  17490. if (completeHandler)
  17491. completeHandler.run();
  17492. }
  17493. else
  17494. this.loadList([path], completeHandler, progressHandler);
  17495. }
  17496. getRes(path) {
  17497. let res = this.resMap[path];
  17498. if (!res)
  17499. this.showLog("资源不存在:" + path);
  17500. else
  17501. return this.loader.getRes(path);
  17502. }
  17503. clearList(list, force = false) {
  17504. if (!list || list.length < 1)
  17505. return;
  17506. let cr = () => {
  17507. for (const k in list) {
  17508. let v = list[k];
  17509. if (!v)
  17510. continue;
  17511. if (force) {
  17512. this.loader.clearRes(v);
  17513. delete this.resMap[v];
  17514. }
  17515. else {
  17516. let count = this.resMap[v];
  17517. if (count && count > 1) {
  17518. count--;
  17519. this.resMap[v] = count;
  17520. }
  17521. else {
  17522. this.loader.clearRes(v);
  17523. delete this.resMap[v];
  17524. }
  17525. }
  17526. }
  17527. if (!window.hasOwnProperty("ks"))
  17528. Laya.Resource.destroyUnusedResources();
  17529. };
  17530. Laya.timer.clearAll(this);
  17531. Laya.timer.once(2000, this, cr);
  17532. }
  17533. clear3D() {
  17534. for (const k in this.loader.tdResMap) {
  17535. this.loader.clearRes(k);
  17536. if (this.resMap[k])
  17537. delete this.resMap[k];
  17538. }
  17539. if (!window.hasOwnProperty("ks"))
  17540. Laya.Resource.destroyUnusedResources();
  17541. }
  17542. clear(path, force = false) {
  17543. this.clearList([path], force);
  17544. }
  17545. getResInfo() {
  17546. if (this.doneList.length > 0)
  17547. return this.doneList.pop();
  17548. else
  17549. return new ResInfo();
  17550. }
  17551. startLoad() {
  17552. if (this.currentLoad)
  17553. return;
  17554. this.currentLoad = this.resList.pop();
  17555. if (this.currentLoad) {
  17556. this.loader.load(this.currentLoad.resList);
  17557. }
  17558. }
  17559. onComplete() {
  17560. if (!this.currentLoad)
  17561. return;
  17562. for (const k in this.currentLoad.resList) {
  17563. let v = this.currentLoad.resList[k];
  17564. let count = this.resMap[v];
  17565. if (count)
  17566. count++;
  17567. else
  17568. count = 1;
  17569. this.resMap[v] = count;
  17570. }
  17571. if (this.currentLoad.completeHandler)
  17572. this.currentLoad.completeHandler.run();
  17573. this.doneList.push(this.currentLoad);
  17574. this.currentLoad = null;
  17575. this.startLoad();
  17576. }
  17577. onProgress(pro) {
  17578. if (!this.currentLoad)
  17579. return;
  17580. if (this.currentLoad.progressHandler)
  17581. this.currentLoad.progressHandler.runWith(pro);
  17582. }
  17583. showLog(str, ...args) {
  17584. console.log("[ResLoader] " + str);
  17585. }
  17586. }
  17587. ResMgr._instance = null;
  17588. class EventMgr extends Laya.EventDispatcher {
  17589. }
  17590. let eventMgr = new EventMgr();
  17591. /*! *****************************************************************************
  17592. Copyright (c) Microsoft Corporation. All rights reserved.
  17593. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17594. this file except in compliance with the License. You may obtain a copy of the
  17595. License at http://www.apache.org/licenses/LICENSE-2.0
  17596. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17597. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17598. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17599. MERCHANTABLITY OR NON-INFRINGEMENT.
  17600. See the Apache Version 2.0 License for specific language governing permissions
  17601. and limitations under the License.
  17602. ***************************************************************************** */
  17603. /* global Reflect, Promise */
  17604. var extendStatics = function(d, b) {
  17605. extendStatics = Object.setPrototypeOf ||
  17606. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17607. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17608. return extendStatics(d, b);
  17609. };
  17610. function __extends(d, b) {
  17611. extendStatics(d, b);
  17612. function __() { this.constructor = d; }
  17613. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17614. }
  17615. var __assign = function() {
  17616. __assign = Object.assign || function __assign(t) {
  17617. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17618. s = arguments[i];
  17619. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17620. }
  17621. return t;
  17622. };
  17623. return __assign.apply(this, arguments);
  17624. };
  17625. function __rest(s, e) {
  17626. var t = {};
  17627. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17628. t[p] = s[p];
  17629. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17630. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17631. t[p[i]] = s[p[i]];
  17632. return t;
  17633. }
  17634. function __decorate(decorators, target, key, desc) {
  17635. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17636. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17637. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  17638. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17639. }
  17640. function __param(paramIndex, decorator) {
  17641. return function (target, key) { decorator(target, key, paramIndex); }
  17642. }
  17643. function __metadata(metadataKey, metadataValue) {
  17644. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17645. }
  17646. function __awaiter(thisArg, _arguments, P, generator) {
  17647. return new (P || (P = Promise))(function (resolve, reject) {
  17648. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17649. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17650. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17651. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17652. });
  17653. }
  17654. function __generator(thisArg, body) {
  17655. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17656. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17657. function verb(n) { return function (v) { return step([n, v]); }; }
  17658. function step(op) {
  17659. if (f) throw new TypeError("Generator is already executing.");
  17660. while (_) try {
  17661. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  17662. if (y = 0, t) op = [op[0] & 2, t.value];
  17663. switch (op[0]) {
  17664. case 0: case 1: t = op; break;
  17665. case 4: _.label++; return { value: op[1], done: false };
  17666. case 5: _.label++; y = op[1]; op = [0]; continue;
  17667. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17668. default:
  17669. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17670. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17671. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17672. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17673. if (t[2]) _.ops.pop();
  17674. _.trys.pop(); continue;
  17675. }
  17676. op = body.call(thisArg, _);
  17677. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17678. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17679. }
  17680. }
  17681. function __exportStar(m, exports) {
  17682. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17683. }
  17684. function __values(o) {
  17685. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17686. if (m) return m.call(o);
  17687. return {
  17688. next: function () {
  17689. if (o && i >= o.length) o = void 0;
  17690. return { value: o && o[i++], done: !o };
  17691. }
  17692. };
  17693. }
  17694. function __read(o, n) {
  17695. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17696. if (!m) return o;
  17697. var i = m.call(o), r, ar = [], e;
  17698. try {
  17699. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17700. }
  17701. catch (error) { e = { error: error }; }
  17702. finally {
  17703. try {
  17704. if (r && !r.done && (m = i["return"])) m.call(i);
  17705. }
  17706. finally { if (e) throw e.error; }
  17707. }
  17708. return ar;
  17709. }
  17710. function __spread() {
  17711. for (var ar = [], i = 0; i < arguments.length; i++)
  17712. ar = ar.concat(__read(arguments[i]));
  17713. return ar;
  17714. }
  17715. function __await(v) {
  17716. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17717. }
  17718. function __asyncGenerator(thisArg, _arguments, generator) {
  17719. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17720. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17721. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17722. function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
  17723. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17724. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17725. function fulfill(value) { resume("next", value); }
  17726. function reject(value) { resume("throw", value); }
  17727. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17728. }
  17729. function __asyncDelegator(o) {
  17730. var i, p;
  17731. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17732. function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
  17733. }
  17734. function __asyncValues(o) {
  17735. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17736. var m = o[Symbol.asyncIterator], i;
  17737. return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
  17738. function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
  17739. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17740. }
  17741. function __makeTemplateObject(cooked, raw) {
  17742. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17743. return cooked;
  17744. };
  17745. function __importStar(mod) {
  17746. if (mod && mod.__esModule) return mod;
  17747. var result = {};
  17748. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17749. result.default = mod;
  17750. return result;
  17751. }
  17752. function __importDefault(mod) {
  17753. return (mod && mod.__esModule) ? mod : { default: mod };
  17754. }
  17755. class CustomAlert {
  17756. static show(title, content, buttons) {
  17757. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17758. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17759. return;
  17760. }
  17761. const bg = new Laya.Box();
  17762. bg.alpha = 0;
  17763. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17764. Laya.stage.addChild(bg);
  17765. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17766. const panel = new Laya.Box();
  17767. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17768. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17769. bg.addChild(panel);
  17770. const titleText = new Laya.Text();
  17771. titleText.text = title;
  17772. titleText.fontSize = 32;
  17773. titleText.color = "#333333";
  17774. titleText.bold = true;
  17775. titleText.pos(20, 20);
  17776. titleText.width = 360;
  17777. titleText.align = "center";
  17778. panel.addChild(titleText);
  17779. const contentText = new Laya.Text();
  17780. contentText.text = content;
  17781. contentText.fontSize = 21;
  17782. contentText.color = "#555555";
  17783. contentText.pos(20, 70);
  17784. contentText.width = 360;
  17785. contentText.wordWrap = true;
  17786. contentText.align = "center";
  17787. panel.addChild(contentText);
  17788. const buttonContainer = new Laya.Box();
  17789. buttonContainer.pos(20, 160);
  17790. panel.addChild(buttonContainer);
  17791. const btnWidth = 120;
  17792. const spacing = 30;
  17793. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17794. buttons.forEach((btn, index) => {
  17795. const button = new Laya.Button();
  17796. button.label = btn.label;
  17797. button.size(btnWidth, 40);
  17798. button.labelSize = 22;
  17799. button.pos(index * (btnWidth + spacing), 0);
  17800. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17801. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17802. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17803. button.alpha = 0.9;
  17804. });
  17805. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17806. button.alpha = 1;
  17807. });
  17808. button.on(Laya.Event.CLICK, this, () => {
  17809. btn.handler();
  17810. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17811. bg.removeSelf();
  17812. }));
  17813. });
  17814. buttonContainer.addChild(button);
  17815. });
  17816. buttonContainer.x = (panel.width - totalWidth) / 2;
  17817. }
  17818. }
  17819. class ConfigMgr {
  17820. constructor() {
  17821. this.httpReqCount = 4;
  17822. this.httpReqOkCount = 0;
  17823. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17824. try {
  17825. this.httpReqOkCount = 0;
  17826. let reqData = xGame.httpMgr.getReqData();
  17827. console.log('zh:第1个请求getClassicCfg');
  17828. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17829. this.classicCfg = classicCfg;
  17830. this.httpReqOkCount++;
  17831. console.log('zh:第2个请求getLevelCfg');
  17832. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17833. this.levelCfg = levelCfg;
  17834. this.httpReqOkCount++;
  17835. console.log('zh:第3个请求 getPlaceBallCfg');
  17836. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17837. this.placeBallCfg = placeBallCfg;
  17838. this.httpReqOkCount++;
  17839. console.log('zh:第4个请求 npc');
  17840. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17841. this.npcJson = npc.Data;
  17842. this.httpReqOkCount++;
  17843. console.log('zh:所有配置加载完成');
  17844. }
  17845. catch (error) {
  17846. console.error('zh:❌请求失败:', error);
  17847. Laya.timer.once(5000, this, () => {
  17848. let retryCount = 0;
  17849. const maxRetries = 3;
  17850. const tryFetchConfig = () => {
  17851. try {
  17852. xGame.cfgMgr.getConfigFromServer();
  17853. }
  17854. catch (error) {
  17855. if (retryCount < maxRetries) {
  17856. retryCount++;
  17857. console.log(`zh:🔄 第${retryCount}次重试获取配置...`);
  17858. Laya.timer.once(5000, this, tryFetchConfig);
  17859. }
  17860. else {
  17861. console.error("zh:❌ 达到最大重试次数,配置获取失败");
  17862. }
  17863. }
  17864. };
  17865. tryFetchConfig();
  17866. });
  17867. }
  17868. finally {
  17869. if (this.httpReqCount > this.httpReqOkCount) {
  17870. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [{
  17871. label: "Okay", handler: () => {
  17872. JSBridgeUtils.instance.exitAndCloseGame();
  17873. }
  17874. }]);
  17875. }
  17876. }
  17877. });
  17878. this.sendPostAsync = (action, reqData) => {
  17879. return new Promise((resolve, reject) => {
  17880. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17881. try {
  17882. let code = res.code;
  17883. if (code == 200) {
  17884. const parsedData = JSON.parse(res.msg);
  17885. resolve(parsedData);
  17886. }
  17887. else {
  17888. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17889. reject(new Error(`Request failed with code: ${code}`));
  17890. }
  17891. }
  17892. catch (error) {
  17893. console.error(`ERROR=${error}`);
  17894. alert("Please check your network connection.");
  17895. reject(error);
  17896. }
  17897. finally {
  17898. console.log(`zh:${action}的请求处理完毕`);
  17899. }
  17900. });
  17901. });
  17902. };
  17903. }
  17904. static getInstance() {
  17905. if (!this._instance) {
  17906. this._instance = new ConfigMgr();
  17907. }
  17908. return this._instance;
  17909. }
  17910. init() {
  17911. this.getConfigFromServer();
  17912. }
  17913. test() {
  17914. let reqData = xGame.httpMgr.getReqData();
  17915. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17916. console.log('zh:1s');
  17917. try {
  17918. let code = res.code;
  17919. let data = res.data;
  17920. if (code == 200) {
  17921. const parsedData = JSON.parse(data);
  17922. this.classicCfg = parsedData;
  17923. }
  17924. else {
  17925. console.log('zh:res = ' + JSON.stringify(res));
  17926. }
  17927. }
  17928. catch (error) {
  17929. console.log('error=' + error);
  17930. alert("Please check your network connection.");
  17931. }
  17932. finally {
  17933. console.log('zh:1');
  17934. }
  17935. });
  17936. }
  17937. getUserInfoByIndex(index) {
  17938. return this.npcJson[index];
  17939. }
  17940. getRandomUserInfo() {
  17941. let index = xGame.tools.random(0, this.npcJson.length);
  17942. let rs = this.npcJson[index];
  17943. return rs;
  17944. }
  17945. getMaxBigMoveLength() {
  17946. return Object.keys(this.levelCfg).length;
  17947. }
  17948. getBigMoveLevelByIndex(index) {
  17949. let cfg = this.levelCfg;
  17950. cfg = cfg[index];
  17951. return cfg;
  17952. }
  17953. getRandomClassicLevel() {
  17954. let cfg = this.classicCfg;
  17955. let num = Object.keys(cfg).length;
  17956. let rand = xGame.common.randomNum(1, num);
  17957. return cfg[rand];
  17958. }
  17959. getPlaceBallByLevel(level) {
  17960. return this.placeBallCfg[level];
  17961. }
  17962. getMaxPlaceBall() {
  17963. return Object.keys(this.placeBallCfg).length;
  17964. }
  17965. }
  17966. class PoolD3Mgr {
  17967. constructor() {
  17968. this.pool = {};
  17969. }
  17970. static get ins() {
  17971. return this._ins || (this._ins = new PoolD3Mgr);
  17972. }
  17973. createList(key, prefab, parent) {
  17974. if (!this.pool[key]) {
  17975. this.pool[key] = {};
  17976. this.pool[key].prefab = prefab;
  17977. this.pool[key].list = [];
  17978. this.pool[key].parent = parent;
  17979. }
  17980. }
  17981. getItem(key) {
  17982. if (!this.pool[key]) {
  17983. return;
  17984. }
  17985. let temp;
  17986. if (this.pool[key].list.length > 0) {
  17987. temp = this.pool[key].list.pop();
  17988. }
  17989. else {
  17990. temp = this.pool[key].prefab.clone();
  17991. if (this.pool[key].parent) {
  17992. this.pool[key].parent.addChild(temp);
  17993. }
  17994. }
  17995. temp.active = true;
  17996. return temp;
  17997. }
  17998. putItem(key, obj) {
  17999. if (!this.pool[key]) {
  18000. return;
  18001. }
  18002. obj.active = false;
  18003. this.pool[key].list.push(obj);
  18004. }
  18005. }
  18006. let context$1 = context;
  18007. let uiMgr = UIMgr.inst;
  18008. let soundMgr = SoundMgr.getInstance();
  18009. let resMgr = ResMgr.getInstance();
  18010. let httpMgr = HttpMgr.getInstance();
  18011. let common = Common.getInstance();
  18012. let cfgMgr = ConfigMgr.getInstance();
  18013. let poolD3Mgr = PoolD3Mgr.ins;
  18014. let d3TexUrl = "res/d3Res/";
  18015. let d3ModeUrl = "res/unityRes/";
  18016. function setStageSize(view) {
  18017. if (view.width) {
  18018. view.width = Laya.stage.width;
  18019. view.height = Laya.stage.height;
  18020. }
  18021. }
  18022. function filledBg(view) {
  18023. let wh = Laya.stage.height / Laya.stage.width;
  18024. if (wh > 16 / 9) {
  18025. view.height = Laya.stage.height;
  18026. view.width = Laya.stage.height / 1334 * 750;
  18027. }
  18028. else {
  18029. view.width = Laya.stage.width;
  18030. view.height = Laya.stage.width / 750 * 1334;
  18031. }
  18032. }
  18033. function setNotch(view) {
  18034. if (view.height) {
  18035. view.y += context$1.notchHeight;
  18036. }
  18037. }
  18038. function showTip(str) {
  18039. uiMgr.Show(UIMsg, str);
  18040. }
  18041. function log(...args) {
  18042. console.log(args);
  18043. }
  18044. let xGame = {
  18045. context: context$1,
  18046. eventMgr,
  18047. resMgr,
  18048. uiMgr,
  18049. soundMgr,
  18050. define,
  18051. tools,
  18052. httpMgr,
  18053. d3TexUrl,
  18054. d3ModeUrl,
  18055. common,
  18056. cfgMgr,
  18057. poolD3Mgr,
  18058. setStageSize,
  18059. filledBg,
  18060. setNotch,
  18061. showTip,
  18062. log,
  18063. };
  18064. window["xGame"] = xGame;
  18065. let dataName = 'tBall_';
  18066. class UserData {
  18067. constructor() {
  18068. this.userId = "";
  18069. this.isAgree = false;
  18070. this.coinNum = 0;
  18071. this.gemNum = 0;
  18072. this.sound = true;
  18073. this.vibration = true;
  18074. this.currentDate = 0;
  18075. this.createTime = 0;
  18076. this.awardTime = 0;
  18077. this.roleId = 1;
  18078. this.roleList = [];
  18079. this.roleAds = [];
  18080. this.dressId = 101;
  18081. this.itemId = 201;
  18082. this.bigSkills = [1, 1, 1, 1, 1];
  18083. this.coin = 4000;
  18084. this.diamond = 0;
  18085. this.skillSuccessTimes = 0;
  18086. this.skillGuide = 0;
  18087. this.skillAccTimes = 0;
  18088. this.placeBallData = [];
  18089. this.shareDiamondTimes = 0;
  18090. this.dailyVideoShareTimes = 0;
  18091. this.secretary = [1, 0];
  18092. this.curSecretary = 0;
  18093. this.ballRod = [1, 0, 0, 0, 0, 1];
  18094. this.curBallRod = 5;
  18095. this.signData = 0;
  18096. this.signTime = 0;
  18097. this.drawTimes = 0;
  18098. this.drawAwardTimes = 0;
  18099. this.dailyfreeDrawTimes = 1;
  18100. this.power = 5;
  18101. this.powerTime = 0;
  18102. this.challengeTimes = 0;
  18103. this.extraSign = 0;
  18104. this.classicTimes = 0;
  18105. this.guideHelpLine = 0;
  18106. this.newUser = true;
  18107. this.rootBallFoul = 0;
  18108. this.timeoutFoul = 0;
  18109. this.roleList = [1];
  18110. }
  18111. saveData() {
  18112. let data = {};
  18113. for (let k in this) {
  18114. data[k.toString()] = this[k];
  18115. }
  18116. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  18117. }
  18118. getData() {
  18119. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18120. if (ld) {
  18121. let localData = JSON.parse(ld);
  18122. if (localData) {
  18123. for (let k in this) {
  18124. let key = k.toString();
  18125. let data = localData[key];
  18126. if (data != undefined) {
  18127. this[k] = data;
  18128. }
  18129. }
  18130. }
  18131. }
  18132. }
  18133. }
  18134. class ItemData {
  18135. constructor() {
  18136. this.itemList = {};
  18137. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18138. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18139. }
  18140. saveData() {
  18141. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18142. }
  18143. getData() {
  18144. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18145. if (ld) {
  18146. let localData = JSON.parse(ld);
  18147. if (localData) {
  18148. this.itemList = localData;
  18149. }
  18150. }
  18151. }
  18152. }
  18153. class GameData {
  18154. constructor() {
  18155. this.curLevel = 0;
  18156. this.gameType = 1;
  18157. this.signIdx = 0;
  18158. this.signMax = 0;
  18159. this.rotaryTime = 0;
  18160. this.rotaryCount = 0;
  18161. this.rotaryList = [];
  18162. this.diyCount = 3;
  18163. this.awardIdx = 0;
  18164. this.shareNum = 2;
  18165. this.rankWeek = 0;
  18166. this.rankScore = 0;
  18167. this.gameCount = 0;
  18168. this.trySkill = -1;
  18169. this.tryTime = 0;
  18170. }
  18171. saveData() {
  18172. let data = {};
  18173. for (let k in this) {
  18174. data[k.toString()] = this[k];
  18175. }
  18176. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18177. }
  18178. getData() {
  18179. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18180. if (ld) {
  18181. let localData = JSON.parse(ld);
  18182. if (localData) {
  18183. for (let k in this) {
  18184. let key = k.toString();
  18185. let data = localData[key];
  18186. if (data != undefined) {
  18187. this[k] = data;
  18188. }
  18189. }
  18190. }
  18191. }
  18192. }
  18193. }
  18194. class Diy2025GameData {
  18195. constructor() {
  18196. this.challengeMode_overLev = 0;
  18197. this.xszyForClassic = false;
  18198. this.xszyForChallenge = false;
  18199. }
  18200. saveData() {
  18201. let data = {};
  18202. for (let k in this) {
  18203. data[k.toString()] = this[k];
  18204. }
  18205. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18206. }
  18207. getData() {
  18208. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18209. if (ld) {
  18210. let localData = JSON.parse(ld);
  18211. if (localData) {
  18212. for (let k in this) {
  18213. let key = k.toString();
  18214. let data = localData[key];
  18215. if (data != undefined) {
  18216. this[k] = data;
  18217. }
  18218. }
  18219. }
  18220. }
  18221. }
  18222. }
  18223. class DataMgr {
  18224. static Init() {
  18225. this.userData = new UserData();
  18226. this.gameData = new GameData();
  18227. this.itemData = new ItemData();
  18228. this.diyGameData = new Diy2025GameData();
  18229. this.userData.getData();
  18230. this.gameData.getData();
  18231. this.itemData.getData();
  18232. this.diyGameData.getData();
  18233. this.roleId = this.userData.roleId;
  18234. this.resetUse();
  18235. }
  18236. static isNewDay() {
  18237. Moyu.isNewDay(this, (isnew) => {
  18238. xGame.common.isNewDay = isnew;
  18239. if (!isnew)
  18240. return;
  18241. DataMgr.setShareDiamondTimes(0, false);
  18242. DataMgr.setDailyVideoShareTimes(0, false);
  18243. DataMgr.setDailyfreeDrawTimes(1);
  18244. DataMgr.setExtraSign(0);
  18245. });
  18246. }
  18247. static deletData() {
  18248. Laya.LocalStorage.clear();
  18249. }
  18250. static upRankData() {
  18251. let num = xGame.common.getAllStarNum();
  18252. if (num > 0)
  18253. Moyu.upRankData(xGame.common.curRankID, num);
  18254. }
  18255. static addItem(id, count = 1) {
  18256. let v = this.itemData.itemList[id];
  18257. if (!v)
  18258. v = { id: id, count: count, adnum: 0, active: true };
  18259. else {
  18260. if (v.active) {
  18261. v.count += count;
  18262. }
  18263. else {
  18264. v.count = count;
  18265. v.active = true;
  18266. }
  18267. }
  18268. this.itemData.itemList[id] = v;
  18269. xGame.soundMgr.playGetSound();
  18270. this.saveItemData();
  18271. }
  18272. static hasItem(id) {
  18273. let v = this.itemData.itemList[id];
  18274. if (v && v.active)
  18275. return true;
  18276. return false;
  18277. }
  18278. static getItem(id) {
  18279. let v = this.itemData.itemList[id];
  18280. return v;
  18281. }
  18282. static getItemCount(id) {
  18283. let v = this.itemData.itemList[id];
  18284. if (v && v.active)
  18285. return v.count;
  18286. return 0;
  18287. }
  18288. static getItemAd(id) {
  18289. let v = this.itemData.itemList[id];
  18290. if (v) {
  18291. return v.adnum;
  18292. }
  18293. return 0;
  18294. }
  18295. static onItemAd(id, num = 1) {
  18296. let v = this.itemData.itemList[id];
  18297. if (!v)
  18298. v = { id: id, count: 1, adnum: num, active: false };
  18299. else
  18300. v.adnum += num;
  18301. this.itemData.itemList[id] = v;
  18302. this.saveItemData();
  18303. }
  18304. static costItem(id, count) {
  18305. let v = this.itemData.itemList[id];
  18306. if (v && v.active) {
  18307. if (v.count < count)
  18308. return false;
  18309. else {
  18310. v.count -= count;
  18311. this.itemData.itemList[id] = v;
  18312. return true;
  18313. }
  18314. }
  18315. return false;
  18316. }
  18317. static resetUse() {
  18318. this.dressId = this.userData.dressId;
  18319. this.itemId = this.userData.itemId;
  18320. }
  18321. static passLevel() {
  18322. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18323. this.gameData.curLevel++;
  18324. this.curLevel = this.gameData.curLevel;
  18325. this.saveGameData();
  18326. }
  18327. static useRole(id) {
  18328. this.roleId = id;
  18329. if (this.hasRole(id)) {
  18330. this.userData.roleId = id;
  18331. this.saveUserData();
  18332. }
  18333. }
  18334. static addRole(id) {
  18335. if (this.hasRole(id))
  18336. return;
  18337. this.userData.roleList.push(id);
  18338. this.saveUserData();
  18339. }
  18340. static hasRole(id) {
  18341. return this.userData.roleList.indexOf(id) >= 0;
  18342. }
  18343. static gemEnough(num) {
  18344. return this.userData.gemNum >= num;
  18345. }
  18346. static roleHasAd(id) {
  18347. let count = this.userData.roleAds[id];
  18348. if (count != undefined && count >= 0)
  18349. return true;
  18350. else
  18351. return false;
  18352. }
  18353. static saveUserData(time = 500, event, arg) {
  18354. if (this.userSaving)
  18355. return;
  18356. this.userSaving = true;
  18357. Laya.timer.once(time, this, () => {
  18358. this.userSaving = false;
  18359. this.userData.saveData();
  18360. if (event)
  18361. xGame.eventMgr.event(event, arg);
  18362. });
  18363. }
  18364. static updateUserNickName(loginUserName) {
  18365. let kyeStr = 'moyudata_180';
  18366. console.log('zh:################### kyeStr=' + kyeStr);
  18367. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18368. if (moyudata) {
  18369. const obj = JSON.parse(moyudata);
  18370. obj.nickName = loginUserName;
  18371. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18372. console.log('zh:################### updateUserNickName');
  18373. }
  18374. }
  18375. static saveGameData() {
  18376. if (this.gameSaving)
  18377. return;
  18378. this.gameSaving = true;
  18379. Laya.timer.once(1000, this, () => {
  18380. this.gameSaving = false;
  18381. this.gameData.saveData();
  18382. });
  18383. }
  18384. static saveItemData() {
  18385. let fun = () => {
  18386. this.itemData.saveData();
  18387. };
  18388. Laya.timer.clear(this, fun);
  18389. Laya.timer.once(500, this, fun);
  18390. }
  18391. static saveData() {
  18392. this.saveUserData();
  18393. this.saveGameData();
  18394. }
  18395. static getBigSkillList() {
  18396. return this.userData.bigSkills;
  18397. }
  18398. static getBigSkillByIndex(index) {
  18399. return this.userData.bigSkills[index];
  18400. }
  18401. static setBigSkill(index, val, addUp = true) {
  18402. if (addUp) {
  18403. this.userData.bigSkills[index] += val;
  18404. }
  18405. else {
  18406. this.userData.bigSkills[index] = val;
  18407. }
  18408. this.saveUserData();
  18409. }
  18410. static coinEnough(need) {
  18411. if (typeof need != "number") {
  18412. console.error("金币格式错误");
  18413. return;
  18414. }
  18415. return this.userData.coin >= need;
  18416. }
  18417. static setCoin(val) {
  18418. if (typeof val != "number") {
  18419. return;
  18420. }
  18421. this.userData.coin += val;
  18422. this.saveUserData();
  18423. xGame.eventMgr.event(COIN_CHANGE);
  18424. this.updateUserInfo2Server("jb");
  18425. }
  18426. static setCoin2(val) {
  18427. if (typeof val != "number") {
  18428. return;
  18429. }
  18430. this.userData.coin = val;
  18431. this.saveUserData();
  18432. xGame.eventMgr.event(COIN_CHANGE);
  18433. }
  18434. static setCoinFormServer(val) {
  18435. if (typeof val != "number") {
  18436. return;
  18437. }
  18438. this.userData.coin = val;
  18439. this.saveUserData();
  18440. console.log('zh:通知更新金币变化' + val);
  18441. xGame.eventMgr.event(COIN_CHANGE);
  18442. }
  18443. static getCoin() {
  18444. return this.userData.coin;
  18445. }
  18446. static diamondEnough(need) {
  18447. if (typeof need != "number") {
  18448. console.error("金币格式错误");
  18449. return;
  18450. }
  18451. return this.userData.diamond >= need;
  18452. }
  18453. static setDiamond(val) {
  18454. if (typeof val != "number") {
  18455. return;
  18456. }
  18457. this.userData.diamond += val;
  18458. this.saveUserData();
  18459. xGame.eventMgr.event(DIAMOND_CHANGE);
  18460. this.updateUserInfo2Server("zs");
  18461. }
  18462. static setDiamond2(val) {
  18463. if (typeof val != "number") {
  18464. return;
  18465. }
  18466. this.userData.diamond = val;
  18467. this.saveUserData();
  18468. xGame.eventMgr.event(DIAMOND_CHANGE);
  18469. }
  18470. static setDiamondFormServer(val) {
  18471. if (typeof val != "number") {
  18472. return;
  18473. }
  18474. this.userData.diamond = val;
  18475. this.saveUserData();
  18476. console.log('zh:通知更新钻石变化' + val);
  18477. xGame.eventMgr.event(DIAMOND_CHANGE);
  18478. }
  18479. static getDiamond() {
  18480. return this.userData.diamond;
  18481. }
  18482. static getSkillSuccessTimes() {
  18483. return this.userData.skillSuccessTimes;
  18484. }
  18485. static setSkillSuccessTimes(val, addUp = true) {
  18486. if (addUp)
  18487. this.userData.skillSuccessTimes += val;
  18488. else
  18489. this.userData.skillSuccessTimes = val;
  18490. this.saveUserData();
  18491. }
  18492. static getSkillAccTimes() {
  18493. return this.userData.skillAccTimes;
  18494. }
  18495. static setSkillAccTimes(val) {
  18496. this.userData.skillAccTimes += val;
  18497. this.saveUserData();
  18498. }
  18499. static getSkillGuide() {
  18500. if (!xGame.common.openGuide) {
  18501. return 1;
  18502. }
  18503. return this.userData.skillGuide;
  18504. }
  18505. static setSkillGuide(val) {
  18506. this.userData.skillGuide = val;
  18507. this.saveUserData();
  18508. }
  18509. static getPlaceBallLevelList() {
  18510. return this.userData.placeBallData;
  18511. }
  18512. static setPlaceBallLevelList(objStr) {
  18513. if (objStr) {
  18514. let obj = JSON.parse(objStr);
  18515. this.userData.placeBallData = obj;
  18516. let cd = obj.length;
  18517. console.log('zh:setPlaceBallLevelList cd=' + cd);
  18518. xGame.common.placeBallCurLevel = cd;
  18519. DataMgr.setChallengeMode_overLev(cd);
  18520. this.saveUserData();
  18521. }
  18522. else {
  18523. this.userData.placeBallData = [];
  18524. this.saveUserData();
  18525. }
  18526. }
  18527. static getPlaceBallLevel(level) {
  18528. let arr = this.userData.placeBallData;
  18529. let index = level - 1;
  18530. let out;
  18531. if (arr[index]) {
  18532. out = arr[index];
  18533. }
  18534. else {
  18535. let max = arr.length;
  18536. if (max == index) {
  18537. out = {
  18538. star: 0,
  18539. play: true,
  18540. isCur: true,
  18541. getAward: false
  18542. };
  18543. }
  18544. else {
  18545. out = {
  18546. star: 0,
  18547. play: false,
  18548. getAward: false
  18549. };
  18550. }
  18551. }
  18552. return out;
  18553. }
  18554. static setPlaceBallLevel(level, star) {
  18555. let arr = this.userData.placeBallData;
  18556. let index = level - 1;
  18557. if (arr[index]) {
  18558. arr[index].star = Math.max(arr[index].star, star);
  18559. }
  18560. else {
  18561. let max = arr.length;
  18562. if (max == index) {
  18563. arr.push({
  18564. star: star,
  18565. play: true,
  18566. getAward: false
  18567. });
  18568. }
  18569. else {
  18570. console.error("关卡存储出错");
  18571. }
  18572. }
  18573. this.saveUserData();
  18574. }
  18575. static setPlaceBallAward(level) {
  18576. let arr = this.userData.placeBallData;
  18577. let index = level - 1;
  18578. if (arr[index]) {
  18579. arr[index].getAward = true;
  18580. }
  18581. this.saveUserData();
  18582. }
  18583. static getShareDiamondTimes() {
  18584. return this.userData.shareDiamondTimes;
  18585. }
  18586. static setShareDiamondTimes(val, addUp = true) {
  18587. if (addUp) {
  18588. this.userData.shareDiamondTimes += val;
  18589. }
  18590. else {
  18591. this.userData.shareDiamondTimes = val;
  18592. }
  18593. this.saveUserData();
  18594. }
  18595. static getDailyVideoShareTimes() {
  18596. return this.userData.dailyVideoShareTimes;
  18597. }
  18598. static setDailyVideoShareTimes(val, addUp = true) {
  18599. if (addUp) {
  18600. this.userData.dailyVideoShareTimes += val;
  18601. }
  18602. else {
  18603. this.userData.dailyVideoShareTimes = val;
  18604. }
  18605. this.saveUserData();
  18606. }
  18607. static getSecretary(index) {
  18608. return this.userData.secretary[index];
  18609. }
  18610. static setSecretary(index, val) {
  18611. this.userData.secretary[index] = val;
  18612. this.saveUserData();
  18613. }
  18614. static getCurSecretary() {
  18615. return this.userData.curSecretary;
  18616. }
  18617. static setCurSecretary(index) {
  18618. this.userData.curSecretary = index;
  18619. this.saveUserData();
  18620. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18621. }
  18622. static getBallRod(index) {
  18623. return this.userData.ballRod[index];
  18624. }
  18625. static setBallRod(index, val) {
  18626. this.userData.ballRod[index] = val;
  18627. this.saveUserData();
  18628. }
  18629. static setBallRodFormServer(haveQiuGanJsonStr) {
  18630. if (!haveQiuGanJsonStr) {
  18631. console.log("setBallRodFormServer数据为空或未定义");
  18632. return;
  18633. }
  18634. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18635. const keys = Object.keys(haveQiuGanJsonObj);
  18636. keys.forEach(key => {
  18637. let v = haveQiuGanJsonObj[key];
  18638. let k = parseInt(key);
  18639. let idx = k - 1;
  18640. this.userData.ballRod[idx] = v;
  18641. });
  18642. }
  18643. static getCurBallRod() {
  18644. return this.userData.curBallRod;
  18645. }
  18646. static setCurBallRod(index) {
  18647. this.userData.curBallRod = index;
  18648. this.saveUserData();
  18649. }
  18650. static setSignData(val) {
  18651. this.userData.signData = val;
  18652. this.saveUserData();
  18653. }
  18654. static getSignData() {
  18655. return this.userData.signData;
  18656. }
  18657. static setSignTime(val) {
  18658. this.userData.signTime = val;
  18659. this.saveUserData();
  18660. }
  18661. static getSignTime() {
  18662. return this.userData.signTime;
  18663. }
  18664. static getDrawTimes() {
  18665. return this.userData.drawTimes;
  18666. }
  18667. static setDrawTimes(val, addUp = true) {
  18668. if (addUp) {
  18669. this.userData.drawTimes += val;
  18670. }
  18671. else {
  18672. this.userData.drawTimes = val;
  18673. }
  18674. this.saveUserData();
  18675. }
  18676. static getDrawAwardTimes() {
  18677. return this.userData.drawAwardTimes;
  18678. }
  18679. static setDrawAwardTimes(val) {
  18680. this.userData.drawAwardTimes = val;
  18681. this.saveUserData();
  18682. }
  18683. static getDailyfreeDrawTimes() {
  18684. return this.userData.dailyfreeDrawTimes;
  18685. }
  18686. static setDailyfreeDrawTimes(val) {
  18687. this.userData.dailyfreeDrawTimes = val;
  18688. this.saveUserData();
  18689. }
  18690. static setPower(val, addUp = true) {
  18691. if (addUp)
  18692. this.userData.power += val;
  18693. else
  18694. this.userData.power = val;
  18695. if (this.userData.power >= xGame.common.maxPower) {
  18696. this.userData.power = xGame.common.maxPower;
  18697. }
  18698. xGame.eventMgr.event(POWER_CHANGE, val);
  18699. this.saveUserData();
  18700. }
  18701. static getPower() {
  18702. return this.userData.power;
  18703. }
  18704. static setPowerTime(val) {
  18705. this.userData.powerTime = val;
  18706. this.saveUserData();
  18707. }
  18708. static getPowerTime() {
  18709. return this.userData.powerTime;
  18710. }
  18711. static powerEnough() {
  18712. return this.getPower() > 0;
  18713. }
  18714. static getChallengeTimes() {
  18715. return this.userData.challengeTimes;
  18716. }
  18717. static setChallengeTimes(val) {
  18718. this.userData.challengeTimes += val;
  18719. this.saveUserData();
  18720. }
  18721. static getExtraSign() {
  18722. return this.userData.extraSign;
  18723. }
  18724. static setExtraSign(val) {
  18725. this.userData.extraSign = val;
  18726. this.saveUserData();
  18727. }
  18728. static getClassicTimes() {
  18729. return this.userData.classicTimes;
  18730. }
  18731. static setClassicTimes() {
  18732. this.userData.classicTimes += 1;
  18733. this.saveUserData();
  18734. }
  18735. static getGuideHelpLine() {
  18736. return this.userData.guideHelpLine;
  18737. }
  18738. static setGuideHelpLine() {
  18739. this.userData.guideHelpLine = 1;
  18740. this.saveUserData();
  18741. }
  18742. static getNewUser() {
  18743. return this.userData.newUser;
  18744. }
  18745. static setNewUser() {
  18746. this.userData.newUser = false;
  18747. this.saveUserData();
  18748. }
  18749. static getRootBallFoul() {
  18750. return this.userData.rootBallFoul;
  18751. }
  18752. static setRootBallFoul() {
  18753. this.userData.rootBallFoul = 1;
  18754. this.saveUserData();
  18755. }
  18756. static getTimeoutFoul() {
  18757. return this.userData.timeoutFoul;
  18758. }
  18759. static setTimeoutFoul() {
  18760. this.userData.timeoutFoul = 1;
  18761. this.saveUserData();
  18762. }
  18763. static saveDiyGameData() {
  18764. if (this.diyGameSaving)
  18765. return;
  18766. this.diyGameSaving = true;
  18767. Laya.timer.once(500, this, () => {
  18768. this.diyGameSaving = false;
  18769. this.diyGameData.saveData();
  18770. });
  18771. }
  18772. static getChallengeMode_overLev() {
  18773. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18774. return this.challengeMode_overLev;
  18775. }
  18776. static setChallengeMode_overLev(levNum) {
  18777. this.diyGameData.challengeMode_overLev = levNum;
  18778. this.saveDiyGameData();
  18779. }
  18780. static updateUserInfo2Server(type, count = 0) {
  18781. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18782. if (userInfoData == null) {
  18783. return;
  18784. }
  18785. let reqData = xGame.httpMgr.getReqData();
  18786. let rd = JSON.parse(reqData);
  18787. rd.dataType = type;
  18788. let dataValue = 0;
  18789. if (type == "zs") {
  18790. dataValue = this.getDiamond();
  18791. }
  18792. if (type == "jb") {
  18793. dataValue = this.getCoin();
  18794. }
  18795. rd.dataValue = dataValue;
  18796. reqData = JSON.stringify(rd);
  18797. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18798. try {
  18799. let code = res.code;
  18800. let data = res.data;
  18801. if (code == 401) {
  18802. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18803. console.log('zh:保存资产信息失败,请重新登录 ');
  18804. return;
  18805. }
  18806. if (code == 200) {
  18807. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18808. }
  18809. else {
  18810. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18811. }
  18812. }
  18813. catch (error) {
  18814. console.log('error=' + error);
  18815. alert("Please check your network connection.");
  18816. }
  18817. finally {
  18818. }
  18819. });
  18820. }
  18821. static getUserZiChanInfo(winTip = false) {
  18822. console.log('zh:getUserZCI');
  18823. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18824. console.log('zh:userInfoData=' + userInfoData);
  18825. if (userInfoData == null || userInfoData == "" || userInfoData === "null") {
  18826. if (winTip) {
  18827. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18828. }
  18829. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18830. return;
  18831. }
  18832. let reqData = xGame.httpMgr.getReqData();
  18833. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18834. try {
  18835. let code = res.code;
  18836. let msg = res.msg;
  18837. if (code == 401) {
  18838. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18839. if (winTip) {
  18840. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18841. }
  18842. return;
  18843. }
  18844. if (code == 200) {
  18845. let d = res.data;
  18846. let zuanShi = d.zuanShi;
  18847. let jinBi = d.jinBi;
  18848. let haveQiuGanJson = d.haveQiuGanJson;
  18849. let signData = d.signData;
  18850. let placeBallData = d.placeBallData;
  18851. DataMgr.setDiamondFormServer(zuanShi);
  18852. DataMgr.setCoinFormServer(jinBi);
  18853. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18854. DataMgr.setPlaceBallLevelList(placeBallData);
  18855. if (signData && signData > 0) {
  18856. DataMgr.setSignData(signData);
  18857. }
  18858. }
  18859. else {
  18860. console.log("zh:更新用户资产信息error" + msg);
  18861. if (winTip) {
  18862. xGame.uiMgr.Show(UIMsg, msg);
  18863. }
  18864. }
  18865. }
  18866. catch (error) {
  18867. console.log('error=' + error);
  18868. if (winTip) {
  18869. alert(error);
  18870. }
  18871. }
  18872. finally {
  18873. console.log("zh:更新用户资产信息结束");
  18874. }
  18875. });
  18876. }
  18877. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  18878. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18879. console.log('zh:updateLocalUserData=' + userInfo);
  18880. if (userInfo != null) {
  18881. if (!userInfo.buySpids) {
  18882. userInfo.buySpids = { 1: false, 7: false };
  18883. }
  18884. else {
  18885. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  18886. }
  18887. userInfo.buySpids[spid] = isBuyOk;
  18888. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  18889. }
  18890. else {
  18891. }
  18892. }
  18893. static loadUserSpOrderForAd() {
  18894. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18895. if (userInfo == null) {
  18896. return;
  18897. }
  18898. console.log('zh:重新加载更新广告权利');
  18899. let reqData = xGame.httpMgr.getReqData();
  18900. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  18901. try {
  18902. console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
  18903. let code = res.code;
  18904. let msg = res.msg;
  18905. if (code == 401) {
  18906. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18907. return;
  18908. }
  18909. if (code == 200) {
  18910. let data = res.data;
  18911. let buy_spid1 = false;
  18912. let buy_spid7 = false;
  18913. for (let index = 0; index < data.length; index++) {
  18914. let element = data[index];
  18915. console.log('zh:list element.spid = ' + element.spid);
  18916. if (element.spid == 1) {
  18917. buy_spid1 = true;
  18918. }
  18919. if (element.spid == 7) {
  18920. buy_spid7 = true;
  18921. }
  18922. }
  18923. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  18924. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  18925. }
  18926. else {
  18927. }
  18928. }
  18929. catch (error) {
  18930. console.log('error=' + error);
  18931. alert(error);
  18932. }
  18933. finally {
  18934. }
  18935. });
  18936. }
  18937. }
  18938. DataMgr.isNewUser = false;
  18939. DataMgr.fristEnter = true;
  18940. DataMgr.levelType = 0;
  18941. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18942. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18943. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18944. DataMgr.challengeMode_overLev = 0;
  18945. DataMgr.xszyForClassic = false;
  18946. DataMgr.xszyForChallenge = false;
  18947. DataMgr.awardId = 0;
  18948. DataMgr.awardCoin = 0;
  18949. DataMgr.sceneId = -1;
  18950. DataMgr.tryId = 0;
  18951. DataMgr.curLevel = 1;
  18952. DataMgr.vipLevel = 0;
  18953. DataMgr.maxLevel = 0;
  18954. DataMgr.awardRatio = 1;
  18955. DataMgr.gameList = [];
  18956. DataMgr.rankList = [];
  18957. DataMgr.recoverTime = 480000;
  18958. DataMgr.minScore = 0;
  18959. DataMgr.rankDis = 0;
  18960. DataMgr.userSaving = false;
  18961. DataMgr.gameSaving = false;
  18962. DataMgr.diyGameSaving = false;
  18963. class D3Tween extends Laya.Script3D {
  18964. constructor() {
  18965. super();
  18966. this.isInited = false;
  18967. }
  18968. ;
  18969. init() {
  18970. if (this.isInited)
  18971. return;
  18972. this.isInited = true;
  18973. this.gameObj = this.owner;
  18974. this.transform = this.gameObj.transform;
  18975. }
  18976. get rotX() {
  18977. return this.transform.localRotationEulerX;
  18978. }
  18979. set rotX(v) {
  18980. this.transform.localRotationEulerX = v;
  18981. }
  18982. get rotY() {
  18983. return this.transform.localRotationEulerY;
  18984. }
  18985. set rotY(v) {
  18986. this.transform.localRotationEulerY = v;
  18987. }
  18988. get rotZ() {
  18989. return this.transform.localRotationEulerZ;
  18990. }
  18991. set rotZ(v) {
  18992. this.transform.localRotationEulerZ = v;
  18993. }
  18994. get posX() {
  18995. return this.transform.localPositionX;
  18996. }
  18997. set posX(v) {
  18998. this.transform.localPositionX = v;
  18999. }
  19000. get posY() {
  19001. return this.transform.localPositionY;
  19002. }
  19003. set posY(v) {
  19004. this.transform.localPositionY = v;
  19005. }
  19006. get posZ() {
  19007. return this.transform.localPositionZ;
  19008. }
  19009. set posZ(v) {
  19010. this.transform.localPositionZ = v;
  19011. }
  19012. get rotation() {
  19013. return this.transform.localRotation;
  19014. }
  19015. set rotation(v) {
  19016. this.transform.localRotation = v;
  19017. }
  19018. }
  19019. class D2Hole extends Laya.Script {
  19020. constructor() { super(); }
  19021. onTriggerEnter(collider) {
  19022. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  19023. return;
  19024. }
  19025. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  19026. if (collider.owner["mySrc"].isRunSkillAni) {
  19027. return;
  19028. }
  19029. if (collider.owner["mySrc"].number != 0) {
  19030. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  19031. }
  19032. xGame.common.ballColliHole(collider);
  19033. xGame.common.recoverCameraView();
  19034. }
  19035. }
  19036. }
  19037. class Table extends Laya.Script3D {
  19038. constructor() {
  19039. super();
  19040. this.isSetBorder = false;
  19041. this.inited = false;
  19042. }
  19043. ;
  19044. onAwake() {
  19045. this.init();
  19046. }
  19047. init() {
  19048. if (this.inited)
  19049. return;
  19050. this.inited = true;
  19051. this.gameObj = this.owner;
  19052. this.border = this.gameObj.getChildByName("border");
  19053. }
  19054. setBorderPos() {
  19055. if (this.isSetBorder)
  19056. return;
  19057. this.isSetBorder = true;
  19058. let ui = xGame.common.gameUI.ui;
  19059. let bar1 = this.border.getChildByName("bar1");
  19060. let bar2 = this.border.getChildByName("bar2");
  19061. let bar3 = this.border.getChildByName("bar3");
  19062. let bar4 = this.border.getChildByName("bar4");
  19063. let bar5 = this.border.getChildByName("bar5");
  19064. let bar6 = this.border.getChildByName("bar6");
  19065. this.setInfo(bar1, ui.border.bar1, "box");
  19066. this.setInfo(bar2, ui.border.bar2, "box");
  19067. this.setInfo(bar3, ui.border.bar3, "box");
  19068. this.setInfo(bar4, ui.border.bar4, "box");
  19069. this.setInfo(bar5, ui.border.bar5, "box");
  19070. this.setInfo(bar6, ui.border.bar6, "box");
  19071. let circle1 = this.border.getChildByName("circle1");
  19072. let circle2 = this.border.getChildByName("circle2");
  19073. let circle3 = this.border.getChildByName("circle3");
  19074. let circle4 = this.border.getChildByName("circle4");
  19075. let circle5 = this.border.getChildByName("circle5");
  19076. let circle6 = this.border.getChildByName("circle6");
  19077. this.setInfo(circle1, ui.border.circle1, "circle");
  19078. this.setInfo(circle2, ui.border.circle2, "circle");
  19079. this.setInfo(circle3, ui.border.circle3, "circle");
  19080. this.setInfo(circle4, ui.border.circle4, "circle");
  19081. this.setInfo(circle5, ui.border.circle5, "circle");
  19082. this.setInfo(circle6, ui.border.circle6, "circle");
  19083. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  19084. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  19085. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  19086. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  19087. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  19088. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  19089. let arr = xGame.common.gameMgr.holePosList;
  19090. xGame.common.gameMgr.posObj = {
  19091. "1": arr[0],
  19092. "3": arr[2],
  19093. "4": arr[3],
  19094. "6": arr[5]
  19095. };
  19096. }
  19097. initHolePos(x, y) {
  19098. if (x < 300)
  19099. x += 25;
  19100. else if (x > 1000)
  19101. x -= 25;
  19102. else if (y > 200)
  19103. y -= 10;
  19104. else
  19105. y += 10;
  19106. if (y < 200)
  19107. y += 30;
  19108. else if (y > 500)
  19109. y -= 30;
  19110. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  19111. }
  19112. setInfo(d3Obj, d2Obj, type) {
  19113. let ui = xGame.common.gameUI.ui;
  19114. let sprite = new Laya.Sprite();
  19115. ui.border.displayObject.addChild(sprite);
  19116. let colli = xGame.common.getCollider(type);
  19117. sprite.addComponentIntance(colli);
  19118. let rigy = xGame.common.getRigbody();
  19119. rigy.type = "static";
  19120. sprite.addComponentIntance(rigy);
  19121. let d3Pos = d3Obj.transform.position;
  19122. xGame.common.pos3to2Convert(d3Pos);
  19123. let scaleX = d3Obj.transform.localScaleX;
  19124. let scaleZ = d3Obj.transform.localScaleZ;
  19125. let width = xGame.common.scale3to2Convert(scaleZ);
  19126. let height = xGame.common.scale3to2Convert(scaleX);
  19127. sprite.pivotX = width / 2;
  19128. sprite.pivotY = height / 2;
  19129. sprite.x = d3Pos.x;
  19130. sprite.y = d3Pos.y;
  19131. sprite.width = width;
  19132. sprite.height = height;
  19133. d2Obj.x = d3Pos.x;
  19134. d2Obj.y = d3Pos.y;
  19135. d2Obj.width = width;
  19136. d2Obj.height = height;
  19137. if (type == "box") {
  19138. colli.width = width;
  19139. colli.height = height;
  19140. colli.isSensor = false;
  19141. colli.label = "border";
  19142. }
  19143. else {
  19144. colli.radius = width / 2;
  19145. colli.isSensor = true;
  19146. colli.label = "hole";
  19147. sprite.addComponent(D2Hole);
  19148. }
  19149. }
  19150. }
  19151. class D3World extends Laya.Script3D {
  19152. constructor() {
  19153. super();
  19154. this.loadNum = 0;
  19155. this.setLoadNum = 7;
  19156. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  19157. }
  19158. onAwake() {
  19159. }
  19160. loadScene() {
  19161. this.scene = this.owner;
  19162. let url = `res/unityRes/root.lh`;
  19163. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  19164. this.scene.addChild(prefab);
  19165. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  19166. this.putCameraInfo();
  19167. this.camera.enableHDR = false;
  19168. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  19169. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  19170. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  19171. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  19172. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  19173. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  19174. this.knife.active = false;
  19175. this.loadD3Obj();
  19176. }));
  19177. }
  19178. putCameraInfo() {
  19179. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  19180. this.cameraObj = new cameraType();
  19181. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  19182. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  19183. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  19184. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  19185. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  19186. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  19187. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  19188. this.visitAngleChild.init();
  19189. this.visitRootObj.posX = this.visitAngleChild.posX;
  19190. this.visitRootObj.posY = this.visitAngleChild.posY;
  19191. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  19192. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  19193. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  19194. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  19195. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  19196. xGame.common.showOneCamera("mainCamera");
  19197. }
  19198. loadD3Obj() {
  19199. this.loadTable();
  19200. this.loadRoom();
  19201. this.loadInHoleParticial();
  19202. this.loadIceParticial();
  19203. this.loadHitParticial();
  19204. this.loadFireworksParticial();
  19205. this.loadBall();
  19206. }
  19207. loadInHoleParticial() {
  19208. this.loadD3Res("inHoleEft", "", (prefab) => {
  19209. prefab.addComponent(Partical);
  19210. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19211. });
  19212. }
  19213. loadIceParticial() {
  19214. this.loadD3Res("iceEft", "", (prefab) => {
  19215. prefab.addComponent(Partical);
  19216. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19217. });
  19218. }
  19219. loadHitParticial() {
  19220. this.loadD3Res("hitEft", "", (prefab) => {
  19221. prefab.addComponent(Partical);
  19222. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19223. });
  19224. }
  19225. loadFireworksParticial() {
  19226. this.loadD3Res("fireworksEft", "", (prefab) => {
  19227. prefab.addComponent(Partical);
  19228. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19229. });
  19230. }
  19231. loadBall(index = 1) {
  19232. this.loadD3Res("ball", index, (prefab) => {
  19233. this.ballPrefab = prefab;
  19234. this.ballPrefab.addComponent(Ball);
  19235. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19236. });
  19237. }
  19238. loadTable(index = 1) {
  19239. this.loadD3Res("table", index, (prefab) => {
  19240. this.tableSrc = prefab.addComponent(Table);
  19241. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19242. this.d3Hand.init();
  19243. this.tableRoot.addChild(prefab);
  19244. });
  19245. }
  19246. loadRoom(index = 1) {
  19247. this.loadD3Res("room", index, (prefab) => {
  19248. this.roomRoot.addChild(prefab);
  19249. });
  19250. }
  19251. loadD3Res(type, index, callback) {
  19252. let url = `res/unityRes/${type}${index}.lh`;
  19253. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19254. callback && callback(prefab);
  19255. this.checkResLoad();
  19256. }));
  19257. }
  19258. checkResLoad() {
  19259. this.loadNum++;
  19260. if (this.loadNum >= this.setLoadNum) {
  19261. xGame.eventMgr.event(D3RES_LOADED);
  19262. }
  19263. }
  19264. prePlayEft() {
  19265. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19266. eft.transform.localPositionX = 0;
  19267. eft.transform.localPositionY = -5;
  19268. eft.transform.localPositionZ = 0;
  19269. eft.active = true;
  19270. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19271. ice.transform.localPositionX = 0;
  19272. ice.transform.localPositionY = -5;
  19273. ice.transform.localPositionZ = 0;
  19274. ice.active = true;
  19275. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19276. hit.transform.localPositionX = 0;
  19277. hit.transform.localPositionY = -5;
  19278. hit.transform.localPositionZ = 0;
  19279. hit.active = true;
  19280. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19281. fireworks.transform.localPositionX = 0;
  19282. fireworks.transform.localPositionY = -5;
  19283. fireworks.transform.localPositionZ = 0;
  19284. fireworks.active = true;
  19285. }
  19286. }
  19287. class cameraType {
  19288. }
  19289. class MoyuMgr$1 {
  19290. static initMoyu() {
  19291. this.moyuView = new MoyuView$1();
  19292. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19293. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19294. this.moyuView.ui.displayObject.zOrder = 1000;
  19295. this.moyuView.init();
  19296. this.moyuView.showTip(true);
  19297. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19298. window['XApk'] = this;
  19299. }
  19300. static showAge(show) {
  19301. if (this.moyuView)
  19302. this.moyuView.showAge(show);
  19303. }
  19304. static onPlatMsg(idx) {
  19305. if (!MoyuMgr$1.moyuView)
  19306. return;
  19307. if (idx == '0') {
  19308. MoyuMgr$1.moyuView.showTip(false);
  19309. }
  19310. }
  19311. static showAgree(call) {
  19312. if (this.moyuView)
  19313. this.moyuView.showAgree(call);
  19314. else
  19315. call && call();
  19316. }
  19317. static showXy(type = 1) {
  19318. if (this.moyuView)
  19319. this.moyuView.showXy(type);
  19320. }
  19321. }
  19322. MoyuMgr$1.isAdvise = false;
  19323. class MoyuView$1 {
  19324. constructor() {
  19325. this.ysxyNum = 1;
  19326. this.ysJson = null;
  19327. this.ui = ui_UIMoyu.createInstance();
  19328. }
  19329. init() {
  19330. this.ui.mainBg.visible = false;
  19331. this.ui.xyNode.visible = false;
  19332. this.ui.ageNode.visible = false;
  19333. this.ui.tipNode.visible = false;
  19334. this.ui.rnNode.visible = false;
  19335. this.ui.fcmNode.visible = false;
  19336. this.ui.ageTip.visible = false;
  19337. this.ui.msgNode.visible = false;
  19338. this.ui.visible = false;
  19339. this.ui.xyNode.xyList.setVirtual();
  19340. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19341. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19342. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19343. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19344. this.ui.xyNode.btnKnown.visible = false;
  19345. this.ui.xyNode.xy1.visible = false;
  19346. this.ui.xyNode.xy2.visible = false;
  19347. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19348. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19349. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19350. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19351. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19352. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19353. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19354. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19355. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19356. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19357. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19358. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19359. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19360. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19361. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19362. this.ysxyNum = 2;
  19363. }
  19364. }
  19365. onClick(obj) {
  19366. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19367. switch (obj) {
  19368. case this.ui.ageTip:
  19369. if (Moyu.isTTApk) {
  19370. this.ui.ageNode.visible = true;
  19371. this.ui.mainBg.visible = true;
  19372. }
  19373. break;
  19374. case this.ui.tipNode:
  19375. this.showTip(false);
  19376. break;
  19377. case this.ui.ageNode.btnAge:
  19378. this.ui.ageNode.visible = false;
  19379. this.ui.mainBg.visible = false;
  19380. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19381. this.ui.visible = false;
  19382. break;
  19383. case this.ui.xyNode.btnXy3:
  19384. case this.ui.xyNode.btnXy1:
  19385. this.loadXy(1);
  19386. break;
  19387. case this.ui.xyNode.btnXy2:
  19388. this.loadXy(2);
  19389. break;
  19390. case this.ui.xyNode.btnBack:
  19391. this.ui.xyNode.xy1.visible = true;
  19392. this.ui.xyNode.xy2.visible = false;
  19393. break;
  19394. case this.ui.xyNode.btnKnown:
  19395. this.ui.xyNode.visible = false;
  19396. this.ui.mainBg.visible = false;
  19397. this.ui.visible = false;
  19398. break;
  19399. case this.ui.rnNode.btnCheck:
  19400. this.check();
  19401. break;
  19402. case this.ui.rnNode.btnExit:
  19403. case this.ui.xyNode.btnNo:
  19404. this.ysxyNum--;
  19405. if (this.ysxyNum > 0)
  19406. this.showMsg("Refuse to quit the game once again");
  19407. else {
  19408. Moyu.userAgree(false);
  19409. Moyu.exit();
  19410. }
  19411. break;
  19412. case this.ui.xyNode.btnSure:
  19413. case this.ui.xyNode.btnYes:
  19414. DataMgr.userData.isAgree = true;
  19415. DataMgr.saveUserData();
  19416. this.onAgree();
  19417. break;
  19418. case this.ui.rnNode.btnDone:
  19419. this.ui.rnNode.visible = false;
  19420. this.ui.visible = false;
  19421. break;
  19422. case this.ui.fcmNode.btnRn:
  19423. this.showRn();
  19424. break;
  19425. }
  19426. }
  19427. showTip(show) {
  19428. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19429. return;
  19430. if (show) {
  19431. MoyuMgr$1.isAdvise = true;
  19432. this.ui.visible = true;
  19433. this.ui.tipNode.visible = true;
  19434. this.ui.tipNode.alpha = 1;
  19435. Laya.timer.once(1000, this, this.showTip, [false]);
  19436. }
  19437. else {
  19438. this.ui.tipNode.alpha = 1;
  19439. this.ui.tipNode.visible = true;
  19440. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19441. this.ui.tipNode.visible = false;
  19442. MoyuMgr$1.isAdvise = false;
  19443. }), 1000);
  19444. }
  19445. }
  19446. showAge(show, px = 0, py = 0) {
  19447. if (Moyu.platType > 10 && !Moyu.isIos) {
  19448. this.ui.ageTip.x = px;
  19449. this.ui.ageTip.y = py;
  19450. this.ui.ageTip.visible = show;
  19451. if (show)
  19452. this.ui.visible = true;
  19453. }
  19454. }
  19455. showAgree(call) {
  19456. this.agreeCall = call;
  19457. this.onAgree();
  19458. return;
  19459. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19460. this.showXy(0);
  19461. }
  19462. else
  19463. this.onAgree();
  19464. }
  19465. onAgree() {
  19466. if (!this.ui.ageNode.visible)
  19467. this.ui.visible = false;
  19468. this.ui.xyNode.visible = false;
  19469. Moyu.userAgree(true);
  19470. this.showAge(false);
  19471. this.agreeCall && this.agreeCall();
  19472. this.showRn();
  19473. }
  19474. showMsg(txt) {
  19475. this.ui.msgNode.txtMsg.text = txt;
  19476. this.ui.msgNode.visible = true;
  19477. this.ui.msgNode.alpha = 1;
  19478. this.ui.visible = true;
  19479. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19480. this.ui.msgNode.visible = false;
  19481. }), 2500, true);
  19482. }
  19483. showRn() {
  19484. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19485. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19486. this.ui.rnNode.rn1.visible = true;
  19487. this.ui.rnNode.rn2.visible = false;
  19488. this.ui.rnNode.rn3.visible = false;
  19489. this.ui.rnNode.rn4.visible = false;
  19490. this.ui.rnNode.visible = true;
  19491. this.ui.mainBg.visible = true;
  19492. this.ui.rnNode.btnDone.visible = false;
  19493. this.ui.rnNode.btnExit.visible = true;
  19494. this.ui.rnNode.btnCheck.visible = true;
  19495. this.ui.fcmNode.visible = false;
  19496. this.ui.visible = true;
  19497. return;
  19498. }
  19499. }
  19500. this.showFcm();
  19501. }
  19502. showFcm() {
  19503. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19504. Moyu.initFCM(true);
  19505. if (Moyu.gameTime < 1)
  19506. this.fcmLoop();
  19507. else if (Moyu.gameTime < 999)
  19508. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19509. }
  19510. }
  19511. fcmLoop() {
  19512. if (Moyu.gameTime < 1) {
  19513. this.ui.rnNode.visible = false;
  19514. this.ui.fcmNode.visible = true;
  19515. this.ui.mainBg.visible = true;
  19516. this.ui.visible = true;
  19517. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19518. Laya.timer.clear(this.ui, this.fcmLoop);
  19519. }
  19520. }
  19521. check() {
  19522. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19523. this.ui.rnNode.rn1.visible = false;
  19524. this.ui.rnNode.rn2.visible = false;
  19525. this.ui.rnNode.rn4.visible = true;
  19526. }
  19527. else if (this.ui.rnNode.rn4.visible) {
  19528. let name = this.ui.rnNode.inputName.text;
  19529. let code = this.ui.rnNode.inputCode.text;
  19530. if (code && code.length == 18) {
  19531. this.ui.rnNode.rn1.visible = false;
  19532. this.ui.rnNode.rn4.visible = false;
  19533. Moyu.authenticate(name, code, (res) => {
  19534. this.ui.rnNode.rn2.visible = !res;
  19535. this.ui.rnNode.rn3.visible = res;
  19536. this.ui.rnNode.btnDone.visible = res;
  19537. this.ui.rnNode.btnExit.visible = !res;
  19538. this.ui.rnNode.btnCheck.visible = !res;
  19539. if (res)
  19540. this.showFcm();
  19541. });
  19542. }
  19543. else
  19544. this.showMsg("信息填写不完整");
  19545. }
  19546. }
  19547. loadXy(type = 0) {
  19548. this.ui.xyNode.xy1.visible = false;
  19549. this.ui.xyNode.xy2.visible = true;
  19550. this.ui.xyNode.xyList.scrollToView(0);
  19551. if (type == 1) {
  19552. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19553. }
  19554. else if (type == 2) {
  19555. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19556. }
  19557. }
  19558. showXy(type = 0) {
  19559. this.xyBtn();
  19560. if (type == 0) {
  19561. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19562. this.ui.xyNode.btnSure.visible = true;
  19563. }
  19564. else {
  19565. this.ui.xyNode.btnYes.visible = true;
  19566. this.ui.xyNode.btnNo.visible = true;
  19567. }
  19568. }
  19569. else {
  19570. this.ui.xyNode.btnKnown.visible = true;
  19571. this.ui.mainBg.visible = true;
  19572. }
  19573. this.ui.xyNode.xy1.visible = true;
  19574. this.ui.xyNode.xy2.visible = false;
  19575. this.ui.xyNode.visible = true;
  19576. this.ui.visible = true;
  19577. }
  19578. xyBtn() {
  19579. this.ui.xyNode.btnSure.visible = false;
  19580. this.ui.xyNode.btnYes.visible = false;
  19581. this.ui.xyNode.btnNo.visible = false;
  19582. this.ui.xyNode.btnKnown.visible = false;
  19583. {
  19584. this.ui.xyNode.btnXy3.visible = false;
  19585. this.ui.xyNode.btnXy2.visible = true;
  19586. this.ui.xyNode.btnXy1.visible = true;
  19587. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19588. }
  19589. }
  19590. createXY(json) {
  19591. this.ysJson = json.content;
  19592. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19593. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19594. this.ui.xyNode.xy2.visible = true;
  19595. }
  19596. renderListItem(idx, cell) {
  19597. let xy = this.ysJson[idx];
  19598. cell.height = xy.line * 30;
  19599. cell.xyItem.text = xy.text;
  19600. }
  19601. onDestroy() {
  19602. this.agreeCall = null;
  19603. }
  19604. }
  19605. class UILoading extends UIBase {
  19606. constructor() {
  19607. super();
  19608. this.accTime = 0;
  19609. this.curNum = 0;
  19610. this.rate = 1;
  19611. this.loadSubOk = false;
  19612. this.loadResOK = false;
  19613. this.openLoading = true;
  19614. this.beginLoadRes = false;
  19615. this.finishD2 = false;
  19616. this.finishD3 = false;
  19617. }
  19618. onConstructor() {
  19619. this.ui = ui_UILoading.createInstance();
  19620. this.contentPane = this.ui;
  19621. this.isEject = false;
  19622. this._initUI();
  19623. this._addEvent();
  19624. }
  19625. _initUI() {
  19626. MoyuMgr$1.initMoyu();
  19627. }
  19628. _addEvent() {
  19629. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19630. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19631. }
  19632. show() {
  19633. super.show();
  19634. console.log('zh:加载分包资源');
  19635. loadSubRes(this.subResProgress.bind(this));
  19636. this.ui.txtLoad.text = "Loading...";
  19637. this.setGlobalFont(this.ui);
  19638. }
  19639. subResProgress(pro, finish) {
  19640. this.curNum = pro;
  19641. if (finish) {
  19642. this.curNum = 1;
  19643. this.loadSubOk = true;
  19644. }
  19645. }
  19646. laodD3Res() {
  19647. let scene3D = new Laya.Scene3D();
  19648. xGame.common.d3Scene = scene3D;
  19649. xGame.common.d3World = scene3D.addComponent(D3World);
  19650. xGame.common.d3World.loadScene();
  19651. }
  19652. loadD2Res() {
  19653. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19654. this.finishD2 = true;
  19655. this.checkLoadAll();
  19656. this.curNum = 1;
  19657. }), Laya.Handler.create(this, (pro) => {
  19658. this.curNum = pro;
  19659. }, null, false));
  19660. }
  19661. d3ResFinish() {
  19662. this.finishD3 = true;
  19663. this.checkLoadAll();
  19664. }
  19665. checkLoadAll() {
  19666. if (this.finishD2 && this.finishD3) {
  19667. this.loadResOK = true;
  19668. }
  19669. }
  19670. loadRes() {
  19671. this.laodD3Res();
  19672. this.loadD2Res();
  19673. }
  19674. myUpdate(dt) {
  19675. if (!this.openLoading)
  19676. return;
  19677. this.accTime += dt * this.rate;
  19678. if (this.accTime >= this.curNum)
  19679. this.accTime = this.curNum;
  19680. this.ui.loadinfo.value = this.accTime * 100;
  19681. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19682. if (!this.beginLoadRes) {
  19683. this.beginLoadRes = true;
  19684. this.ui.txtLoad.text = "Loading...";
  19685. this.curNum = 0;
  19686. this.accTime = 0;
  19687. this.loadRes();
  19688. }
  19689. if (this.loadResOK) {
  19690. this.openLoading = false;
  19691. Laya.timer.once(300, this, () => {
  19692. xGame.common.d3Scene.active = false;
  19693. MoyuMgr$1.showAgree(enterGame);
  19694. });
  19695. }
  19696. }
  19697. }
  19698. release() {
  19699. }
  19700. hide() {
  19701. super.hide();
  19702. this.release();
  19703. }
  19704. onClose() {
  19705. this.hide();
  19706. }
  19707. }
  19708. UILoading.uiName = "UILoading";
  19709. class UIRepentProp$1 extends UIBase {
  19710. constructor() {
  19711. super();
  19712. this.viewType = 0;
  19713. this.regretType = 0;
  19714. }
  19715. onConstructor() {
  19716. this.ui = ui_UIRepentProp.createInstance();
  19717. this.contentPane = this.ui;
  19718. this.isEject = false;
  19719. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19720. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19721. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19722. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19723. }
  19724. show(viewType, regretType, callback) {
  19725. PlatMgr.showInsert(true);
  19726. this.viewType = viewType;
  19727. this.regretType = regretType;
  19728. this.callback = callback;
  19729. super.show();
  19730. this.ui.t0.play();
  19731. this.ui.c1.selectedIndex = this.viewType;
  19732. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19733. if (this.viewType == 0) {
  19734. let guide = DataMgr.getGuideHelpLine();
  19735. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19736. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19737. }
  19738. xGame.common.gameMgr.gamePause = true;
  19739. this.setGlobalFont(this.ui);
  19740. }
  19741. hideSelf() {
  19742. xGame.common.gameMgr.gamePause = false;
  19743. this.callback && this.callback(false);
  19744. this.hide();
  19745. }
  19746. videoRegret() {
  19747. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19748. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19749. }
  19750. else {
  19751. console.log('zh:AD 失败,直接发放奖励');
  19752. this.qjff_AD_for_UIrepentProp_videoRegret();
  19753. }
  19754. }
  19755. qjff_AD_for_UIrepentProp_videoRegret() {
  19756. this.callback && this.callback(true);
  19757. this.hideSelf();
  19758. }
  19759. videoAddHelpLine() {
  19760. let guide = DataMgr.getGuideHelpLine();
  19761. if (guide == 0) {
  19762. this.callback && this.callback(true);
  19763. this.hideSelf();
  19764. DataMgr.setGuideHelpLine();
  19765. xGame.common.gameUI.ui.guideNode.visible = false;
  19766. }
  19767. else {
  19768. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19769. if (Laya.Browser.onAndroid) {
  19770. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19771. if (!boo) {
  19772. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19773. return;
  19774. }
  19775. }
  19776. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19777. }
  19778. else {
  19779. console.log('zh:AD 失败,直接发放奖励');
  19780. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19781. }
  19782. }
  19783. }
  19784. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19785. this.callback && this.callback(true);
  19786. this.hideSelf();
  19787. }
  19788. }
  19789. UIRepentProp$1.uiName = "UIRepentProp";
  19790. class UIRodMethod$1 extends UIBase {
  19791. constructor() {
  19792. super();
  19793. this.isPressd = false;
  19794. }
  19795. onConstructor() {
  19796. this.ui = ui_UIRodMethod.createInstance();
  19797. this.contentPane = this.ui;
  19798. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19799. this.moveDir = new Laya.Vector2();
  19800. this.moveDest = new Laya.Vector2();
  19801. this.centerPos = new Laya.Vector2();
  19802. xGame.common.uiRodMethod = this;
  19803. }
  19804. show() {
  19805. super.show();
  19806. xGame.common.gameMgr.gamePause = true;
  19807. this.openPressDotEvent();
  19808. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19809. this.centerPos.x = this.ui.white.x;
  19810. this.centerPos.y = this.ui.white.y;
  19811. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19812. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19813. this.setDot();
  19814. this.setGlobalFont(this.ui);
  19815. }
  19816. setDot() {
  19817. this.ui.dot.x = this.moveDest.x;
  19818. this.ui.dot.y = this.moveDest.y;
  19819. }
  19820. closeSelf() {
  19821. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19822. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19823. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19824. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19825. xGame.common.gameMgr.gamePause = false;
  19826. this.hide();
  19827. }
  19828. openPressDotEvent() {
  19829. this.closePressDotEvent();
  19830. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19831. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19832. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19833. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19834. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19835. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19836. }
  19837. closePressDotEvent() {
  19838. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19839. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19840. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19841. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19842. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19843. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19844. }
  19845. onDown(e) {
  19846. if (e.type == Laya.Event.MOUSE_DOWN)
  19847. this.isPressd = true;
  19848. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19849. this.isPressd = false;
  19850. if (!this.isPressd)
  19851. return;
  19852. this.moveDest.x = e.stageX;
  19853. this.moveDest.y = e.stageY;
  19854. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19855. if (dis > 6724) {
  19856. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19857. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19858. }
  19859. this.setDot();
  19860. }
  19861. resetRod() {
  19862. this.ui.dot.x = this.ui.white.x;
  19863. this.ui.dot.y = this.ui.white.y;
  19864. this.gameRod.dot.x = this.gameRod.bg.x;
  19865. this.gameRod.dot.y = this.gameRod.bg.y;
  19866. xGame.common.rodOffest.x = 0;
  19867. xGame.common.rodOffest.y = 0;
  19868. }
  19869. }
  19870. UIRodMethod$1.uiName = "UIRodMethod";
  19871. class UIMsg$1 extends UIBase {
  19872. constructor() {
  19873. super();
  19874. }
  19875. onConstructor() {
  19876. this.ui = ui_UIMsg.createInstance();
  19877. this.contentPane = this.ui;
  19878. this.isEject = false;
  19879. this.isMuti = true;
  19880. }
  19881. show(msg, callback) {
  19882. super.show();
  19883. this.ui.tipsNode.msgTxt.text = msg;
  19884. this.ui.alpha = 1;
  19885. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19886. this.hide();
  19887. callback && callback();
  19888. }), 1000);
  19889. this.setGlobalFont(this.ui);
  19890. }
  19891. }
  19892. UIMsg$1.uiName = "UIMsg";
  19893. class UITips$1 extends UIBase {
  19894. constructor() {
  19895. super();
  19896. this.type = 0;
  19897. }
  19898. onConstructor() {
  19899. this.ui = ui_UITips.createInstance();
  19900. this.contentPane = this.ui;
  19901. this.isEject = false;
  19902. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19903. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19904. }
  19905. show(tipsTxt, womanTxt, type) {
  19906. super.show();
  19907. this.ui.t0.play();
  19908. this.ui.myNode.tipsTxt.text = tipsTxt;
  19909. this.ui.myNode.womanTxt.text = womanTxt;
  19910. PlatMgr.showInsert(true);
  19911. this.ui.myNode.c1.selectedIndex = type;
  19912. this.type = type;
  19913. switch (this.type) {
  19914. case TipsType.exitGame:
  19915. xGame.common.gameMgr.gamePause = true;
  19916. break;
  19917. case TipsType.foul:
  19918. Laya.timer.once(200, this, () => {
  19919. xGame.common.gameMgr.gamePause = true;
  19920. });
  19921. break;
  19922. default:
  19923. break;
  19924. }
  19925. this.setGlobalFont(this.ui);
  19926. }
  19927. clickLeftBtn() {
  19928. this.hide();
  19929. xGame.common.gameMgr.gamePause = false;
  19930. switch (this.type) {
  19931. case TipsType.exitGame:
  19932. break;
  19933. case TipsType.foul:
  19934. break;
  19935. default:
  19936. break;
  19937. }
  19938. }
  19939. clickRightBtn() {
  19940. this.hide();
  19941. switch (this.type) {
  19942. case TipsType.exitGame:
  19943. xGame.eventMgr.event(RESET_GAME);
  19944. xGame.uiMgr.Show(UIMain$1);
  19945. Moyu.recordEnd(this, null);
  19946. xGame.common.longHelpLine = false;
  19947. break;
  19948. case TipsType.foul:
  19949. xGame.common.gameMgr.gamePause = false;
  19950. Laya.timer.clearAll(this);
  19951. break;
  19952. default:
  19953. break;
  19954. }
  19955. }
  19956. }
  19957. UITips$1.uiName = "UITips";
  19958. class UIGame$1 extends UIBase {
  19959. constructor() {
  19960. super();
  19961. this.powerNum = 0;
  19962. this.isD3Inited = false;
  19963. this.isPrePlay = false;
  19964. this.isMoveRod = false;
  19965. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19966. this.rulerDis = 20;
  19967. this.rulerOffset = 0;
  19968. }
  19969. onConstructor() {
  19970. this.ui = ui_UIGame.createInstance();
  19971. this.contentPane = this.ui;
  19972. this.ui.x += xGame.common.sysOffestNum;
  19973. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19974. this.isEject = false;
  19975. xGame.common.gameUI = this;
  19976. this.initSelf();
  19977. }
  19978. isTurnSelf() {
  19979. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19980. return true;
  19981. }
  19982. }
  19983. initSelf() {
  19984. let topUI = this.ui.topNode;
  19985. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  19986. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  19987. this.barInfo = {};
  19988. this.barInfo.curY = 0;
  19989. this.barInfo.height = this.ui.powerNode.height;
  19990. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  19991. this.barInfo.powerStartY = this.ui.powerNode.y;
  19992. xGame.common.aiPlayer = new AIPlayer();
  19993. xGame.common.gameMgr = new GameMgr();
  19994. xGame.common.skillMgr = new SkillMgr();
  19995. xGame.common.wordsMgr = new WordsMgr();
  19996. xGame.common.talkMgr = new TalkMgr();
  19997. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  19998. });
  19999. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  20000. });
  20001. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  20002. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  20003. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  20004. this.addUIClick(this.ui.returnBtn, this.returnHome);
  20005. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  20006. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  20007. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  20008. }
  20009. getGanZiImg() {
  20010. let index = DataMgr.getCurBallRod();
  20011. let data = cfgTable.ballrodData[index + 1];
  20012. let gan_url = xGame.common.getGameIconUrl(data.img);
  20013. this.ui.powerNode.showImg.url = gan_url;
  20014. }
  20015. returnHome() {
  20016. let tips = "Are you sure to exit the game?";
  20017. let woman = "Boss, why don't you play for a while longer?";
  20018. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  20019. }
  20020. addRodMethodClick() {
  20021. if (this.isTurnSelf()) {
  20022. xGame.uiMgr.Show(UIRodMethod$1);
  20023. }
  20024. }
  20025. clickHelpLineBtn(force = false) {
  20026. if (!this.isTurnSelf())
  20027. return;
  20028. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  20029. if (success) {
  20030. xGame.common.longHelpLine = true;
  20031. xGame.common.d2World.getHelpLine();
  20032. Moyu.sendDataEvent("guideNum");
  20033. }
  20034. else {
  20035. }
  20036. });
  20037. }
  20038. renderSelfDisplayBalls(index, target) {
  20039. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  20040. target.myImg.url = xGame.common.getGameIconUrl(str);
  20041. }
  20042. renderAIDisplayBalls(index, target) {
  20043. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  20044. target.myImg.url = xGame.common.getGameIconUrl(str);
  20045. ;
  20046. }
  20047. updateMode() {
  20048. if (xGame.common.gameMode == GameMode.classic) {
  20049. this.ui.topNode.scoreNode.visible = false;
  20050. }
  20051. else if (xGame.common.gameMode == GameMode.bigMove) {
  20052. this.ui.topNode.scoreNode.visible = true;
  20053. }
  20054. }
  20055. show() {
  20056. super.show();
  20057. this.ui.alpha = 0;
  20058. this.updateSelf();
  20059. xGame.common.gameMgr.gamePause = false;
  20060. xGame.common.gameUI.ui.blackAni.visible = false;
  20061. xGame.common.gameUI.ui.whiteAni.visible = false;
  20062. this.ui.powerEft.visible = false;
  20063. this.ui.colorNode.visible = false;
  20064. this.updateHead();
  20065. let curUse = DataMgr.getCurBallRod();
  20066. this.getGanZiImg();
  20067. this.setGlobalFont(this.ui);
  20068. }
  20069. updateSelf() {
  20070. if (xGame.common.gameMode == GameMode.classic) {
  20071. this.ui.c1.selectedIndex = 0;
  20072. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  20073. this.ui.topNode.middleNode.visible = true;
  20074. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  20075. }
  20076. else if (xGame.common.gameMode == GameMode.bigMove) {
  20077. this.ui.c1.selectedIndex = 0;
  20078. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  20079. this.ui.topNode.middleNode.visible = false;
  20080. let max = xGame.cfgMgr.getMaxBigMoveLength();
  20081. let rand = xGame.common.randomNum(1, max);
  20082. let guide = DataMgr.getSkillGuide();
  20083. if (guide == 0)
  20084. rand = 1;
  20085. xGame.common.bigMoveLevelIndex = rand;
  20086. }
  20087. else if (xGame.common.gameMode == GameMode.placeBall) {
  20088. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20089. this.ui.c1.selectedIndex = 1 + data.type;
  20090. this.ui.alpha = 1;
  20091. this.startGame();
  20092. }
  20093. this.updateMode();
  20094. this.initD3world();
  20095. this.initD2world();
  20096. }
  20097. startGame() {
  20098. this.ui.snowNode.visible = Math.random() <= 0.1;
  20099. this.ui.d2Node.visible = false;
  20100. xGame.common.d3World.d3Hand.gameObj.active = false;
  20101. xGame.common.d3World.tableSrc.init();
  20102. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20103. this.cameraViewChange(() => {
  20104. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  20105. switch (xGame.common.gameMode) {
  20106. case GameMode.classic:
  20107. xGame.common.d3World.d3Hand.gameObj.active = true;
  20108. this.playPutBallD3Ani();
  20109. break;
  20110. case GameMode.bigMove:
  20111. this.enterGame();
  20112. Laya.timer.once(500, this, () => {
  20113. this.ui.topNode.middleNode.visible = true;
  20114. this.ui.topNode.middleNode.t0.play();
  20115. });
  20116. break;
  20117. case GameMode.placeBall:
  20118. this.enterGame();
  20119. break;
  20120. default:
  20121. break;
  20122. }
  20123. });
  20124. PlatMgr.showBanner(false);
  20125. }
  20126. enterGame() {
  20127. this.ui.d2Node.visible = true;
  20128. xGame.common.d3World.d3Hand.gameObj.active = false;
  20129. xGame.common.showOneCamera("mainCamera");
  20130. Moyu.recordGame(30, true);
  20131. if (!this.isPrePlay) {
  20132. this.isPrePlay = true;
  20133. xGame.common.d3World.prePlayEft();
  20134. }
  20135. xGame.common.gameMgr.gameReady();
  20136. this.openAllEvent();
  20137. this.ui.snowNode.visible = false;
  20138. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  20139. this.ui.helpBtn.visible = condition;
  20140. }
  20141. showHelpLineGuide() {
  20142. let longGuide = DataMgr.getGuideHelpLine();
  20143. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  20144. this.ui.helpBtn.visible = true;
  20145. this.ui.guideNode.visible = true;
  20146. }
  20147. }
  20148. setTurnAlpha(alpha) {
  20149. this.ui.keduNode.alpha = alpha;
  20150. this.ui.ganNode.alpha = alpha;
  20151. this.ui.rodMethodNode.alpha = alpha;
  20152. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  20153. }
  20154. cameraViewChange(callback) {
  20155. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20156. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  20157. xGame.common.showOneCamera("visitAngle");
  20158. cameraSrc.localRotationEulerY = 180;
  20159. cameraSrc.localRotationEulerZ = 0;
  20160. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  20161. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  20162. callback && callback();
  20163. }));
  20164. }));
  20165. }
  20166. playPutBallD3Ani() {
  20167. xGame.common.showOneCamera("mainCamera");
  20168. let handSrc = xGame.common.d3World.d3Hand;
  20169. handSrc.gameObj.active = true;
  20170. handSrc.transform.localPositionZ = 3;
  20171. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  20172. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  20173. handSrc.gameObj.active = false;
  20174. this.enterGame();
  20175. }), 400);
  20176. }));
  20177. }
  20178. updateHead() {
  20179. let user = Moyu.getUserInfo();
  20180. this.ui.topNode.selfNameTxt.text = user.nickName;
  20181. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  20182. let aiData = xGame.cfgMgr.getRandomUserInfo();
  20183. if (DataMgr.getSkillGuide() < 1) {
  20184. this.ui.topNode.aiNameTxt.text = 'billiards';
  20185. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  20186. }
  20187. else {
  20188. this.ui.topNode.aiNameTxt.text = aiData.name;
  20189. let randNo = Math.floor(Math.random() * 10) + 1;
  20190. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  20191. }
  20192. }
  20193. initD2world() {
  20194. let node = this.ui.d2Root.displayObject;
  20195. let src = node.getComponent(D2World);
  20196. if (!src) {
  20197. xGame.common.d2World = node.addComponent(D2World);
  20198. }
  20199. xGame.common.d2World.initSelf();
  20200. }
  20201. initD3world() {
  20202. if (this.isD3Inited)
  20203. return;
  20204. this.isD3Inited = true;
  20205. let scene3D = xGame.common.d3Scene;
  20206. this.ui.d3Root.displayObject.addChild(scene3D);
  20207. scene3D.active = true;
  20208. xGame.common.d3World.tableSrc.setBorderPos();
  20209. }
  20210. onRootMove(e) {
  20211. let rootBall = xGame.common.d2World.rootBall;
  20212. this.ui.moveNode.x = e.x;
  20213. this.ui.moveNode.y = e.y;
  20214. rootBall.gameObj.x = e.x;
  20215. rootBall.gameObj.y = e.y;
  20216. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20217. }
  20218. aiRootMove(move) {
  20219. if (move)
  20220. this.hideBallUI();
  20221. else {
  20222. this.showBallUI();
  20223. xGame.common.d2World.getHelpLine();
  20224. }
  20225. }
  20226. aiForce(type, force = 0) {
  20227. this.pressTarget = PressType.powerNode;
  20228. if (type == 1)
  20229. this.onEventUp({ force: true });
  20230. else if (type == 2)
  20231. this.onEventMove({ stageY: force, force: true });
  20232. }
  20233. onEventPress(e) {
  20234. if (e.stopPropagation)
  20235. e.stopPropagation();
  20236. if (!this.isTurnSelf())
  20237. return;
  20238. let target = e.target;
  20239. switch (target) {
  20240. case this.ui.myPowerNode.displayObject:
  20241. this.pressTarget = PressType.powerNode;
  20242. this.barInfo.curY = e.stageY;
  20243. this.updateBarInfo();
  20244. break;
  20245. case this.ui.moveNode.displayObject:
  20246. this.pressTarget = PressType.moveNode;
  20247. this.hideBallUI();
  20248. this.eventObj.curX = this.ui.moveNode.x;
  20249. this.eventObj.curY = this.ui.moveNode.y;
  20250. this.ui.moveNode.finger.visible = false;
  20251. this.eventObj.lastX = e.stageX;
  20252. this.eventObj.lastY = e.stageY;
  20253. break;
  20254. case this.ui.rulerClickNode.displayObject:
  20255. this.pressTarget = PressType.rulerNode;
  20256. this.eventObj.lastY = e.stageY;
  20257. break;
  20258. case this.ui.d2Root.displayObject:
  20259. this.pressTarget = PressType.d2Root;
  20260. this.eventObj.lastX = e.stageX;
  20261. this.eventObj.lastY = e.stageY;
  20262. this.eventObj.starX = e.stageX;
  20263. this.eventObj.starY = e.stageY;
  20264. this.eventObj.curX = 0;
  20265. this.eventObj.curY = 0;
  20266. xGame.common.d2World.d2Gan.setGanLastInfo();
  20267. this.rulerOffset = 0;
  20268. break;
  20269. default:
  20270. break;
  20271. }
  20272. }
  20273. onEventMove(e) {
  20274. if (e.stopPropagation)
  20275. e.stopPropagation();
  20276. if (e && e.force) {
  20277. }
  20278. else {
  20279. if (!this.isTurnSelf())
  20280. return;
  20281. }
  20282. switch (this.pressTarget) {
  20283. case PressType.powerNode:
  20284. this.barInfo.curY = e.stageY;
  20285. this.updateBarInfo();
  20286. this.isMoveRod = true;
  20287. break;
  20288. case PressType.moveNode:
  20289. let rootBall = xGame.common.d2World.rootBall;
  20290. let radius = rootBall.gameObj.width / 2;
  20291. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20292. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20293. let border = xGame.common.d2World.borderRect;
  20294. if (curX <= border.x + radius)
  20295. curX = border.x + radius;
  20296. else if (curX >= border.x + border.width - radius)
  20297. curX = border.x + border.width - radius;
  20298. if (curY <= border.y + radius)
  20299. curY = border.y + radius;
  20300. else if (curY >= border.y + border.height - radius)
  20301. curY = border.y + border.height - radius;
  20302. if (xGame.common.gameMgr.isOpenBall) {
  20303. if (curX >= border.x + border.openBallW - radius)
  20304. curX = border.x + border.openBallW - radius;
  20305. }
  20306. this.ui.moveNode.x = curX;
  20307. this.ui.moveNode.y = curY;
  20308. rootBall.gameObj.x = curX;
  20309. rootBall.gameObj.y = curY;
  20310. rootBall.d3BallSrc.setTransPos(curX, curY);
  20311. this.isMoveRod = true;
  20312. break;
  20313. case PressType.rulerNode:
  20314. let yy = e.stageY - this.eventObj.lastY;
  20315. this.eventObj.lastY = e.stageY;
  20316. let ruler1 = this.ui.rulerNode.img1;
  20317. let ruler2 = this.ui.rulerNode.img2;
  20318. ruler1.y += yy;
  20319. ruler2.y += yy;
  20320. this.rulerOffset += yy;
  20321. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20322. this.rulerOffset = 0;
  20323. xGame.soundMgr.playSound("inch", 1, 10);
  20324. }
  20325. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20326. let h = ruler1.height;
  20327. this.checkGuide();
  20328. this.isMoveRod = true;
  20329. if (ruler1.y >= h) {
  20330. ruler1.y = -h;
  20331. ruler2.y = 0;
  20332. return;
  20333. }
  20334. else if (ruler1.y <= -h) {
  20335. ruler1.y = h;
  20336. ruler2.y = 0;
  20337. return;
  20338. }
  20339. if (ruler2.y >= h) {
  20340. ruler2.y = -h;
  20341. ruler1.y = 0;
  20342. return;
  20343. }
  20344. else if (ruler2.y <= -h) {
  20345. ruler2.y = h;
  20346. ruler1.y = 0;
  20347. return;
  20348. }
  20349. break;
  20350. case PressType.d2Root:
  20351. this.eventObj.curX = e.stageX;
  20352. this.eventObj.curY = e.stageY;
  20353. let offset = this.checkRodMoveDir();
  20354. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20355. this.eventObj.lastX = e.stageX;
  20356. this.eventObj.lastY = e.stageY;
  20357. break;
  20358. default:
  20359. break;
  20360. }
  20361. }
  20362. onEventUp(e) {
  20363. if (e.stopPropagation)
  20364. e.stopPropagation();
  20365. if (e && e.force) {
  20366. }
  20367. else {
  20368. if (!this.isTurnSelf())
  20369. return;
  20370. }
  20371. switch (this.pressTarget) {
  20372. case PressType.powerNode:
  20373. this.ui.powerNode.value = 0;
  20374. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20375. this.ui.powerTxt.text = "";
  20376. if (this.powerNum > 0) {
  20377. xGame.eventMgr.event(BALL_SHOOT);
  20378. xGame.common.d2World.shoot(this.powerNum);
  20379. xGame.common.d2World.d2Gan.shoot();
  20380. xGame.common.d2World.d2HelpLine.shoot();
  20381. this.finishGuide();
  20382. this.ui.powerEft.visible = false;
  20383. this.ui.colorNode.visible = false;
  20384. let ganStr = "";
  20385. if (this.powerNum <= 30) {
  20386. ganStr = "gan_30";
  20387. }
  20388. else if (this.powerNum <= 60) {
  20389. ganStr = "gan_50";
  20390. }
  20391. else {
  20392. ganStr = "gan_80";
  20393. }
  20394. xGame.soundMgr.playSound(ganStr);
  20395. }
  20396. break;
  20397. case PressType.moveNode:
  20398. let rootBall = xGame.common.d2World.rootBall;
  20399. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20400. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20401. let isIntersect = this.judgeBallIntersect();
  20402. if (isIntersect) {
  20403. this.ui.moveNode.x = lastX;
  20404. this.ui.moveNode.y = lastY;
  20405. rootBall.gameObj.x = lastX;
  20406. rootBall.gameObj.y = lastY;
  20407. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20408. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20409. }
  20410. else {
  20411. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20412. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20413. }
  20414. this.showBallUI();
  20415. this.ui.moveNode.finger.visible = true;
  20416. xGame.common.d2World.getHelpLine();
  20417. break;
  20418. case PressType.rulerNode:
  20419. break;
  20420. case PressType.d2Root:
  20421. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20422. if (dis <= 25) {
  20423. this.moveToClickDot(e);
  20424. }
  20425. break;
  20426. default:
  20427. break;
  20428. }
  20429. this.pressTarget = -1;
  20430. }
  20431. checkGuide() {
  20432. let guide = DataMgr.getSkillGuide();
  20433. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20434. xGame.common.guideStep++;
  20435. xGame.common.gameUI.ui.guide2.visible = false;
  20436. xGame.common.gameUI.ui.guide3.visible = true;
  20437. }
  20438. }
  20439. finishGuide() {
  20440. let guide = DataMgr.getSkillGuide();
  20441. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20442. xGame.common.guideStep = 10;
  20443. this.closeAllGuide();
  20444. console.log('zh: 新手引导完毕');
  20445. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20446. }
  20447. }
  20448. closeAllGuide() {
  20449. xGame.common.gameUI.ui.guide1.visible = false;
  20450. xGame.common.gameUI.ui.guide2.visible = false;
  20451. xGame.common.gameUI.ui.guide3.visible = false;
  20452. }
  20453. updateBarInfo() {
  20454. let star = this.ui.powerNode.y;
  20455. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20456. if (rate >= 1)
  20457. rate = 1;
  20458. if (rate <= 0)
  20459. rate = 0;
  20460. this.powerNum = Math.ceil(rate * 100);
  20461. this.ui.powerNode.value = this.powerNum;
  20462. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20463. this.ui.colorNode.value = this.powerNum;
  20464. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20465. this.ui.powerEft.visible = this.powerNum != 0;
  20466. this.ui.colorNode.visible = this.powerNum != 0;
  20467. this.ui.powerTxt.text = this.powerNum + "";
  20468. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20469. }
  20470. forceCancel() {
  20471. this.ui.powerNode.value = 0;
  20472. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20473. this.ui.powerTxt.text = "";
  20474. }
  20475. checkRodMoveDir() {
  20476. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20477. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20478. if (tempX >= 0 && tempY <= 0) {
  20479. return this.checkDir();
  20480. }
  20481. else if (tempX < 0 && tempY < 0) {
  20482. return this.checkDir(1, -1);
  20483. }
  20484. else if (tempX < 0 && tempY > 0) {
  20485. return this.checkDir(-1, -1);
  20486. }
  20487. else {
  20488. return this.checkDir(-1, 1);
  20489. }
  20490. }
  20491. checkDir(flagX = 1, flagY = 1) {
  20492. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20493. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20494. if (offsetY == 0) {
  20495. return offsetX * flagX;
  20496. }
  20497. if (offsetX == 0) {
  20498. return offsetY * flagY;
  20499. }
  20500. let angle = offsetY / offsetX;
  20501. if (Math.abs(angle) >= 1) {
  20502. return offsetY * flagY;
  20503. }
  20504. else {
  20505. return offsetX * flagX;
  20506. }
  20507. }
  20508. judgeBallIntersect() {
  20509. let rootBall = xGame.common.d2World.rootBall;
  20510. let ballArr = xGame.common.d2World.ballArr;
  20511. let radius = rootBall.gameObj.width / 2;
  20512. let temp;
  20513. let isIntersect = false;
  20514. for (let index = 0; index < ballArr.length; index++) {
  20515. temp = ballArr[index];
  20516. if (temp.number == rootBall.number)
  20517. continue;
  20518. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20519. if (isIntersect) {
  20520. break;
  20521. }
  20522. }
  20523. return isIntersect;
  20524. }
  20525. hideBallUI() {
  20526. let d2Gan = xGame.common.d2World.d2Gan;
  20527. if (!d2Gan.ui.isDisposed)
  20528. d2Gan.ui.visible = false;
  20529. let d2Help = xGame.common.d2World.d2HelpLine;
  20530. if (!d2Help.ui.isDisposed)
  20531. d2Help.ui.visible = false;
  20532. let rootBall = xGame.common.d2World.rootBall;
  20533. if (!rootBall.destroyed) {
  20534. rootBall.gameObj.active = false;
  20535. }
  20536. }
  20537. showBallUI() {
  20538. let d2Gan = xGame.common.d2World.d2Gan;
  20539. if (!d2Gan.ui.isDisposed)
  20540. d2Gan.ui.visible = true;
  20541. let d2Help = xGame.common.d2World.d2HelpLine;
  20542. if (!d2Help.ui.isDisposed)
  20543. d2Help.ui.visible = true;
  20544. let rootBall = xGame.common.d2World.rootBall;
  20545. if (!rootBall.destroyed) {
  20546. rootBall.gameObj.active = true;
  20547. }
  20548. }
  20549. moveToClickDot(e) {
  20550. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20551. let root = xGame.common.d2World.rootBall.gameObj;
  20552. let xx = e.stageX - xGame.common.sysOffestNum;
  20553. let yy = e.stageY;
  20554. let x = xx - root.x;
  20555. let y = yy - root.y;
  20556. let angle = xGame.common.getfguiRotation(x, y);
  20557. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20558. xGame.common.d2World.getHelpLine();
  20559. }
  20560. this.isMoveRod = false;
  20561. xGame.common.clickedBall = false;
  20562. }
  20563. openAllEvent() {
  20564. this.closeAllEvent();
  20565. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20566. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20567. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20568. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20569. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20570. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20571. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20572. }
  20573. closeAllEvent() {
  20574. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20575. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20576. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20577. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20578. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20579. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20580. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20581. }
  20582. resetGame() {
  20583. this.closeAllEvent();
  20584. this.hideBallUI();
  20585. xGame.common.gameMgr.gamePause = true;
  20586. }
  20587. }
  20588. UIGame$1.uiName = "UIGame";
  20589. class UIAddCoin$1 extends UIBase {
  20590. constructor() {
  20591. super();
  20592. this.coinNum = 2000;
  20593. }
  20594. onConstructor() {
  20595. this.ui = ui_UIAddCoin.createInstance();
  20596. this.contentPane = this.ui;
  20597. this.isEject = false;
  20598. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20599. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20600. }
  20601. show() {
  20602. super.show();
  20603. this.ui.t0.play();
  20604. this.setGlobalFont(this.ui);
  20605. }
  20606. videoAddCoin() {
  20607. console.log('zh:qjff_AD_for_UIAddCoin');
  20608. if (Laya.Browser.onAndroid) {
  20609. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20610. if (!boo) {
  20611. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20612. return;
  20613. }
  20614. }
  20615. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20616. }
  20617. else {
  20618. console.log('zh:AD 失败,直接发放奖励');
  20619. this.qjff_AD_for_UIAddCoin();
  20620. }
  20621. }
  20622. qjff_AD_for_UIAddCoin() {
  20623. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20624. this.hide();
  20625. }
  20626. }
  20627. UIAddCoin$1.uiName = "UIAddCoin";
  20628. class UIInvitation$1 extends UIBase {
  20629. constructor() {
  20630. super();
  20631. }
  20632. onConstructor() {
  20633. this.ui = ui_UIInvitation.createInstance();
  20634. this.contentPane = this.ui;
  20635. this.isEject = false;
  20636. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20637. }
  20638. show() {
  20639. super.show();
  20640. this.setGlobalFont(this.ui);
  20641. }
  20642. enterGame() {
  20643. xGame.common.gameMode = GameMode.classic;
  20644. DataMgr.setChallengeTimes(1);
  20645. xGame.common.passAwardCoin = 2000;
  20646. let need = xGame.common.classicNiceNeddCoin;
  20647. if (DataMgr.coinEnough(need)) {
  20648. DataMgr.setCoin(-need);
  20649. xGame.eventMgr.event(RESTART_GAME, true);
  20650. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20651. }
  20652. else {
  20653. xGame.eventMgr.event(RESTART_GAME, true);
  20654. }
  20655. this.hide();
  20656. }
  20657. hide() {
  20658. super.hide();
  20659. }
  20660. }
  20661. UIInvitation$1.uiName = "UIInvitation";
  20662. class UIPower$1 extends UIBase {
  20663. constructor() {
  20664. super();
  20665. }
  20666. onConstructor() {
  20667. this.ui = ui_UIPower.createInstance();
  20668. this.contentPane = this.ui;
  20669. this.isEject = false;
  20670. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20671. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20672. }
  20673. show() {
  20674. super.show();
  20675. this.ui.t0.play();
  20676. this.setGlobalFont(this.ui);
  20677. }
  20678. videoGetPower() {
  20679. console.log('zh:qjff_AD_for_uipower');
  20680. if (Laya.Browser.onAndroid) {
  20681. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20682. if (!boo) {
  20683. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20684. return;
  20685. }
  20686. }
  20687. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20688. }
  20689. else {
  20690. console.log('zh:AD 失败,直接发放奖励');
  20691. this.qjff_AD_for_uipower();
  20692. }
  20693. }
  20694. qjff_AD_for_uipower() {
  20695. DataMgr.setPower(xGame.common.videoPower, true);
  20696. xGame.eventMgr.event(POWER_TIME);
  20697. this.hide();
  20698. }
  20699. }
  20700. UIPower$1.uiName = "UIPower";
  20701. class UIGameEnd$1 extends UIBase {
  20702. constructor() {
  20703. super();
  20704. this.success = false;
  20705. this.awardCoinNum = 1000;
  20706. this.awardDiamondNum = 10;
  20707. }
  20708. onConstructor() {
  20709. this.ui = ui_UIGameEnd.createInstance();
  20710. this.contentPane = this.ui;
  20711. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20712. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20713. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20714. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20715. this.ui.talkNode.visible = false;
  20716. if (Moyu.isKs)
  20717. this.ui.closeNode.closeBtn.x += 100;
  20718. }
  20719. updateType() {
  20720. switch (xGame.common.gameMode) {
  20721. case GameMode.classic:
  20722. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20723. this.ui.coinNode.visible = this.success;
  20724. if (!this.success) {
  20725. Laya.timer.once(500, this, () => {
  20726. xGame.uiMgr.Show(UIAddCoin$1);
  20727. });
  20728. }
  20729. else {
  20730. this.logEventForClassic_win();
  20731. }
  20732. this.logEventForClassic_complete();
  20733. this.ui.isGetAward.visible = false;
  20734. this.ui.leftBtn.c1.selectedIndex = 3;
  20735. this.ui.rightBtn.c1.selectedIndex = 0;
  20736. this.moneyNode.ui.c1.selectedIndex = 1;
  20737. break;
  20738. case GameMode.bigMove:
  20739. console.log('zh:招法模式 aaaaaa bigMove');
  20740. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20741. this.ui.coinNode.visible = this.success;
  20742. if (xGame.common.gameMode == GameMode.bigMove) {
  20743. if (this.success) {
  20744. DataMgr.setSkillSuccessTimes(1, true);
  20745. DataMgr.setSkillAccTimes(1);
  20746. }
  20747. else {
  20748. DataMgr.setSkillSuccessTimes(0, false);
  20749. }
  20750. }
  20751. this.logEventForRod_complete_N();
  20752. if (!this.success) {
  20753. Laya.timer.once(500, this, () => {
  20754. xGame.uiMgr.Show(UIAddCoin$1);
  20755. });
  20756. }
  20757. else {
  20758. this.logEventForRod_win();
  20759. }
  20760. this.ui.isGetAward.visible = false;
  20761. this.ui.leftBtn.c1.selectedIndex = 3;
  20762. this.ui.rightBtn.c1.selectedIndex = 0;
  20763. this.moneyNode.ui.c1.selectedIndex = 1;
  20764. break;
  20765. case GameMode.placeBall:
  20766. this.ui.coinNode.visible = false;
  20767. if (this.success) {
  20768. if (xGame.common.placeBallStarNum == 3) {
  20769. this.ui.c1.selectedIndex = 2;
  20770. }
  20771. else {
  20772. this.ui.c1.selectedIndex = 3;
  20773. }
  20774. let level = xGame.common.placeBallCurLevel;
  20775. if (level > 59) {
  20776. this.logEventForChallenge_level_complete(level);
  20777. }
  20778. else {
  20779. this.logEventForChallenge_level_N(level);
  20780. }
  20781. }
  20782. else {
  20783. this.ui.c1.selectedIndex = 4;
  20784. }
  20785. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20786. if (cfg.type == PlaceBallType.challenge) {
  20787. this.ui.c1.selectedIndex = 2;
  20788. }
  20789. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20790. this.updatePlaceBallBtn();
  20791. this.updatePlaceBallStarNum();
  20792. this.updatePlaceBallAwardState();
  20793. this.moneyNode.ui.c1.selectedIndex = 2;
  20794. this.moneyNode.checkPowerTime();
  20795. this.moneyNode.powerChange();
  20796. DataMgr.upRankData();
  20797. break;
  20798. default:
  20799. break;
  20800. }
  20801. }
  20802. logEventForRod_complete_N() {
  20803. let gfmsIdx = xGame.common.curPlayerSkillType;
  20804. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20805. let gfmc = 'Skyfall Shot';
  20806. if (gfmsIdx == 0) {
  20807. gfmc = 'Skyfall Shot';
  20808. }
  20809. if (gfmsIdx == 1) {
  20810. gfmc = 'Surging break';
  20811. }
  20812. if (gfmsIdx == 2) {
  20813. gfmc = 'Frost Lock';
  20814. }
  20815. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20816. console.log('zh:logEventForRod_complete_N level = ' + level);
  20817. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20818. let jsonStr = {
  20819. "count": 0,
  20820. "name": gfmc
  20821. };
  20822. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20823. const d = LocalStorageManager.getItem(keyStr);
  20824. jsonStr.count = d.count + 1;
  20825. LocalStorageManager.setItem(keyStr, jsonStr);
  20826. }
  20827. else {
  20828. LocalStorageManager.setItem(keyStr, jsonStr);
  20829. }
  20830. const d2 = LocalStorageManager.getItem(keyStr);
  20831. let count = d2.count;
  20832. console.log('zh:logEventForRod_complete_N count = ' + count);
  20833. if (count % 5 == 0) {
  20834. const reqStr = JSON.stringify(jsonStr);
  20835. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20836. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20837. }
  20838. }
  20839. logEventForRod_win() {
  20840. console.log('zh:logEventForRod_win,胜利');
  20841. let gfmsIdx = xGame.common.curPlayerSkillType;
  20842. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20843. let gfmc = 'Skyfall Shot';
  20844. if (gfmsIdx == 0) {
  20845. gfmc = 'Skyfall Shot';
  20846. }
  20847. if (gfmsIdx == 1) {
  20848. gfmc = 'Surging break';
  20849. }
  20850. if (gfmsIdx == 2) {
  20851. gfmc = 'Frost Lock';
  20852. }
  20853. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20854. console.log('zh:logEventForRod_win level = ' + level);
  20855. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20856. let jsonStr = {
  20857. "count": 1,
  20858. "name": gfmc + ' Lev' + level
  20859. };
  20860. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20861. const d = LocalStorageManager.getItem(keyStr);
  20862. jsonStr.count = d.count + 1;
  20863. LocalStorageManager.setItem(keyStr, jsonStr);
  20864. }
  20865. else {
  20866. LocalStorageManager.setItem(keyStr, jsonStr);
  20867. }
  20868. const reqStr = JSON.stringify(jsonStr);
  20869. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20870. }
  20871. logEventForClassic_win() {
  20872. console.log('zh:logEventForClassic_win,胜利');
  20873. let rtype = xGame.common.classicRoomType;
  20874. let msmc = '';
  20875. if (rtype == 1) {
  20876. msmc = 'beginner';
  20877. }
  20878. if (rtype == 2) {
  20879. msmc = 'expert';
  20880. }
  20881. if (rtype == 3) {
  20882. msmc = 'master';
  20883. }
  20884. let keyStr = 'sjmd_classic_win_' + rtype;
  20885. let jsonStr = {
  20886. "difficulty": msmc,
  20887. "classic_count": 1,
  20888. "difficulty_count": 1
  20889. };
  20890. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20891. const d = LocalStorageManager.getItem(keyStr);
  20892. jsonStr.classic_count = d.classic_count + 1;
  20893. jsonStr.difficulty_count = d.difficulty_count + 1;
  20894. LocalStorageManager.setItem(keyStr, jsonStr);
  20895. }
  20896. else {
  20897. LocalStorageManager.setItem(keyStr, jsonStr);
  20898. }
  20899. const reqStr = JSON.stringify(jsonStr);
  20900. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20901. }
  20902. logEventForClassic_complete() {
  20903. console.log('zh:logEventForClassic_complete,胜利');
  20904. let rtype = xGame.common.classicRoomType;
  20905. let msmc = '';
  20906. if (rtype == 1) {
  20907. msmc = 'beginner';
  20908. }
  20909. if (rtype == 2) {
  20910. msmc = 'expert';
  20911. }
  20912. if (rtype == 3) {
  20913. msmc = 'master';
  20914. }
  20915. let keyStr = 'sjmd_classic_complete_' + rtype;
  20916. let jsonStr = {
  20917. "msmc": msmc,
  20918. "count": 0
  20919. };
  20920. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20921. const d = LocalStorageManager.getItem(keyStr);
  20922. jsonStr.count = d.count + 1;
  20923. LocalStorageManager.setItem(keyStr, jsonStr);
  20924. }
  20925. else {
  20926. LocalStorageManager.setItem(keyStr, jsonStr);
  20927. }
  20928. if (jsonStr.count % 5 == 0) {
  20929. const reqStr = JSON.stringify(jsonStr);
  20930. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20931. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20932. }
  20933. }
  20934. updatePlaceBallBtn() {
  20935. this.ui.leftBtn.c1.selectedIndex = 5;
  20936. if (this.success) {
  20937. this.ui.rightBtn.c1.selectedIndex = 14;
  20938. }
  20939. else {
  20940. if (xGame.common.placeBallStarNum == 3) {
  20941. this.ui.rightBtn.c1.selectedIndex = 14;
  20942. }
  20943. else {
  20944. this.ui.rightBtn.c1.selectedIndex = 1;
  20945. }
  20946. }
  20947. }
  20948. updatePlaceBallStarNum() {
  20949. let starNum = xGame.common.placeBallStarNum;
  20950. if (starNum == 0)
  20951. this.ui.starNumNode.c1.selectedIndex = 3;
  20952. else {
  20953. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20954. }
  20955. }
  20956. updatePlaceBallAwardState() {
  20957. let level = xGame.common.placeBallCurLevel;
  20958. let starNum = xGame.common.placeBallStarNum;
  20959. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20960. let data = cfgTable.placeballData[level].award;
  20961. let cfg = cfgTable.placeballData[level];
  20962. this.awardDiamondNum = data[1];
  20963. this.awardCoinNum = data[0];
  20964. if (cfg.type == PlaceBallType.challenge) {
  20965. this.awardDiamondNum = 0;
  20966. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20967. }
  20968. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20969. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20970. if (cfg.type == PlaceBallType.challenge) {
  20971. this.ui.awardNode.coinNode.visible = true;
  20972. }
  20973. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20974. this.ui.awardNode.diamondNode.x = 265;
  20975. this.ui.awardNode.coinNode.x = 354;
  20976. }
  20977. else {
  20978. this.ui.awardNode.diamondNode.x = 291;
  20979. this.ui.awardNode.coinNode.x = 291;
  20980. }
  20981. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20982. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20983. if (this.awardCoinNum == 0) {
  20984. this.ui.awardNode.coinNode.numTxt.text = "";
  20985. }
  20986. if (getAward) {
  20987. this.ui.isGetAward.visible = true;
  20988. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  20989. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  20990. }
  20991. else {
  20992. this.ui.isGetAward.visible = false;
  20993. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  20994. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  20995. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  20996. }
  20997. else {
  20998. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  20999. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  21000. }
  21001. }
  21002. }
  21003. show(success) {
  21004. super.show();
  21005. xGame.eventMgr.event(RESET_GAME);
  21006. this.success = success;
  21007. Laya.timer.clearAll(this);
  21008. this.playSecretaryAni();
  21009. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  21010. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  21011. offsetTime = Math.floor(offsetTime / 1000);
  21012. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  21013. this.updateType();
  21014. Laya.timer.once(200, this, () => {
  21015. this.addAward(() => {
  21016. this.updateType();
  21017. Laya.timer.once(500, this, () => {
  21018. this.showChallengeLevel();
  21019. });
  21020. });
  21021. });
  21022. if (this.success) {
  21023. JSBridgeUtils.instance.showInternAd('gameend_success');
  21024. console.log('zh:game end 成功');
  21025. xGame.soundMgr.playSound('slots_roll01');
  21026. xGame.soundMgr.playSound("s_win");
  21027. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21028. this.diyGameDataUtilForGameWin();
  21029. this.updateGamePlaceBallData2Server();
  21030. }
  21031. else {
  21032. JSBridgeUtils.instance.showInternAd('gameend_faill');
  21033. console.log('zh:game end失败');
  21034. xGame.soundMgr.playSound('matchwin01');
  21035. xGame.soundMgr.playSound("s_lose");
  21036. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21037. }
  21038. let challengeNum = DataMgr.getChallengeTimes();
  21039. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  21040. DataMgr.setChallengeTimes(1);
  21041. }
  21042. if (this.success && xGame.common.gameMode == GameMode.classic) {
  21043. DataMgr.setClassicTimes();
  21044. }
  21045. this.setGlobalFont(this.ui);
  21046. }
  21047. diyGameDataUtilForGameWin() {
  21048. console.log('zh: DiyGameDataUtilForGameWin diy ');
  21049. switch (xGame.common.gameMode) {
  21050. case GameMode.classic:
  21051. console.log('zh:DiyGameDataUtilForGameWin 111');
  21052. case GameMode.bigMove:
  21053. console.log('zh:DiyGameDataUtilForGameWin 222');
  21054. this.restartGame();
  21055. break;
  21056. case GameMode.placeBall:
  21057. console.log('zh:DiyGameDataUtilForGameWin 333');
  21058. var level = xGame.common.placeBallCurLevel;
  21059. console.log('zh:练习模式 联系了多少LEV=' + level);
  21060. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21061. if (level > db_over_lev) {
  21062. DataMgr.setChallengeMode_overLev(level);
  21063. }
  21064. break;
  21065. default:
  21066. console.log('zh:DiyGameDataUtilForGameWin 444');
  21067. break;
  21068. }
  21069. }
  21070. updateGamePlaceBallData2Server() {
  21071. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  21072. if (userInfo == null) {
  21073. return;
  21074. }
  21075. let pbdObj = DataMgr.getPlaceBallLevelList();
  21076. let reqData = xGame.httpMgr.getReqData();
  21077. let pd = JSON.parse(reqData);
  21078. pd.placeBallData = JSON.stringify(pbdObj);
  21079. reqData = JSON.stringify(pd);
  21080. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  21081. try {
  21082. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  21083. let code = res.code;
  21084. let msg = res.msg;
  21085. if (code == 401) {
  21086. Laya.LocalStorage.removeItem(keyForLoginInfo);
  21087. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  21088. return;
  21089. }
  21090. if (code == 200) {
  21091. let data = res.data;
  21092. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  21093. }
  21094. else {
  21095. xGame.uiMgr.Show(UIMsg$1, msg);
  21096. }
  21097. }
  21098. catch (error) {
  21099. console.log('error=' + error);
  21100. alert(error);
  21101. }
  21102. finally {
  21103. }
  21104. });
  21105. }
  21106. showChallengeLevel() {
  21107. if (DataMgr.getChallengeTimes() != 0)
  21108. return;
  21109. let skill = DataMgr.getSkillAccTimes();
  21110. let put = DataMgr.getPlaceBallLevelList().length;
  21111. if (skill >= 3 || put >= 5) {
  21112. xGame.uiMgr.Show(UIInvitation$1);
  21113. this.hide();
  21114. }
  21115. }
  21116. addAward(callback) {
  21117. if (!this.success) {
  21118. callback && callback();
  21119. return;
  21120. }
  21121. switch (xGame.common.gameMode) {
  21122. case GameMode.classic:
  21123. this.awardCoinNum = xGame.common.passAwardCoin;
  21124. this.awardDiamondNum = 0;
  21125. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21126. break;
  21127. case GameMode.bigMove:
  21128. this.awardCoinNum = xGame.common.passAwardCoin;
  21129. this.awardDiamondNum = 0;
  21130. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21131. callback && callback();
  21132. break;
  21133. case GameMode.placeBall:
  21134. let level = xGame.common.placeBallCurLevel;
  21135. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  21136. if (xGame.common.placeBallStarNum != 3) {
  21137. callback && callback();
  21138. return;
  21139. }
  21140. else {
  21141. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21142. if (getAward) {
  21143. callback && callback();
  21144. return;
  21145. }
  21146. }
  21147. let cfg = cfgTable.placeballData[level];
  21148. let data = cfgTable.placeballData[level].award;
  21149. this.awardCoinNum = data[0];
  21150. this.awardDiamondNum = data[1];
  21151. if (cfg.type == PlaceBallType.challenge) {
  21152. this.awardDiamondNum = 0;
  21153. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21154. }
  21155. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  21156. let diamondAward;
  21157. if (this.awardDiamondNum > 0) {
  21158. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  21159. xGame.common.getAward([diamondAward, coinAward], callback);
  21160. }
  21161. else {
  21162. xGame.common.getAward([coinAward], callback);
  21163. }
  21164. if (cfg.type == PlaceBallType.normal) {
  21165. DataMgr.setPlaceBallAward(level);
  21166. }
  21167. break;
  21168. default:
  21169. break;
  21170. }
  21171. }
  21172. playSecretaryAni_old() {
  21173. let parent = this.ui.secretary.displayObject;
  21174. parent.destroyChildren();
  21175. let xx = this.ui.secretary.width / 2;
  21176. let yy = this.ui.secretary.height;
  21177. let scale = xGame.common.getSecretaryScale();
  21178. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21179. if (this.success) {
  21180. let rand = Math.random() <= 0.5 ? 2 : 3;
  21181. xGame.common.secretary.play(data, rand, false, parent, () => {
  21182. xGame.common.secretary.play(data, 1, true, parent);
  21183. });
  21184. }
  21185. else {
  21186. xGame.common.secretary.play(data, 0, true, parent);
  21187. }
  21188. }
  21189. playSecretaryAni() {
  21190. let parent = this.ui.secretary.displayObject;
  21191. parent.destroyChildren();
  21192. let xx = this.ui.secretary.width / 2;
  21193. let yy = this.ui.secretary.height;
  21194. let scale = xGame.common.getSecretaryScale();
  21195. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21196. if (this.success) {
  21197. let rand = 0;
  21198. xGame.common.secretary.play(data, 0, true, parent);
  21199. }
  21200. else {
  21201. xGame.common.secretary.play(data, 0, true, parent);
  21202. }
  21203. }
  21204. restartGame() {
  21205. switch (xGame.common.gameMode) {
  21206. case GameMode.classic:
  21207. xGame.eventMgr.event(RESTART_GAME);
  21208. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21209. break;
  21210. case GameMode.bigMove:
  21211. this.hide();
  21212. xGame.eventMgr.event(RESTART_GAME);
  21213. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21214. break;
  21215. default:
  21216. break;
  21217. }
  21218. }
  21219. hide() {
  21220. super.hide();
  21221. xGame.common.stopGirlPop(this.ui.talkNode);
  21222. PlatMgr.showBanner(false);
  21223. }
  21224. returnHome() {
  21225. this.hide();
  21226. let showFailWords = !this.success;
  21227. xGame.uiMgr.Show(UIMain$1, showFailWords);
  21228. }
  21229. clickLeftBtn() {
  21230. switch (xGame.common.gameMode) {
  21231. case GameMode.classic:
  21232. case GameMode.bigMove:
  21233. this.returnHome();
  21234. break;
  21235. case GameMode.placeBall:
  21236. let level = xGame.common.placeBallCurLevel;
  21237. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  21238. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21239. break;
  21240. default:
  21241. break;
  21242. }
  21243. }
  21244. powerStartPlaceBallLevel(level, btn) {
  21245. if (DataMgr.powerEnough()) {
  21246. btn.touchable = false;
  21247. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21248. btn.touchable = true;
  21249. DataMgr.setPower(-1);
  21250. xGame.eventMgr.event(POWER_TIME);
  21251. this.startPlaceBallLevel(level);
  21252. this.logEventForChallenge_level_start(level);
  21253. }));
  21254. }
  21255. else {
  21256. xGame.uiMgr.Show(UIPower$1, 0);
  21257. }
  21258. }
  21259. clickRightBtn() {
  21260. switch (xGame.common.gameMode) {
  21261. case GameMode.classic:
  21262. console.log('zh:clickRightBtn 111');
  21263. case GameMode.bigMove:
  21264. console.log('zh:clickRightBtn 222');
  21265. this.restartGame();
  21266. break;
  21267. case GameMode.placeBall:
  21268. console.log('zh:clickRightBtn 333');
  21269. let level = xGame.common.placeBallCurLevel;
  21270. let data = DataMgr.getPlaceBallLevel(level);
  21271. let curPss = data.play && !data.isCur;
  21272. if (curPss) {
  21273. console.log('zh:clickRightBtn 333-111');
  21274. console.log('zh:当前LV=' + level);
  21275. if (level == 60) {
  21276. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21277. Laya.timer.once(3000, this, () => {
  21278. this.returnHome();
  21279. });
  21280. }
  21281. else {
  21282. let lev = level + 1;
  21283. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21284. }
  21285. }
  21286. else {
  21287. console.log('zh:clickRightBtn 333-000');
  21288. Moyu.sendDataEvent("placeBallNextLevel");
  21289. console.log('zh:qjff_AD_for_uiGameEnd');
  21290. if (Laya.Browser.onAndroid) {
  21291. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21292. if (!boo) {
  21293. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21294. return;
  21295. }
  21296. }
  21297. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21298. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21299. }
  21300. else {
  21301. console.log('zh:AD 失败,直接发放奖励');
  21302. this.qjff_AD_for_uiGameEnd(level);
  21303. }
  21304. }
  21305. break;
  21306. default:
  21307. console.log('zh:clickRightBtn 444');
  21308. break;
  21309. }
  21310. }
  21311. logEventForChallenge_level_start(level) {
  21312. let keyStr = 'sjmd_challenge_level_start';
  21313. let jsonStr = {
  21314. "count": 0,
  21315. "gold_balance ": DataMgr.getCoin(),
  21316. "level": level,
  21317. "diamond_balance ": DataMgr.getDiamond()
  21318. };
  21319. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21320. const d = LocalStorageManager.getItem(keyStr);
  21321. if (level > d.level) {
  21322. jsonStr.count = d.count + 1;
  21323. LocalStorageManager.setItem(keyStr, jsonStr);
  21324. }
  21325. else {
  21326. }
  21327. }
  21328. else {
  21329. LocalStorageManager.setItem(keyStr, jsonStr);
  21330. }
  21331. const reqStr = JSON.stringify(jsonStr);
  21332. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21333. }
  21334. qjff_AD_for_uiGameEnd(level) {
  21335. DataMgr.setPlaceBallLevel(level, 1);
  21336. this.startPlaceBallLevel(level + 1);
  21337. }
  21338. startPlaceBallLevel(level) {
  21339. xGame.common.gameMode = GameMode.placeBall;
  21340. xGame.common.placeBallCurLevel = level;
  21341. xGame.uiMgr.Show(UIGame$1);
  21342. this.hide();
  21343. }
  21344. logEventForChallenge_level_complete(level) {
  21345. let keyStr = 'sjmd_challenge_level_complete';
  21346. let jsonStr = {
  21347. "count": 1,
  21348. "gold_balance ": DataMgr.getCoin(),
  21349. "level": level,
  21350. "diamond_balance ": DataMgr.getDiamond()
  21351. };
  21352. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21353. const d = LocalStorageManager.getItem(keyStr);
  21354. jsonStr.count = d.count + 1;
  21355. LocalStorageManager.setItem(keyStr, jsonStr);
  21356. }
  21357. else {
  21358. LocalStorageManager.setItem(keyStr, jsonStr);
  21359. }
  21360. const reqStr = JSON.stringify(jsonStr);
  21361. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21362. }
  21363. logEventForChallenge_level_N(level) {
  21364. console.log('zh:logEventForChallenge_level_N ' + level);
  21365. let keyStr = 'sjmd_challenge_level_N';
  21366. if (LocalStorageManager.hasKey(keyStr)) {
  21367. let lev = LocalStorageManager.getItem(keyStr);
  21368. if (level > lev) {
  21369. LocalStorageManager.setItem(keyStr, level);
  21370. }
  21371. if ((level) % 5 == 0) {
  21372. console.log('zh:每5关上报1次');
  21373. let sjmc = 'challenge_level_' + level;
  21374. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21375. let sjmcForFirebase = 'challenge_level_' + level;
  21376. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21377. }
  21378. else {
  21379. console.log('zh:5 no 上报');
  21380. }
  21381. }
  21382. else {
  21383. LocalStorageManager.setItem(keyStr, level);
  21384. }
  21385. }
  21386. }
  21387. UIGameEnd$1.uiName = "UIGameEnd";
  21388. class ShowItem$1 {
  21389. constructor() {
  21390. this.ui = ui_ShowItem.createInstance();
  21391. }
  21392. destroySelf() {
  21393. if (!this.ui.isDisposed) {
  21394. this.ui.removeFromParent();
  21395. this.ui.dispose();
  21396. }
  21397. }
  21398. setParent(parent) {
  21399. parent.addChild(this.ui);
  21400. }
  21401. setPos(x, y) {
  21402. this.ui.x = x;
  21403. this.ui.y = y;
  21404. }
  21405. setUrl(index) {
  21406. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21407. }
  21408. }
  21409. class UILevelProp$1 extends UIBase {
  21410. constructor() {
  21411. super();
  21412. this.firstPos = 385;
  21413. this.secondPos = 467;
  21414. this.showItemArr = [];
  21415. }
  21416. onConstructor() {
  21417. this.ui = ui_UILevelProp.createInstance();
  21418. this.contentPane = this.ui;
  21419. this.isEject = false;
  21420. this.addUIClick(this.ui.closeBtn, this.hide);
  21421. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21422. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21423. }
  21424. show(level) {
  21425. super.show();
  21426. this.ui.t1.play();
  21427. this.level = level;
  21428. this.data = cfgTable.placeballData[this.level];
  21429. this.updateSelf();
  21430. this.showPreView();
  21431. this.moneyNode.ui.c1.selectedIndex = 2;
  21432. this.moneyNode.checkPowerTime();
  21433. this.moneyNode.powerChange();
  21434. this.setGlobalFont(this.ui);
  21435. }
  21436. showPreView() {
  21437. let item;
  21438. let data;
  21439. for (let index = 0; index < this.showItemArr.length; index++) {
  21440. item = this.showItemArr[index];
  21441. item.destroySelf();
  21442. }
  21443. this.showItemArr = [];
  21444. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21445. for (const key in cfgData) {
  21446. data = cfgData[key];
  21447. item = new ShowItem$1();
  21448. item.setParent(this.ui.myNode.displayRoot);
  21449. item.setPos(data.x, data.y);
  21450. item.setUrl(data.value);
  21451. this.showItemArr.push(item);
  21452. }
  21453. }
  21454. updateSelf() {
  21455. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21456. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21457. if (this.data.ball == -1) {
  21458. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21459. }
  21460. else {
  21461. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21462. }
  21463. let localData = DataMgr.getPlaceBallLevel(this.level);
  21464. let getAward = localData.getAward;
  21465. let cfg = cfgTable.placeballData[this.level];
  21466. let coin = this.data.award[0];
  21467. let diamond = this.data.award[1];
  21468. if (cfg.type == PlaceBallType.challenge) {
  21469. diamond = 0;
  21470. coin = 100;
  21471. }
  21472. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21473. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21474. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21475. if (cfg.type == PlaceBallType.challenge) {
  21476. this.ui.myNode.coinNode.numTxt.text = "";
  21477. }
  21478. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21479. if (coin > 0 && diamond > 0) {
  21480. this.ui.myNode.diamondNode.x = 385;
  21481. this.ui.myNode.coinNode.x = 467;
  21482. }
  21483. else {
  21484. this.ui.myNode.diamondNode.x = 385;
  21485. this.ui.myNode.coinNode.x = 385;
  21486. }
  21487. if (!getAward) {
  21488. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21489. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21490. }
  21491. else {
  21492. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21493. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21494. }
  21495. }
  21496. startGame() {
  21497. if (DataMgr.powerEnough()) {
  21498. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21499. this.ui.myNode.startBtn.touchable = false;
  21500. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21501. console.log('zh:startGame ');
  21502. this.ui.myNode.startBtn.touchable = true;
  21503. DataMgr.setPower(-1);
  21504. xGame.eventMgr.event(POWER_TIME);
  21505. xGame.common.gameMode = GameMode.placeBall;
  21506. xGame.common.placeBallCurLevel = this.level;
  21507. xGame.uiMgr.Show(UIGame$1);
  21508. this.logEventForChallenge_level_start(this.level);
  21509. xGame.uiMgr.Hide(UILevelDisplay$1);
  21510. xGame.uiMgr.Hide(UIMain$1);
  21511. this.hide();
  21512. }));
  21513. }
  21514. else {
  21515. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  21516. xGame.uiMgr.Show(UIPower$1);
  21517. }
  21518. }
  21519. logEventForChallenge_level_start(level) {
  21520. let keyStr = 'sjmd_challenge_level_start';
  21521. let jsonStr = {
  21522. "count": 1,
  21523. "gold_balance ": DataMgr.getCoin(),
  21524. "level": level,
  21525. "diamond_balance ": DataMgr.getDiamond()
  21526. };
  21527. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21528. const d = LocalStorageManager.getItem(keyStr);
  21529. if (level > d.level) {
  21530. jsonStr.count = d.count + 1;
  21531. LocalStorageManager.setItem(keyStr, jsonStr);
  21532. }
  21533. else {
  21534. }
  21535. }
  21536. else {
  21537. LocalStorageManager.setItem(keyStr, jsonStr);
  21538. }
  21539. const reqStr = JSON.stringify(jsonStr);
  21540. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21541. }
  21542. hide() {
  21543. super.hide();
  21544. }
  21545. }
  21546. UILevelProp$1.uiName = "UILevelProp";
  21547. class PutBallLevelDisplay$1 {
  21548. constructor(ui, index) {
  21549. this.index = 0;
  21550. this.ui = ui;
  21551. this.index = index;
  21552. this.ui.onClick(this, this.clickSelf);
  21553. this.updateSelf();
  21554. this.ui.levelTxt.text = (this.index + 1) + "";
  21555. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21556. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21557. }
  21558. updateSelf() {
  21559. let level = this.index + 1;
  21560. this.data = DataMgr.getPlaceBallLevel(level);
  21561. this.ui.starNode.c1.selectedIndex = this.data.star;
  21562. let isChallenge = cfgTable.placeballData[level].type;
  21563. if (this.data.isCur) {
  21564. if (isChallenge) {
  21565. this.ui.c1.selectedIndex = 5;
  21566. }
  21567. else {
  21568. this.ui.c1.selectedIndex = 2;
  21569. }
  21570. }
  21571. else {
  21572. if (this.data.play) {
  21573. if (this.data.star == 3) {
  21574. this.ui.c1.selectedIndex = 0;
  21575. }
  21576. else {
  21577. this.ui.c1.selectedIndex = 1;
  21578. }
  21579. }
  21580. else {
  21581. if (isChallenge) {
  21582. this.ui.c1.selectedIndex = 4;
  21583. }
  21584. else {
  21585. this.ui.c1.selectedIndex = 3;
  21586. }
  21587. }
  21588. }
  21589. }
  21590. clickSelf() {
  21591. if (!this.data.play)
  21592. return;
  21593. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21594. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21595. }
  21596. }
  21597. class UILevelDisplay$1 extends UIBase {
  21598. constructor() {
  21599. super();
  21600. }
  21601. onConstructor() {
  21602. this.ui = ui_UILevelDisplay.createInstance();
  21603. this.contentPane = this.ui;
  21604. this.isEject = false;
  21605. this.myList = this.ui.myNode.myList;
  21606. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21607. this.levelItemArr = [];
  21608. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21609. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21610. this.myList.numItems = levelNum;
  21611. }
  21612. levelItemRender(index, target) {
  21613. let item = new PutBallLevelDisplay$1(target, index);
  21614. this.levelItemArr.push(item);
  21615. }
  21616. show() {
  21617. super.show();
  21618. this.updateLevel();
  21619. this.scrollToPlace();
  21620. this.setGlobalFont(this.ui);
  21621. }
  21622. updateLevel() {
  21623. let temp;
  21624. for (let index = 0; index < this.levelItemArr.length; index++) {
  21625. temp = this.levelItemArr[index];
  21626. temp.updateSelf();
  21627. }
  21628. }
  21629. scrollToPlace() {
  21630. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21631. let passArr = DataMgr.getPlaceBallLevelList();
  21632. let offest = passArr.length;
  21633. if (offest >= maxNum - 1)
  21634. offest = maxNum - 1;
  21635. this.myList.scrollToView(offest, true, true);
  21636. }
  21637. hide() {
  21638. super.hide();
  21639. }
  21640. }
  21641. UILevelDisplay$1.uiName = "UILevelDisplay";
  21642. class UIMatching$1 extends UIBase {
  21643. constructor() {
  21644. super();
  21645. }
  21646. onConstructor() {
  21647. this.ui = ui_UIMatching.createInstance();
  21648. this.contentPane = this.ui;
  21649. this.isEject = false;
  21650. }
  21651. show(callback) {
  21652. super.show();
  21653. PlatMgr.showBanner(true);
  21654. this.callback = callback;
  21655. let user = Moyu.getUserInfo();
  21656. if (!this.selfPot) {
  21657. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21658. }
  21659. if (!this.aiPot) {
  21660. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21661. }
  21662. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21663. this.ui.selfHead.nameTxt.text = user.nickName;
  21664. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21665. this.ui.aiHead.nameTxt.text = "???";
  21666. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21667. this.ui.selfHead.c1.selectedIndex = 0;
  21668. this.ui.aiHead.c1.selectedIndex = 0;
  21669. this.ui.selfHead.x = this.selfPot.x;
  21670. this.ui.selfHead.y = this.selfPot.y;
  21671. this.ui.aiHead.x = this.aiPot.x;
  21672. this.ui.aiHead.y = this.aiPot.y;
  21673. switch (xGame.common.gameMode) {
  21674. case GameMode.classic:
  21675. break;
  21676. case GameMode.bigMove:
  21677. this.initSkillData();
  21678. break;
  21679. default:
  21680. break;
  21681. }
  21682. this.ui.t1.play(Laya.Handler.create(this, () => {
  21683. this.ui.t2.play(Laya.Handler.create(this, () => {
  21684. switch (xGame.common.gameMode) {
  21685. case GameMode.classic:
  21686. this.waitingPeople();
  21687. break;
  21688. case GameMode.bigMove:
  21689. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21690. break;
  21691. default:
  21692. break;
  21693. }
  21694. }));
  21695. }));
  21696. this.setGlobalFont(this.ui);
  21697. }
  21698. initSkillData() {
  21699. this.skillSelectData = [];
  21700. let skillUrl = xGame.common.skillIconList;
  21701. let skillName = xGame.common.skillNameList;
  21702. let skillLevel = DataMgr.getBigSkillList();
  21703. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21704. for (let index = 0; index < 5; index++) {
  21705. let obj = {};
  21706. obj.skillImg = skillUrl[index];
  21707. obj.skillName = skillName[index];
  21708. obj.skillType = skillType[index];
  21709. obj.skillLevel = skillLevel[index];
  21710. this.skillSelectData.push(obj);
  21711. }
  21712. }
  21713. getAISkillLevel(myLevel) {
  21714. let video = xGame.common.upSkillLevel;
  21715. let aiLevel;
  21716. let temp;
  21717. if (video) {
  21718. temp = xGame.common.randomNum(-2, -1);
  21719. }
  21720. else {
  21721. if (myLevel <= 5) {
  21722. temp = xGame.common.randomNum(1, 3);
  21723. }
  21724. else if (myLevel <= 9) {
  21725. temp = xGame.common.randomNum(-2, 1);
  21726. }
  21727. else {
  21728. temp = xGame.common.randomNum(-4, 0);
  21729. }
  21730. }
  21731. aiLevel = temp + myLevel;
  21732. if (aiLevel <= 1)
  21733. aiLevel = 1;
  21734. if (aiLevel >= 10)
  21735. aiLevel = 10;
  21736. return aiLevel;
  21737. }
  21738. getAISkillType() {
  21739. return xGame.common.randomNum(1, 4);
  21740. let successTimes = DataMgr.getSkillSuccessTimes();
  21741. let info = cfgTable.aiskillData[successTimes];
  21742. if (!info) {
  21743. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21744. info = cfgTable.aiskillData[max];
  21745. }
  21746. let dataArr = info.skillselect;
  21747. let myCfg = {};
  21748. for (let index = 0; index < dataArr.length; index++) {
  21749. let temp = dataArr[index].split('-');
  21750. myCfg[temp[0]] = {};
  21751. myCfg[temp[0]].id = parseInt(temp[0]);
  21752. myCfg[temp[0]].weight = parseInt(temp[1]);
  21753. }
  21754. let aiCfg = xGame.common.initWeight(myCfg);
  21755. let curData = xGame.common.getRandomWeightData(aiCfg);
  21756. return parseInt(curData.id);
  21757. }
  21758. getAISkillData(index) {
  21759. let myLevel = this.skillSelectData[index].skillLevel;
  21760. let aiLevel = this.getAISkillLevel(myLevel);
  21761. let aiType = this.getAISkillType() - 1;
  21762. return { aiLevel, aiType } = { aiLevel, aiType };
  21763. }
  21764. skillSelectFinish(index) {
  21765. let aiInfo = this.getAISkillData(index);
  21766. xGame.common.gameMgr.selfCurSkill = index;
  21767. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21768. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21769. this.ui.selfHead.c1.selectedIndex = 1;
  21770. this.ui.aiHead.c1.selectedIndex = 1;
  21771. let myData = this.skillSelectData[index];
  21772. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21773. let guide = DataMgr.getSkillGuide();
  21774. if (guide == 0) {
  21775. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21776. }
  21777. else {
  21778. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21779. }
  21780. let aiData = this.skillSelectData[aiInfo.aiType];
  21781. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21782. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21783. this.waitingPeople();
  21784. }
  21785. waitingPeople() {
  21786. let time = xGame.common.randomNum(1000, 3000);
  21787. time += 1000;
  21788. Laya.timer.once(time, this, () => {
  21789. this.matchingSuccess();
  21790. });
  21791. }
  21792. matchingSuccess() {
  21793. let gameUI = xGame.common.gameUI;
  21794. let name = gameUI.ui.topNode.aiNameTxt.text;
  21795. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21796. this.ui.aiHead.nameTxt.text = name;
  21797. this.ui.aiHead.headImg.url = url;
  21798. name = gameUI.ui.topNode.selfNameTxt.text;
  21799. url = gameUI.ui.topNode.selfHeadLoader.url;
  21800. this.ui.selfHead.nameTxt.text = name;
  21801. this.ui.selfHead.headImg.url = url;
  21802. this.ui.t3.play(Laya.Handler.create(this, () => {
  21803. this.callback && this.callback();
  21804. this.ui.t4.play(Laya.Handler.create(this, () => {
  21805. this.destroySelf();
  21806. }));
  21807. }));
  21808. }
  21809. destroySelf() {
  21810. this.callback = null;
  21811. this.skillSelectData = null;
  21812. this.selfPot = null;
  21813. this.aiPot = null;
  21814. if (!this.ui.isDisposed) {
  21815. this.ui.removeFromParent();
  21816. this.ui.dispose();
  21817. }
  21818. xGame.uiMgr.destroyUI(this);
  21819. }
  21820. }
  21821. UIMatching$1.uiName = "UIMatching";
  21822. class SkillDisplay$1 {
  21823. constructor(ui, data, uiIndex) {
  21824. this.starX = 0;
  21825. this.starY = 0;
  21826. this.index = 0;
  21827. this.ui = ui;
  21828. this.data = data;
  21829. this.index = uiIndex;
  21830. this.initSelf();
  21831. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21832. }
  21833. initSelf() {
  21834. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21835. this.ui.nameTxt.text = this.data.name;
  21836. this.ui.describeTxt.text = this.data.describe;
  21837. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21838. this.ui.startBtn.onClick(this, this.startGame);
  21839. this.updateSelf();
  21840. }
  21841. updateSelf() {
  21842. this.checkTry();
  21843. let level = DataMgr.getBigSkillByIndex(this.index);
  21844. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21845. }
  21846. checkTry() {
  21847. let index = this.index;
  21848. let level = DataMgr.getBigSkillByIndex(index);
  21849. if (level == null) {
  21850. DataMgr.setBigSkill(index, 1, false);
  21851. level = 1;
  21852. }
  21853. this.ui.levelTxt.text = "LV." + level;
  21854. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21855. this.ui.tryNode.visible = true;
  21856. else
  21857. this.ui.tryNode.visible = false;
  21858. }
  21859. clickAddLevel() {
  21860. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21861. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21862. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21863. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21864. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21865. }
  21866. else {
  21867. console.log('zh:AD 失败,直接发放奖励');
  21868. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21869. }
  21870. }
  21871. qjff_AD_for_skilldisplay_clickAddLevel() {
  21872. DataMgr.setBigSkill(this.data.index, 1);
  21873. this.updateSelf();
  21874. xGame.common.upSkillLevel = true;
  21875. }
  21876. startGame() {
  21877. console.log('zh:rod skill startgame');
  21878. if (this.data.index == 3) {
  21879. alert('Coming soon!');
  21880. return;
  21881. }
  21882. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21883. let needCoin = xGame.common.bigMoveNeedCoin;
  21884. xGame.common.passAwardCoin = 2000;
  21885. let guide = DataMgr.getSkillGuide();
  21886. console.log('zh:startGame guide=' + guide);
  21887. xGame.common.temSelfLevel = 0;
  21888. if (guide == 0) {
  21889. needCoin = 0;
  21890. xGame.common.temSelfLevel = 100;
  21891. }
  21892. if (DataMgr.coinEnough(needCoin)) {
  21893. DataMgr.setCoin(-needCoin);
  21894. xGame.common.curPlayerSkillType = this.index;
  21895. if (guide == 0)
  21896. xGame.common.curPlayerSkillType = 0;
  21897. console.log('zh: skilldisplay 1');
  21898. xGame.uiMgr.Show(UIGame$1);
  21899. xGame.uiMgr.Hide(UIMain$1);
  21900. xGame.uiMgr.Show(UIMatching$1, () => {
  21901. xGame.common.gameUI.ui.alpha = 1;
  21902. xGame.common.gameUI.startGame();
  21903. xGame.uiMgr.Hide(UISkill$1);
  21904. });
  21905. this.logEventForRod_start();
  21906. }
  21907. else {
  21908. console.log('zh: skilldisplay 2');
  21909. xGame.uiMgr.Show(UIAddProp$1, 0);
  21910. Moyu.sendDataEvent("AddCoinVideo");
  21911. }
  21912. }
  21913. logEventForRod_start() {
  21914. let gfmsIdx = xGame.common.curPlayerSkillType;
  21915. console.log('zh:选择的技能=' + gfmsIdx);
  21916. let gfmc = 'Skyfall Shot';
  21917. if (gfmsIdx == 0) {
  21918. gfmc = 'Skyfall Shot';
  21919. }
  21920. if (gfmsIdx == 1) {
  21921. gfmc = 'Surging break';
  21922. }
  21923. if (gfmsIdx == 2) {
  21924. gfmc = 'Frost Lock';
  21925. }
  21926. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21927. let jsonStr = {
  21928. "count": 0,
  21929. "name": gfmc
  21930. };
  21931. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21932. const d = LocalStorageManager.getItem(keyStr);
  21933. jsonStr.count = d.count + 1;
  21934. LocalStorageManager.setItem(keyStr, jsonStr);
  21935. }
  21936. else {
  21937. LocalStorageManager.setItem(keyStr, jsonStr);
  21938. }
  21939. const reqStr = JSON.stringify(jsonStr);
  21940. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21941. }
  21942. }
  21943. class UISkill$1 extends UIBase {
  21944. constructor() {
  21945. super();
  21946. this.skillData = [];
  21947. }
  21948. onConstructor() {
  21949. this.ui = ui_UISkill.createInstance();
  21950. this.contentPane = this.ui;
  21951. this.isEject = false;
  21952. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21953. this.initSkillData();
  21954. console.log('zh:aaaaaa1111111111');
  21955. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21956. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21957. console.log('zh:aaaaaa22222222');
  21958. this.displayList = [];
  21959. this.ui.skillNode.skillList.numItems = 3;
  21960. this.addUIClick(this.ui, this.interuptSecretary);
  21961. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21962. this.ui.talkNode.visible = false;
  21963. if (Moyu.isKs)
  21964. this.ui.closeNode.closeBtn.x += 100;
  21965. }
  21966. show() {
  21967. super.show();
  21968. this.playSecretaryIdle();
  21969. this.moneyNode.ui.c1.selectedIndex = 1;
  21970. Laya.timer.clearAll(this);
  21971. xGame.soundMgr.playSound("s_start");
  21972. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21973. let guide = DataMgr.getSkillGuide();
  21974. this.ui.guideNode.visible = guide == 0;
  21975. let item = this.getSkillItemByUIIndex(0);
  21976. if (guide == 0) {
  21977. item.ui.c1.selectedIndex = 1;
  21978. }
  21979. else {
  21980. item.ui.c1.selectedIndex = 0;
  21981. }
  21982. this.ui.guideNode.guideBtn.visible = guide == 0;
  21983. for (let index = 0; index < this.displayList.length; index++) {
  21984. this.displayList[index].checkTry();
  21985. }
  21986. this.setGlobalFont(this.ui);
  21987. }
  21988. getSkillItemByUIIndex(cur) {
  21989. for (let index = 0; index < this.displayList.length; index++) {
  21990. if (this.displayList[index].index == cur) {
  21991. return this.displayList[index];
  21992. }
  21993. }
  21994. }
  21995. enterGuideLevel() {
  21996. let item = this.getSkillItemByUIIndex(0);
  21997. item.startGame();
  21998. if (DataMgr.getNewUser())
  21999. Moyu.sendDataEvent("gameStart1");
  22000. }
  22001. initSkillData() {
  22002. this.skillData = [];
  22003. let nameList = xGame.common.skillNameList;
  22004. let iconList = xGame.common.skillIconList;
  22005. let describeList = [
  22006. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  22007. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  22008. "The power of frost descends—freezing the flow and taking full control of the game!"
  22009. ];
  22010. console.log('zh:initSkillData 111111111');
  22011. let data;
  22012. for (let index = 0; index < nameList.length; index++) {
  22013. data = {};
  22014. data.name = nameList[index];
  22015. data.icon = iconList[index];
  22016. data.describe = describeList[index];
  22017. data.index = index;
  22018. this.skillData.push(data);
  22019. }
  22020. }
  22021. updateSkillItem(index, target) {
  22022. if (this.displayList[index] == null) {
  22023. let uiIndex;
  22024. switch (index) {
  22025. case 0:
  22026. uiIndex = 1;
  22027. break;
  22028. case 1:
  22029. uiIndex = 0;
  22030. break;
  22031. case 2:
  22032. uiIndex = 2;
  22033. break;
  22034. case 3:
  22035. uiIndex = 3;
  22036. break;
  22037. default:
  22038. break;
  22039. }
  22040. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  22041. this.displayList.push(temp);
  22042. }
  22043. }
  22044. playSecretaryIdle() {
  22045. let parent = this.ui.secretary.displayObject;
  22046. parent.destroyChildren();
  22047. let xx = this.ui.secretary.width / 2;
  22048. let yy = this.ui.secretary.height;
  22049. let scale = xGame.common.getSecretaryScale();
  22050. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22051. xGame.common.secretary.play(data, 0, true, parent);
  22052. }
  22053. returnUIMain() {
  22054. this.hide();
  22055. xGame.common.stopGirlPop(this.ui.talkNode);
  22056. xGame.uiMgr.Show(UIMain$1);
  22057. }
  22058. interuptSecretary() {
  22059. Laya.timer.clearAll(this);
  22060. this.playSecretaryRandomSound();
  22061. }
  22062. playSecretaryRandomSound() {
  22063. if (this.isHide)
  22064. return;
  22065. let time = xGame.common.randomNum(45000, 60000);
  22066. Laya.timer.once(time, this, () => {
  22067. if (this.isHide)
  22068. return;
  22069. let index = xGame.common.randomNum(4, 7);
  22070. xGame.soundMgr.playSound("s_main0" + index);
  22071. let words = 1;
  22072. switch (index) {
  22073. case 4:
  22074. words = 5;
  22075. break;
  22076. case 5:
  22077. words = 3;
  22078. break;
  22079. case 6:
  22080. words = 6;
  22081. break;
  22082. case 7:
  22083. words = 7;
  22084. break;
  22085. default:
  22086. break;
  22087. }
  22088. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22089. this.playSecretaryRandomSound();
  22090. });
  22091. }
  22092. }
  22093. UISkill$1.uiName = "UISkill";
  22094. class UIAddProp$1 extends UIBase {
  22095. constructor() {
  22096. super();
  22097. this.curType = "";
  22098. }
  22099. onConstructor() {
  22100. this.ui = ui_UIAddProp.createInstance();
  22101. this.contentPane = this.ui;
  22102. this.isEject = false;
  22103. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22104. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  22105. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  22106. this.updateUI();
  22107. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  22108. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  22109. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  22110. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  22111. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  22112. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  22113. }
  22114. show(type) {
  22115. super.show();
  22116. this.curType = type == 0 ? "coin" : "diamond";
  22117. this.switchBtn("");
  22118. this.ui.t0.play();
  22119. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  22120. PlatMgr.showInsert(true);
  22121. this.setGlobalFont(this.ui);
  22122. }
  22123. closeSelf() {
  22124. this.hide();
  22125. }
  22126. updateUI() {
  22127. let data = cfgTable.moneyData;
  22128. let temp;
  22129. let obj;
  22130. for (const key in data) {
  22131. temp = data[key];
  22132. obj = this.ui.myNode["node" + key];
  22133. if (parseInt(key) <= 2) {
  22134. obj.diamondTxt.text = "+" + temp.num;
  22135. }
  22136. else {
  22137. obj.coinTxt.text = temp.num;
  22138. obj.diamondTxt.text = temp.get.split('_')[1];
  22139. }
  22140. }
  22141. this.updateDiamondShare();
  22142. }
  22143. updateDiamondShare() {
  22144. let data = DataMgr.getShareDiamondTimes();
  22145. if (data >= xGame.common.maxShareDiamondTimes) {
  22146. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  22147. this.ui.myNode.node1.touchable = false;
  22148. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22149. }
  22150. else {
  22151. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  22152. this.ui.myNode.node1.touchable = true;
  22153. }
  22154. }
  22155. switchBtn(type) {
  22156. if (type == "")
  22157. type = this.curType;
  22158. else {
  22159. if (this.curType == type) {
  22160. return;
  22161. }
  22162. else {
  22163. this.curType = type;
  22164. }
  22165. }
  22166. if (type == "coin") {
  22167. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  22168. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  22169. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  22170. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  22171. this.ui.myNode.c1.selectedIndex = 0;
  22172. }
  22173. else {
  22174. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  22175. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  22176. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  22177. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  22178. this.ui.myNode.c1.selectedIndex = 1;
  22179. }
  22180. }
  22181. convertCoin(index) {
  22182. let data = cfgTable.moneyData[index];
  22183. let coinNum = data.num;
  22184. let str = data.get.split('_')[1];
  22185. let needDiamond = parseInt(str);
  22186. if (DataMgr.diamondEnough(needDiamond)) {
  22187. DataMgr.setDiamond(-needDiamond);
  22188. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  22189. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  22190. }
  22191. else {
  22192. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  22193. this.switchBtn("diamond");
  22194. }
  22195. }
  22196. videoGetDiamond() {
  22197. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  22198. if (Laya.Browser.onAndroid) {
  22199. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22200. if (!boo) {
  22201. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22202. return;
  22203. }
  22204. }
  22205. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  22206. }
  22207. else {
  22208. console.log('zh:AD 失败,直接发放奖励');
  22209. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  22210. }
  22211. }
  22212. qjff_AD_for_uiAddProp_videoGetDiamond() {
  22213. let num = cfgTable.moneyData[2].num;
  22214. xGame.common.playObjFlyAnim(num, Prop.diamond);
  22215. this.closeSelf();
  22216. }
  22217. videoGetCoin() {
  22218. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  22219. if (Laya.Browser.onAndroid) {
  22220. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22221. if (!boo) {
  22222. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22223. return;
  22224. }
  22225. }
  22226. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  22227. }
  22228. else {
  22229. console.log('zh:AD 失败,直接发放奖励');
  22230. this.qjff_AD_for_uiAddProp_videoGetCoin();
  22231. }
  22232. }
  22233. qjff_AD_for_uiAddProp_videoGetCoin() {
  22234. xGame.common.playObjFlyAnim(2000, Prop.coin);
  22235. this.closeSelf();
  22236. }
  22237. shareGetDiamond() {
  22238. let times = DataMgr.getShareDiamondTimes();
  22239. if (times >= xGame.common.maxShareDiamondTimes) {
  22240. console.log('zh: 233333333333 maxShareDiamondTimes');
  22241. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22242. }
  22243. else {
  22244. console.log('zh:33333333333333ad');
  22245. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22246. if (Laya.Browser.onAndroid) {
  22247. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22248. if (!boo) {
  22249. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22250. return;
  22251. }
  22252. }
  22253. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22254. }
  22255. else {
  22256. console.log('zh:AD 失败,直接发放奖励');
  22257. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22258. }
  22259. }
  22260. }
  22261. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22262. let diamond = xGame.common.randomNum(50, 100);
  22263. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22264. DataMgr.setShareDiamondTimes(1);
  22265. this.updateDiamondShare();
  22266. }
  22267. openPutBallView() {
  22268. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22269. let skill = xGame.uiMgr.getUI(UISkill$1);
  22270. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22271. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22272. if (end && !end.isHide) {
  22273. xGame.uiMgr.Hide(UIGameEnd$1);
  22274. xGame.uiMgr.Show(UIMain$1);
  22275. }
  22276. if (skill && !skill.isHide)
  22277. xGame.uiMgr.Hide(UISkill$1);
  22278. if (uigame && !uigame.isHide)
  22279. xGame.uiMgr.Hide(UIGame$1);
  22280. if (level && !level.isHide) {
  22281. }
  22282. else {
  22283. xGame.uiMgr.Show(UILevelDisplay$1);
  22284. }
  22285. this.closeSelf();
  22286. }
  22287. }
  22288. UIAddProp$1.uiName = "UIAddProp";
  22289. class MoneyNode$1 {
  22290. constructor(ui) {
  22291. this.leftTime = 0;
  22292. this.ui = ui;
  22293. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22294. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22295. this.ui.addPowerBtn.onClick(this, this.addPower);
  22296. this.ui.c1.selectedIndex = 1;
  22297. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22298. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22299. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22300. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22301. this.coinChange();
  22302. this.diamondChange();
  22303. this.powerChange();
  22304. }
  22305. addPower() {
  22306. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22307. xGame.uiMgr.Show(UIPower$1);
  22308. }
  22309. powerChange() {
  22310. let powerNum = DataMgr.getPower();
  22311. this.ui.powerTxt.text = powerNum + "";
  22312. }
  22313. checkPowerTime() {
  22314. let cur = new Date().getTime();
  22315. let last = DataMgr.getPowerTime();
  22316. if (last == 0) {
  22317. last = cur;
  22318. DataMgr.setPowerTime(cur);
  22319. }
  22320. let power = DataMgr.getPower();
  22321. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22322. Laya.timer.clearAll(this);
  22323. if (power >= xGame.common.natureMaxPower) {
  22324. this.ui.powerTimeTxt.text = "";
  22325. DataMgr.setPowerTime(cur);
  22326. return;
  22327. }
  22328. if (power + offset >= xGame.common.natureMaxPower) {
  22329. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22330. this.ui.powerTimeTxt.text = "";
  22331. DataMgr.setPowerTime(cur);
  22332. }
  22333. else {
  22334. if (offset > 0) {
  22335. DataMgr.setPower(offset);
  22336. DataMgr.setPowerTime(cur);
  22337. }
  22338. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22339. this.leftTime = xGame.common.powerRecoverNum - time;
  22340. if (this.leftTime <= 0)
  22341. this.leftTime = 0;
  22342. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22343. Laya.timer.loop(1000, this, this.updatePowerTime);
  22344. }
  22345. }
  22346. updatePowerTime() {
  22347. this.leftTime -= 1;
  22348. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22349. if (this.leftTime <= 0) {
  22350. this.checkPowerTime();
  22351. }
  22352. }
  22353. coinChange() {
  22354. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22355. }
  22356. diamondChange() {
  22357. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22358. }
  22359. addCoin() {
  22360. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22361. Moyu.sendDataEvent("AddCoinBtn");
  22362. xGame.uiMgr.Show(UIAddProp$1, 0);
  22363. }
  22364. addDiamond() {
  22365. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22366. Moyu.sendDataEvent("AddDiamondBtn");
  22367. xGame.uiMgr.Show(UIAddProp$1, 1);
  22368. }
  22369. }
  22370. class SettingNode$1 {
  22371. constructor(ui) {
  22372. this.showSetting = false;
  22373. this.openSound = true;
  22374. this.openShake = true;
  22375. this.ui = ui;
  22376. this.ui.soundBtn.onClick(this, this.switchSound);
  22377. this.ui.shakeBtn.onClick(this, this.switchShake);
  22378. this.ui.xyBtn.onClick(this, this.onXy);
  22379. this.ui.clickNode.onClick(this, this.changeSetting);
  22380. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22381. this.ui.xyBtn.visible = false;
  22382. this.ui.shakeBtn.visible = false;
  22383. }
  22384. changeSetting() {
  22385. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22386. this.showSetting = !this.showSetting;
  22387. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22388. }
  22389. switchSound() {
  22390. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22391. this.openSound = !this.openSound;
  22392. Moyu.onSetting(this.openSound, this.openShake);
  22393. xGame.soundMgr.onSetting(this.openSound);
  22394. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22395. }
  22396. switchShake() {
  22397. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22398. this.openShake = !this.openShake;
  22399. Moyu.onSetting(this.openSound, this.openShake);
  22400. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22401. }
  22402. onXy() {
  22403. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22404. MoyuMgr$1.showXy(1);
  22405. }
  22406. }
  22407. class UIDraw$1 extends UIBase {
  22408. constructor() {
  22409. super();
  22410. this.curKey = 0;
  22411. }
  22412. onConstructor() {
  22413. this.ui = ui_UIDraw.createInstance();
  22414. this.contentPane = this.ui;
  22415. this.isEject = false;
  22416. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22417. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22418. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22419. this.initDraw();
  22420. this.initUI();
  22421. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22422. }
  22423. show() {
  22424. super.show();
  22425. this.ui.t0.play();
  22426. this.playSecretaryIdle();
  22427. this.updateDraw();
  22428. this.checkFree();
  22429. if (PlatMgr.bannerDelay > 0) {
  22430. this.ui.closeNode.closeBtn.visible = false;
  22431. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22432. this.ui.closeNode.closeBtn.visible = true;
  22433. });
  22434. }
  22435. PlatMgr.showRateBanner();
  22436. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  22437. this.setGlobalFont(this.ui);
  22438. }
  22439. hide() {
  22440. Laya.timer.clearAll(this);
  22441. super.hide();
  22442. }
  22443. checkFree() {
  22444. let isFree = DataMgr.getDailyfreeDrawTimes();
  22445. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22446. }
  22447. initDraw() {
  22448. this.drawObj = [];
  22449. let data = cfgTable.drawData;
  22450. let temp;
  22451. let weight = 0;
  22452. for (const key in data) {
  22453. temp = data[key];
  22454. weight += temp.weight;
  22455. this.drawObj.push(weight);
  22456. }
  22457. this.allWeight = weight;
  22458. }
  22459. initUI() {
  22460. let data = cfgTable.drawData;
  22461. let temp;
  22462. let img;
  22463. let txt;
  22464. for (const key in data) {
  22465. temp = data[key];
  22466. img = this.ui.myNode.rotNode["img" + key];
  22467. txt = this.ui.myNode.rotNode["txt" + key];
  22468. img.url = xGame.common.getGameIconUrl(temp.icon);
  22469. txt.visible = true;
  22470. if (temp.award > 2) {
  22471. img.rotation = 0;
  22472. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  22473. }
  22474. else {
  22475. img.rotation = temp.rotation;
  22476. txt.text = temp.num;
  22477. }
  22478. }
  22479. }
  22480. getCurkey() {
  22481. let rand = Math.random() * this.allWeight;
  22482. let temp;
  22483. for (let index = 0; index < this.drawObj.length - 1; index++) {
  22484. temp = this.drawObj[index];
  22485. if (index == 0) {
  22486. if (rand < temp) {
  22487. return index + 1;
  22488. }
  22489. }
  22490. else {
  22491. if (rand >= temp && rand < this.drawObj[index + 1]) {
  22492. return index + 1;
  22493. }
  22494. }
  22495. }
  22496. return 2;
  22497. }
  22498. startDraw() {
  22499. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  22500. if (freeTimes > 0) {
  22501. this.beginDraw();
  22502. DataMgr.setDailyfreeDrawTimes(0);
  22503. this.checkFree();
  22504. }
  22505. else {
  22506. if (Laya.Browser.onAndroid) {
  22507. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22508. if (!boo) {
  22509. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22510. return;
  22511. }
  22512. }
  22513. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  22514. }
  22515. else {
  22516. console.log('zh:AD 失败,直接发放奖励');
  22517. this.qjff_chouJiang();
  22518. }
  22519. }
  22520. }
  22521. qjff_chouJiang() {
  22522. this.beginDraw();
  22523. }
  22524. beginDraw() {
  22525. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  22526. this.ui.drawBtn.touchable = false;
  22527. this.curKey = this.getCurkey();
  22528. console.log("当前key", this.curKey);
  22529. let cell = 60;
  22530. let lap = 3;
  22531. let angle = cell * (this.curKey - 1) + lap * 360;
  22532. let target = this.ui.myNode.rotNode;
  22533. target.rotation = 0;
  22534. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22535. console.log("旋转完成");
  22536. this.ui.drawBtn.touchable = true;
  22537. this.getAward();
  22538. }));
  22539. }
  22540. getAward() {
  22541. let data = cfgTable.drawData[this.curKey];
  22542. let temp = new AwardType();
  22543. temp.type = data.award;
  22544. temp.num = data.num;
  22545. xGame.common.getAward([temp], () => {
  22546. DataMgr.setDrawTimes(1);
  22547. this.updateDraw();
  22548. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22549. });
  22550. }
  22551. updateDraw() {
  22552. let drawTimes = DataMgr.getDrawTimes();
  22553. let awardTimes = DataMgr.getDrawAwardTimes();
  22554. if (Math.floor(drawTimes / 3) > awardTimes) {
  22555. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22556. this.ui.extraNode.boxBtn.touchable = true;
  22557. this.ui.extraNode.tipsTxt.text = "3/3";
  22558. this.ui.extraNode.barNode.width = 265;
  22559. this.getExtraAward();
  22560. }
  22561. else {
  22562. this.ui.extraNode.boxBtn.t0.stop();
  22563. this.ui.extraNode.boxBtn.touchable = false;
  22564. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22565. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22566. }
  22567. let data = cfgTable.drawData[1];
  22568. if (awardTimes == 0) {
  22569. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22570. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22571. this.ui.myNode.rotNode.img1.rotation = 0;
  22572. }
  22573. else {
  22574. let award = data.nextid;
  22575. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22576. this.ui.myNode.rotNode.txt1.text = award[1];
  22577. this.ui.myNode.rotNode.img1.rotation = 0;
  22578. }
  22579. }
  22580. getExtraAward() {
  22581. let drawTimes = DataMgr.getDrawTimes();
  22582. let awardTimes = DataMgr.getDrawAwardTimes();
  22583. let data = cfgTable.drawData[1];
  22584. let award = new AwardType();
  22585. if (awardTimes == 0) {
  22586. award.num = data.num;
  22587. award.type = data.award;
  22588. xGame.common.getAward([award], () => {
  22589. let all = Math.floor(drawTimes / 3);
  22590. DataMgr.setDrawAwardTimes(all);
  22591. this.updateDraw();
  22592. });
  22593. }
  22594. else {
  22595. award.num = parseInt(data.nextid[1]);
  22596. award.type = parseInt(data.nextid[0]);
  22597. xGame.common.getAward([award], () => {
  22598. let all = Math.floor(drawTimes / 3);
  22599. DataMgr.setDrawAwardTimes(all);
  22600. this.updateDraw();
  22601. });
  22602. }
  22603. }
  22604. closeSelf() {
  22605. this.hide();
  22606. }
  22607. playSecretaryIdle() {
  22608. let parent = this.ui.secretary.displayObject;
  22609. parent.destroyChildren();
  22610. let xx = this.ui.secretary.width / 2;
  22611. let yy = this.ui.secretary.height;
  22612. let scale = xGame.common.getSecretaryScale();
  22613. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22614. xGame.common.secretary.play(data, 0, true, parent);
  22615. }
  22616. }
  22617. UIDraw$1.uiName = "UIDraw";
  22618. class UIRanking$1 extends UIBase {
  22619. constructor() {
  22620. super();
  22621. this.showSelf = true;
  22622. this.rankType = 1;
  22623. this.rankList = [];
  22624. this.topX = 10;
  22625. this.myIndex = this.topX + 1;
  22626. this.myStar = 0;
  22627. }
  22628. onConstructor() {
  22629. this.ui = ui_UIRanking.createInstance();
  22630. this.contentPane = this.ui;
  22631. this.isEject = false;
  22632. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22633. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22634. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22635. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22636. this.ui.myNode.myList.setVirtual();
  22637. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22638. }
  22639. show() {
  22640. super.show();
  22641. this.getPaiHangBangDataFormJosnFile();
  22642. this.updateSelf();
  22643. let self = Moyu.getUserInfo();
  22644. if (!self.isAuth) {
  22645. Moyu.initUser(this, () => {
  22646. DataMgr.upRankData();
  22647. });
  22648. }
  22649. this.setGlobalFont(this.ui);
  22650. }
  22651. getPaiHangBangDataFormJosnFile() {
  22652. const rankingList = cfgTable.paiHangBangData.list;
  22653. this.updateItemData(rankingList);
  22654. }
  22655. updateSelfItem() {
  22656. console.log('zh:Moyu.platType =' + Moyu.platType);
  22657. let self = Moyu.getUserInfo();
  22658. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22659. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22660. if (this.myIndex > this.topX) {
  22661. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22662. }
  22663. else {
  22664. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22665. }
  22666. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22667. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22668. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22669. }
  22670. updateItemData(data) {
  22671. this.myStar = xGame.common.getAllStarNum();
  22672. if (this.rankList.length < 2) {
  22673. this.rankList = data;
  22674. let self = Moyu.getUserInfo();
  22675. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22676. self.headIcon = self.headIcon;
  22677. for (let i = 0; i < data.length; i++) {
  22678. let data = this.rankList[i];
  22679. if (data.userId == self.userId) {
  22680. this.rankList.splice(i, 1);
  22681. break;
  22682. }
  22683. }
  22684. for (let i = 0; i < data.length; i++) {
  22685. let data = this.rankList[i];
  22686. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22687. this.myIndex = i + 1;
  22688. let user = { headIcon: self.headIcon, nickName: "myself" };
  22689. let ud = { user: user, data: {} };
  22690. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22691. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22692. if (Moyu.platType < 11) {
  22693. user.headIcon = self.headIcon;
  22694. user.nickName = self.nickName;
  22695. }
  22696. this.rankList.splice(i, 0, md);
  22697. break;
  22698. }
  22699. }
  22700. }
  22701. this.updateSelfItem();
  22702. this.ui.myNode.myList.numItems = this.rankList.length;
  22703. }
  22704. updateItemUI(index, obj) {
  22705. let data = this.rankList[index];
  22706. let userData = JSON.parse(data.userData).user;
  22707. obj.nameTxt.text = userData.nickName.toString();
  22708. obj.valueTxt.text = data.rankScore;
  22709. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22710. obj.rankTxt.text = index + 1;
  22711. switch (index) {
  22712. case 0:
  22713. this.setImg(obj, 1, 0, 0);
  22714. obj.rankTxt.color = "#FFC047";
  22715. break;
  22716. case 1:
  22717. this.setImg(obj, 0, 1, 0);
  22718. obj.rankTxt.color = "#ACACAC";
  22719. break;
  22720. case 2:
  22721. this.setImg(obj, 0, 0, 1);
  22722. obj.rankTxt.color = "#D09672";
  22723. break;
  22724. default:
  22725. this.setImg(obj, 0, 0, 0);
  22726. obj.rankTxt.color = "#496FAB";
  22727. break;
  22728. }
  22729. }
  22730. setImg(obj, a, b, c) {
  22731. obj.img1.visible = a ? true : false;
  22732. obj.img2.visible = b ? true : false;
  22733. obj.img3.visible = c ? true : false;
  22734. }
  22735. changeList(type) {
  22736. this.rankType = type;
  22737. this.updateSelf();
  22738. }
  22739. changeSelfNode() {
  22740. this.showSelf = !this.showSelf;
  22741. this.updateSelf();
  22742. }
  22743. updateSelf() {
  22744. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22745. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22746. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22747. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22748. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22749. }
  22750. }
  22751. UIRanking$1.uiName = "UIRanking";
  22752. class UISecretary$1 extends UIBase {
  22753. constructor() {
  22754. super();
  22755. this.curIndex = 1;
  22756. }
  22757. onConstructor() {
  22758. this.ui = ui_UISecretary.createInstance();
  22759. this.contentPane = this.ui;
  22760. this.isEject = false;
  22761. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22762. this.nodeObj = { left: null, right: null, cur: null };
  22763. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22764. }
  22765. show() {
  22766. super.show();
  22767. this.ui.t0.play();
  22768. this.updateData();
  22769. this.setGlobalFont(this.ui);
  22770. }
  22771. addSecretarySpine(node, spineName) {
  22772. if (spineName == "mishu") {
  22773. if (this.secretarySpine1) {
  22774. node.displayObject.destroyChildren();
  22775. this.playWoman(this.secretarySpine1, node.displayObject);
  22776. }
  22777. else {
  22778. let spine1 = new SpineMgr("mishu", () => {
  22779. this.secretarySpine1 = spine1;
  22780. this.playWoman(this.secretarySpine1, node.displayObject);
  22781. });
  22782. }
  22783. }
  22784. else {
  22785. if (this.secretarySpine2) {
  22786. node.displayObject.destroyChildren();
  22787. this.playWoman(this.secretarySpine2, node.displayObject);
  22788. }
  22789. else {
  22790. let spine2 = new SpineMgr("xiaomishu2", () => {
  22791. this.secretarySpine2 = spine2;
  22792. this.playWoman(this.secretarySpine2, node.displayObject);
  22793. });
  22794. }
  22795. }
  22796. }
  22797. playWoman(node, parent) {
  22798. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22799. let yy = this.ui.myNode.gameNode3.secretary.height;
  22800. let scale = 1.5;
  22801. if (node == this.secretarySpine2) {
  22802. scale = 1.2;
  22803. }
  22804. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22805. node.play(data, 0, true, parent);
  22806. }
  22807. turnLeft() {
  22808. this.curIndex--;
  22809. if (this.curIndex < 1) {
  22810. this.curIndex = 2;
  22811. }
  22812. let left = this.nodeObj.left;
  22813. let right = this.nodeObj.right;
  22814. let cur = this.nodeObj.cur;
  22815. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22816. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22817. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22818. this.updateData();
  22819. }));
  22820. this.ui.myNode.setChildIndex(right, 2);
  22821. this.nodeObj.left = cur;
  22822. this.nodeObj.right = left;
  22823. this.nodeObj.cur = right;
  22824. }
  22825. turnRight() {
  22826. this.curIndex++;
  22827. if (this.curIndex > 2) {
  22828. this.curIndex = 1;
  22829. }
  22830. let left = this.nodeObj.left;
  22831. let right = this.nodeObj.right;
  22832. let cur = this.nodeObj.cur;
  22833. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22834. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22835. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22836. this.updateData();
  22837. }));
  22838. this.ui.myNode.setChildIndex(left, 2);
  22839. this.nodeObj.left = right;
  22840. this.nodeObj.right = cur;
  22841. this.nodeObj.cur = left;
  22842. }
  22843. updateData() {
  22844. console.log('zh: updateData FFFFFFFFFF');
  22845. let data = cfgTable.secretaryshopData;
  22846. let children = this.ui.myNode._children;
  22847. let temp;
  22848. let curData;
  22849. for (let index = 0; index < children.length; index++) {
  22850. temp = children[index];
  22851. curData = data[1];
  22852. temp.heightTxt.text = curData.height;
  22853. temp.foodTxt.text = curData.food;
  22854. temp.historyTxt.text = curData.history;
  22855. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22856. this.addSecretarySpine(temp.secretary, curData.spine);
  22857. let womanIndex = curData.id - 1;
  22858. let getWoman = DataMgr.getSecretary(womanIndex);
  22859. let curUse = DataMgr.getCurSecretary();
  22860. if (getWoman) {
  22861. if (curUse == womanIndex) {
  22862. temp.purchaseBtn.c1.selectedIndex = 1;
  22863. }
  22864. else {
  22865. temp.purchaseBtn.c1.selectedIndex = 2;
  22866. }
  22867. }
  22868. else {
  22869. temp.purchaseBtn.c1.selectedIndex = 0;
  22870. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22871. }
  22872. temp.purchaseBtn.visible = false;
  22873. }
  22874. }
  22875. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22876. console.log('zh: 点击了clickSecretary ');
  22877. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22878. if (getWoman) {
  22879. if (curUse != womanIndex) {
  22880. console.log();
  22881. DataMgr.setCurSecretary(womanIndex);
  22882. this.updateData();
  22883. }
  22884. }
  22885. else {
  22886. console.log('zh:点击购买了');
  22887. let need = needDiamond;
  22888. if (DataMgr.diamondEnough(need)) {
  22889. DataMgr.setDiamond(-need);
  22890. DataMgr.setSecretary(womanIndex, 1);
  22891. DataMgr.setCurSecretary(womanIndex);
  22892. this.updateData();
  22893. }
  22894. else {
  22895. xGame.uiMgr.Show(UIAddProp$1, 1);
  22896. }
  22897. }
  22898. }
  22899. closeSelf() {
  22900. this.hide();
  22901. }
  22902. }
  22903. UISecretary$1.uiName = "UISecretary";
  22904. class BallRodDisplay$1 {
  22905. constructor(ui, index) {
  22906. this.index = 0;
  22907. this.uiIndex = 0;
  22908. this.ui = ui;
  22909. this.index = index;
  22910. this.initData();
  22911. }
  22912. initData() {
  22913. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22914. let data = cfgTable.ballrodData[this.index + 1];
  22915. this.ui.nameTxt.text = data.name;
  22916. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22917. this.ui.levelNode.c1.selectedIndex = data.quality;
  22918. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22919. if (data.spine) {
  22920. this.mySpine = new SpineMgr(data.spine, () => {
  22921. let xx = 150;
  22922. let yy = 70;
  22923. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22924. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22925. });
  22926. }
  22927. }
  22928. updateSelf() {
  22929. let get = DataMgr.getBallRod(this.index);
  22930. if (get == null)
  22931. get = 1;
  22932. let curUse = DataMgr.getCurBallRod();
  22933. if (get) {
  22934. if (curUse == this.index) {
  22935. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22936. }
  22937. else {
  22938. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22939. }
  22940. }
  22941. else {
  22942. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22943. }
  22944. }
  22945. buyBallRod() {
  22946. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22947. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22948. switch (selectedIndex) {
  22949. case 0:
  22950. break;
  22951. case 1:
  22952. console.log('zh:点击了 USE THIS');
  22953. DataMgr.setCurBallRod(this.index);
  22954. let curUse = DataMgr.getCurBallRod();
  22955. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22956. let ui = xGame.uiMgr.getUI(UIShop$1);
  22957. ui.updateBallRod();
  22958. break;
  22959. case 2:
  22960. let data = cfgTable.ballrodData[this.index + 1];
  22961. let need = data.price;
  22962. if (DataMgr.diamondEnough(need)) {
  22963. this.buyQiuGan(data);
  22964. DataMgr.setDiamond(-need);
  22965. DataMgr.setBallRod(this.index, 1);
  22966. DataMgr.setCurBallRod(this.index);
  22967. let ui = xGame.uiMgr.getUI(UIShop$1);
  22968. ui.updateBallRod();
  22969. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22970. }
  22971. else {
  22972. xGame.uiMgr.Show(UIAddProp$1, 1);
  22973. }
  22974. break;
  22975. default:
  22976. break;
  22977. }
  22978. }
  22979. buyQiuGan(qgItem) {
  22980. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  22981. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22982. if (userInfo == null) {
  22983. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22984. return;
  22985. }
  22986. let reqData = xGame.httpMgr.getReqData();
  22987. let pd = JSON.parse(reqData);
  22988. pd.qiuGanData = qgItem;
  22989. reqData = JSON.stringify(pd);
  22990. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  22991. try {
  22992. console.log('zh:buySp res = ' + JSON.stringify(res));
  22993. let code = res.code;
  22994. let msg = res.msg;
  22995. if (code == 401) {
  22996. Laya.LocalStorage.removeItem(keyForLoginInfo);
  22997. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.loginTimeOut);
  22998. return;
  22999. }
  23000. if (code == 200) {
  23001. xGame.uiMgr.Show(UIMsg$1, msg);
  23002. DataMgr.getUserZiChanInfo(false);
  23003. }
  23004. else {
  23005. xGame.uiMgr.Show(UIMsg$1, msg);
  23006. }
  23007. }
  23008. catch (error) {
  23009. console.log('error=' + error);
  23010. alert(error);
  23011. }
  23012. finally {
  23013. }
  23014. });
  23015. }
  23016. logEventForGouMaiGan(qiuGanName) {
  23017. const ev = {
  23018. value: qiuGanName
  23019. };
  23020. const jsonStr = JSON.stringify(ev);
  23021. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  23022. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  23023. }
  23024. }
  23025. class DaoJuDisplay$1 {
  23026. constructor(ui, index) {
  23027. this.index = 0;
  23028. this.uiIndex = 0;
  23029. this.ggSpid = "";
  23030. this.spid = 0;
  23031. this.ui = ui;
  23032. this.index = index;
  23033. this.initData();
  23034. }
  23035. initData() {
  23036. this.ui.btn_buy.onClick(this, this.gotoBuy);
  23037. let data = cfgTable.daoJuData[this.index + 1];
  23038. this.ui.nameTxt.text = data.spbt;
  23039. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  23040. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  23041. this.ggSpid = data.ggSpid;
  23042. this.spid = data.spid;
  23043. let baseUrl = "asset/sound/ogg/";
  23044. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  23045. }
  23046. gotoBuy() {
  23047. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23048. if (userInfo != null) {
  23049. let token = userInfo.token;
  23050. let ggSpid = this.ggSpid;
  23051. let spid = this.spid;
  23052. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  23053. console.log('zh:gotoBuy1 spid =' + spid);
  23054. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  23055. return;
  23056. }
  23057. else {
  23058. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23059. }
  23060. }
  23061. gotoBuy1() {
  23062. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23063. let djItem = cfgTable.daoJuData[this.index + 1];
  23064. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  23065. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23066. if (userInfo == null) {
  23067. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23068. return;
  23069. }
  23070. let reqData = xGame.httpMgr.getReqData();
  23071. let pd = JSON.parse(reqData);
  23072. pd.spItem = djItem;
  23073. reqData = JSON.stringify(pd);
  23074. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  23075. try {
  23076. console.log('zh:buySp res = ' + JSON.stringify(res));
  23077. let code = res.code;
  23078. let msg = res.msg;
  23079. if (code == 401) {
  23080. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23081. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23082. return;
  23083. }
  23084. if (code == 200) {
  23085. xGame.uiMgr.Show(UIMsg$1, msg);
  23086. DataMgr.getUserZiChanInfo(false);
  23087. }
  23088. else {
  23089. xGame.uiMgr.Show(UIMsg$1, msg);
  23090. }
  23091. }
  23092. catch (error) {
  23093. console.log('error=' + error);
  23094. alert(error);
  23095. }
  23096. finally {
  23097. }
  23098. });
  23099. }
  23100. }
  23101. class UIShop$1 extends UIBase {
  23102. constructor() {
  23103. super();
  23104. this.itemNums = 0;
  23105. this.itemNumsForDj = 0;
  23106. this.curType = "";
  23107. }
  23108. onConstructor() {
  23109. this.ui = ui_UIShop.createInstance();
  23110. this.contentPane = this.ui;
  23111. this.isEject = false;
  23112. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23113. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23114. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  23115. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  23116. this.addUIClick(this.ui, this.interuptSecretary);
  23117. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  23118. this.ballRodArr = [];
  23119. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  23120. this.ui.myNode.myList.numItems = this.itemNums;
  23121. this.loadDjdata_old();
  23122. }
  23123. loadDjdata_old() {
  23124. let fff = cfgTable.daoJuData;
  23125. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  23126. this.daoJuArr = [];
  23127. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  23128. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  23129. }
  23130. getProductList() {
  23131. let reqData = xGame.httpMgr.getReqData();
  23132. let pd = JSON.parse(reqData);
  23133. pd.splx = "Consumable";
  23134. reqData = JSON.stringify(pd);
  23135. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  23136. try {
  23137. let code = res.code;
  23138. let msg = res.msg;
  23139. if (code == 401) {
  23140. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23141. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  23142. return;
  23143. }
  23144. if (code == 200) {
  23145. let data = res.data;
  23146. for (let index = 0; index < data.length; index++) {
  23147. let element = data[index];
  23148. cfgTable.daoJuData[element.spid] = element;
  23149. }
  23150. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  23151. }
  23152. else {
  23153. xGame.uiMgr.Show(UIMsg, msg);
  23154. }
  23155. }
  23156. catch (error) {
  23157. console.log('error=' + error);
  23158. alert(error);
  23159. }
  23160. finally {
  23161. }
  23162. });
  23163. }
  23164. show(type) {
  23165. super.show();
  23166. this.curType = type == 0 ? "qiugan" : "daoju";
  23167. this.switchBtn("");
  23168. this.playSecretaryIdle();
  23169. this.updateBallRod();
  23170. this.setGlobalFont(this.ui);
  23171. }
  23172. test123() {
  23173. console.log('zh:test123 ');
  23174. }
  23175. switchBtn(type) {
  23176. console.log('zh:1111切換 sel type=' + type);
  23177. if (type == "") {
  23178. type = this.curType;
  23179. }
  23180. else {
  23181. if (this.curType == type) {
  23182. return;
  23183. }
  23184. else {
  23185. this.curType = type;
  23186. }
  23187. }
  23188. if (type == "qiugan") {
  23189. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  23190. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  23191. this.ui.myNode.c1.selectedIndex = 0;
  23192. this.ui.myNode.myList.visible = true;
  23193. this.ui.myNode.djList.visible = false;
  23194. }
  23195. else {
  23196. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  23197. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  23198. this.ui.myNode.c1.selectedIndex = 1;
  23199. this.ui.myNode.myList.visible = false;
  23200. this.ui.myNode.djList.visible = true;
  23201. }
  23202. }
  23203. updateBallRod() {
  23204. for (let index = 0; index < this.ballRodArr.length; index++) {
  23205. this.ballRodArr[index].updateSelf();
  23206. }
  23207. }
  23208. renderBallRod(sort, obj) {
  23209. let index = this.getIndexBySort(sort + 1) - 1;
  23210. let ballRod = new BallRodDisplay$1(obj, index);
  23211. this.ballRodArr.push(ballRod);
  23212. }
  23213. renderDaoJu(idx, obj) {
  23214. let index = this.getIndexBySortForDj(idx + 1) - 1;
  23215. let b = new DaoJuDisplay$1(obj, index);
  23216. this.daoJuArr.push(b);
  23217. }
  23218. getIndexBySort(sort) {
  23219. let object = cfgTable.ballrodData;
  23220. for (const key in object) {
  23221. if (object[key].sort == sort) {
  23222. return parseInt(key);
  23223. }
  23224. }
  23225. }
  23226. getIndexBySortForDj(idx) {
  23227. let object = cfgTable.daoJuData;
  23228. for (const key in object) {
  23229. if (object[key].idx == idx) {
  23230. return parseInt(key);
  23231. }
  23232. }
  23233. }
  23234. playSecretaryIdle() {
  23235. let parent = this.ui.secretary.displayObject;
  23236. parent.destroyChildren();
  23237. let xx = this.ui.secretary.width / 2;
  23238. let yy = this.ui.secretary.height;
  23239. let scale = xGame.common.getSecretaryScale();
  23240. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23241. xGame.common.secretary.play(data, 0, true, parent);
  23242. }
  23243. interuptSecretary() {
  23244. Laya.timer.clearAll(this);
  23245. this.playSecretaryRandomSound();
  23246. }
  23247. playSecretaryRandomSound() {
  23248. if (this.isHide)
  23249. return;
  23250. let time = xGame.common.randomNum(45000, 60000);
  23251. Laya.timer.once(time, this, () => {
  23252. if (this.isHide)
  23253. return;
  23254. let index = xGame.common.randomNum(4, 7);
  23255. xGame.soundMgr.playSound("s_main0" + index);
  23256. let words = 1;
  23257. switch (index) {
  23258. case 4:
  23259. words = 5;
  23260. break;
  23261. case 5:
  23262. words = 3;
  23263. break;
  23264. case 6:
  23265. words = 6;
  23266. break;
  23267. case 7:
  23268. words = 7;
  23269. break;
  23270. default:
  23271. break;
  23272. }
  23273. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23274. this.playSecretaryRandomSound();
  23275. });
  23276. }
  23277. closeSelf() {
  23278. this.hide();
  23279. }
  23280. }
  23281. UIShop$1.uiName = "UIShop";
  23282. class SignMax$1 {
  23283. constructor(ui) {
  23284. this.ui = ui;
  23285. }
  23286. updateSelf(index, sameDay, curDayIndex) {
  23287. let data = cfgTable.signData[index + 1];
  23288. this.ui.titleTxt.text = data.title;
  23289. let arr1 = data.award[0].split('-');
  23290. let arr2 = data.award[1].split('-');
  23291. let num1 = parseInt(arr1[1]);
  23292. let num2 = parseInt(arr2[1]);
  23293. this.ui.numTxt1.text = num1 + "";
  23294. this.ui.numTxt2.text = num2 + "";
  23295. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23296. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23297. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23298. this.ui.numTxt1.visible = false;
  23299. }
  23300. else {
  23301. this.ui.numTxt1.visible = true;
  23302. }
  23303. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23304. this.ui.numTxt2.visible = false;
  23305. }
  23306. else {
  23307. this.ui.numTxt2.visible = true;
  23308. }
  23309. if (index < curDayIndex) {
  23310. this.ui.c1.selectedIndex = 1;
  23311. }
  23312. else if (index == curDayIndex) {
  23313. if (sameDay) {
  23314. this.ui.c1.selectedIndex = 2;
  23315. }
  23316. else {
  23317. this.ui.c1.selectedIndex = 2;
  23318. }
  23319. }
  23320. else {
  23321. this.ui.c1.selectedIndex = 0;
  23322. }
  23323. }
  23324. }
  23325. class SignNormal$1 {
  23326. constructor(ui) {
  23327. this.ui = ui;
  23328. }
  23329. updateSelf(index, sameDay, curDayIndex) {
  23330. let data = cfgTable.signData[index + 1];
  23331. this.ui.titleTxt.text = data.title;
  23332. let arr = data.award[0].split('-');
  23333. let type = parseInt(arr[0]);
  23334. let num = parseInt(arr[1]);
  23335. this.ui.numTxt.text = num + "";
  23336. if (type > 2) {
  23337. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23338. this.ui.myIcon.rotation = 0;
  23339. }
  23340. else {
  23341. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23342. this.ui.myIcon.rotation = 0;
  23343. }
  23344. if (xGame.common.signAwardContainsRod(data.award)) {
  23345. this.ui.numTxt.visible = false;
  23346. }
  23347. else {
  23348. this.ui.numTxt.visible = true;
  23349. }
  23350. if (index < curDayIndex) {
  23351. this.ui.c1.selectedIndex = 1;
  23352. }
  23353. else if (index == curDayIndex) {
  23354. if (sameDay) {
  23355. this.ui.c1.selectedIndex = 2;
  23356. }
  23357. else {
  23358. this.ui.c1.selectedIndex = 2;
  23359. }
  23360. }
  23361. else {
  23362. this.ui.c1.selectedIndex = 0;
  23363. }
  23364. }
  23365. }
  23366. class UISign$1 extends UIBase {
  23367. constructor() {
  23368. super();
  23369. this.curDayIndex = 0;
  23370. this.starX = 0;
  23371. }
  23372. onConstructor() {
  23373. this.ui = ui_UISign.createInstance();
  23374. this.contentPane = this.ui;
  23375. this.isEject = false;
  23376. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23377. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23378. this.initSignItem();
  23379. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23380. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23381. }
  23382. show() {
  23383. super.show();
  23384. this.ui.t0.play();
  23385. this.playSecretaryIdle();
  23386. this.updateSign();
  23387. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23388. this.setGlobalFont(this.ui);
  23389. }
  23390. initSignItem() {
  23391. this.signArr = [];
  23392. for (let index = 0; index < 6; index++) {
  23393. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23394. this.signArr.push(temp);
  23395. }
  23396. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23397. if (Moyu.isKs)
  23398. this.ui.closeNode.closeBtn.x += 100;
  23399. }
  23400. updateSign() {
  23401. let sameDay = xGame.common.judgeSameDay();
  23402. let max = 7;
  23403. this.curDayIndex = DataMgr.getSignData();
  23404. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23405. this.curDayIndex = 0;
  23406. if (!sameDay) {
  23407. this.ui.normalBtn.visible = true;
  23408. this.ui.tipsNode.visible = false;
  23409. this.ui.againBtn.visible = false;
  23410. }
  23411. else {
  23412. this.ui.normalBtn.visible = false;
  23413. let again = DataMgr.getExtraSign();
  23414. let isCurrency = false;
  23415. let index = this.curDayIndex;
  23416. if (index == 0)
  23417. index = 7;
  23418. let award = cfgTable.signData[index].award;
  23419. let num = award[0].split("-")[0];
  23420. if (num == "1" || num == "2")
  23421. isCurrency = true;
  23422. let showAgain = again == 0 && isCurrency;
  23423. this.ui.againBtn.visible = showAgain;
  23424. this.ui.tipsNode.visible = !showAgain;
  23425. }
  23426. for (let index = 0; index < this.signArr.length; index++) {
  23427. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23428. }
  23429. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23430. }
  23431. playSecretaryIdle() {
  23432. let parent = this.ui.secretary.displayObject;
  23433. parent.destroyChildren();
  23434. let xx = this.ui.secretary.width / 2;
  23435. let yy = this.ui.secretary.height;
  23436. let scale = xGame.common.getSecretaryScale();
  23437. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23438. xGame.common.secretary.play(data, 0, true, parent);
  23439. }
  23440. closeSelf() {
  23441. this.hide();
  23442. }
  23443. normalGetAward() {
  23444. let sameDay = xGame.common.judgeSameDay();
  23445. if (!sameDay) {
  23446. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23447. let temp;
  23448. let type;
  23449. let num;
  23450. let arr = [];
  23451. for (let index = 0; index < award.length; index++) {
  23452. temp = award[index].split("-");
  23453. type = parseInt(temp[0]);
  23454. num = parseInt(temp[1]);
  23455. let awardType = new AwardType();
  23456. awardType.num = num;
  23457. awardType.type = type;
  23458. arr.push(awardType);
  23459. }
  23460. xGame.common.getAward(arr, (watchVideo) => {
  23461. this.curDayIndex++;
  23462. if (this.curDayIndex > 7)
  23463. this.curDayIndex = 0;
  23464. DataMgr.setSignData(this.curDayIndex);
  23465. this.updateSignData2Server(this.curDayIndex);
  23466. DataMgr.setSignTime(new Date().getTime());
  23467. if (watchVideo) {
  23468. DataMgr.setExtraSign(1);
  23469. Moyu.sendDataEvent("signIn1");
  23470. }
  23471. this.updateSign();
  23472. });
  23473. }
  23474. }
  23475. againGetAward() {
  23476. Moyu.sendDataEvent("signIn2");
  23477. console.log('zh:qjff_AD_for_uisign');
  23478. if (Laya.Browser.onAndroid) {
  23479. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23480. if (!boo) {
  23481. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23482. return;
  23483. }
  23484. }
  23485. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  23486. }
  23487. else {
  23488. console.log('zh:AD 失败,直接发放奖励');
  23489. this.qjff_AD_for_uisign();
  23490. }
  23491. }
  23492. qjff_AD_for_uisign() {
  23493. let index = this.curDayIndex;
  23494. if (index == 0)
  23495. index = 7;
  23496. let award = cfgTable.signData[index].award;
  23497. let temp;
  23498. let type;
  23499. let num;
  23500. for (let index = 0; index < award.length; index++) {
  23501. temp = award[index].split("-");
  23502. type = parseInt(temp[0]);
  23503. num = parseInt(temp[1]) * 3;
  23504. xGame.common.playObjFlyAnim(num, type);
  23505. }
  23506. DataMgr.setExtraSign(1);
  23507. this.updateSign();
  23508. }
  23509. updateSignData2Server(day) {
  23510. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23511. if (userInfo == null) {
  23512. return;
  23513. }
  23514. let reqData = xGame.httpMgr.getReqData();
  23515. let pd = JSON.parse(reqData);
  23516. pd.signData = day;
  23517. reqData = JSON.stringify(pd);
  23518. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  23519. try {
  23520. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  23521. let code = res.code;
  23522. let msg = res.msg;
  23523. if (code == 401) {
  23524. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23525. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23526. return;
  23527. }
  23528. if (code == 200) {
  23529. let data = res.data;
  23530. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  23531. }
  23532. else {
  23533. xGame.uiMgr.Show(UIMsg$1, msg);
  23534. }
  23535. }
  23536. catch (error) {
  23537. console.log('error=' + error);
  23538. alert(error);
  23539. }
  23540. finally {
  23541. }
  23542. });
  23543. }
  23544. }
  23545. UISign$1.uiName = "UISign";
  23546. class UIModeSelection$1 extends UIBase {
  23547. constructor() {
  23548. super();
  23549. }
  23550. onConstructor() {
  23551. this.ui = ui_UIModeSelection.createInstance();
  23552. this.contentPane = this.ui;
  23553. this.isEject = false;
  23554. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  23555. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  23556. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  23557. this.addUIClick(this.ui.closeBtn, this.hide);
  23558. this.peopleArr = [65, 990, 580];
  23559. this.peopleOffest = [5, 10, 10];
  23560. }
  23561. show(callback) {
  23562. this.updateSelf();
  23563. super.show();
  23564. this.ui.t0.play();
  23565. this.callback = callback;
  23566. this.setGlobalFont(this.ui);
  23567. }
  23568. updateSelf() {
  23569. let cfg = cfgTable.modeselectData;
  23570. for (let index = 1; index <= 3; index++) {
  23571. let node = this.ui.myNode["type" + index];
  23572. node.need.text = cfg[index].need;
  23573. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  23574. node.peopleTxt.text = this.getRandPeople(index - 1);
  23575. }
  23576. }
  23577. enterGame(type) {
  23578. console.log('zh: 进入经典模式 type: ' + type);
  23579. xGame.common.classicRoomType = type;
  23580. let cfg = cfgTable.modeselectData[type];
  23581. let need = cfg.need;
  23582. xGame.common.passAwardCoin = cfg.award;
  23583. if (DataMgr.coinEnough(need)) {
  23584. DataMgr.setCoin(-need);
  23585. this.ui.myNode["type" + type].t0.play();
  23586. Laya.timer.once(200, this, () => {
  23587. this.callback && this.callback();
  23588. });
  23589. this.logEventForClassic_start();
  23590. }
  23591. else {
  23592. Moyu.sendDataEvent("AddCoinVideo");
  23593. xGame.uiMgr.Show(UIAddProp$1, 0);
  23594. }
  23595. }
  23596. getRandPeople(index) {
  23597. let rand = this.peopleOffest[index];
  23598. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23599. }
  23600. logEventForClassic_start() {
  23601. let rtype = xGame.common.classicRoomType;
  23602. let msmc = '';
  23603. if (rtype == 1) {
  23604. msmc = 'beginner';
  23605. }
  23606. if (rtype == 2) {
  23607. msmc = 'expert';
  23608. }
  23609. if (rtype == 3) {
  23610. msmc = 'master';
  23611. }
  23612. let keyStr = 'sjmd_classic_start_' + rtype;
  23613. let jsonStr = {
  23614. "difficulty": msmc,
  23615. "classic_count": 1,
  23616. "difficulty_count": 1
  23617. };
  23618. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23619. const d = LocalStorageManager.getItem(keyStr);
  23620. jsonStr.classic_count = d.classic_count + 1;
  23621. jsonStr.difficulty_count = d.difficulty_count + 1;
  23622. LocalStorageManager.setItem(keyStr, jsonStr);
  23623. }
  23624. else {
  23625. LocalStorageManager.setItem(keyStr, jsonStr);
  23626. }
  23627. const reqStr = JSON.stringify(jsonStr);
  23628. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23629. }
  23630. }
  23631. UIModeSelection$1.uiName = "UIModeSelection";
  23632. class UILogin$1 extends UIBase {
  23633. constructor() {
  23634. super();
  23635. }
  23636. onConstructor() {
  23637. this.ui = ui_UILogin.createInstance();
  23638. this.contentPane = this.ui;
  23639. this.isEject = false;
  23640. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23641. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  23642. this.addUIClick(this.ui.btn_login, this.userLogin);
  23643. }
  23644. show() {
  23645. super.show();
  23646. this.x = (Laya.stage.width - this.width) / 2;
  23647. this.y = (Laya.stage.height - this.height) / 2;
  23648. this.setGlobalFont(this.ui);
  23649. }
  23650. closeSelf() {
  23651. this.hide();
  23652. }
  23653. userLogin() {
  23654. let ua = this.ui.txt_ua.text;
  23655. let up = this.ui.txt_up.text;
  23656. if (ua && up) {
  23657. let reqData = JSON.stringify({
  23658. username: ua.trim(),
  23659. password: up.trim(),
  23660. fromMark: 'app_game'
  23661. });
  23662. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23663. try {
  23664. console.log('zh:res = ' + JSON.stringify(res));
  23665. let code = res.code;
  23666. let msg = res.msg;
  23667. if (code == 200) {
  23668. let keyStr = keyForLoginInfo;
  23669. let jsonStr = {
  23670. "username": res.username,
  23671. "token": res.token,
  23672. "buySpids": { 1: false, 7: false }
  23673. };
  23674. LocalStorageManager.setItem(keyStr, jsonStr);
  23675. let myu = Moyu.getUserInfo();
  23676. console.log('zh:myu = ' + JSON.stringify(myu));
  23677. DataMgr.updateUserNickName(res.username);
  23678. Moyu.updateUserInfo(res.username);
  23679. xGame.uiMgr.Show(UIMsg$1, msg);
  23680. DataMgr.loadUserSpOrderForAd();
  23681. DataMgr.getUserZiChanInfo(false);
  23682. xGame.eventMgr.event(LOGIN_IN);
  23683. this.closeSelf();
  23684. }
  23685. else {
  23686. xGame.uiMgr.Show(UIMsg$1, msg);
  23687. }
  23688. }
  23689. catch (error) {
  23690. console.log('error=' + error);
  23691. alert(error);
  23692. }
  23693. finally {
  23694. }
  23695. });
  23696. }
  23697. else {
  23698. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23699. }
  23700. }
  23701. gotoRegPage() {
  23702. this.closeSelf();
  23703. xGame.uiMgr.Show(UIReg$1);
  23704. }
  23705. }
  23706. UILogin$1.uiName = "UILogin";
  23707. class UIReg$1 extends UIBase {
  23708. constructor() {
  23709. super();
  23710. }
  23711. onConstructor() {
  23712. this.ui = ui_UIReg.createInstance();
  23713. this.contentPane = this.ui;
  23714. this.isEject = false;
  23715. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23716. this.addUIClick(this.ui.btn_reg, this.regUser);
  23717. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23718. }
  23719. show() {
  23720. super.show();
  23721. this.x = (Laya.stage.width - this.width) / 2;
  23722. this.y = (Laya.stage.height - this.height) / 2;
  23723. this.setGlobalFont(this.ui);
  23724. }
  23725. closeSelf() {
  23726. this.hide();
  23727. }
  23728. regUser() {
  23729. this.ui.lab_tip.visible = false;
  23730. let ua = this.ui.txt_ua.text;
  23731. let up1 = this.ui.txt_up1.text;
  23732. let up2 = this.ui.txt_up2.text;
  23733. if (ua && up1 && up2 && up1 == up2) {
  23734. let reqData = JSON.stringify({
  23735. username: ua.trim(),
  23736. password: up1.trim(),
  23737. fromMark: 'app_game'
  23738. });
  23739. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23740. try {
  23741. console.log('zh:res = ' + JSON.stringify(res));
  23742. let code = res.code;
  23743. let msg = res.msg;
  23744. xGame.uiMgr.Show(UIMsg$1, msg);
  23745. if (code == 200) {
  23746. this.ui.lab_tip.color = "#FFFFFF";
  23747. xGame.uiMgr.Show(UIMsg$1, msg);
  23748. this.closeSelf();
  23749. }
  23750. else {
  23751. this.ui.lab_tip.color = "#FF0000";
  23752. xGame.uiMgr.Show(UIMsg$1, msg);
  23753. }
  23754. }
  23755. catch (error) {
  23756. console.log('error=' + error);
  23757. alert(error);
  23758. }
  23759. finally {
  23760. }
  23761. });
  23762. }
  23763. else {
  23764. if (up1 != up2) {
  23765. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23766. }
  23767. else {
  23768. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23769. }
  23770. }
  23771. }
  23772. gotoLogin() {
  23773. this.closeSelf();
  23774. xGame.uiMgr.Show(UILogin$1);
  23775. }
  23776. }
  23777. UIReg$1.uiName = "UIReg";
  23778. class UIFuli1$1 extends UIBase {
  23779. constructor() {
  23780. super();
  23781. this.jiage = 4.99;
  23782. }
  23783. onConstructor() {
  23784. this.ui = ui_UIFuli1.createInstance();
  23785. this.contentPane = this.ui;
  23786. this.isEject = false;
  23787. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23788. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23789. }
  23790. show() {
  23791. super.show();
  23792. this.x = (Laya.stage.width - this.width) / 2;
  23793. this.y = (Laya.stage.height - this.height) / 2;
  23794. this.ui.n2.txt_price.text = "$" + this.jiage;
  23795. this.setGlobalFont(this.ui);
  23796. }
  23797. closeSelf() {
  23798. DataMgr.loadUserSpOrderForAd();
  23799. this.hide();
  23800. }
  23801. gotoBuy() {
  23802. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23803. if (userInfo != null) {
  23804. let token = userInfo.token;
  23805. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  23806. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  23807. DataMgr.loadUserSpOrderForAd();
  23808. return;
  23809. }
  23810. else {
  23811. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23812. }
  23813. }
  23814. gotoBuy2() {
  23815. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23816. if (userInfo == null) {
  23817. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23818. return;
  23819. }
  23820. let reqData = xGame.httpMgr.getReqData();
  23821. let pd = JSON.parse(reqData);
  23822. pd.productId = 1;
  23823. reqData = JSON.stringify(pd);
  23824. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23825. try {
  23826. console.log('zh:buySp res = ' + JSON.stringify(res));
  23827. let code = res.code;
  23828. let msg = res.msg;
  23829. if (code == 401) {
  23830. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23831. alert(TIP_MSG_key.loginTimeOut);
  23832. xGame.uiMgr.Show(UIMsg$1, msg);
  23833. return;
  23834. }
  23835. if (code == 200) {
  23836. xGame.uiMgr.Show(UIMsg$1, msg);
  23837. DataMgr.loadUserSpOrderForAd();
  23838. DataMgr.getUserZiChanInfo(false);
  23839. this.closeSelf();
  23840. }
  23841. else {
  23842. xGame.uiMgr.Show(UIMsg$1, msg);
  23843. }
  23844. }
  23845. catch (error) {
  23846. console.log('error=' + error);
  23847. alert(error);
  23848. }
  23849. finally {
  23850. }
  23851. });
  23852. }
  23853. }
  23854. UIFuli1$1.uiName = "UIFuli1";
  23855. class UIFuli2$1 extends UIBase {
  23856. constructor() {
  23857. super();
  23858. this.jiage = 14.99;
  23859. }
  23860. onConstructor() {
  23861. this.ui = ui_UIFuli2.createInstance();
  23862. this.contentPane = this.ui;
  23863. this.isEject = false;
  23864. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23865. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23866. }
  23867. show() {
  23868. super.show();
  23869. this.x = (Laya.stage.width - this.width) / 2;
  23870. this.y = (Laya.stage.height - this.height) / 2;
  23871. this.ui.n2.txt_price.text = "$" + this.jiage;
  23872. this.ui.n2.n_zzq_fl2.url = 'res/fuli2.png';
  23873. this.setGlobalFont(this.ui);
  23874. }
  23875. closeSelf() {
  23876. DataMgr.loadUserSpOrderForAd();
  23877. this.hide();
  23878. }
  23879. gotoBuy() {
  23880. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23881. if (userInfo != null) {
  23882. let token = userInfo.token;
  23883. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  23884. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  23885. DataMgr.loadUserSpOrderForAd();
  23886. return;
  23887. }
  23888. else {
  23889. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23890. }
  23891. }
  23892. gotoBuy1() {
  23893. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23894. if (userInfo == null) {
  23895. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23896. return;
  23897. }
  23898. let reqData = xGame.httpMgr.getReqData();
  23899. let pd = JSON.parse(reqData);
  23900. pd.productId = 2;
  23901. reqData = JSON.stringify(pd);
  23902. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23903. try {
  23904. console.log('zh:buySp res = ' + JSON.stringify(res));
  23905. let code = res.code;
  23906. let msg = res.msg;
  23907. if (code == 401) {
  23908. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23909. alert(TIP_MSG_key.loginTimeOut);
  23910. xGame.uiMgr.Show(UIMsg$1, msg);
  23911. return;
  23912. }
  23913. if (code == 200) {
  23914. xGame.uiMgr.Show(UIMsg$1, msg);
  23915. DataMgr.loadUserSpOrderForAd();
  23916. DataMgr.getUserZiChanInfo(false);
  23917. this.closeSelf();
  23918. }
  23919. else {
  23920. xGame.uiMgr.Show(UIMsg$1, msg);
  23921. }
  23922. }
  23923. catch (error) {
  23924. console.log('error=' + error);
  23925. alert(error);
  23926. }
  23927. finally {
  23928. }
  23929. });
  23930. }
  23931. }
  23932. UIFuli2$1.uiName = "UIFuli2";
  23933. class UITry$1 extends UIBase {
  23934. constructor() {
  23935. super();
  23936. this.closeTime = 0;
  23937. this.closeNum = 0;
  23938. this.skillUrl = xGame.common.skillIconList;
  23939. }
  23940. onConstructor() {
  23941. this.ui = ui_UITry.createInstance();
  23942. this.contentPane = this.ui;
  23943. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  23944. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  23945. }
  23946. show() {
  23947. super.show();
  23948. this.closeNum = 0;
  23949. this.closeTime = 15;
  23950. this.ui.t0.play();
  23951. PlatMgr.showRateBanner();
  23952. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23953. Laya.timer.loop(1000, this, this.updateTime);
  23954. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  23955. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  23956. xGame.common.gameMgr.gamePause = true;
  23957. this.setGlobalFont(this.ui);
  23958. }
  23959. updateTime() {
  23960. if (this.closeTime > 1) {
  23961. this.closeTime--;
  23962. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23963. }
  23964. else
  23965. this.hide();
  23966. }
  23967. hide() {
  23968. Laya.timer.clearAll(this);
  23969. Moyu.showBannerAd(false);
  23970. super.hide();
  23971. xGame.common.gameMgr.gamePause = false;
  23972. }
  23973. onTry() {
  23974. console.log('zh:qjff_AD_for_uitry');
  23975. if (Laya.Browser.onAndroid) {
  23976. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23977. if (!boo) {
  23978. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23979. return;
  23980. }
  23981. }
  23982. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  23983. }
  23984. else {
  23985. console.log('zh:AD 失败,直接发放奖励');
  23986. this.qjff_AD_for_uitry();
  23987. }
  23988. }
  23989. qjff_AD_for_uitry() {
  23990. let select = xGame.common.curPlayerSkillType;
  23991. DataMgr.gameData.trySkill = select;
  23992. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  23993. DataMgr.saveGameData();
  23994. DataMgr.setBigSkill(select, 1);
  23995. xGame.showTip("Trial Successful");
  23996. this.hide();
  23997. }
  23998. onCancel() {
  23999. if (this.closeNum > 0) {
  24000. this.closeNum--;
  24001. if (this.closeNum < 2)
  24002. this.hide();
  24003. return;
  24004. }
  24005. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  24006. this.onTry();
  24007. }
  24008. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  24009. this.closeNum = 3;
  24010. }
  24011. else
  24012. this.hide();
  24013. }
  24014. }
  24015. UITry$1.uiName = "UITry";
  24016. class UIGetAward$1 extends UIBase {
  24017. constructor() {
  24018. super();
  24019. this.showTriple = true;
  24020. }
  24021. onConstructor() {
  24022. this.ui = ui_UIGetAward.createInstance();
  24023. this.contentPane = this.ui;
  24024. this.isEject = false;
  24025. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  24026. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  24027. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  24028. }
  24029. show(arr, showTriple, callback) {
  24030. super.show();
  24031. this.ui.t0.play();
  24032. this.ui.eftNode.visible = true;
  24033. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  24034. this.ui.eftNode.visible = false;
  24035. }), 1, 0, 0, 0.9);
  24036. this.awardArr = arr;
  24037. this.showTriple = showTriple;
  24038. this.callback = callback;
  24039. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  24040. this.ui.myList.numItems = arr.length;
  24041. xGame.soundMgr.playSound("getaward");
  24042. this.setGlobalFont(this.ui);
  24043. }
  24044. updateSelf(index, obj) {
  24045. let temp = this.awardArr[index];
  24046. let icon = this.getIcon(temp.type);
  24047. let str = icon;
  24048. if (temp.type > 2) {
  24049. str = "s" + icon;
  24050. }
  24051. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  24052. obj.myIcon.rotation = 0;
  24053. obj.numTxt.text = temp.num + "";
  24054. obj.numTxt.visible = temp.type > 2 ? false : true;
  24055. obj.nameTxt.text = this.getNameStr(temp.type);
  24056. }
  24057. renderItem(index, obj) {
  24058. this.updateSelf(index, obj);
  24059. }
  24060. tripleGetAward() {
  24061. console.log('zh:qjff_AD_for_uigetAward');
  24062. if (Laya.Browser.onAndroid) {
  24063. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24064. if (!boo) {
  24065. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24066. return;
  24067. }
  24068. }
  24069. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  24070. }
  24071. else {
  24072. console.log('zh:AD 失败,直接发放奖励');
  24073. this.qjff_AD_for_uigetAward();
  24074. }
  24075. }
  24076. qjff_AD_for_uigetAward() {
  24077. this.getAward(3);
  24078. }
  24079. normalGetAward() {
  24080. if (PlatMgr.isMisVideo())
  24081. this.tripleGetAward();
  24082. else
  24083. this.getAward();
  24084. }
  24085. getAward(times = 1) {
  24086. this.hide();
  24087. for (let index = 0; index < this.awardArr.length; index++) {
  24088. this.awardArr[index].num *= times;
  24089. }
  24090. this.callback && this.callback(times != 1);
  24091. }
  24092. getIcon(type) {
  24093. switch (type) {
  24094. case Prop.diamond:
  24095. return "ty_zs";
  24096. case Prop.coin:
  24097. return "ty_jb";
  24098. case Prop.gan1:
  24099. return "qg1";
  24100. case Prop.gan2:
  24101. return "qg2";
  24102. case Prop.gan3:
  24103. return "qg3";
  24104. case Prop.gan4:
  24105. return "qg4";
  24106. default:
  24107. break;
  24108. }
  24109. }
  24110. getNameStr(type) {
  24111. switch (type) {
  24112. case Prop.diamond:
  24113. return "Diamond";
  24114. case Prop.coin:
  24115. return "Coins";
  24116. case Prop.gan1:
  24117. case Prop.gan2:
  24118. case Prop.gan3:
  24119. case Prop.gan4:
  24120. return cfgTable.ballrodData[type - 1].name;
  24121. default:
  24122. break;
  24123. }
  24124. }
  24125. }
  24126. UIGetAward$1.uiName = "UIGetAward";
  24127. class UIBox$1 extends UIBase {
  24128. constructor() {
  24129. super();
  24130. this.boxNum = 0;
  24131. this.boxMax = 10;
  24132. this.inAd = false;
  24133. this.isClose = false;
  24134. }
  24135. onConstructor() {
  24136. this.ui = ui_UIBox.createInstance();
  24137. this.contentPane = this.ui;
  24138. this.isEject = false;
  24139. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  24140. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  24141. Laya.timer.loop(1000, this, this.update);
  24142. }
  24143. update() {
  24144. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  24145. this.boxNum -= 1;
  24146. this.upBar();
  24147. }
  24148. }
  24149. upBar() {
  24150. if (this.boxNum > this.boxMax)
  24151. this.boxNum = this.boxMax;
  24152. this.ui.bar.value = this.boxNum * 10;
  24153. }
  24154. show() {
  24155. super.show();
  24156. this.isClose = false;
  24157. this.boxNum = 0;
  24158. this.inAd = false;
  24159. this.upBar();
  24160. this.ui.t0.play();
  24161. this.ui.closeBtn.visible = false;
  24162. Laya.timer.once(3000, this, () => {
  24163. this.ui.closeBtn.visible = true;
  24164. this.ui.bar.alpha = 1;
  24165. });
  24166. Laya.timer.once(500, this, () => {
  24167. this.ui.t1.play();
  24168. });
  24169. this.setGlobalFont(this.ui);
  24170. }
  24171. hide() {
  24172. Laya.timer.clearAll(this);
  24173. Moyu.showBannerAd(false);
  24174. super.hide();
  24175. }
  24176. onOpenBox() {
  24177. this.boxNum++;
  24178. if (this.boxNum < this.boxMax) {
  24179. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  24180. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  24181. }
  24182. }
  24183. else if (this.boxNum == this.boxMax) {
  24184. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  24185. this.ui.openBtn.c1.selectedIndex = 13;
  24186. this.inAd = true;
  24187. }
  24188. else
  24189. this.getAward();
  24190. }
  24191. else if (this.inAd) {
  24192. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  24193. if (Laya.Browser.onAndroid) {
  24194. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24195. if (!boo) {
  24196. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24197. return;
  24198. }
  24199. }
  24200. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  24201. }
  24202. else {
  24203. console.log('zh:AD 失败,直接发放奖励');
  24204. this.qjff_AD_for_UIBOX_onOpenBox();
  24205. }
  24206. }
  24207. this.upBar();
  24208. }
  24209. qjff_AD_for_UIBOX_onOpenBox() {
  24210. this.getAward();
  24211. }
  24212. onCloseBox() {
  24213. if (this.isClose)
  24214. this.hide();
  24215. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  24216. this.isClose = true;
  24217. PlatMgr.showBanner(true, 0, 3000);
  24218. }
  24219. else
  24220. this.hide();
  24221. }
  24222. getAward() {
  24223. let str = "";
  24224. if (Math.random() < 0.5) {
  24225. let max = Moyu.isLegal ? 500 : 2500;
  24226. let num = xGame.tools.random(max, 500 + max);
  24227. DataMgr.setCoin(num);
  24228. str = "金币x" + num;
  24229. }
  24230. else {
  24231. let max = Moyu.isLegal ? 10 : 30;
  24232. let num = xGame.tools.random(max, 30 + max);
  24233. DataMgr.setDiamond(num);
  24234. str = "钻石x" + num;
  24235. }
  24236. xGame.showTip("恭喜获得-" + str);
  24237. this.hide();
  24238. }
  24239. }
  24240. UIBox$1.uiName = "UIBox";
  24241. class UIMain$1 extends UIBase {
  24242. constructor() {
  24243. super();
  24244. this.firstEnter = true;
  24245. }
  24246. nativeCallJs(msg) {
  24247. let t = msg;
  24248. console.log("zh: nativeCallJs 奖励开始发放:", t);
  24249. switch (t) {
  24250. case 'qjff_chouJiang':
  24251. let dui = xGame.uiMgr.getUI(UIDraw$1);
  24252. dui.qjff_chouJiang();
  24253. break;
  24254. case 'qjff_AD_for_uisign':
  24255. let dui2 = xGame.uiMgr.getUI(UISign$1);
  24256. dui2.qjff_AD_for_uisign();
  24257. break;
  24258. case 'qjff_AD_for_uitry':
  24259. let dui3 = xGame.uiMgr.getUI(UITry$1);
  24260. dui3.qjff_AD_for_uitry();
  24261. break;
  24262. case 'qjff_AD_for_uipower':
  24263. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  24264. dui4.qjff_AD_for_uipower();
  24265. break;
  24266. case 'qjff_AD_for_uigetAward':
  24267. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  24268. dui5.qjff_AD_for_uigetAward();
  24269. break;
  24270. case 'qjff_AD_for_uiGameEnd':
  24271. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  24272. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  24273. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  24274. break;
  24275. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  24276. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  24277. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  24278. break;
  24279. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  24280. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  24281. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  24282. break;
  24283. case 'qjff_AD_for_UIrepentProp_videoRegret':
  24284. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  24285. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  24286. break;
  24287. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  24288. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  24289. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  24290. break;
  24291. case 'qjff_AD_for_UIBOX_onOpenBox':
  24292. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  24293. dui11.qjff_AD_for_UIBOX_onOpenBox();
  24294. break;
  24295. case 'qjff_AD_for_UIAddCoin':
  24296. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24297. dui12.qjff_AD_for_UIAddCoin();
  24298. break;
  24299. case 'app_sign_for_buyProduct_onSuccess':
  24300. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  24301. DataMgr.getUserZiChanInfo(false);
  24302. break;
  24303. case '222axxxxxx':
  24304. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24305. dui15.qjff_AD_for_uisign();
  24306. break;
  24307. case '333axsxxxxxx':
  24308. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24309. dui16.qjff_AD_for_uisign();
  24310. break;
  24311. default:
  24312. console.log('zh:未知的方法名字' + t);
  24313. break;
  24314. }
  24315. }
  24316. onConstructor() {
  24317. console.log('zh: UIMain onConstructor');
  24318. this.ui = ui_UIMain.createInstance();
  24319. this.contentPane = this.ui;
  24320. this.isEject = false;
  24321. this.addEvent();
  24322. this.addClickSpine();
  24323. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24324. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24325. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24326. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24327. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24328. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24329. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24330. let curUse = DataMgr.getCurSecretary();
  24331. this.changeSecretary(curUse);
  24332. this.ui.talkNode.visible = false;
  24333. let guide = DataMgr.getSkillGuide();
  24334. if (xGame.common.isNewDay && guide == 1) {
  24335. xGame.common.isNewDay = false;
  24336. xGame.soundMgr.playSound("s_main01");
  24337. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24338. console.log("zh:播放小秘书每天语音");
  24339. }
  24340. this.onGetUserInfo();
  24341. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24342. DataMgr.getUserZiChanInfo(false);
  24343. }
  24344. this.ui.n83.visible = false;
  24345. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24346. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24347. let ua = d.username;
  24348. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24349. }
  24350. this.c_btn_for_user();
  24351. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24352. }
  24353. Logout() {
  24354. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24355. LocalStorageManager.removeItem(keyForLoginInfo);
  24356. this.freshUser();
  24357. }
  24358. JSBridgeUtils.instance.loginOutForApp();
  24359. this.setUserDefaultNickname();
  24360. DataMgr.setCoin2(4000);
  24361. DataMgr.setDiamond2(0);
  24362. this.setDefaultQiuGanInfo();
  24363. DataMgr.setPlaceBallLevelList("");
  24364. DataMgr.setChallengeMode_overLev(1);
  24365. this.setDefaultSignData();
  24366. }
  24367. setDefaultSignData() {
  24368. DataMgr.setSignData(1);
  24369. DataMgr.setSignTime(new Date().getTime());
  24370. }
  24371. setDefaultQiuGanInfo() {
  24372. DataMgr.setBallRod(0, 1);
  24373. DataMgr.setBallRod(1, 0);
  24374. DataMgr.setBallRod(2, 0);
  24375. DataMgr.setBallRod(3, 0);
  24376. DataMgr.setBallRod(4, 0);
  24377. DataMgr.setBallRod(5, 1);
  24378. }
  24379. setUserDefaultNickname() {
  24380. let defUsername = "player";
  24381. this.ui.headNode.nameTxt.text = defUsername;
  24382. DataMgr.updateUserNickName(defUsername);
  24383. Moyu.updateUserInfo(defUsername);
  24384. }
  24385. gotoLogin() {
  24386. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  24387. xGame.uiMgr.Show(UILogin$1);
  24388. }
  24389. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  24390. this.Logout();
  24391. }
  24392. }
  24393. gotoRegUser() {
  24394. xGame.uiMgr.Show(UIReg$1);
  24395. }
  24396. showFuLiSp1() {
  24397. console.log('zh:福利1');
  24398. this.checkForShowFuLi17(1);
  24399. }
  24400. showFuLiSp7() {
  24401. console.log('zh:福利7');
  24402. this.checkForShowFuLi17(7);
  24403. }
  24404. checkForShowFuLi17(spid) {
  24405. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24406. if (userInfo == null) {
  24407. if (spid === 1) {
  24408. xGame.uiMgr.Show(UIFuli1$1);
  24409. }
  24410. if (spid === 7) {
  24411. xGame.uiMgr.Show(UIFuli2$1);
  24412. }
  24413. return;
  24414. }
  24415. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  24416. let reqData = xGame.httpMgr.getReqData();
  24417. let pd = JSON.parse(reqData);
  24418. pd.productId = spid;
  24419. reqData = JSON.stringify(pd);
  24420. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  24421. try {
  24422. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  24423. let code = res.code;
  24424. let msg = res.msg;
  24425. if (code == 401) {
  24426. Laya.LocalStorage.removeItem(keyForLoginInfo);
  24427. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24428. return;
  24429. }
  24430. if (code == 200) {
  24431. let isBuyOk = res.data;
  24432. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  24433. if (isBuyOk === false) {
  24434. if (spid === 1) {
  24435. xGame.uiMgr.Show(UIFuli1$1);
  24436. }
  24437. if (spid === 7) {
  24438. xGame.uiMgr.Show(UIFuli2$1);
  24439. }
  24440. }
  24441. else {
  24442. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  24443. }
  24444. }
  24445. else {
  24446. xGame.uiMgr.Show(UIMsg$1, msg);
  24447. }
  24448. }
  24449. catch (error) {
  24450. console.log('error=' + error);
  24451. alert(error);
  24452. }
  24453. finally {
  24454. }
  24455. });
  24456. }
  24457. c_btn_for_user() {
  24458. this.ui.n_dengLu.c1.selectedIndex = 0;
  24459. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24460. this.ui.n_dengLu.c1.selectedIndex = 1;
  24461. }
  24462. else {
  24463. this.ui.n_dengLu.c1.selectedIndex = 0;
  24464. }
  24465. }
  24466. changeSecretary(curUse) {
  24467. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24468. xGame.common.secretary && xGame.common.secretary.dispose();
  24469. this.addSecretarySpine(name);
  24470. }
  24471. addSecretarySpine(name) {
  24472. let spine = new SpineMgr(name, () => {
  24473. this.playSecretaryIdle();
  24474. });
  24475. xGame.common.secretary = spine;
  24476. }
  24477. addClickSpine() {
  24478. let clickSpine = new SpineMgr("dianji", () => {
  24479. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24480. let parent = Laya.stage;
  24481. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24482. clickSpine.play(data, 0, false, parent, (spine) => {
  24483. spine.destroy(true);
  24484. });
  24485. });
  24486. });
  24487. }
  24488. addEvent() {
  24489. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24490. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24491. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  24492. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24493. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24494. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24495. this.addUIClick(this.ui, this.interuptSecretary);
  24496. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24497. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24498. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24499. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24500. this.addUIClick(this.ui.signBtn, this.openSignView);
  24501. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24502. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24503. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24504. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24505. }
  24506. show(showFailWords) {
  24507. super.show();
  24508. DataMgr.loadUserSpOrderForAd();
  24509. this.moneyNode.ui.c1.selectedIndex = 1;
  24510. this.playSecretaryIdle();
  24511. xGame.soundMgr.playMusic("caromhall01", 0);
  24512. Laya.timer.clearAll(this);
  24513. this.playSecretaryRandomSound();
  24514. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24515. if (showFailWords) {
  24516. console.log('zh:uimain.ts ');
  24517. setTimeout(() => {
  24518. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24519. let words = -1;
  24520. if (str == "s_main02") {
  24521. words = 2;
  24522. }
  24523. else {
  24524. words = 3;
  24525. }
  24526. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24527. xGame.soundMgr.playSound(str);
  24528. }, 300);
  24529. }
  24530. this.showGuide();
  24531. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24532. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24533. let guide = DataMgr.getSkillGuide();
  24534. if (guide == 1) {
  24535. let randTime = xGame.common.randomNum(300, 800);
  24536. if (this.firstEnter) {
  24537. console.log("zh: firstEnter");
  24538. this.firstEnter = false;
  24539. randTime += 900;
  24540. }
  24541. else {
  24542. console.log("zh: no firstEnter");
  24543. }
  24544. Laya.timer.once(randTime, this, () => {
  24545. });
  24546. Laya.timer.once(1000, this, () => {
  24547. console.log('zh: 1秒后 showFuLiSp1');
  24548. this.showFuLiSp1();
  24549. });
  24550. Laya.timer.once(10000, this, () => {
  24551. console.log('zh: 10秒后 showFuLiSp1');
  24552. this.showFuLiSp7();
  24553. });
  24554. }
  24555. this.setGlobalFont(this.ui);
  24556. }
  24557. checkActive(show) {
  24558. }
  24559. showGuide() {
  24560. let guide = DataMgr.getSkillGuide();
  24561. this.ui.guideBtn.visible = guide == 0;
  24562. this.ui.enterGuide.visible = false;
  24563. this.ui.secretaryGuide.visible = guide == 0;
  24564. if (guide == 0) {
  24565. console.log("zh:显示引导");
  24566. xGame.soundMgr.playSound("s_guide");
  24567. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24568. }
  24569. else {
  24570. console.log("zh:不需要显示引导");
  24571. }
  24572. }
  24573. ensureSecretary() {
  24574. console.log('zh: ensureSecretary ');
  24575. this.ui.secretaryGuide.visible = false;
  24576. this.ui.enterGuide.visible = true;
  24577. this.ui.wordsNode.t0.play();
  24578. if (DataMgr.getNewUser())
  24579. Moyu.sendDataEvent("gameReady");
  24580. }
  24581. playSecretaryIdle() {
  24582. let parent = this.ui.secretary.displayObject;
  24583. parent.destroyChildren();
  24584. let xx = this.ui.secretary.width / 2;
  24585. let yy = this.ui.secretary.height;
  24586. let scale = xGame.common.getSecretaryScale();
  24587. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24588. xGame.common.secretary.play(data, 0, true, parent);
  24589. }
  24590. startGame(type) {
  24591. if (!this.isReadyForLoadNetSource()) {
  24592. return;
  24593. }
  24594. xGame.common.gameMode = type;
  24595. Moyu.sendDataEvent("PlayGame", { type: type });
  24596. let gm = xGame.common.gameMode;
  24597. console.log('zh:进入游戏gameMode =' + gm);
  24598. switch (gm) {
  24599. case GameMode.classic:
  24600. console.log('zh:进入经典模式111111111');
  24601. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  24602. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24603. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  24604. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  24605. console.log('zh:判断是否可以玩该模式classic =NO');
  24606. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  24607. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24608. return;
  24609. }
  24610. else {
  24611. console.log('zh:可以玩该模式classic');
  24612. this.beginGame();
  24613. }
  24614. }
  24615. else {
  24616. console.log('zh:不需要判断是否可以玩该classic');
  24617. let challengeTimes = DataMgr.getChallengeTimes();
  24618. if (challengeTimes == 0) {
  24619. xGame.uiMgr.Show(UIInvitation$1);
  24620. }
  24621. else {
  24622. this.beginGame();
  24623. }
  24624. }
  24625. break;
  24626. case GameMode.bigMove:
  24627. console.info('zh:bigMove check 大招');
  24628. let guide = DataMgr.getSkillGuide();
  24629. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  24630. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24631. console.log('zh:bigMove db_over_lev=', db_over_lev);
  24632. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  24633. console.log('zh:提示不可以玩');
  24634. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  24635. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24636. return;
  24637. }
  24638. else {
  24639. console.log('zh:可以玩该模式 bigMove');
  24640. this.beginGame();
  24641. if (DataMgr.getNewUser())
  24642. Moyu.sendDataEvent("gameStart0");
  24643. }
  24644. }
  24645. else {
  24646. this.beginGame();
  24647. if (DataMgr.getNewUser())
  24648. Moyu.sendDataEvent("gameStart0");
  24649. }
  24650. break;
  24651. default:
  24652. console.error('zh:未知错误!!!!');
  24653. break;
  24654. }
  24655. }
  24656. beginGame(isNice = false) {
  24657. console.log('zh:beginGame ');
  24658. let guide = DataMgr.getSkillGuide();
  24659. if (guide == 1) {
  24660. console.log('zh:非新手引导,showInternAd ');
  24661. JSBridgeUtils.instance.showInternAd('beginGame');
  24662. }
  24663. else {
  24664. console.log('zh:新手引导,不显示AD ');
  24665. }
  24666. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  24667. console.log('zh:beginGame 1');
  24668. if (xGame.common.gameMode == GameMode.classic) {
  24669. console.log('zh:beginGame 2');
  24670. if (isNice) {
  24671. console.log('zh:进入巅峰赛');
  24672. this.enterClassic();
  24673. }
  24674. else {
  24675. console.log('zh:beginGame 3-1');
  24676. xGame.uiMgr.Show(UIModeSelection$1, () => {
  24677. console.log('zh:beginGame 3-2');
  24678. this.enterClassic();
  24679. });
  24680. }
  24681. }
  24682. else if (xGame.common.gameMode == GameMode.bigMove) {
  24683. console.log('zh:beginGame 5');
  24684. this.ui.enterGuide.visible = false;
  24685. xGame.uiMgr.Show(UISkill$1);
  24686. }
  24687. }
  24688. enterClassic() {
  24689. console.log('zh:beginGame 7');
  24690. xGame.uiMgr.Show(UIGame$1);
  24691. xGame.uiMgr.Show(UIMatching$1, () => {
  24692. if (!this.isHide)
  24693. this.hide();
  24694. xGame.common.gameUI.ui.alpha = 1;
  24695. console.log('zh:beginGame 8');
  24696. xGame.common.gameUI.startGame();
  24697. xGame.uiMgr.Hide(UIGameEnd$1);
  24698. });
  24699. }
  24700. start_debug_for_moni_payOk() {
  24701. console.log('zh:start_debug_for_moni_payOk');
  24702. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24703. if (userInfo != null) {
  24704. let token = userInfo.token;
  24705. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  24706. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  24707. alert('模拟支付OK');
  24708. return;
  24709. }
  24710. else {
  24711. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24712. }
  24713. }
  24714. startGlobal() {
  24715. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  24716. }
  24717. startWeekly() {
  24718. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  24719. }
  24720. zhouSaiMonth() {
  24721. console.log('zh: zhouSaiMonth 被调用');
  24722. }
  24723. isReadyForLoadNetSource() {
  24724. let reqCount = xGame.cfgMgr.httpReqCount;
  24725. let ok = xGame.cfgMgr.httpReqOkCount;
  24726. if (reqCount > ok) {
  24727. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  24728. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  24729. Laya.timer.once(5000, this, () => {
  24730. let retryCount = 0;
  24731. const maxRetries = 3;
  24732. const tryFetchConfig = () => {
  24733. try {
  24734. xGame.cfgMgr.getConfigFromServer();
  24735. }
  24736. catch (error) {
  24737. if (retryCount < maxRetries) {
  24738. retryCount++;
  24739. console.log(`🔄 第${retryCount}次重试获取配置...`);
  24740. Laya.timer.once(5000, this, tryFetchConfig);
  24741. }
  24742. else {
  24743. console.error("❌ 达到最大重试次数,配置获取失败");
  24744. }
  24745. }
  24746. };
  24747. tryFetchConfig();
  24748. });
  24749. return false;
  24750. }
  24751. return true;
  24752. }
  24753. startPlaceBall() {
  24754. if (!this.isReadyForLoadNetSource()) {
  24755. return;
  24756. }
  24757. xGame.uiMgr.Show(UILevelDisplay$1);
  24758. }
  24759. hide() {
  24760. console.log('zh:uimain hide ...');
  24761. super.hide();
  24762. xGame.common.stopGirlPop(this.ui.talkNode);
  24763. }
  24764. onGetUserInfo(force = false) {
  24765. if (Moyu.isWx) {
  24766. let info = Moyu.getSystemInfo();
  24767. if (info)
  24768. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24769. }
  24770. else {
  24771. Moyu.initUser(this, this.freshUser, force);
  24772. }
  24773. this.freshUser();
  24774. console.log('zh:5秒后更新用户信息');
  24775. setTimeout(() => {
  24776. DataMgr.getUserZiChanInfo(true);
  24777. }, 5000);
  24778. }
  24779. event_login_in() {
  24780. console.log("zh:event_login_in被触发");
  24781. this.freshUser();
  24782. }
  24783. freshUser() {
  24784. let user = Moyu.getUserInfo();
  24785. if (!user.isAuth) {
  24786. user.headIcon = 'res/ty_touxiang.png';
  24787. }
  24788. else {
  24789. DataMgr.upRankData();
  24790. }
  24791. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24792. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24793. let keyStr = keyForLoginInfo;
  24794. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24795. const d = LocalStorageManager.getItem(keyStr);
  24796. let ua = d.username;
  24797. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24798. }
  24799. else {
  24800. }
  24801. this.c_btn_for_user();
  24802. }
  24803. interuptSecretary() {
  24804. Laya.timer.clearAll(this);
  24805. this.playSecretaryRandomSound();
  24806. }
  24807. playSecretaryRandomSound() {
  24808. if (this.isHide)
  24809. return;
  24810. let time = xGame.common.randomNum(45000, 60000);
  24811. Laya.timer.once(time, this, () => {
  24812. if (this.isHide)
  24813. return;
  24814. let index = xGame.common.randomNum(4, 7);
  24815. xGame.soundMgr.playSound("s_main0" + index);
  24816. let words = 1;
  24817. switch (index) {
  24818. case 4:
  24819. words = 5;
  24820. break;
  24821. case 5:
  24822. words = 3;
  24823. break;
  24824. case 6:
  24825. words = 6;
  24826. break;
  24827. case 7:
  24828. words = 7;
  24829. break;
  24830. default:
  24831. break;
  24832. }
  24833. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24834. this.playSecretaryRandomSound();
  24835. });
  24836. }
  24837. openSecretaryView() {
  24838. xGame.uiMgr.Show(UISecretary$1);
  24839. Moyu.sendDataEvent("secretary");
  24840. }
  24841. openShopView() {
  24842. xGame.uiMgr.Show(UIShop$1, 1);
  24843. }
  24844. openShopView0() {
  24845. xGame.uiMgr.Show(UIShop$1, 0);
  24846. }
  24847. openSignView() {
  24848. xGame.uiMgr.Show(UISign$1);
  24849. }
  24850. openDrawView() {
  24851. xGame.uiMgr.Show(UIDraw$1);
  24852. }
  24853. openRanking() {
  24854. console.log('zh:phb openRanking');
  24855. xGame.uiMgr.Show(UIRanking$1);
  24856. Moyu.sendDataEvent("rankingList");
  24857. }
  24858. }
  24859. UIMain$1.uiName = "UIMain";
  24860. function InitShader() {
  24861. }
  24862. function appInit() {
  24863. xGame.context.init(getLoadingResList(), initCallback);
  24864. }
  24865. function getLoadingResList() {
  24866. return [
  24867. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24868. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24869. ];
  24870. }
  24871. function getGameResList() {
  24872. return [
  24873. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24874. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24875. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24876. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24877. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24878. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24879. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24880. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24881. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24882. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24883. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24884. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24885. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24886. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24887. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24888. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24889. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24890. ];
  24891. }
  24892. function initCallback() {
  24893. window["DataMgr"] = DataMgr;
  24894. DataMgr.Init();
  24895. Moyu.init(getPlat(), this, () => {
  24896. DataMgr.isNewDay();
  24897. PlatMgr.initConfig();
  24898. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24899. }, true);
  24900. console.log('zh:开始sm init1 start');
  24901. xGame.soundMgr.init();
  24902. console.log('zh:开始sm init1 end');
  24903. xGame.uiMgr.init();
  24904. xGame.uiMgr.clearTempData();
  24905. xGame.uiMgr.bindFUI(fguiRes.loading);
  24906. xGame.uiMgr.Show(UILoading);
  24907. }
  24908. function onFontLoaded() {
  24909. try {
  24910. Laya.Text.defaultFont = "arial";
  24911. console.log("zh: onFontLoaded 设置arial字体成功");
  24912. }
  24913. catch (error) {
  24914. console.log("zh: constructor onFontLoaded加载arial字体失败");
  24915. }
  24916. }
  24917. function loadSubRes(callback) {
  24918. var tab = ["asset", "res", "spine"];
  24919. let subDone = 0;
  24920. for (var i = 0; i < tab.length; i++) {
  24921. let sub = tab[i];
  24922. Moyu.loadSubRes(sub, (pro) => {
  24923. callback && callback(pro, false);
  24924. }).then(() => {
  24925. subDone++;
  24926. if (subDone >= tab.length)
  24927. callback && callback(1, true);
  24928. });
  24929. }
  24930. }
  24931. function enterGame() {
  24932. xGame.cfgMgr.init();
  24933. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  24934. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  24935. xGame.uiMgr.Hide(UILoading);
  24936. fgui.UIPackage.removePackage(fguiRes.loading);
  24937. xGame.uiMgr.bindFUI(fguiRes.game);
  24938. xGame.uiMgr.Show(UIMain$1);
  24939. if (DataMgr.getNewUser())
  24940. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  24941. }
  24942. function getPlat() {
  24943. let cfg = new MoyuCfg();
  24944. cfg.plat = MoyuPlat.web;
  24945. cfg.myId = 180;
  24946. cfg.myKey = '8848a885774230a4';
  24947. cfg.version = 0;
  24948. if (window.hasOwnProperty("gamebox")) {
  24949. cfg.plat = MoyuPlat.f399;
  24950. cfg.version = 0;
  24951. }
  24952. else if (window.hasOwnProperty("ks")) {
  24953. cfg.plat = MoyuPlat.ks;
  24954. cfg.version = 0;
  24955. cfg.ads.ksVideoId = '2300002254_01';
  24956. cfg.ads.ksInsertId = '2300002254_02';
  24957. }
  24958. else if (Laya.Browser.onTTMiniGame) {
  24959. cfg.plat = MoyuPlat.tt;
  24960. cfg.version = 0;
  24961. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  24962. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  24963. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  24964. }
  24965. else if (Laya.Browser.onMiniGame) {
  24966. cfg.plat = MoyuPlat.wx;
  24967. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  24968. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  24969. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  24970. }
  24971. else if (Laya.Browser.onQQMiniGame) {
  24972. cfg.plat = MoyuPlat.qq;
  24973. }
  24974. else if (Laya.Browser.onQGMiniGame) {
  24975. cfg.plat = MoyuPlat.op;
  24976. cfg.ads.opVideoId = '455502';
  24977. cfg.ads.opBannerId = '455507';
  24978. }
  24979. else if (Laya.Browser.onVVMiniGame) {
  24980. cfg.plat = MoyuPlat.vv;
  24981. cfg.version = 0;
  24982. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  24983. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  24984. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  24985. }
  24986. else if (Laya.Browser.onHWMiniGame) {
  24987. cfg.plat = MoyuPlat.hw;
  24988. }
  24989. else if (window["mz"]) {
  24990. cfg.plat = MoyuPlat.mz;
  24991. }
  24992. else {
  24993. let cfg = window['conchConfig'];
  24994. if (cfg) {
  24995. var os = cfg.getOS();
  24996. if (os == "Conch-ios") {
  24997. cfg.plat = MoyuPlat.ios;
  24998. }
  24999. else if (os == "Conch-android") {
  25000. }
  25001. }
  25002. }
  25003. return cfg;
  25004. }
  25005. class Main {
  25006. constructor() {
  25007. if (window["Laya3D"])
  25008. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  25009. else {
  25010. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  25011. this.initMain();
  25012. }
  25013. }
  25014. initMain() {
  25015. Laya["Physics"] && Laya["Physics"].enable();
  25016. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  25017. Laya.stage.scaleMode = GameConfig.scaleMode;
  25018. Laya.stage.screenMode = GameConfig.screenMode;
  25019. Laya.stage.alignV = GameConfig.alignV;
  25020. Laya.stage.alignH = GameConfig.alignH;
  25021. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  25022. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  25023. Laya.enableDebugPanel();
  25024. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  25025. Laya["PhysicsDebugDraw"].enable();
  25026. if (GameConfig.stat)
  25027. Laya.Stat.show();
  25028. Laya.alertGlobalError(true);
  25029. this.loadFont();
  25030. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  25031. }
  25032. loadFont() {
  25033. try {
  25034. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoaded));
  25035. console.log("zh: constructor加载arial字体成功1");
  25036. }
  25037. catch (error) {
  25038. console.log("zh: constructor加载arial字体失败1");
  25039. }
  25040. }
  25041. onFontLoaded() {
  25042. try {
  25043. Laya.Text.defaultFont = "Arial";
  25044. console.log("zh: onFontLoaded 设置arial字体成功1");
  25045. }
  25046. catch (error) {
  25047. console.log("zh: constructor onFontLoaded加载arial字体失败1");
  25048. }
  25049. }
  25050. onVersionLoaded() {
  25051. appInit();
  25052. }
  25053. }
  25054. new Main();
  25055. }());
  25056. //# sourceMappingURL=bundle.js.map