1
0

bundle.js 997 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923
  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. console.log('zh:jian kong bug1');
  2255. if (ball && ball.gameObj) {
  2256. }
  2257. else {
  2258. console.log('zh:jian kong bug2 如果到这里应该能看到一个alert弹框报错');
  2259. }
  2260. let dx = ball.gameObj.x;
  2261. let dy = ball.gameObj.y;
  2262. let kickAngle = 0;
  2263. if (score) {
  2264. dx = ball.kickPos.x;
  2265. dy = ball.kickPos.y;
  2266. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2267. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2268. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2269. if (adot > 1)
  2270. adot = 1;
  2271. kickAngle = Math.acos(adot) * 57.3;
  2272. if (kickAngle > 45) {
  2273. let kdx = ball.kickPos.x - ball.gameObj.x;
  2274. let kdy = ball.kickPos.y - ball.gameObj.y;
  2275. dx = ball.kickPos.x - kdx * mis * 0.3;
  2276. dy = ball.kickPos.y - kdy * mis * 0.3;
  2277. }
  2278. else
  2279. this.destRot += mis;
  2280. }
  2281. else if (ball.poleAngle != 0) {
  2282. this.destRot += ball.poleAngle;
  2283. }
  2284. if (xGame.common.gameMode == 0) {
  2285. let af = kickAngle * 0.08;
  2286. this.forceMax = ball.hard * 0.1 + af * af;
  2287. }
  2288. this.setKick(dx, dy);
  2289. }
  2290. else {
  2291. let rand = this.aiLv * 5 + 40;
  2292. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2293. ball = xGame.common.getRandArrEle(this.scoreBall);
  2294. else
  2295. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2296. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2297. if (xGame.tools.random(0, 100) > rand) {
  2298. this.selectNum = max;
  2299. }
  2300. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2301. this.selectNum++;
  2302. }
  2303. ball.onClick(0, true);
  2304. }
  2305. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2306. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2307. let balls = xGame.common.d2World.ballArr;
  2308. let max = xGame.tools.getDis(hx, hy, bx, by);
  2309. for (let index = 0; index < balls.length; index++) {
  2310. let obj = balls[index];
  2311. if (obj.number == 0)
  2312. continue;
  2313. if (obj.number == bn || obj.number == dn)
  2314. continue;
  2315. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2316. if (dis * dis > max)
  2317. continue;
  2318. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2319. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2320. if (num > 1)
  2321. num = 1;
  2322. if (num < 0)
  2323. continue;
  2324. let gap = Math.sin(Math.acos(num)) * dis;
  2325. if (gap < this.ballSize)
  2326. return true;
  2327. }
  2328. return false;
  2329. }
  2330. isLine(xy, ball) {
  2331. let bx = xy.x;
  2332. let by = xy.y;
  2333. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2334. let dis = ball.getDestDis(xy);
  2335. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2336. let sin = Math.sin(angle);
  2337. let cos = Math.cos(angle);
  2338. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2339. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2340. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2341. let dx = bx + this.tempDir2.x * dis;
  2342. let dy = by + this.tempDir2.y * dis;
  2343. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2344. sin = Math.sin(-angle);
  2345. cos = Math.cos(-angle);
  2346. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2347. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2348. dx = bx + this.tempDir2.x * dis;
  2349. dy = by + this.tempDir2.y * dis;
  2350. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2351. if (isr && isl)
  2352. return false;
  2353. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2354. }
  2355. return true;
  2356. }
  2357. turnPole() {
  2358. this.turnNum++;
  2359. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2360. let dr = rot - this.destRot;
  2361. let abs = Math.abs(dr) % 360;
  2362. if (abs > 180) {
  2363. if (rot > 180)
  2364. rot -= 360;
  2365. if (this.destRot > 180)
  2366. this.destRot -= 360;
  2367. }
  2368. let max = this.turnNum * 5 + this.aiLv * 5;
  2369. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2370. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2371. let at = xGame.tools.random(1000, 2000);
  2372. if (!this.onAway(3))
  2373. at += xGame.tools.random(10000, 15000);
  2374. this.setState(AIState.shoot, at);
  2375. }
  2376. else {
  2377. let mr = 0;
  2378. if (abs > 3)
  2379. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2380. else if (Math.random() > 0.6)
  2381. mr = xGame.tools.random(1, 10) * 0.1;
  2382. mr = dr > 0 ? -mr : mr;
  2383. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2384. }
  2385. }
  2386. setKick(dx, dy) {
  2387. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2388. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2389. this.tempDir1.x = 0;
  2390. this.tempDir1.y = 1;
  2391. this.tempDir2.y = -this.tempDir2.y;
  2392. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2393. if (num > 1)
  2394. num = 1;
  2395. let rot = Math.acos(num) * 57.3;
  2396. if (this.tempDir2.x < 0)
  2397. rot = 360 - rot;
  2398. this.destRot += rot;
  2399. if (!xGame.common.gameMgr.finishOneShoot) {
  2400. this.forceMax += xGame.tools.random(10, 50);
  2401. this.forceMax -= this.aiLv * 2;
  2402. if (this.forceMax < 20)
  2403. this.forceMax = 20;
  2404. }
  2405. if (this.forceMax > 100)
  2406. this.forceMax = 101;
  2407. else if (this.forceMax < 10)
  2408. this.forceMax += xGame.tools.random(0, 10);
  2409. if (xGame.common.gameMode == 1)
  2410. this.forceMax = xGame.tools.random(80, 100);
  2411. else
  2412. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2413. let max = 2000 - this.aiLv * 100;
  2414. if (Math.random() > 0.8)
  2415. max += xGame.tools.random(100, 2000);
  2416. this.setState(AIState.turn, xGame.tools.random(500, max));
  2417. }
  2418. shoot() {
  2419. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2420. if (Math.random() > 0.8) {
  2421. this.gameSrc.aiForce(1);
  2422. this.setState(AIState.wait);
  2423. }
  2424. }
  2425. else {
  2426. let df = xGame.tools.random(3, 8);
  2427. if (this.forceNum < this.forceMax)
  2428. this.forceNum += df;
  2429. else
  2430. this.forceNum -= df;
  2431. let startY = this.gameSrc.ui.powerNode.y;
  2432. let height = this.gameSrc.ui.powerNode.height;
  2433. let force = startY + height * this.forceNum * 0.01;
  2434. this.gameSrc.aiForce(2, force);
  2435. }
  2436. }
  2437. reset() {
  2438. for (let i = 0; i < 4; i++) {
  2439. this.setRate--;
  2440. this.setNum++;
  2441. let pos = this.posList[this.posIdx];
  2442. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2443. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2444. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2445. this.rootPos.x = 387;
  2446. if (this.rootPos.x < this.rectL)
  2447. this.rootPos.x = this.rectL;
  2448. else if (this.rootPos.x > this.rectR)
  2449. this.rootPos.x = this.rectR;
  2450. if (this.rootPos.y < this.rectT)
  2451. this.rootPos.y = this.rectT;
  2452. else if (this.rootPos.y > this.rectB)
  2453. this.rootPos.y = this.rectB;
  2454. this.posIdx++;
  2455. let max = this.posList.length;
  2456. if (this.posIdx >= max)
  2457. this.posIdx -= max;
  2458. this.initHoleBall();
  2459. let ball = null;
  2460. if (this.scoreBall.length > 0)
  2461. ball = this.scoreBall[0];
  2462. else if (this.lineBall.length > 0)
  2463. ball = xGame.common.getRandArrEle(this.lineBall);
  2464. if (ball && ball.kickAngle < this.bestAngle) {
  2465. this.bestAngle = ball.kickAngle;
  2466. this.bestKick.x = ball.kickPos.x;
  2467. this.bestKick.y = ball.kickPos.y;
  2468. this.bestPos.x = this.rootPos.x;
  2469. this.bestPos.y = this.rootPos.y;
  2470. this.bestForce = ball.hard * 0.08;
  2471. }
  2472. }
  2473. if (this.setNum >= this.setMax)
  2474. this.setMax = 0;
  2475. if (this.setRate < 1) {
  2476. this.setState(AIState.move, 0);
  2477. this.rootMoveTime = Laya.timer.currTimer;
  2478. this.gameSrc.aiRootMove(true);
  2479. }
  2480. }
  2481. delayLine() {
  2482. this.gameSrc.aiRootMove(false);
  2483. }
  2484. move() {
  2485. if (this.bestPos.x < 1)
  2486. this.bestPos = this.rootPos;
  2487. let wObj = this.wBall.gameObj;
  2488. let destx = wObj.x;
  2489. let desty = wObj.y;
  2490. let dx = Math.abs(destx - this.bestPos.x);
  2491. let dy = Math.abs(desty - this.bestPos.y);
  2492. let mx = 3 + dx * 0.03;
  2493. let my = 3 + dy * 0.03;
  2494. if (dx < 4 && dy < 4) {
  2495. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2496. dt = dt < 1000 ? 1000 - dt : 0;
  2497. if (this.setMax > 0) {
  2498. let min = this.setMax * 0.3 + this.aiLv * 5;
  2499. this.setRate = xGame.tools.random(min, this.setMax);
  2500. this.setState(AIState.reset, 0);
  2501. }
  2502. else {
  2503. this.destRot = 0;
  2504. this.forceMax = this.bestForce;
  2505. this.setKick(this.bestKick.x, this.bestKick.y);
  2506. }
  2507. if (dt > 100) {
  2508. Laya.timer.clear(this, this.delayLine);
  2509. Laya.timer.once(dt, this, this.delayLine);
  2510. }
  2511. else
  2512. this.gameSrc.aiRootMove(false);
  2513. }
  2514. else {
  2515. if (dx > 4)
  2516. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2517. if (dy > 4)
  2518. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2519. this.gameSrc.onRootMove({ x: destx, y: desty });
  2520. }
  2521. }
  2522. resetRoot() {
  2523. this.bestAngle = 180;
  2524. this.bestForce = 0;
  2525. this.setMax = this.posList.length;
  2526. this.posIdx = xGame.tools.random(0, this.setMax);
  2527. let min = this.setMax * 0.3 + this.aiLv * 5;
  2528. this.setRate = xGame.tools.random(min, this.setMax);
  2529. let max = 2000 - this.aiLv * 100;
  2530. if (Math.random() > 0.8)
  2531. max += xGame.tools.random(100, 1000);
  2532. if (this.isGuide)
  2533. this.setState(AIState.select, 500);
  2534. else if (this.onAway(2))
  2535. this.setState(AIState.reset, xGame.tools.random(400, max));
  2536. else
  2537. this.setState(AIState.none);
  2538. if (xGame.common.gameMgr.finishOneShoot)
  2539. this.chat();
  2540. }
  2541. runAI() {
  2542. if (this.state > AIState.idle)
  2543. return;
  2544. this.initBall();
  2545. this.onGame(2500);
  2546. if (Math.random() > 0.6)
  2547. this.chat();
  2548. }
  2549. stopRun() {
  2550. this.setState(AIState.idle);
  2551. }
  2552. onGame(base) {
  2553. let max = base - this.aiLv * 100;
  2554. if (Math.random() > 0.8)
  2555. max += xGame.tools.random(100, 1000);
  2556. if (this.onAway(2))
  2557. this.setState(AIState.select, xGame.tools.random(500, max));
  2558. else
  2559. this.setState(AIState.none);
  2560. }
  2561. setState(sta, wt = 0) {
  2562. if (this.state == AIState.none)
  2563. return;
  2564. this.state = sta;
  2565. this.waitTime = wt;
  2566. }
  2567. onUpdate() {
  2568. if (this.state == AIState.none)
  2569. return;
  2570. this.awayTime -= this.dtime;
  2571. if (this.awayTime < 1) {
  2572. this.awayTime = xGame.tools.random(6000, 10000);
  2573. this.awayNum += (11 - this.aiLv);
  2574. this.onAway(1);
  2575. }
  2576. if (this.waitTime >= 0) {
  2577. this.waitTime -= this.dtime;
  2578. return;
  2579. }
  2580. switch (this.state) {
  2581. case AIState.idle:
  2582. this.chat();
  2583. break;
  2584. case AIState.reset:
  2585. this.reset();
  2586. break;
  2587. case AIState.move:
  2588. this.move();
  2589. break;
  2590. case AIState.leave:
  2591. this.state = AIState.none;
  2592. xGame.common.gameMgr.aiGameEnd(true);
  2593. break;
  2594. case AIState.select:
  2595. this.selectBall();
  2596. break;
  2597. case AIState.turn:
  2598. this.turnPole();
  2599. break;
  2600. case AIState.shoot:
  2601. this.shoot();
  2602. break;
  2603. }
  2604. }
  2605. onAway(type) {
  2606. if (type == 1) {
  2607. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2608. let num = this.awayNum + db * 20;
  2609. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2610. xGame.common.gameMgr.aiLeave();
  2611. this.setState(AIState.leave, 6666);
  2612. }
  2613. }
  2614. else if (type == 2) {
  2615. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2616. let num = this.awayNum + db * 30;
  2617. if (xGame.tools.random(0, 10000) < num)
  2618. return false;
  2619. }
  2620. else if (type == 3) {
  2621. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2622. let num = this.awayNum + db * 10;
  2623. if (xGame.tools.random(0, 4000) < num)
  2624. return false;
  2625. }
  2626. return true;
  2627. }
  2628. chat() {
  2629. if (this.chatTime > 0) {
  2630. this.chatTime -= this.dtime;
  2631. return;
  2632. }
  2633. this.chatTime = xGame.tools.random(2000, 10000);
  2634. let rand = xGame.tools.random(0, 100);
  2635. if (rand < 15)
  2636. this.talk();
  2637. else if (rand < 35)
  2638. this.emotion();
  2639. }
  2640. talk() {
  2641. xGame.common.talkMgr.showAITalk(0);
  2642. }
  2643. emotion() {
  2644. xGame.common.talkMgr.showAIEmotion(0);
  2645. }
  2646. resetAI() {
  2647. this.stopRun();
  2648. this.state = AIState.none;
  2649. }
  2650. }
  2651. class Partical extends Laya.Script3D {
  2652. constructor() {
  2653. super();
  2654. this.duration = 2000;
  2655. }
  2656. ;
  2657. onAwake() {
  2658. this.gameObj = this.owner;
  2659. }
  2660. onEnable() {
  2661. this.openTimer();
  2662. }
  2663. openTimer() {
  2664. Laya.timer.once(this.duration, this, this.disappear);
  2665. }
  2666. setCallback(obj, callback) {
  2667. this.obj = obj;
  2668. this.callback = callback;
  2669. Laya.timer.clearAll(this);
  2670. Laya.timer.once(this.duration, this, this.disappear);
  2671. }
  2672. disappear() {
  2673. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2674. this.callback && this.callback(this.obj);
  2675. }
  2676. }
  2677. class Ball extends Laya.Script3D {
  2678. constructor() {
  2679. super();
  2680. this.posV3 = new Laya.Vector3();
  2681. this.rotRate = 2.1;
  2682. this.rotSpeed = new Laya.Vector3();
  2683. this.myIndex = 0;
  2684. }
  2685. onAwake() {
  2686. this.gameObj = this.owner;
  2687. this.transform = this.gameObj.transform;
  2688. this.ballNode = this.gameObj.getChildByName("Ball");
  2689. this.shadowNode = this.gameObj.getChildByName("shadow");
  2690. }
  2691. initSelf(index, x, y, owner) {
  2692. this.d2BallSrc = owner;
  2693. this.myIndex = index;
  2694. this.setAlbedoTexture();
  2695. this.setTransPos(x, y);
  2696. this.setScale();
  2697. this.ballNode.transform.localRotationEulerX = 90;
  2698. if (index == 0) {
  2699. }
  2700. }
  2701. setAlbedoTexture(isIce = false) {
  2702. let url;
  2703. if (isIce) {
  2704. url = `res/d3Res/ballTexture/ice.jpg`;
  2705. }
  2706. else {
  2707. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2708. }
  2709. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2710. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2711. }));
  2712. }
  2713. runFireworks(obj, delay, callback) {
  2714. Laya.timer.clearAll(this);
  2715. Laya.timer.once(delay + 1, this, () => {
  2716. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2717. fire.transform.localPositionX = this.transform.localPositionX;
  2718. fire.transform.localPositionY = this.transform.localPositionY;
  2719. fire.transform.localPositionZ = this.transform.localPositionZ;
  2720. let src = fire.getComponent(Partical);
  2721. src.duration = 1000;
  2722. src.setCallback(obj, callback);
  2723. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2724. eft.transform.localPositionX = this.transform.localPositionX;
  2725. eft.transform.localPositionY = this.transform.localPositionY;
  2726. eft.transform.localPositionZ = this.transform.localPositionZ;
  2727. });
  2728. }
  2729. setTransPos(x, y) {
  2730. this.setRotation();
  2731. xGame.common.pos2to3Convert(x, y, this.posV3);
  2732. this.transform.localPositionX = this.posV3.x;
  2733. this.transform.localPositionY = 0;
  2734. this.transform.localPositionZ = this.posV3.z;
  2735. this.transform.localRotationEulerX = 0;
  2736. this.transform.localRotationEulerY = 0;
  2737. this.transform.localRotationEulerZ = 0;
  2738. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2739. this.shadowNode.transform.localPositionY = 0.1;
  2740. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2741. }
  2742. setRotation() {
  2743. if (this.d2BallSrc.canRot) {
  2744. let speed = this.d2BallSrc.rigy.linearVelocity;
  2745. this.rotSpeed.x = speed.x * this.rotRate;
  2746. this.rotSpeed.z = speed.y * this.rotRate;
  2747. this.rotSpeed.y = this.d2BallSrc.rotY;
  2748. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2749. }
  2750. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2751. this.rotSpeed.x = this.rotSpeed.y = 0;
  2752. this.rotSpeed.y = this.d2BallSrc.rotY;
  2753. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2754. }
  2755. }
  2756. setScale() {
  2757. let radius = xGame.common.d2World.rootBall.ui.width;
  2758. let scale = xGame.common.scale2to3Convert(radius);
  2759. this.transform.localScaleX = scale;
  2760. this.transform.localScaleY = scale;
  2761. this.transform.localScaleZ = scale;
  2762. }
  2763. playInHoleEft() {
  2764. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2765. eft.transform.position = this.transform.position;
  2766. }
  2767. playIceEft() {
  2768. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2769. eft.transform.position = this.transform.position;
  2770. }
  2771. get scaleXYZ() {
  2772. return this.transform.localScaleX;
  2773. }
  2774. set scaleXYZ(val) {
  2775. this.transform.localScaleX = val;
  2776. this.transform.localScaleY = val;
  2777. this.transform.localScaleZ = val;
  2778. }
  2779. get posX() {
  2780. return this.transform.localPositionX;
  2781. }
  2782. set posX(val) {
  2783. this.transform.localPositionX = val;
  2784. }
  2785. get posY() {
  2786. return this.transform.localPositionY;
  2787. }
  2788. set posY(val) {
  2789. this.transform.localPositionY = val;
  2790. }
  2791. get posZ() {
  2792. return this.transform.localPositionZ;
  2793. }
  2794. set posZ(val) {
  2795. this.transform.localPositionZ = val;
  2796. }
  2797. destroySelf() {
  2798. this.posV3 = null;
  2799. this.rotSpeed = null;
  2800. this.d2BallSrc = null;
  2801. this.ballNode = null;
  2802. this.gameObj.destroy(true);
  2803. this.transform = null;
  2804. this.destroy();
  2805. }
  2806. }
  2807. class ui_D2Ball extends fgui.GComponent {
  2808. static createInstance() {
  2809. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2810. }
  2811. onConstruct() {
  2812. this.myIcon = (this.getChild("myIcon"));
  2813. this.inner = (this.getChild("inner"));
  2814. this.n8 = (this.getChild("n8"));
  2815. this.n4 = (this.getChild("n4"));
  2816. this.wrongTips = (this.getChild("wrongTips"));
  2817. this.rightTips = (this.getChild("rightTips"));
  2818. this.breathAni = this.getTransition("breathAni");
  2819. }
  2820. }
  2821. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2822. class D2BallSrc extends Laya.Script {
  2823. constructor() {
  2824. super();
  2825. this.number = 0;
  2826. this.startX = 0;
  2827. this.startY = 0;
  2828. this.angleV2 = new Laya.Vector2();
  2829. this.isRootBall = false;
  2830. this.isBlackBall = false;
  2831. this.ballType = "";
  2832. this.canRot = true;
  2833. this.rotY = 0;
  2834. this.poleAngle = 0;
  2835. this.kickPos = { x: 0, y: 0 };
  2836. this.hard = 0;
  2837. this.kickAngle = 0;
  2838. this.borderDis = 0;
  2839. this.speedP10 = 5.6;
  2840. this.lastSpeed = { x: 0, y: 0 };
  2841. this.stillSpeed = 0.12;
  2842. this.ballFunc = "normal";
  2843. this.isRunSkillAni = false;
  2844. this.isInHole = false;
  2845. this.iceOwner = "";
  2846. this.forceRun = false;
  2847. this.myUNID = "";
  2848. this.rectL = 0;
  2849. this.rectR = 0;
  2850. this.rectT = 0;
  2851. this.rectB = 0;
  2852. this.forceVec = new Laya.Vector2();
  2853. this.lastDis = 0;
  2854. this.helpOut = { type: "", x: 0, y: 0 };
  2855. }
  2856. initSelf(number, x, y, d3Ball) {
  2857. if (!this.gameObj)
  2858. this.gameObj = this.owner;
  2859. this.number = number;
  2860. this.startX = x;
  2861. this.startY = y;
  2862. this.d3Ball = d3Ball;
  2863. this.isRootBall = false;
  2864. this.isBlackBall = false;
  2865. this.ballType = "";
  2866. if (number == 0) {
  2867. this.isRootBall = true;
  2868. }
  2869. else if (number == 8) {
  2870. this.isBlackBall = true;
  2871. }
  2872. else {
  2873. if (number <= 7) {
  2874. this.ballType = ballCamp.full;
  2875. }
  2876. else {
  2877. this.ballType = ballCamp.flower;
  2878. }
  2879. }
  2880. this.setInfo();
  2881. this.setD3Ball();
  2882. this.owner["mySrc"] = this;
  2883. this.rigy.linearDamping = 1;
  2884. D2BallSrc._unid++;
  2885. this.myUNID = "d2ball" + D2BallSrc._unid;
  2886. let rect = xGame.common.d2World.borderRect;
  2887. this.rectL = Math.ceil(rect.x) + 20;
  2888. this.rectT = Math.ceil(rect.y) + 20;
  2889. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2890. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2891. }
  2892. setInfo() {
  2893. this.gameObj.x = this.startX;
  2894. this.gameObj.y = this.startY;
  2895. let radius = this.ui.width / 2;
  2896. this.gameObj.width = radius * 2;
  2897. this.gameObj.height = radius * 2;
  2898. if (xGame.common.showDebug) {
  2899. this.ui.myIcon.alpha = 1;
  2900. this.ui.inner.alpha = 1;
  2901. }
  2902. else {
  2903. this.ui.myIcon.alpha = 0;
  2904. this.ui.inner.alpha = 0;
  2905. }
  2906. }
  2907. setD3Ball() {
  2908. this.d3Ball = this.d3Ball;
  2909. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2910. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2911. }
  2912. onUpdate() {
  2913. if (xGame.common.gameMgr.gamePause)
  2914. return;
  2915. if (this.isInHole)
  2916. return;
  2917. if (!xGame.common.d2World.openCheckStill)
  2918. return;
  2919. this.runBall();
  2920. }
  2921. runBall() {
  2922. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2923. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2924. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2925. this.judgeBorder();
  2926. }
  2927. getDestDis(dest) {
  2928. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2929. }
  2930. setmyXY(x, y) {
  2931. this.d3BallSrc.setTransPos(x, y);
  2932. }
  2933. getSpeed() {
  2934. let speed = this.rigy.linearVelocity;
  2935. return speed.x * speed.x + speed.y * speed.y;
  2936. }
  2937. onTriggerEnter(collider) {
  2938. if (!collider || !collider.owner)
  2939. return;
  2940. let coll = "collide";
  2941. let speed = this.getSpeed();
  2942. let sv2 = this.speedP10 * this.speedP10;
  2943. if (collider.label == "ball") {
  2944. if (speed < 9 && this.number != 0)
  2945. coll = "";
  2946. else if (speed < sv2)
  2947. coll = "collide_4";
  2948. else if (speed < sv2 * 6.2)
  2949. coll = "collide_3";
  2950. else if (speed < sv2 * 25)
  2951. coll = "collide_2";
  2952. else if (speed < sv2 * 56)
  2953. coll = "collide_1";
  2954. xGame.soundMgr.playSound(coll);
  2955. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2956. if (collider.owner) {
  2957. let rig = collider.owner.getComponent(D2BallSrc);
  2958. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2959. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2960. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2961. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2962. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2963. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2964. let rx = 0;
  2965. let ry = 0;
  2966. if (this.gameObj.x < this.rectL)
  2967. rx = vx;
  2968. else if (this.gameObj.x > this.rectR)
  2969. rx = -vx;
  2970. else if (this.gameObj.y < this.rectT)
  2971. ry = vy;
  2972. else if (this.gameObj.y > this.rectB)
  2973. ry = -vy;
  2974. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2975. }
  2976. }
  2977. if (this.number != 0) {
  2978. return;
  2979. }
  2980. else {
  2981. if (this.forceRun) {
  2982. console.log("randon force");
  2983. this.applyForce(collider);
  2984. }
  2985. }
  2986. if (xGame.common.d2World.isOnSameLine) {
  2987. xGame.common.d2World.isOnSameLine = false;
  2988. this.rigy.linearVelocity = { x: 0, y: 0 };
  2989. }
  2990. if (xGame.common.gameMgr.firstColliObj == null) {
  2991. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2992. xGame.common.gameMgr.isTouchedBall = true;
  2993. }
  2994. }
  2995. else {
  2996. xGame.common.recoverCameraView();
  2997. let wallStr = "";
  2998. if (speed < 9) { }
  2999. else if (speed < sv2) { }
  3000. else if (speed < sv2 * 6.2)
  3001. wallStr = "wall_30";
  3002. else if (speed < sv2 * 25)
  3003. wallStr = "wall_50";
  3004. else if (speed < sv2 * 56)
  3005. wallStr = "wall_80";
  3006. xGame.soundMgr.playSound(wallStr);
  3007. }
  3008. }
  3009. applyForce(collider) {
  3010. let src = collider.owner.mySrc;
  3011. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  3012. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  3013. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  3014. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  3015. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  3016. }
  3017. checkWrongBall(playEft = true) {
  3018. if (this.isInHole)
  3019. return;
  3020. xGame.common.gameMgr.inHoleBalls.push(this.number);
  3021. if (this.number != 0 && playEft)
  3022. this.d3BallSrc.playInHoleEft();
  3023. let coll = "inpocket_1";
  3024. let speed = this.getSpeed();
  3025. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  3026. if (speed < 9 && this.number != 0)
  3027. coll = "";
  3028. else if (speed < sv2 * 6.2)
  3029. coll = "inpocket_4";
  3030. else if (speed < sv2 * 25)
  3031. coll = "collide_3";
  3032. else if (speed < sv2 * 56)
  3033. coll = "collide_2";
  3034. xGame.soundMgr.playSound(coll);
  3035. this.isInHole = true;
  3036. if (this.number == 0) {
  3037. console.log("白球进了。。");
  3038. this.reset();
  3039. this.rigy.linearVelocity = { x: 0, y: 0 };
  3040. this.hideSelf();
  3041. xGame.common.gameUI.ui.whiteAni.visible = true;
  3042. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  3043. xGame.common.gameUI.ui.whiteAni.visible = false;
  3044. }));
  3045. }
  3046. else {
  3047. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  3048. xGame.common.d2World.removeOneBall(this);
  3049. this.destroySelf();
  3050. xGame.common.playHappySound(this.number);
  3051. this.runFlyEft();
  3052. }
  3053. }
  3054. runFlyEft() {
  3055. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  3056. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  3057. }
  3058. }
  3059. hideSelf() {
  3060. if (this.d3Ball)
  3061. this.d3Ball.active = false;
  3062. }
  3063. showSelf() {
  3064. this.isInHole = false;
  3065. if (this.d3Ball && !this.d3Ball.active)
  3066. this.d3Ball.active = true;
  3067. }
  3068. isStill() {
  3069. let speed = this.rigy.linearVelocity;
  3070. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  3071. this.rigy.linearVelocity = { x: 0, y: 0 };
  3072. return true;
  3073. }
  3074. return false;
  3075. }
  3076. reset() {
  3077. }
  3078. destroySelf() {
  3079. this.d3BallSrc.destroySelf();
  3080. if (!this.ui.isDisposed) {
  3081. this.ui.removeFromParent();
  3082. this.ui.dispose();
  3083. this.ui = null;
  3084. }
  3085. this.outColli = null;
  3086. this.innerColli = null;
  3087. this.rigy = null;
  3088. this.d3Ball = null;
  3089. this.d3BallSrc = null;
  3090. this.angleV2 = null;
  3091. this.gameObj.destroy(true);
  3092. this.destroy();
  3093. }
  3094. judgeBorder() {
  3095. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  3096. return;
  3097. }
  3098. if (this.destroyed)
  3099. return;
  3100. if (xGame.common.gameMode == GameMode.classic)
  3101. return;
  3102. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  3103. if (isOver) {
  3104. this.checkWrongBall();
  3105. }
  3106. }
  3107. onClick(e, force = false) {
  3108. if (this.number == 0)
  3109. return;
  3110. if (force) {
  3111. }
  3112. else {
  3113. if (xGame.common.d2World.openCheckStill)
  3114. return;
  3115. if (!xGame.common.gameMgr.selfTurn) {
  3116. return;
  3117. }
  3118. }
  3119. if (!xGame.common.gameMgr.finishOneShoot)
  3120. return;
  3121. let root = xGame.common.d2World.rootBall.gameObj;
  3122. let x = this.gameObj.x - root.x;
  3123. let y = this.gameObj.y - root.y;
  3124. let angle = xGame.common.getfguiRotation(x, y);
  3125. xGame.common.d2World.d2Gan.ui.rotation = angle;
  3126. xGame.common.d2World.getHelpLine();
  3127. xGame.common.clickedBall = true;
  3128. console.log('zh:点击之后=判断引导');
  3129. this.checkGuide();
  3130. this.checkGuideForLianXi();
  3131. }
  3132. checkGuide() {
  3133. let guide = DataMgr.getSkillGuide();
  3134. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3135. xGame.common.guideStep++;
  3136. xGame.common.gameUI.ui.guide1.visible = false;
  3137. xGame.common.gameUI.ui.guide2.visible = true;
  3138. }
  3139. }
  3140. checkGuideForLianXi() {
  3141. let guide_lianxi = DataMgr.getLianXiGuide();
  3142. if (guide_lianxi == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 0) {
  3143. xGame.common.guideStepForLianXi = 1;
  3144. xGame.common.gameUI.ui.n_lxms_yd1.visible = true;
  3145. return;
  3146. }
  3147. if (guide_lianxi == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 1) {
  3148. xGame.common.guideStepForLianXi = 2;
  3149. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  3150. xGame.common.gameUI.ui.n_lxms_yd2.visible = true;
  3151. }
  3152. else {
  3153. console.log('zh: xGame.common.guideStepForLianXi=' + xGame.common.guideStepForLianXi);
  3154. }
  3155. }
  3156. checkDistance(disX, disY, angle) {
  3157. let diameter = this.gameObj.width - 1;
  3158. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3159. if (!this.lastDis)
  3160. this.lastDis = dis;
  3161. else {
  3162. if (dis > this.lastDis) {
  3163. this.helpOut.type = "remove";
  3164. return this.helpOut;
  3165. }
  3166. }
  3167. if (dis <= Math.pow(diameter, 2)) {
  3168. let del = 0.01;
  3169. let offest = 0;
  3170. let realX = disX - this.gameObj.x;
  3171. let realY = disY - this.gameObj.y;
  3172. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3173. offest += del;
  3174. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3175. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3176. }
  3177. this.helpOut.type = "ok";
  3178. this.helpOut.x = realX + this.gameObj.x;
  3179. this.helpOut.y = realY + this.gameObj.y;
  3180. return this.helpOut;
  3181. }
  3182. else {
  3183. this.helpOut.type = "no";
  3184. return this.helpOut;
  3185. }
  3186. }
  3187. clearBallEft() {
  3188. this.clearBallRightEft();
  3189. this.clearBallWrongEft();
  3190. }
  3191. clearBallRightEft() {
  3192. this.ui.breathAni.stop();
  3193. this.ui.rightTips.visible = false;
  3194. }
  3195. clearBallWrongEft() {
  3196. this.ui.wrongTips.visible = false;
  3197. }
  3198. showWrongEft() {
  3199. if (!xGame.common.gameMgr.selfTurn)
  3200. return;
  3201. this.ui.wrongTips.visible = true;
  3202. }
  3203. showRightEft() {
  3204. if (!xGame.common.gameMgr.selfTurn)
  3205. return;
  3206. this.ui.rightTips.visible = true;
  3207. this.ui.rightTips.scaleX = 1;
  3208. this.ui.rightTips.scaleY = 1;
  3209. this.ui.breathAni.play();
  3210. }
  3211. setBallFunc(type, owner) {
  3212. if (type == "ice") {
  3213. this.ballFunc = type;
  3214. this.d3BallSrc.setAlbedoTexture(true);
  3215. this.rigy.type = "static";
  3216. this.iceOwner = owner;
  3217. }
  3218. else {
  3219. if (owner == this.iceOwner) {
  3220. this.ballFunc = type;
  3221. this.d3BallSrc.setAlbedoTexture(false);
  3222. this.rigy.type = "dynamic";
  3223. }
  3224. }
  3225. }
  3226. }
  3227. D2BallSrc._unid = 0;
  3228. class D2RootBallSrc extends D2BallSrc {
  3229. constructor() {
  3230. super();
  3231. this.maxSpeed = 0;
  3232. this.classicMaxSpeed = 2.2;
  3233. this.bigSkillMaxSpeed = 4;
  3234. this.angle = 0;
  3235. this.allPercent = 0;
  3236. this.linearPercent = 0;
  3237. this.anglePercent = 0;
  3238. this.maxAngleRate = 0.6;
  3239. this.baseRot = 7;
  3240. this.angleMax = 0;
  3241. this.speed = new Laya.Vector2();
  3242. this.rotSpeed = new Laya.Vector2();
  3243. }
  3244. isStill() {
  3245. let speed = this.rigy.linearVelocity;
  3246. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3247. if (this.anglePercent <= 0.1) {
  3248. this.rigy.linearVelocity = { x: 0, y: 0 };
  3249. return true;
  3250. }
  3251. }
  3252. return false;
  3253. }
  3254. reset() {
  3255. this.linearPercent = 0;
  3256. this.anglePercent = 0;
  3257. }
  3258. setSpeed(percent, angle) {
  3259. this.allPercent = percent;
  3260. this.angle = angle;
  3261. this.setAngleSpeed();
  3262. this.setLinearSpeed();
  3263. let hit = "hit";
  3264. if (percent < 25)
  3265. hit = "hit03";
  3266. else if (percent < 50)
  3267. hit = "hit02";
  3268. else if (percent < 75)
  3269. hit = "hit01";
  3270. xGame.soundMgr.playSound(hit);
  3271. }
  3272. setAngleSpeed() {
  3273. let offest = xGame.common.rodOffest;
  3274. let radius = 82;
  3275. let rate = Math.abs(offest.y / radius) * 0.5;
  3276. if (offest.y > 0)
  3277. this.angleMax = -this.baseRot * 2;
  3278. else
  3279. this.angleMax = this.baseRot;
  3280. this.rotY = -offest.x / radius * 100;
  3281. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3282. this.linearPercent = this.allPercent - this.anglePercent;
  3283. }
  3284. setLinearSpeed() {
  3285. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3286. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3287. if (!xGame.common.longHelpLine) {
  3288. let offset = -150 + xGame.common.randomNum(0, 300);
  3289. offset /= 100;
  3290. this.angle += offset;
  3291. }
  3292. }
  3293. }
  3294. let sin = Math.sin(this.angle * Math.PI / 180);
  3295. let cos = Math.cos(this.angle * Math.PI / 180);
  3296. switch (xGame.common.gameMode) {
  3297. case GameMode.classic:
  3298. this.maxSpeed = this.classicMaxSpeed;
  3299. break;
  3300. case GameMode.bigMove:
  3301. this.maxSpeed = this.bigSkillMaxSpeed;
  3302. break;
  3303. case GameMode.placeBall:
  3304. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3305. if (data.type == 1) {
  3306. this.maxSpeed = this.bigSkillMaxSpeed;
  3307. }
  3308. else {
  3309. this.maxSpeed = this.classicMaxSpeed;
  3310. }
  3311. break;
  3312. default:
  3313. break;
  3314. }
  3315. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3316. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3317. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3318. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3319. this.rigy.applyLinearImpulseToCenter(this.speed);
  3320. }
  3321. onUpdate() {
  3322. if (this.anglePercent > 0.1) {
  3323. this.anglePercent *= 0.97;
  3324. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3325. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3326. this.rigy.applyForceToCenter(this.rotSpeed);
  3327. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3328. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3329. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3330. if (num > 0.9)
  3331. this.canRot = true;
  3332. }
  3333. else
  3334. this.canRot = true;
  3335. if (Math.abs(this.rotY) > 0.1)
  3336. this.rotY *= 0.98;
  3337. super.onUpdate();
  3338. }
  3339. destroySelf() {
  3340. super.destroySelf();
  3341. this.speed = null;
  3342. }
  3343. }
  3344. class D2Ball extends Laya.Sprite {
  3345. constructor(isRootBall = false) {
  3346. super();
  3347. this.ui = ui_D2Ball.createInstance();
  3348. this.pivotX = this.ui.width / 2;
  3349. this.pivotY = this.ui.width / 2;
  3350. this.x = 0;
  3351. this.y = 0;
  3352. this.addChild(this.ui.displayObject);
  3353. this.ui.displayObject.x += this.ui.width / 2;
  3354. this.ui.displayObject.y += this.ui.width / 2;
  3355. if (isRootBall) {
  3356. this.d2Src = this.addComponent(D2RootBallSrc);
  3357. }
  3358. else {
  3359. this.d2Src = this.addComponent(D2BallSrc);
  3360. }
  3361. this.d2Src.ui = this.ui;
  3362. this.addCircleCollider();
  3363. this.addInnerCircleCollider();
  3364. this.addRigyBody();
  3365. }
  3366. addCircleCollider() {
  3367. let colli = xGame.common.getCollider("circle");
  3368. colli.radius = this.ui.width / 2;
  3369. this.addComponentIntance(colli);
  3370. this.d2Src.outColli = colli;
  3371. colli.label = "ball";
  3372. }
  3373. addInnerCircleCollider() {
  3374. let colli = xGame.common.getCollider("circle");
  3375. colli.radius = this.ui.inner.width / 2;
  3376. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3377. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3378. this.addComponentIntance(colli);
  3379. this.d2Src.innerColli = colli;
  3380. colli.label = "inner";
  3381. }
  3382. addRigyBody() {
  3383. let rigy = xGame.common.getRigbody();
  3384. rigy.type = "dynamic";
  3385. this.addComponentIntance(rigy);
  3386. this.d2Src.rigy = rigy;
  3387. }
  3388. disposeSelf() {
  3389. if (!this.ui.isDisposed) {
  3390. this.ui.dispose();
  3391. this.ui.removeFromParent();
  3392. this.ui = null;
  3393. }
  3394. }
  3395. }
  3396. class ui_D2Gan extends fgui.GComponent {
  3397. static createInstance() {
  3398. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3399. }
  3400. onConstruct() {
  3401. this.myIcon = (this.getChild("myIcon"));
  3402. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3403. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3404. this.self = (this.getChild("self"));
  3405. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3406. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3407. this.ai = (this.getChild("ai"));
  3408. }
  3409. }
  3410. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3411. class D2Gan {
  3412. constructor() {
  3413. this.offset = 0.15;
  3414. this.cell = 1.5;
  3415. this.onBallCell = 0.4;
  3416. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3417. this.moveNum = 70;
  3418. this.rulerRate = 0.1;
  3419. this.ui = ui_D2Gan.createInstance();
  3420. this.changeSelfRod();
  3421. this.changeAIRod();
  3422. }
  3423. changeSelfRod() {
  3424. let index = DataMgr.getCurBallRod();
  3425. let data = cfgTable.ballrodData[index + 1];
  3426. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3427. this.selfMySpine && this.selfMySpine.dispose();
  3428. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3429. if (data.spine) {
  3430. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3431. this.selfMySpine = new SpineMgr(data.spine, () => {
  3432. let xx = this.ui.selfEftRoot.width / 2;
  3433. let yy = this.ui.selfEftRoot.height / 2;
  3434. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3435. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3436. outSpine.rotation = -90;
  3437. });
  3438. }
  3439. }
  3440. changeAIRod() {
  3441. let length = Object.keys(cfgTable.ballrodData).length;
  3442. let rand = Math.floor(length * Math.random()) + 1;
  3443. let data = cfgTable.ballrodData[rand];
  3444. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3445. this.aiMySpine && this.aiMySpine.dispose();
  3446. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3447. if (data.spine) {
  3448. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3449. this.aiMySpine = new SpineMgr(data.spine, () => {
  3450. let xx = this.ui.aiEftRoot.width / 2;
  3451. let yy = this.ui.aiEftRoot.height / 2;
  3452. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3453. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3454. outSpine.rotation = -90;
  3455. });
  3456. }
  3457. }
  3458. setGanLastInfo() {
  3459. this.lastInfo.rotation = this.ui.rotation;
  3460. this.lastInfo.x = this.ui.x;
  3461. this.lastInfo.y = this.ui.y;
  3462. }
  3463. rotateSelf(flag, isRuler = false) {
  3464. let angle;
  3465. flag = flag * this.offset;
  3466. if (xGame.common.d2World.isHelpLineOnBall) {
  3467. angle = flag * this.onBallCell;
  3468. }
  3469. else {
  3470. angle = flag * this.cell;
  3471. }
  3472. if (isRuler) {
  3473. angle *= this.rulerRate;
  3474. }
  3475. this.ui.rotation += angle;
  3476. xGame.common.d2World.getHelpLine();
  3477. }
  3478. checkDistance() {
  3479. let target = xGame.common.d2World.targetBall;
  3480. let root = xGame.common.d2World.rootBall;
  3481. if (target == null) {
  3482. return 1;
  3483. }
  3484. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3485. if (dis <= 2500) {
  3486. return 5;
  3487. }
  3488. return 1;
  3489. }
  3490. rotDest(rot) {
  3491. this.ui.rotation = rot;
  3492. xGame.common.d2World.getHelpLine();
  3493. }
  3494. storagePower(powerNum) {
  3495. let pos = (powerNum / 100) * this.moveNum;
  3496. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3497. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3498. this.ui.x = this.lastInfo.x + xx;
  3499. this.ui.y = this.lastInfo.y + yy;
  3500. }
  3501. shoot() {
  3502. this.storagePower(0);
  3503. this.ui.visible = false;
  3504. }
  3505. destroySelf() {
  3506. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3507. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3508. this.selfMySpine && this.selfMySpine.dispose();
  3509. this.aiMySpine && this.aiMySpine.dispose();
  3510. this.lastInfo = null;
  3511. if (!this.ui.isDisposed) {
  3512. this.ui.removeFromParent();
  3513. this.ui.dispose();
  3514. }
  3515. }
  3516. }
  3517. class ui_HelpLine extends fgui.GComponent {
  3518. static createInstance() {
  3519. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3520. }
  3521. onConstruct() {
  3522. this.n10 = (this.getChild("n10"));
  3523. this.rect = (this.getChild("rect"));
  3524. this.dir11 = (this.getChild("dir11"));
  3525. this.dir = (this.getChild("dir"));
  3526. this.rootDir = (this.getChild("rootDir"));
  3527. this.dirDot = (this.getChild("dirDot"));
  3528. }
  3529. }
  3530. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3531. class D2HelpLine {
  3532. constructor() {
  3533. this.starX = 0;
  3534. this.starY = 0;
  3535. this.ui = ui_HelpLine.createInstance();
  3536. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3537. this.starX = this.ui.rect.x;
  3538. this.starY = this.ui.rect.y;
  3539. }
  3540. shoot() {
  3541. this.ui.visible = false;
  3542. }
  3543. destroySelf() {
  3544. if (this.ui.isDisposed) {
  3545. this.ui.removeFromParent();
  3546. this.ui.dispose();
  3547. }
  3548. }
  3549. }
  3550. class D2World extends Laya.Script {
  3551. constructor() {
  3552. super();
  3553. this.ballArr = [];
  3554. this.openCheckStill = false;
  3555. this.checkArr = [];
  3556. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3557. this.isHelpLineOnBall = false;
  3558. this.isOnSameLine = false;
  3559. this.reflectAngle = 0;
  3560. this.powerPercent = 0;
  3561. this.inHolesSpeed = [];
  3562. this.outDir = new Laya.Vector2();
  3563. this.rootDir = new Laya.Vector2();
  3564. this.aiLv = 0;
  3565. this.rootPos = new Laya.Vector2();
  3566. this.tempDir1 = new Laya.Vector2();
  3567. this.tempDir2 = new Laya.Vector2();
  3568. this.tempDir3 = new Laya.Vector2();
  3569. this.ballSize = 33;
  3570. this.destRot = 0;
  3571. }
  3572. initSelf() {
  3573. this.createBalls();
  3574. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3575. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3576. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3577. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3578. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3579. }
  3580. setBorderRect() {
  3581. let ui = xGame.common.gameUI.ui;
  3582. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3583. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3584. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3585. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3586. this.borderRect.x = starX;
  3587. this.borderRect.y = starY;
  3588. this.borderRect.width = width;
  3589. this.borderRect.height = height;
  3590. }
  3591. resetGame() {
  3592. this.openCheckStill = false;
  3593. let temp;
  3594. for (let index = 0; index < this.ballArr.length; index++) {
  3595. temp = this.ballArr[index];
  3596. temp.destroySelf();
  3597. }
  3598. xGame.common.d3World.ballRoot.destroyChildren();
  3599. xGame.common.gameUI.ui.ballNode.removeChildren();
  3600. console.log("进入摧毁逻辑");
  3601. this.d2Gan.destroySelf();
  3602. this.d2HelpLine.destroySelf();
  3603. this.ballArr = [];
  3604. }
  3605. setD2Gan() {
  3606. let ballNode = this.rootBall.ui;
  3607. let d2Gan = new D2Gan();
  3608. this.d2Gan = d2Gan;
  3609. let ganNode = d2Gan.ui;
  3610. ballNode.addChild(ganNode);
  3611. ganNode.pivotX = ganNode.pivotX;
  3612. ganNode.pivotY = ganNode.pivotY;
  3613. ganNode.x = ganNode.myIcon.width / 2;
  3614. ganNode.y = this.rootBall.gameObj.width;
  3615. d2Gan.setGanLastInfo();
  3616. }
  3617. setHelpLine() {
  3618. let d2Help = new D2HelpLine();
  3619. this.d2HelpLine = d2Help;
  3620. }
  3621. createBalls() {
  3622. let cfg;
  3623. switch (xGame.common.gameMode) {
  3624. case GameMode.classic:
  3625. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3626. break;
  3627. case GameMode.bigMove:
  3628. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3629. break;
  3630. case GameMode.placeBall:
  3631. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3632. break;
  3633. default:
  3634. break;
  3635. }
  3636. cfg = JSON.parse(JSON.stringify(cfg));
  3637. for (const key in cfg) {
  3638. if (cfg[key].value == 0) {
  3639. this.createRootBall(cfg[key]);
  3640. delete cfg[key];
  3641. break;
  3642. }
  3643. }
  3644. this.createOtherBalls(cfg);
  3645. }
  3646. createRootBall(data) {
  3647. let root = new D2Ball(true);
  3648. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3649. this.rootBall = root.d2Src;
  3650. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3651. let d3BallSrc = d3Ball.getComponent(Ball);
  3652. xGame.common.d3World.rootBall = d3Ball;
  3653. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3654. let xx = data.x;
  3655. let yy = data.y;
  3656. let numer = data.value;
  3657. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3658. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3659. this.ballArr.push(this.rootBall);
  3660. this.setD2Gan();
  3661. this.setHelpLine();
  3662. }
  3663. createOtherBalls(cfg) {
  3664. let temp;
  3665. let src;
  3666. let data;
  3667. for (const key in cfg) {
  3668. data = cfg[key];
  3669. temp = new D2Ball();
  3670. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3671. src = temp.d2Src;
  3672. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3673. src.initSelf(data.value, data.x, data.y, d3Ball);
  3674. this.ballArr.push(src);
  3675. }
  3676. }
  3677. shoot(percent) {
  3678. this.powerPercent = percent;
  3679. this.openCheckStill = true;
  3680. let d2Angle = this.d2Gan.ui.rotation;
  3681. this.rootBall.setSpeed(percent, d2Angle);
  3682. this.clearBallAllEft();
  3683. this.changePlayerView();
  3684. }
  3685. onUpdate() {
  3686. if (!this.openCheckStill)
  3687. return;
  3688. this.checkStill();
  3689. }
  3690. checkStill() {
  3691. for (let index = 0; index < this.ballArr.length; index++) {
  3692. if (!this.ballArr[index].isStill()) {
  3693. return;
  3694. }
  3695. }
  3696. xGame.eventMgr.event(ALL_BALL_STOP);
  3697. }
  3698. allBallStop() {
  3699. this.openCheckStill = false;
  3700. xGame.common.recoverCameraView();
  3701. }
  3702. waitShoot() {
  3703. if (!this.d2Gan.ui.isDisposed) {
  3704. this.d2Gan.ui.visible = true;
  3705. }
  3706. if (!this.d2HelpLine.ui.isDisposed) {
  3707. this.d2HelpLine.ui.visible = true;
  3708. }
  3709. this.clearBallAllEft();
  3710. this.showBallRightEft();
  3711. this.getHelpLine();
  3712. this.inHolesSpeed = [];
  3713. this.selectOneBall();
  3714. }
  3715. _getAllBallArr() {
  3716. let arr = this.ballArr;
  3717. let outArr = [];
  3718. for (let index = 0; index < arr.length; index++) {
  3719. if (arr[index] instanceof D2RootBallSrc)
  3720. continue;
  3721. if (arr[index].ballFunc == "ice")
  3722. continue;
  3723. if (arr[index].destroyed)
  3724. continue;
  3725. outArr.push(arr[index]);
  3726. }
  3727. return outArr;
  3728. }
  3729. _getBlackObj() {
  3730. let arr = this.ballArr;
  3731. for (let index = 0; index < arr.length; index++) {
  3732. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3733. return arr[index];
  3734. }
  3735. }
  3736. }
  3737. selectOneBall() {
  3738. let all = this._getAllBallArr();
  3739. let target;
  3740. switch (xGame.common.gameMode) {
  3741. case GameMode.classic:
  3742. if (xGame.common.gameMgr.selfTurn) {
  3743. let self = xGame.common.gameMgr.selfBallArr;
  3744. let black = this._getBlackObj();
  3745. if (xGame.common.gameMgr.ensureBallType) {
  3746. if (self.length > 0) {
  3747. let out = [];
  3748. for (let j = 0; j < all.length; j++) {
  3749. if (self.indexOf(all[j].number) > -1) {
  3750. out.push(all[j]);
  3751. }
  3752. }
  3753. target = this.selectBestEnterOne(out);
  3754. }
  3755. else {
  3756. target = this.selectBestEnterOne([black]);
  3757. }
  3758. }
  3759. else {
  3760. target = this.selectBestEnterOne(all);
  3761. }
  3762. }
  3763. else {
  3764. target = this.selectBestEnterOne(all);
  3765. }
  3766. break;
  3767. case GameMode.bigMove:
  3768. target = this.selectBestEnterOne(all);
  3769. break;
  3770. case GameMode.placeBall:
  3771. if (all.length > 0) {
  3772. target = this.selectBestEnterOne(all);
  3773. }
  3774. break;
  3775. default:
  3776. break;
  3777. }
  3778. if (target && !target.destroyed && target.onClick) {
  3779. target.onClick(0, true);
  3780. let num = -200 + xGame.common.randomNum(0, 400);
  3781. num /= 150;
  3782. if (xGame.common.longHelpLine) {
  3783. num = 0;
  3784. }
  3785. this.destRot += num;
  3786. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3787. }
  3788. }
  3789. removeOneBall(ball) {
  3790. for (let index = 0; index < this.ballArr.length; index++) {
  3791. if (this.ballArr[index].id == ball.id) {
  3792. this.ballArr.splice(index, 1);
  3793. break;
  3794. }
  3795. }
  3796. }
  3797. getHelpLine() {
  3798. this.d2HelpLine.ui.dirDot.visible = false;
  3799. this.isOnSameLine = false;
  3800. let startX = this.rootBall.gameObj.x;
  3801. let startY = this.rootBall.gameObj.y;
  3802. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3803. if (dis == null) {
  3804. this.d2HelpLine.ui.visible = false;
  3805. console.error("辅助线异常");
  3806. return;
  3807. }
  3808. this.d2HelpLine.ui.visible = true;
  3809. let angle = this.d2Gan.ui.rotation;
  3810. let radius = 16.5;
  3811. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3812. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3813. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3814. if (colliObj == null) {
  3815. this.getColliPos(disX, disY, radius, angle);
  3816. xGame.common.d2World.isHelpLineOnBall = false;
  3817. this.targetBall = null;
  3818. this.reflectAngle = 0;
  3819. this.showBallWrongEft();
  3820. }
  3821. else {
  3822. let target = colliObj.src;
  3823. let radius = 16.5;
  3824. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3825. dis1 = Math.sqrt(dis1);
  3826. let realDis = colliObj.disHon - dis1;
  3827. let dir = colliObj.dir;
  3828. let xx = startX + dir.x * realDis;
  3829. let yy = startY + dir.y * realDis;
  3830. this.getColliPos(xx, yy, radius, angle);
  3831. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3832. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3833. let offset = xGame.common.rodOffest;
  3834. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3835. this.isOnSameLine = true;
  3836. }
  3837. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3838. xGame.common.d2World.isHelpLineOnBall = true;
  3839. this.targetBall = target;
  3840. this.reflectAngle = reflectAngle;
  3841. this.showBallWrongEft();
  3842. if (xGame.common.longHelpLine) {
  3843. this.delayReflectLine(target, reflectAngle);
  3844. }
  3845. }
  3846. }
  3847. getBorderDot(startX, startY, angle) {
  3848. let radius = 17;
  3849. let distance;
  3850. let isDone;
  3851. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3852. isDone = this.judgeUpDown(distance, angle, startX);
  3853. if (isDone != null) {
  3854. return isDone;
  3855. }
  3856. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3857. isDone = this.judgeUpDown(distance, angle, startX);
  3858. if (isDone != null) {
  3859. return isDone;
  3860. }
  3861. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3862. isDone = this.judgeLeftRight(distance, angle, startY);
  3863. if (isDone != null) {
  3864. return isDone;
  3865. }
  3866. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3867. isDone = this.judgeLeftRight(distance, angle, startY);
  3868. if (isDone != null) {
  3869. return isDone;
  3870. }
  3871. }
  3872. judgeUpDown(distance, angle, startX) {
  3873. let flag = Math.sin(angle * Math.PI / 180);
  3874. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3875. if (distance >= 0) {
  3876. if (flag > 0) {
  3877. if (temp < this.borderRect.x + this.borderRect.width) {
  3878. return distance;
  3879. }
  3880. }
  3881. else {
  3882. if (temp > this.borderRect.x) {
  3883. return distance;
  3884. }
  3885. }
  3886. }
  3887. }
  3888. judgeLeftRight(distance, angle, starY) {
  3889. let flag = -Math.cos(angle * Math.PI / 180);
  3890. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3891. if (distance >= 0) {
  3892. if (flag > 0) {
  3893. if (temp < this.borderRect.y + this.borderRect.height) {
  3894. return distance;
  3895. }
  3896. }
  3897. else {
  3898. if (temp > this.borderRect.y) {
  3899. return distance;
  3900. }
  3901. }
  3902. }
  3903. }
  3904. clearBallAllEft() {
  3905. let temp;
  3906. for (let index = 0; index < this.ballArr.length; index++) {
  3907. temp = this.ballArr[index];
  3908. temp.clearBallEft();
  3909. }
  3910. }
  3911. showBallRightEft() {
  3912. let gameMgr = xGame.common.gameMgr;
  3913. let temp;
  3914. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3915. if (targetArr.length <= 0)
  3916. return;
  3917. for (let index = 0; index < this.ballArr.length; index++) {
  3918. temp = this.ballArr[index];
  3919. if (targetArr.indexOf(temp.number) > -1) {
  3920. temp.showRightEft();
  3921. }
  3922. }
  3923. }
  3924. showBallWrongEft() {
  3925. let gameMgr = xGame.common.gameMgr;
  3926. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3927. if (targetArr.length <= 0)
  3928. return;
  3929. let temp;
  3930. for (let index = 0; index < this.ballArr.length; index++) {
  3931. temp = this.ballArr[index];
  3932. if (this.targetBall && this.targetBall.number == temp.number) {
  3933. if (targetArr.indexOf(temp.number) <= -1) {
  3934. temp.showWrongEft();
  3935. }
  3936. else {
  3937. temp.clearBallWrongEft();
  3938. }
  3939. }
  3940. else {
  3941. temp.clearBallWrongEft();
  3942. }
  3943. }
  3944. }
  3945. getColliPos(x, y, radius, angle) {
  3946. this.d2HelpLine.ui.x = x;
  3947. this.d2HelpLine.ui.y = y;
  3948. let dirX = x - this.rootBall.gameObj.x;
  3949. let dirY = y - this.rootBall.gameObj.y;
  3950. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3951. if (rectH <= 0)
  3952. rectH = 0;
  3953. this.d2HelpLine.ui.rect.height = 0;
  3954. this.d2HelpLine.ui.rect.height = rectH;
  3955. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3956. if (rectH < this.rootBall.gameObj.width) {
  3957. this.d2HelpLine.ui.rect.visible = false;
  3958. }
  3959. else {
  3960. this.d2HelpLine.ui.rect.visible = true;
  3961. }
  3962. this.d2HelpLine.ui.dir.visible = false;
  3963. this.d2HelpLine.ui.rootDir.visible = false;
  3964. }
  3965. getReflectLine(x, y, radius, target) {
  3966. this.d2HelpLine.ui.dir.visible = true;
  3967. let dirX = target.x - x;
  3968. let dirY = target.y - y;
  3969. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3970. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3971. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3972. this.d2HelpLine.ui.dir.height = 48;
  3973. this.d2HelpLine.ui.dir.rotation = angle;
  3974. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3975. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3976. return angle;
  3977. }
  3978. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3979. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3980. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3981. let targetX = target.gameObj.x;
  3982. let targetY = target.gameObj.y;
  3983. this.outDir.setValue(targetX - xx, targetY - yy);
  3984. this.rootDir.setValue(rtX - xx, rtY - yy);
  3985. let ver = Math.PI / 2;
  3986. let sin = Math.sin(ver);
  3987. let cos = Math.cos(ver);
  3988. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3989. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3990. this.outDir.setValue(outX, outY);
  3991. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3992. Laya.Vector2.normalize(this.outDir, this.outDir);
  3993. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3994. if (Math.abs(result) <= 0.08) {
  3995. this.d2HelpLine.ui.rootDir.visible = false;
  3996. return;
  3997. }
  3998. if (result > 0) {
  3999. angle += 90;
  4000. }
  4001. else if (result < 0) {
  4002. angle -= 90;
  4003. }
  4004. this.d2HelpLine.ui.rootDir.visible = true;
  4005. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  4006. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  4007. this.d2HelpLine.ui.rootDir.rotation = angle;
  4008. }
  4009. delayReflectLine(obj, angle) {
  4010. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  4011. return;
  4012. }
  4013. this.isOnSameLine = false;
  4014. let startX = obj.gameObj.x;
  4015. let startY = obj.gameObj.y;
  4016. let dis = this.getBorderDot(startX, startY, angle);
  4017. if (dis == null) {
  4018. this.d2HelpLine.ui.dirDot.visible = false;
  4019. return;
  4020. }
  4021. this.d2HelpLine.ui.visible = true;
  4022. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4023. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4024. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  4025. if (colliObj == null) {
  4026. this.setDelayLine(disX, disY, obj, angle);
  4027. }
  4028. else {
  4029. let radius = 16;
  4030. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  4031. dis1 = Math.sqrt(dis1);
  4032. let realDis = colliObj.disHon - dis1;
  4033. let dir = colliObj.dir;
  4034. let xx = startX + dir.x * realDis;
  4035. let yy = startY + dir.y * realDis;
  4036. this.setDelayLine(xx, yy, obj, angle);
  4037. }
  4038. }
  4039. setDelayLine(x, y, obj, angle) {
  4040. let dirX = x - obj.gameObj.x;
  4041. let dirY = y - obj.gameObj.y;
  4042. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  4043. if (rectH <= 0)
  4044. rectH = 0;
  4045. this.d2HelpLine.ui.dir.height = rectH;
  4046. this.d2HelpLine.ui.dirDot.visible = true;
  4047. this.d2HelpLine.ui.dirDot.x = 17;
  4048. this.d2HelpLine.ui.dirDot.y = 17;
  4049. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  4050. ;
  4051. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  4052. }
  4053. changePlayerView() {
  4054. if (Math.random() >= 0.7)
  4055. return;
  4056. if (!this.targetBall) {
  4057. return;
  4058. }
  4059. if (!xGame.common.gameMgr.selfTurn)
  4060. return;
  4061. switch (xGame.common.gameMode) {
  4062. case GameMode.classic:
  4063. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  4064. if (this.targetBall.number != 8) {
  4065. return;
  4066. }
  4067. }
  4068. break;
  4069. case GameMode.bigMove:
  4070. return;
  4071. case GameMode.placeBall:
  4072. break;
  4073. default:
  4074. break;
  4075. }
  4076. let startX = this.targetBall.gameObj.x;
  4077. let startY = this.targetBall.gameObj.y;
  4078. let angle = this.reflectAngle;
  4079. let dis = this.getBorderDot(startX, startY, angle);
  4080. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4081. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4082. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  4083. if (colliObj) {
  4084. return;
  4085. }
  4086. let offset = 40;
  4087. let posObj = xGame.common.gameMgr.posObj;
  4088. let temp;
  4089. let radius;
  4090. let tarX, tarY;
  4091. for (const key in posObj) {
  4092. temp = posObj[key];
  4093. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4094. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4095. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4096. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4097. xGame.common.showOneCamera("angle" + key);
  4098. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4099. Laya.physicsTimer.scale = 0.7;
  4100. break;
  4101. }
  4102. }
  4103. }
  4104. selectBestEnterOne(arr) {
  4105. this.aiLv = xGame.tools.random(1, 11);
  4106. this.aiLv = 10;
  4107. this.wBall = xGame.common.d2World.rootBall;
  4108. this.rootPos.x = this.wBall.gameObj.x;
  4109. this.rootPos.y = this.wBall.gameObj.y;
  4110. this.initHoleBall(arr);
  4111. return this.selectBall();
  4112. }
  4113. selectBall() {
  4114. let ball = null;
  4115. this.destRot = 0;
  4116. let ai = 110 - this.aiLv * 10;
  4117. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4118. let score = false;
  4119. if (this.scoreBall.length < 1) {
  4120. if (this.lineBall.length < 1) {
  4121. for (let i = 0; i < this.kickBall.length; i++) {
  4122. let list = [];
  4123. let bo = this.kickBall[i];
  4124. let bobj = bo.gameObj;
  4125. let rect = xGame.common.d2World.borderRect;
  4126. let mobj = this.wBall.gameObj;
  4127. let minb = bobj.y - rect.y - 20;
  4128. let minw = mobj.y - rect.y - 50;
  4129. if (minb > 0 && minw > 0) {
  4130. let dlenx = 0;
  4131. let dleny = mobj.y - rect.y;
  4132. let spx = mobj.x;
  4133. let spy = rect.y - dleny;
  4134. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4135. }
  4136. minb = rect.y + rect.height - bobj.y - 20;
  4137. minw = rect.y + rect.height - mobj.y - 50;
  4138. if (minb > 0 && minw > 0) {
  4139. let dlenx = 0;
  4140. let dleny = rect.y + rect.height - mobj.y;
  4141. let spx = mobj.x;
  4142. let spy = rect.y + rect.height + dleny;
  4143. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4144. }
  4145. minb = bobj.x - rect.x - 20;
  4146. minw = mobj.x - rect.x - 50;
  4147. if (minb > 0 && minw > 0) {
  4148. let dlenx = mobj.x - rect.x;
  4149. let dleny = 0;
  4150. let spx = rect.x - dlenx;
  4151. let spy = mobj.y;
  4152. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4153. }
  4154. minb = rect.x + rect.width - bobj.x - 20;
  4155. minw = rect.x + rect.width - mobj.x - 50;
  4156. if (minb > 0 && minw > 0) {
  4157. let dlenx = rect.x + rect.width - mobj.x;
  4158. let dleny = 0;
  4159. let spx = rect.x + rect.width + dlenx;
  4160. let spy = mobj.y;
  4161. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4162. }
  4163. list.sort(function (a, b) {
  4164. return a.order - b.order;
  4165. });
  4166. for (let i = 0; i < list.length; i++) {
  4167. let data = list[i];
  4168. let mx = mobj.x - bobj.x;
  4169. let my = mobj.y - bobj.y;
  4170. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4171. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4172. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4173. if (num > 1)
  4174. num = 1;
  4175. let cos = Math.acos(num);
  4176. if (cos > 1.57)
  4177. cos = 1.57;
  4178. else if (cos < 0.01)
  4179. cos = 0.01;
  4180. let tan = Math.tan(cos);
  4181. let dx = tan * data.dleny;
  4182. let dy = tan * data.dlenx;
  4183. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4184. if (Math.abs(bx - 667) < 40)
  4185. continue;
  4186. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4187. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4188. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4189. this.forceMax = dis * 0.08;
  4190. this.destRot += mis * 0.1;
  4191. this.setKick(bx, by);
  4192. return true;
  4193. }
  4194. }
  4195. }
  4196. }
  4197. else {
  4198. ball = xGame.common.getRandArrEle(this.lineBall);
  4199. }
  4200. }
  4201. else {
  4202. for (let i = 0; i < this.scoreBall.length; i++) {
  4203. if (i < this.scoreBall.length - 1) {
  4204. let rand = 70 + this.aiLv * 10 + i * 10;
  4205. if (xGame.tools.random(0, 100) < rand) {
  4206. ball = this.scoreBall[i];
  4207. break;
  4208. }
  4209. }
  4210. else {
  4211. ball = this.scoreBall[i];
  4212. break;
  4213. }
  4214. }
  4215. score = true;
  4216. this.selectNum++;
  4217. }
  4218. if (!ball)
  4219. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4220. let dx = ball.gameObj.x;
  4221. let dy = ball.gameObj.y;
  4222. let kickAngle = 0;
  4223. if (score) {
  4224. dx = ball.kickPos.x;
  4225. dy = ball.kickPos.y;
  4226. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4227. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4228. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4229. if (adot > 1)
  4230. adot = 1;
  4231. kickAngle = Math.acos(adot) * 57.3;
  4232. if (kickAngle > 45) {
  4233. let kdx = ball.kickPos.x - ball.gameObj.x;
  4234. let kdy = ball.kickPos.y - ball.gameObj.y;
  4235. dx = ball.kickPos.x - kdx * mis * 0.3;
  4236. dy = ball.kickPos.y - kdy * mis * 0.3;
  4237. }
  4238. else
  4239. this.destRot += mis;
  4240. }
  4241. else if (ball.poleAngle != 0) {
  4242. this.destRot += ball.poleAngle;
  4243. }
  4244. if (xGame.common.gameMode == 0) {
  4245. let af = kickAngle * 0.08;
  4246. this.forceMax = ball.hard * 0.1 + af * af;
  4247. }
  4248. this.setKick(dx, dy);
  4249. return ball;
  4250. }
  4251. initHoleBall(arr) {
  4252. this.kickBall = [];
  4253. this.lineBall = [];
  4254. this.scoreBall = [];
  4255. this.holeBall = [];
  4256. this.selectNum = 0;
  4257. this.forceNum = 0;
  4258. this.forceMax = 0;
  4259. this.turnNum = 0;
  4260. let list = arr;
  4261. let holes = xGame.common.gameMgr.holePosList;
  4262. let self = xGame.common.aiPlayer;
  4263. for (let i = 0; i < list.length; i++) {
  4264. let obj = list[i];
  4265. if (!obj)
  4266. continue;
  4267. obj.kickPos.x = 0;
  4268. obj.kickPos.y = 0;
  4269. obj.poleAngle = 0;
  4270. obj.hard = 0;
  4271. obj.borderDis = 0;
  4272. obj.kickAngle = 180;
  4273. let b = obj.gameObj;
  4274. let wbp = this.rootPos;
  4275. let bx = wbp.x - b.x;
  4276. let by = wbp.y - b.y;
  4277. obj.borderDis = xGame.tools.random(0, 100);
  4278. this.kickBall.push(obj);
  4279. if (!this.isLine(wbp, obj))
  4280. continue;
  4281. obj.kickAngle = xGame.tools.random(90, 180);
  4282. obj.kickPos.x = b.x;
  4283. obj.kickPos.y = b.y;
  4284. this.lineBall.push(obj);
  4285. let minDis = 999999;
  4286. let hole = false;
  4287. for (let j = 0; j < holes.length; j++) {
  4288. let hp = holes[j];
  4289. if (bx >= 0 && hp.x > b.x + 100)
  4290. continue;
  4291. if (bx <= 0 && hp.x < b.x - 100)
  4292. continue;
  4293. if (by < -10 && hp.y < wbp.y)
  4294. continue;
  4295. if (by > 10 && hp.y > wbp.y)
  4296. continue;
  4297. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4298. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4299. if (dis < minDis) {
  4300. let dx = b.x - this.tempDir1.x * this.ballSize;
  4301. let dy = b.y - this.tempDir1.y * this.ballSize;
  4302. this.tempDir3.x = this.tempDir1.x;
  4303. this.tempDir3.y = this.tempDir1.y;
  4304. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4305. obj.kickPos.x = dx;
  4306. obj.kickPos.y = dy;
  4307. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4308. if (num > 1)
  4309. num = 1;
  4310. obj.kickAngle = Math.acos(num) * 57.3;
  4311. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4312. dis = dis * 2;
  4313. if (Math.abs(hp.x - 600) < 100)
  4314. dis += 50;
  4315. obj.hard = dis + obj.kickAngle * 3;
  4316. hole = true;
  4317. }
  4318. }
  4319. }
  4320. }
  4321. if (hole) {
  4322. this.scoreBall.push(obj);
  4323. this.holeBall.push(obj);
  4324. }
  4325. }
  4326. this.scoreBall.sort(function (a, b) {
  4327. return a.hard - b.hard;
  4328. });
  4329. this.holeBall.sort(function (a, b) {
  4330. return a.kickAngle - b.kickAngle;
  4331. });
  4332. this.kickBall.sort(function (a, b) {
  4333. return a.borderDis - b.borderDis;
  4334. });
  4335. }
  4336. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4337. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4338. let balls = xGame.common.d2World.ballArr;
  4339. let max = xGame.tools.getDis(hx, hy, bx, by);
  4340. for (let index = 0; index < balls.length; index++) {
  4341. let obj = balls[index];
  4342. if (obj.number == 0)
  4343. continue;
  4344. if (obj.number == bn || obj.number == dn)
  4345. continue;
  4346. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4347. if (dis * dis > max)
  4348. continue;
  4349. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4350. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4351. if (num > 1)
  4352. num = 1;
  4353. if (num < 0)
  4354. continue;
  4355. let gap = Math.sin(Math.acos(num)) * dis;
  4356. if (gap < this.ballSize)
  4357. return true;
  4358. }
  4359. return false;
  4360. }
  4361. isLine(xy, ball) {
  4362. let bx = xy.x;
  4363. let by = xy.y;
  4364. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4365. let dis = ball.getDestDis(xy);
  4366. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4367. let sin = Math.sin(angle);
  4368. let cos = Math.cos(angle);
  4369. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4370. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4371. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4372. let dx = bx + this.tempDir2.x * dis;
  4373. let dy = by + this.tempDir2.y * dis;
  4374. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4375. sin = Math.sin(-angle);
  4376. cos = Math.cos(-angle);
  4377. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4378. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4379. dx = bx + this.tempDir2.x * dis;
  4380. dy = by + this.tempDir2.y * dis;
  4381. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4382. if (isr && isl)
  4383. return false;
  4384. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4385. }
  4386. return true;
  4387. }
  4388. setKick(dx, dy) {
  4389. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4390. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4391. this.tempDir1.x = 0;
  4392. this.tempDir1.y = 1;
  4393. this.tempDir2.y = -this.tempDir2.y;
  4394. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4395. if (num > 1)
  4396. num = 1;
  4397. let rot = Math.acos(num) * 57.3;
  4398. if (this.tempDir2.x < 0)
  4399. rot = 360 - rot;
  4400. this.destRot += rot;
  4401. }
  4402. }
  4403. class ui_UIGame extends fgui.GComponent {
  4404. static createInstance() {
  4405. return (fgui.UIPackage.createObject("game", "UIGame"));
  4406. }
  4407. onConstruct() {
  4408. this.c1 = this.getController("c1");
  4409. this.d3Root = (this.getChild("d3Root"));
  4410. this.clickNode = (this.getChild("clickNode"));
  4411. this.d2Root = (this.getChild("d2Root"));
  4412. this.topNode = (this.getChild("topNode"));
  4413. this.n72 = (this.getChild("n72"));
  4414. this.n40 = (this.getChild("n40"));
  4415. this.rulerNode = (this.getChild("rulerNode"));
  4416. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4417. this.n50 = (this.getChild("n50"));
  4418. this.keduNode = (this.getChild("keduNode"));
  4419. this.powerTxt = (this.getChild("powerTxt"));
  4420. this.powerNode = (this.getChild("powerNode"));
  4421. this.colorNode = (this.getChild("colorNode"));
  4422. this.powerEft = (this.getChild("powerEft"));
  4423. this.myPowerNode = (this.getChild("myPowerNode"));
  4424. this.ganNode = (this.getChild("ganNode"));
  4425. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4426. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4427. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4428. this.skillRod = (this.getChild("skillRod"));
  4429. this.border = (this.getChild("border"));
  4430. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4431. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4432. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4433. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4434. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4435. this.guanyuNode = (this.getChild("guanyuNode"));
  4436. this.helpBtn = (this.getChild("helpBtn"));
  4437. this.wordsBtn = (this.getChild("wordsBtn"));
  4438. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4439. this.returnBtn = (this.getChild("returnBtn"));
  4440. this.ballNode = (this.getChild("ballNode"));
  4441. this.whiteAni = (this.getChild("whiteAni"));
  4442. this.blackAni = (this.getChild("blackAni"));
  4443. this.selfTurn = (this.getChild("selfTurn"));
  4444. this.aiTurn = (this.getChild("aiTurn"));
  4445. this.deskNode = (this.getChild("deskNode"));
  4446. this.moveNode = (this.getChild("moveNode"));
  4447. this.selfTalk = (this.getChild("selfTalk"));
  4448. this.aiTalk = (this.getChild("aiTalk"));
  4449. this.d2Node = (this.getChild("d2Node"));
  4450. this.snowNode = (this.getChild("snowNode"));
  4451. this.guide2 = (this.getChild("guide2"));
  4452. this.guide1 = (this.getChild("guide1"));
  4453. this.guide3 = (this.getChild("guide3"));
  4454. this.guideNode = (this.getChild("guideNode"));
  4455. this.n_lxms_yd1 = (this.getChild("n_lxms_yd1"));
  4456. this.n_lxms_yd2 = (this.getChild("n_lxms_yd2"));
  4457. this.n_lxms_yd3 = (this.getChild("n_lxms_yd3"));
  4458. }
  4459. }
  4460. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4461. class ui_UIGameEnd extends fgui.GComponent {
  4462. static createInstance() {
  4463. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4464. }
  4465. onConstruct() {
  4466. this.c1 = this.getController("c1");
  4467. this.n22 = (this.getChild("n22"));
  4468. this.n2 = (this.getChild("n2"));
  4469. this.n52 = (this.getChild("n52"));
  4470. this.n53 = (this.getChild("n53"));
  4471. this.coinNode = (this.getChild("coinNode"));
  4472. this.closeNode = (this.getChild("closeNode"));
  4473. this.moneyNode = (this.getChild("moneyNode"));
  4474. this.secretary = (this.getChild("secretary"));
  4475. this.n27 = (this.getChild("n27"));
  4476. this.n29 = (this.getChild("n29"));
  4477. this.talkNode = (this.getChild("talkNode"));
  4478. this.n38 = (this.getChild("n38"));
  4479. this.n39 = (this.getChild("n39"));
  4480. this.n40 = (this.getChild("n40"));
  4481. this.awardNode = (this.getChild("awardNode"));
  4482. this.starNumNode = (this.getChild("starNumNode"));
  4483. this.n47 = (this.getChild("n47"));
  4484. this.conditionNode = (this.getChild("conditionNode"));
  4485. this.isGetAward = (this.getChild("isGetAward"));
  4486. this.leftBtn = (this.getChild("leftBtn"));
  4487. this.rightBtn = (this.getChild("rightBtn"));
  4488. this.btnNode = (this.getChild("btnNode"));
  4489. }
  4490. }
  4491. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4492. class ui_UIAddCoin extends fgui.GComponent {
  4493. static createInstance() {
  4494. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4495. }
  4496. onConstruct() {
  4497. this.n11 = (this.getChild("n11"));
  4498. this.myNode = (this.getChild("myNode"));
  4499. this.t0 = this.getTransition("t0");
  4500. }
  4501. }
  4502. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4503. class UIAddCoin extends UIBase {
  4504. constructor() {
  4505. super();
  4506. this.coinNum = 2000;
  4507. }
  4508. onConstructor() {
  4509. this.ui = ui_UIAddCoin.createInstance();
  4510. this.contentPane = this.ui;
  4511. this.isEject = false;
  4512. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4513. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4514. }
  4515. show() {
  4516. super.show();
  4517. this.ui.t0.play();
  4518. this.setGlobalFont(this.ui);
  4519. }
  4520. videoAddCoin() {
  4521. console.log('zh:qjff_AD_for_UIAddCoin');
  4522. if (Laya.Browser.onAndroid) {
  4523. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4524. if (!boo) {
  4525. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4526. return;
  4527. }
  4528. }
  4529. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4530. }
  4531. else {
  4532. console.log('zh:AD 失败,直接发放奖励');
  4533. this.qjff_AD_for_UIAddCoin();
  4534. }
  4535. }
  4536. qjff_AD_for_UIAddCoin() {
  4537. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4538. this.hide();
  4539. }
  4540. }
  4541. UIAddCoin.uiName = "UIAddCoin";
  4542. class ui_UIInvitation extends fgui.GComponent {
  4543. static createInstance() {
  4544. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4545. }
  4546. onConstruct() {
  4547. this.n14 = (this.getChild("n14"));
  4548. this.myNode = (this.getChild("myNode"));
  4549. this.t0 = this.getTransition("t0");
  4550. }
  4551. }
  4552. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4553. class UIInvitation extends UIBase {
  4554. constructor() {
  4555. super();
  4556. }
  4557. onConstructor() {
  4558. this.ui = ui_UIInvitation.createInstance();
  4559. this.contentPane = this.ui;
  4560. this.isEject = false;
  4561. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4562. }
  4563. show() {
  4564. super.show();
  4565. this.setGlobalFont(this.ui);
  4566. }
  4567. enterGame() {
  4568. xGame.common.gameMode = GameMode.classic;
  4569. DataMgr.setChallengeTimes(1);
  4570. xGame.common.passAwardCoin = 2000;
  4571. let need = xGame.common.classicNiceNeddCoin;
  4572. if (DataMgr.coinEnough(need)) {
  4573. DataMgr.setCoin(-need);
  4574. xGame.eventMgr.event(RESTART_GAME, true);
  4575. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4576. }
  4577. else {
  4578. xGame.eventMgr.event(RESTART_GAME, true);
  4579. }
  4580. this.hide();
  4581. }
  4582. hide() {
  4583. super.hide();
  4584. }
  4585. }
  4586. UIInvitation.uiName = "UIInvitation";
  4587. class ui_UIMain extends fgui.GComponent {
  4588. static createInstance() {
  4589. return (fgui.UIPackage.createObject("game", "UIMain"));
  4590. }
  4591. onConstruct() {
  4592. this.n47 = (this.getChild("n47"));
  4593. this.n10 = (this.getChild("n10"));
  4594. this.secretary = (this.getChild("secretary"));
  4595. this.moneyNode = (this.getChild("moneyNode"));
  4596. this.headNode = (this.getChild("headNode"));
  4597. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4598. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4599. this.classicBtn = (this.getChild("classicBtn"));
  4600. this.globalBtn = (this.getChild("globalBtn"));
  4601. this.n44 = (this.getChild("n44"));
  4602. this.n_dengLu = (this.getChild("n_dengLu"));
  4603. this.settingNode = (this.getChild("settingNode"));
  4604. this.drawBtn = (this.getChild("drawBtn"));
  4605. this.signBtn = (this.getChild("signBtn"));
  4606. this.shopBtn = (this.getChild("shopBtn"));
  4607. this.n45 = (this.getChild("n45"));
  4608. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4609. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4610. this.rankBtn = (this.getChild("rankBtn"));
  4611. this.n46 = (this.getChild("n46"));
  4612. this.liucheng1 = (this.getChild("liucheng1"));
  4613. this.rightBtn = (this.getChild("rightBtn"));
  4614. this.n75 = (this.getChild("n75"));
  4615. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4616. this.liucheng2 = (this.getChild("liucheng2"));
  4617. this.guideBtn = (this.getChild("guideBtn"));
  4618. this.n73 = (this.getChild("n73"));
  4619. this.wordsNode = (this.getChild("wordsNode"));
  4620. this.enterGuide = (this.getChild("enterGuide"));
  4621. this.talkNode = (this.getChild("talkNode"));
  4622. this.n83 = (this.getChild("n83"));
  4623. this.n84 = (this.getChild("n84"));
  4624. this.n_yd_challenge_1_mask = (this.getChild("n_yd_challenge_1_mask"));
  4625. this.n_yd_challenge_1_btn = (this.getChild("n_yd_challenge_1_btn"));
  4626. this.n_yd_challenge_1_hand = (this.getChild("n_yd_challenge_1_hand"));
  4627. this.n_yd_lxms_1 = (this.getChild("n_yd_lxms_1"));
  4628. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4629. }
  4630. }
  4631. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4632. class ui_UIMoyu extends fgui.GComponent {
  4633. static createInstance() {
  4634. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4635. }
  4636. onConstruct() {
  4637. this.ageTip = (this.getChild("ageTip"));
  4638. this.mainBg = (this.getChild("mainBg"));
  4639. this.xyNode = (this.getChild("xyNode"));
  4640. this.rnNode = (this.getChild("rnNode"));
  4641. this.fcmNode = (this.getChild("fcmNode"));
  4642. this.ageNode = (this.getChild("ageNode"));
  4643. this.tipNode = (this.getChild("tipNode"));
  4644. this.msgNode = (this.getChild("msgNode"));
  4645. }
  4646. }
  4647. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4648. class MoyuMgr {
  4649. static initMoyu() {
  4650. this.moyuView = new MoyuView();
  4651. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4652. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4653. this.moyuView.ui.displayObject.zOrder = 1000;
  4654. this.moyuView.init();
  4655. this.moyuView.showTip(true);
  4656. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4657. window['XApk'] = this;
  4658. }
  4659. static showAge(show) {
  4660. if (this.moyuView)
  4661. this.moyuView.showAge(show);
  4662. }
  4663. static onPlatMsg(idx) {
  4664. if (!MoyuMgr.moyuView)
  4665. return;
  4666. if (idx == '0') {
  4667. MoyuMgr.moyuView.showTip(false);
  4668. }
  4669. }
  4670. static showAgree(call) {
  4671. if (this.moyuView)
  4672. this.moyuView.showAgree(call);
  4673. else
  4674. call && call();
  4675. }
  4676. static showXy(type = 1) {
  4677. if (this.moyuView)
  4678. this.moyuView.showXy(type);
  4679. }
  4680. }
  4681. MoyuMgr.isAdvise = false;
  4682. class MoyuView {
  4683. constructor() {
  4684. this.ysxyNum = 1;
  4685. this.ysJson = null;
  4686. this.ui = ui_UIMoyu.createInstance();
  4687. }
  4688. init() {
  4689. this.ui.mainBg.visible = false;
  4690. this.ui.xyNode.visible = false;
  4691. this.ui.ageNode.visible = false;
  4692. this.ui.tipNode.visible = false;
  4693. this.ui.rnNode.visible = false;
  4694. this.ui.fcmNode.visible = false;
  4695. this.ui.ageTip.visible = false;
  4696. this.ui.msgNode.visible = false;
  4697. this.ui.visible = false;
  4698. this.ui.xyNode.xyList.setVirtual();
  4699. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4700. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4701. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4702. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4703. this.ui.xyNode.btnKnown.visible = false;
  4704. this.ui.xyNode.xy1.visible = false;
  4705. this.ui.xyNode.xy2.visible = false;
  4706. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4707. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4708. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4709. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4710. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4711. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4712. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4713. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4714. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4715. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4716. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4717. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4718. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4719. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4720. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4721. this.ysxyNum = 2;
  4722. }
  4723. }
  4724. onClick(obj) {
  4725. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4726. switch (obj) {
  4727. case this.ui.ageTip:
  4728. if (Moyu.isTTApk) {
  4729. this.ui.ageNode.visible = true;
  4730. this.ui.mainBg.visible = true;
  4731. }
  4732. break;
  4733. case this.ui.tipNode:
  4734. this.showTip(false);
  4735. break;
  4736. case this.ui.ageNode.btnAge:
  4737. this.ui.ageNode.visible = false;
  4738. this.ui.mainBg.visible = false;
  4739. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4740. this.ui.visible = false;
  4741. break;
  4742. case this.ui.xyNode.btnXy3:
  4743. case this.ui.xyNode.btnXy1:
  4744. this.loadXy(1);
  4745. break;
  4746. case this.ui.xyNode.btnXy2:
  4747. this.loadXy(2);
  4748. break;
  4749. case this.ui.xyNode.btnBack:
  4750. this.ui.xyNode.xy1.visible = true;
  4751. this.ui.xyNode.xy2.visible = false;
  4752. break;
  4753. case this.ui.xyNode.btnKnown:
  4754. this.ui.xyNode.visible = false;
  4755. this.ui.mainBg.visible = false;
  4756. this.ui.visible = false;
  4757. break;
  4758. case this.ui.rnNode.btnCheck:
  4759. this.check();
  4760. break;
  4761. case this.ui.rnNode.btnExit:
  4762. case this.ui.xyNode.btnNo:
  4763. this.ysxyNum--;
  4764. if (this.ysxyNum > 0)
  4765. this.showMsg("Refuse to quit the game once again");
  4766. else {
  4767. Moyu.userAgree(false);
  4768. Moyu.exit();
  4769. }
  4770. break;
  4771. case this.ui.xyNode.btnSure:
  4772. case this.ui.xyNode.btnYes:
  4773. DataMgr.userData.isAgree = true;
  4774. DataMgr.saveUserData();
  4775. this.onAgree();
  4776. break;
  4777. case this.ui.rnNode.btnDone:
  4778. this.ui.rnNode.visible = false;
  4779. this.ui.visible = false;
  4780. break;
  4781. case this.ui.fcmNode.btnRn:
  4782. this.showRn();
  4783. break;
  4784. }
  4785. }
  4786. showTip(show) {
  4787. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4788. return;
  4789. if (show) {
  4790. MoyuMgr.isAdvise = true;
  4791. this.ui.visible = true;
  4792. this.ui.tipNode.visible = true;
  4793. this.ui.tipNode.alpha = 1;
  4794. Laya.timer.once(1000, this, this.showTip, [false]);
  4795. }
  4796. else {
  4797. this.ui.tipNode.alpha = 1;
  4798. this.ui.tipNode.visible = true;
  4799. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4800. this.ui.tipNode.visible = false;
  4801. MoyuMgr.isAdvise = false;
  4802. }), 1000);
  4803. }
  4804. }
  4805. showAge(show, px = 0, py = 0) {
  4806. if (Moyu.platType > 10 && !Moyu.isIos) {
  4807. this.ui.ageTip.x = px;
  4808. this.ui.ageTip.y = py;
  4809. this.ui.ageTip.visible = show;
  4810. if (show)
  4811. this.ui.visible = true;
  4812. }
  4813. }
  4814. showAgree(call) {
  4815. this.agreeCall = call;
  4816. this.onAgree();
  4817. return;
  4818. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4819. this.showXy(0);
  4820. }
  4821. else
  4822. this.onAgree();
  4823. }
  4824. onAgree() {
  4825. if (!this.ui.ageNode.visible)
  4826. this.ui.visible = false;
  4827. this.ui.xyNode.visible = false;
  4828. Moyu.userAgree(true);
  4829. this.showAge(false);
  4830. this.agreeCall && this.agreeCall();
  4831. this.showRn();
  4832. }
  4833. showMsg(txt) {
  4834. this.ui.msgNode.txtMsg.text = txt;
  4835. this.ui.msgNode.visible = true;
  4836. this.ui.msgNode.alpha = 1;
  4837. this.ui.visible = true;
  4838. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4839. this.ui.msgNode.visible = false;
  4840. }), 2500, true);
  4841. }
  4842. showRn() {
  4843. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4844. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4845. this.ui.rnNode.rn1.visible = true;
  4846. this.ui.rnNode.rn2.visible = false;
  4847. this.ui.rnNode.rn3.visible = false;
  4848. this.ui.rnNode.rn4.visible = false;
  4849. this.ui.rnNode.visible = true;
  4850. this.ui.mainBg.visible = true;
  4851. this.ui.rnNode.btnDone.visible = false;
  4852. this.ui.rnNode.btnExit.visible = true;
  4853. this.ui.rnNode.btnCheck.visible = true;
  4854. this.ui.fcmNode.visible = false;
  4855. this.ui.visible = true;
  4856. return;
  4857. }
  4858. }
  4859. this.showFcm();
  4860. }
  4861. showFcm() {
  4862. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4863. Moyu.initFCM(true);
  4864. if (Moyu.gameTime < 1)
  4865. this.fcmLoop();
  4866. else if (Moyu.gameTime < 999)
  4867. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4868. }
  4869. }
  4870. fcmLoop() {
  4871. if (Moyu.gameTime < 1) {
  4872. this.ui.rnNode.visible = false;
  4873. this.ui.fcmNode.visible = true;
  4874. this.ui.mainBg.visible = true;
  4875. this.ui.visible = true;
  4876. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4877. Laya.timer.clear(this.ui, this.fcmLoop);
  4878. }
  4879. }
  4880. check() {
  4881. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4882. this.ui.rnNode.rn1.visible = false;
  4883. this.ui.rnNode.rn2.visible = false;
  4884. this.ui.rnNode.rn4.visible = true;
  4885. }
  4886. else if (this.ui.rnNode.rn4.visible) {
  4887. let name = this.ui.rnNode.inputName.text;
  4888. let code = this.ui.rnNode.inputCode.text;
  4889. if (code && code.length == 18) {
  4890. this.ui.rnNode.rn1.visible = false;
  4891. this.ui.rnNode.rn4.visible = false;
  4892. Moyu.authenticate(name, code, (res) => {
  4893. this.ui.rnNode.rn2.visible = !res;
  4894. this.ui.rnNode.rn3.visible = res;
  4895. this.ui.rnNode.btnDone.visible = res;
  4896. this.ui.rnNode.btnExit.visible = !res;
  4897. this.ui.rnNode.btnCheck.visible = !res;
  4898. if (res)
  4899. this.showFcm();
  4900. });
  4901. }
  4902. else
  4903. this.showMsg("信息填写不完整");
  4904. }
  4905. }
  4906. loadXy(type = 0) {
  4907. this.ui.xyNode.xy1.visible = false;
  4908. this.ui.xyNode.xy2.visible = true;
  4909. this.ui.xyNode.xyList.scrollToView(0);
  4910. if (type == 1) {
  4911. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4912. }
  4913. else if (type == 2) {
  4914. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4915. }
  4916. }
  4917. showXy(type = 0) {
  4918. this.xyBtn();
  4919. if (type == 0) {
  4920. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4921. this.ui.xyNode.btnSure.visible = true;
  4922. }
  4923. else {
  4924. this.ui.xyNode.btnYes.visible = true;
  4925. this.ui.xyNode.btnNo.visible = true;
  4926. }
  4927. }
  4928. else {
  4929. this.ui.xyNode.btnKnown.visible = true;
  4930. this.ui.mainBg.visible = true;
  4931. }
  4932. this.ui.xyNode.xy1.visible = true;
  4933. this.ui.xyNode.xy2.visible = false;
  4934. this.ui.xyNode.visible = true;
  4935. this.ui.visible = true;
  4936. }
  4937. xyBtn() {
  4938. this.ui.xyNode.btnSure.visible = false;
  4939. this.ui.xyNode.btnYes.visible = false;
  4940. this.ui.xyNode.btnNo.visible = false;
  4941. this.ui.xyNode.btnKnown.visible = false;
  4942. {
  4943. this.ui.xyNode.btnXy3.visible = false;
  4944. this.ui.xyNode.btnXy2.visible = true;
  4945. this.ui.xyNode.btnXy1.visible = true;
  4946. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4947. }
  4948. }
  4949. createXY(json) {
  4950. this.ysJson = json.content;
  4951. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4952. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4953. this.ui.xyNode.xy2.visible = true;
  4954. }
  4955. renderListItem(idx, cell) {
  4956. let xy = this.ysJson[idx];
  4957. cell.height = xy.line * 30;
  4958. cell.xyItem.text = xy.text;
  4959. }
  4960. onDestroy() {
  4961. this.agreeCall = null;
  4962. }
  4963. }
  4964. class SettingNode {
  4965. constructor(ui) {
  4966. this.showSetting = false;
  4967. this.openSound = true;
  4968. this.openShake = true;
  4969. this.ui = ui;
  4970. this.ui.soundBtn.onClick(this, this.switchSound);
  4971. this.ui.shakeBtn.onClick(this, this.switchShake);
  4972. this.ui.xyBtn.onClick(this, this.onXy);
  4973. this.ui.clickNode.onClick(this, this.changeSetting);
  4974. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4975. this.ui.xyBtn.visible = false;
  4976. this.ui.shakeBtn.visible = false;
  4977. }
  4978. changeSetting() {
  4979. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4980. this.showSetting = !this.showSetting;
  4981. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4982. }
  4983. switchSound() {
  4984. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4985. this.openSound = !this.openSound;
  4986. Moyu.onSetting(this.openSound, this.openShake);
  4987. xGame.soundMgr.onSetting(this.openSound);
  4988. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4989. }
  4990. switchShake() {
  4991. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4992. this.openShake = !this.openShake;
  4993. Moyu.onSetting(this.openSound, this.openShake);
  4994. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4995. }
  4996. onXy() {
  4997. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4998. MoyuMgr.showXy(1);
  4999. }
  5000. }
  5001. class ui_UILevelDisplay extends fgui.GComponent {
  5002. static createInstance() {
  5003. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  5004. }
  5005. onConstruct() {
  5006. this.n9 = (this.getChild("n9"));
  5007. this.myNode = (this.getChild("myNode"));
  5008. this.closeNode = (this.getChild("closeNode"));
  5009. }
  5010. }
  5011. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  5012. class ui_UILevelProp extends fgui.GComponent {
  5013. static createInstance() {
  5014. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  5015. }
  5016. onConstruct() {
  5017. this.n16 = (this.getChild("n16"));
  5018. this.myNode = (this.getChild("myNode"));
  5019. this.closeBtn = (this.getChild("closeBtn"));
  5020. this.moneyNode = (this.getChild("moneyNode"));
  5021. this.t1 = this.getTransition("t1");
  5022. }
  5023. }
  5024. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  5025. class ui_ShowItem extends fgui.GComponent {
  5026. static createInstance() {
  5027. return (fgui.UIPackage.createObject("game", "ShowItem"));
  5028. }
  5029. onConstruct() {
  5030. this.myImg = (this.getChild("myImg"));
  5031. }
  5032. }
  5033. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  5034. class ShowItem {
  5035. constructor() {
  5036. this.ui = ui_ShowItem.createInstance();
  5037. }
  5038. destroySelf() {
  5039. if (!this.ui.isDisposed) {
  5040. this.ui.removeFromParent();
  5041. this.ui.dispose();
  5042. }
  5043. }
  5044. setParent(parent) {
  5045. parent.addChild(this.ui);
  5046. }
  5047. setPos(x, y) {
  5048. this.ui.x = x;
  5049. this.ui.y = y;
  5050. }
  5051. setUrl(index) {
  5052. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  5053. }
  5054. }
  5055. class ui_UIPower extends fgui.GComponent {
  5056. static createInstance() {
  5057. return (fgui.UIPackage.createObject("game", "UIPower"));
  5058. }
  5059. onConstruct() {
  5060. this.n11 = (this.getChild("n11"));
  5061. this.myNode = (this.getChild("myNode"));
  5062. this.t0 = this.getTransition("t0");
  5063. }
  5064. }
  5065. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  5066. class UIPower extends UIBase {
  5067. constructor() {
  5068. super();
  5069. }
  5070. onConstructor() {
  5071. this.ui = ui_UIPower.createInstance();
  5072. this.contentPane = this.ui;
  5073. this.isEject = false;
  5074. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  5075. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  5076. }
  5077. show() {
  5078. super.show();
  5079. this.ui.t0.play();
  5080. this.setGlobalFont(this.ui);
  5081. }
  5082. videoGetPower() {
  5083. console.log('zh:qjff_AD_for_uipower');
  5084. if (Laya.Browser.onAndroid) {
  5085. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  5086. if (!boo) {
  5087. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  5088. return;
  5089. }
  5090. }
  5091. if (Laya.Browser.onAndroid) {
  5092. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  5093. }
  5094. else {
  5095. console.log('zh:AD 失败,直接发放奖励');
  5096. this.qjff_AD_for_uipower();
  5097. }
  5098. }
  5099. else {
  5100. this.qjff_AD_for_uipower();
  5101. }
  5102. }
  5103. qjff_AD_for_uipower() {
  5104. DataMgr.setPower(xGame.common.videoPower, true);
  5105. xGame.eventMgr.event(POWER_TIME);
  5106. this.hide();
  5107. }
  5108. }
  5109. UIPower.uiName = "UIPower";
  5110. class UILevelProp extends UIBase {
  5111. constructor() {
  5112. super();
  5113. this.firstPos = 385;
  5114. this.secondPos = 467;
  5115. this.showItemArr = [];
  5116. }
  5117. onConstructor() {
  5118. this.ui = ui_UILevelProp.createInstance();
  5119. this.contentPane = this.ui;
  5120. this.isEject = false;
  5121. this.addUIClick(this.ui.closeBtn, this.hideWin);
  5122. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5123. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5124. this.addUIClick(this.ui.myNode.n_yd_zzq_btn3, this.startGame);
  5125. }
  5126. show(level) {
  5127. console.log('zh:show.');
  5128. super.show();
  5129. this.ui.t1.play();
  5130. this.level = level;
  5131. this.data = cfgTable.placeballData[this.level];
  5132. this.updateSelf();
  5133. this.showPreView();
  5134. this.moneyNode.ui.c1.selectedIndex = 2;
  5135. this.moneyNode.checkPowerTime();
  5136. this.moneyNode.powerChange();
  5137. this.yinDaoForLianxi();
  5138. this.setGlobalFont(this.ui);
  5139. }
  5140. yinDaoForLianxi() {
  5141. let lianXiGuide = DataMgr.getLianXiGuide();
  5142. console.log('zh:lianXiGuide=', lianXiGuide);
  5143. if (lianXiGuide === 0) {
  5144. this.ui.myNode.n_yd_3.visible = true;
  5145. console.log('zh:yinDaoForLianxi 333 set ok');
  5146. }
  5147. else {
  5148. this.ui.myNode.n_yd_3.visible = false;
  5149. console.log('zh:无需引导33');
  5150. }
  5151. }
  5152. showPreView() {
  5153. let item;
  5154. let data;
  5155. for (let index = 0; index < this.showItemArr.length; index++) {
  5156. item = this.showItemArr[index];
  5157. item.destroySelf();
  5158. }
  5159. this.showItemArr = [];
  5160. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5161. for (const key in cfgData) {
  5162. data = cfgData[key];
  5163. item = new ShowItem();
  5164. item.setParent(this.ui.myNode.displayRoot);
  5165. item.setPos(data.x, data.y);
  5166. item.setUrl(data.value);
  5167. this.showItemArr.push(item);
  5168. }
  5169. }
  5170. updateSelf() {
  5171. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5172. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5173. if (this.data.ball == -1) {
  5174. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5175. }
  5176. else {
  5177. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5178. }
  5179. let localData = DataMgr.getPlaceBallLevel(this.level);
  5180. let getAward = localData.getAward;
  5181. let cfg = cfgTable.placeballData[this.level];
  5182. let coin = this.data.award[0];
  5183. let diamond = this.data.award[1];
  5184. if (cfg.type == PlaceBallType.challenge) {
  5185. diamond = 0;
  5186. coin = 100;
  5187. }
  5188. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5189. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5190. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5191. if (cfg.type == PlaceBallType.challenge) {
  5192. this.ui.myNode.coinNode.numTxt.text = "";
  5193. }
  5194. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5195. if (coin > 0 && diamond > 0) {
  5196. this.ui.myNode.diamondNode.x = 385;
  5197. this.ui.myNode.coinNode.x = 467;
  5198. }
  5199. else {
  5200. this.ui.myNode.diamondNode.x = 385;
  5201. this.ui.myNode.coinNode.x = 385;
  5202. }
  5203. if (!getAward) {
  5204. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5205. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5206. }
  5207. else {
  5208. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5209. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5210. }
  5211. }
  5212. startGame() {
  5213. console.log("zh:startGame");
  5214. if (DataMgr.powerEnough()) {
  5215. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5216. this.ui.myNode.startBtn.touchable = false;
  5217. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5218. console.log('zh:startGame dh ');
  5219. this.ui.myNode.startBtn.touchable = true;
  5220. DataMgr.setPower(-1);
  5221. xGame.eventMgr.event(POWER_TIME);
  5222. xGame.common.gameMode = GameMode.placeBall;
  5223. xGame.common.placeBallCurLevel = this.level;
  5224. xGame.uiMgr.Show(UIGame);
  5225. xGame.uiMgr.Hide(UILevelDisplay);
  5226. xGame.uiMgr.Hide(UIMain);
  5227. this.logEventForChallenge_level_start(this.level);
  5228. this.hideWin();
  5229. }));
  5230. console.log('zh:eeeee');
  5231. }
  5232. else {
  5233. let guide = DataMgr.getLianXiGuide();
  5234. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  5235. console.log('zh:自动添加2点体力,以便于完成练习引导模式');
  5236. DataMgr.setPower(2);
  5237. }
  5238. console.log('zh:guide = ' + guide);
  5239. console.log('zh:xGame.common.gameMode = ' + xGame.common.gameMode);
  5240. console.log('zh:powerEnough不足=' + DataMgr.powerEnough());
  5241. xGame.uiMgr.Show(UIPower);
  5242. }
  5243. }
  5244. logEventForChallenge_level_start(level) {
  5245. let keyStr = 'sjmd_challenge_level_start';
  5246. let jsonStr = {
  5247. "count": 1,
  5248. "gold_balance ": DataMgr.getCoin(),
  5249. "level": level,
  5250. "diamond_balance ": DataMgr.getDiamond()
  5251. };
  5252. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5253. const d = LocalStorageManager.getItem(keyStr);
  5254. if (level > d.level) {
  5255. jsonStr.count = d.count + 1;
  5256. LocalStorageManager.setItem(keyStr, jsonStr);
  5257. }
  5258. else {
  5259. }
  5260. }
  5261. else {
  5262. LocalStorageManager.setItem(keyStr, jsonStr);
  5263. }
  5264. const reqStr = JSON.stringify(jsonStr);
  5265. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5266. }
  5267. hideWin() {
  5268. super.hide();
  5269. if (this.ui.myNode.startBtn) {
  5270. this.ui.myNode.startBtn.touchable = true;
  5271. if (this.ui.myNode.startBtn.powerEft.t0) {
  5272. this.ui.myNode.startBtn.powerEft.t0.stop();
  5273. }
  5274. }
  5275. }
  5276. }
  5277. UILevelProp.uiName = "UILevelProp";
  5278. class PutBallLevelDisplay {
  5279. constructor(ui, index) {
  5280. this.index = 0;
  5281. this.ui = ui;
  5282. this.index = index;
  5283. this.ui.onClick(this, this.clickSelf);
  5284. this.updateSelf();
  5285. this.ui.levelTxt.text = (this.index + 1) + "";
  5286. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5287. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5288. }
  5289. updateSelf() {
  5290. let level = this.index + 1;
  5291. this.data = DataMgr.getPlaceBallLevel(level);
  5292. this.ui.starNode.c1.selectedIndex = this.data.star;
  5293. let isChallenge = cfgTable.placeballData[level].type;
  5294. if (this.data.isCur) {
  5295. if (isChallenge) {
  5296. this.ui.c1.selectedIndex = 5;
  5297. }
  5298. else {
  5299. this.ui.c1.selectedIndex = 2;
  5300. }
  5301. }
  5302. else {
  5303. if (this.data.play) {
  5304. if (this.data.star == 3) {
  5305. this.ui.c1.selectedIndex = 0;
  5306. }
  5307. else {
  5308. this.ui.c1.selectedIndex = 1;
  5309. }
  5310. }
  5311. else {
  5312. if (isChallenge) {
  5313. this.ui.c1.selectedIndex = 4;
  5314. }
  5315. else {
  5316. this.ui.c1.selectedIndex = 3;
  5317. }
  5318. }
  5319. }
  5320. }
  5321. clickSelf() {
  5322. console.log("zh:lev clickSelf");
  5323. if (!this.data.play)
  5324. return;
  5325. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5326. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5327. }
  5328. }
  5329. class UILevelDisplay extends UIBase {
  5330. constructor() {
  5331. super();
  5332. }
  5333. onConstructor() {
  5334. this.ui = ui_UILevelDisplay.createInstance();
  5335. this.contentPane = this.ui;
  5336. this.isEject = false;
  5337. this.myList = this.ui.myNode.myList;
  5338. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5339. this.addUIClick(this.ui.myNode.yd_zzq_btn, this.showLevelTipWindows);
  5340. this.levelItemArr = [];
  5341. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5342. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5343. this.myList.numItems = levelNum;
  5344. }
  5345. levelItemRender(index, target) {
  5346. let item = new PutBallLevelDisplay(target, index);
  5347. this.levelItemArr.push(item);
  5348. }
  5349. show() {
  5350. super.show();
  5351. this.updateLevel();
  5352. this.scrollToPlace();
  5353. this.yinDaoForLianxi();
  5354. this.setGlobalFont(this.ui);
  5355. }
  5356. yinDaoForLianxi() {
  5357. let lianXiGuide = DataMgr.getLianXiGuide();
  5358. console.log('zh:lianXiGuide=', lianXiGuide);
  5359. if (lianXiGuide === 0) {
  5360. this.ui.myNode.n_yd.visible = true;
  5361. console.log('zh:yinDaoForLianxi 222 set ok');
  5362. }
  5363. else {
  5364. this.ui.myNode.n_yd.visible = false;
  5365. console.log('zh:无需引导');
  5366. }
  5367. }
  5368. showLevelTipWindows() {
  5369. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5370. xGame.uiMgr.Show(UILevelProp, 1);
  5371. }
  5372. updateLevel() {
  5373. let temp;
  5374. for (let index = 0; index < this.levelItemArr.length; index++) {
  5375. temp = this.levelItemArr[index];
  5376. temp.updateSelf();
  5377. }
  5378. }
  5379. scrollToPlace() {
  5380. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5381. let passArr = DataMgr.getPlaceBallLevelList();
  5382. let offest = passArr.length;
  5383. if (offest >= maxNum - 1)
  5384. offest = maxNum - 1;
  5385. this.myList.scrollToView(offest, true, true);
  5386. }
  5387. hide() {
  5388. super.hide();
  5389. }
  5390. }
  5391. UILevelDisplay.uiName = "UILevelDisplay";
  5392. class ui_UIMatching extends fgui.GComponent {
  5393. static createInstance() {
  5394. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5395. }
  5396. onConstruct() {
  5397. this.n5 = (this.getChild("n5"));
  5398. this.n49 = (this.getChild("n49"));
  5399. this.n51 = (this.getChild("n51"));
  5400. this.n64 = (this.getChild("n64"));
  5401. this.n2 = (this.getChild("n2"));
  5402. this.n53 = (this.getChild("n53"));
  5403. this.n54 = (this.getChild("n54"));
  5404. this.n56 = (this.getChild("n56"));
  5405. this.n58 = (this.getChild("n58"));
  5406. this.n59 = (this.getChild("n59"));
  5407. this.n57 = (this.getChild("n57"));
  5408. this.n60 = (this.getChild("n60"));
  5409. this.n62 = (this.getChild("n62"));
  5410. this.awardTxt = (this.getChild("awardTxt"));
  5411. this.n61 = (this.getChild("n61"));
  5412. this.selfHead = (this.getChild("selfHead"));
  5413. this.aiHead = (this.getChild("aiHead"));
  5414. this.n82 = (this.getChild("n82"));
  5415. this.n84 = (this.getChild("n84"));
  5416. this.n83 = (this.getChild("n83"));
  5417. this.t1 = this.getTransition("t1");
  5418. this.t2 = this.getTransition("t2");
  5419. this.t3 = this.getTransition("t3");
  5420. this.t4 = this.getTransition("t4");
  5421. }
  5422. }
  5423. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5424. class UIMatching extends UIBase {
  5425. constructor() {
  5426. super();
  5427. }
  5428. onConstructor() {
  5429. this.ui = ui_UIMatching.createInstance();
  5430. this.contentPane = this.ui;
  5431. this.isEject = false;
  5432. }
  5433. show(callback) {
  5434. super.show();
  5435. PlatMgr.showBanner(true);
  5436. this.callback = callback;
  5437. let user = Moyu.getUserInfo();
  5438. if (!this.selfPot) {
  5439. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5440. }
  5441. if (!this.aiPot) {
  5442. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5443. }
  5444. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5445. this.ui.selfHead.nameTxt.text = user.nickName;
  5446. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5447. this.ui.aiHead.nameTxt.text = "???";
  5448. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5449. this.ui.selfHead.c1.selectedIndex = 0;
  5450. this.ui.aiHead.c1.selectedIndex = 0;
  5451. this.ui.selfHead.x = this.selfPot.x;
  5452. this.ui.selfHead.y = this.selfPot.y;
  5453. this.ui.aiHead.x = this.aiPot.x;
  5454. this.ui.aiHead.y = this.aiPot.y;
  5455. switch (xGame.common.gameMode) {
  5456. case GameMode.classic:
  5457. break;
  5458. case GameMode.bigMove:
  5459. this.initSkillData();
  5460. break;
  5461. default:
  5462. break;
  5463. }
  5464. this.ui.t1.play(Laya.Handler.create(this, () => {
  5465. this.ui.t2.play(Laya.Handler.create(this, () => {
  5466. switch (xGame.common.gameMode) {
  5467. case GameMode.classic:
  5468. this.waitingPeople();
  5469. break;
  5470. case GameMode.bigMove:
  5471. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5472. break;
  5473. default:
  5474. break;
  5475. }
  5476. }));
  5477. }));
  5478. this.setGlobalFont(this.ui);
  5479. }
  5480. initSkillData() {
  5481. this.skillSelectData = [];
  5482. let skillUrl = xGame.common.skillIconList;
  5483. let skillName = xGame.common.skillNameList;
  5484. let skillLevel = DataMgr.getBigSkillList();
  5485. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5486. for (let index = 0; index < 5; index++) {
  5487. let obj = {};
  5488. obj.skillImg = skillUrl[index];
  5489. obj.skillName = skillName[index];
  5490. obj.skillType = skillType[index];
  5491. obj.skillLevel = skillLevel[index];
  5492. this.skillSelectData.push(obj);
  5493. }
  5494. }
  5495. getAISkillLevel(myLevel) {
  5496. let video = xGame.common.upSkillLevel;
  5497. let aiLevel;
  5498. let temp;
  5499. if (video) {
  5500. temp = xGame.common.randomNum(-2, -1);
  5501. }
  5502. else {
  5503. if (myLevel <= 5) {
  5504. temp = xGame.common.randomNum(1, 3);
  5505. }
  5506. else if (myLevel <= 9) {
  5507. temp = xGame.common.randomNum(-2, 1);
  5508. }
  5509. else {
  5510. temp = xGame.common.randomNum(-4, 0);
  5511. }
  5512. }
  5513. aiLevel = temp + myLevel;
  5514. if (aiLevel <= 1)
  5515. aiLevel = 1;
  5516. if (aiLevel >= 10)
  5517. aiLevel = 10;
  5518. return aiLevel;
  5519. }
  5520. getAISkillType() {
  5521. return xGame.common.randomNum(1, 4);
  5522. let successTimes = DataMgr.getSkillSuccessTimes();
  5523. let info = cfgTable.aiskillData[successTimes];
  5524. if (!info) {
  5525. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5526. info = cfgTable.aiskillData[max];
  5527. }
  5528. let dataArr = info.skillselect;
  5529. let myCfg = {};
  5530. for (let index = 0; index < dataArr.length; index++) {
  5531. let temp = dataArr[index].split('-');
  5532. myCfg[temp[0]] = {};
  5533. myCfg[temp[0]].id = parseInt(temp[0]);
  5534. myCfg[temp[0]].weight = parseInt(temp[1]);
  5535. }
  5536. let aiCfg = xGame.common.initWeight(myCfg);
  5537. let curData = xGame.common.getRandomWeightData(aiCfg);
  5538. return parseInt(curData.id);
  5539. }
  5540. getAISkillData(index) {
  5541. let myLevel = this.skillSelectData[index].skillLevel;
  5542. let aiLevel = this.getAISkillLevel(myLevel);
  5543. let aiType = this.getAISkillType() - 1;
  5544. return { aiLevel, aiType } = { aiLevel, aiType };
  5545. }
  5546. skillSelectFinish(index) {
  5547. let aiInfo = this.getAISkillData(index);
  5548. xGame.common.gameMgr.selfCurSkill = index;
  5549. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5550. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5551. this.ui.selfHead.c1.selectedIndex = 1;
  5552. this.ui.aiHead.c1.selectedIndex = 1;
  5553. let myData = this.skillSelectData[index];
  5554. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5555. let guide = DataMgr.getSkillGuide();
  5556. if (guide == 0) {
  5557. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5558. }
  5559. else {
  5560. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5561. }
  5562. let aiData = this.skillSelectData[aiInfo.aiType];
  5563. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5564. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5565. this.waitingPeople();
  5566. }
  5567. waitingPeople() {
  5568. let time = xGame.common.randomNum(1000, 3000);
  5569. time += 1000;
  5570. Laya.timer.once(time, this, () => {
  5571. this.matchingSuccess();
  5572. });
  5573. }
  5574. matchingSuccess() {
  5575. let gameUI = xGame.common.gameUI;
  5576. let name = gameUI.ui.topNode.aiNameTxt.text;
  5577. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5578. this.ui.aiHead.nameTxt.text = name;
  5579. this.ui.aiHead.headImg.url = url;
  5580. name = gameUI.ui.topNode.selfNameTxt.text;
  5581. url = gameUI.ui.topNode.selfHeadLoader.url;
  5582. this.ui.selfHead.nameTxt.text = name;
  5583. this.ui.selfHead.headImg.url = url;
  5584. this.ui.t3.play(Laya.Handler.create(this, () => {
  5585. this.callback && this.callback();
  5586. this.ui.t4.play(Laya.Handler.create(this, () => {
  5587. this.destroySelf();
  5588. }));
  5589. }));
  5590. }
  5591. destroySelf() {
  5592. this.callback = null;
  5593. this.skillSelectData = null;
  5594. this.selfPot = null;
  5595. this.aiPot = null;
  5596. if (!this.ui.isDisposed) {
  5597. this.ui.removeFromParent();
  5598. this.ui.dispose();
  5599. }
  5600. xGame.uiMgr.destroyUI(this);
  5601. }
  5602. }
  5603. UIMatching.uiName = "UIMatching";
  5604. class ui_UIRanking extends fgui.GComponent {
  5605. static createInstance() {
  5606. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5607. }
  5608. onConstruct() {
  5609. this.n26 = (this.getChild("n26"));
  5610. this.myNode = (this.getChild("myNode"));
  5611. }
  5612. }
  5613. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5614. class UIRanking extends UIBase {
  5615. constructor() {
  5616. super();
  5617. this.showSelf = true;
  5618. this.rankType = 1;
  5619. this.rankList = [];
  5620. this.topX = 10;
  5621. this.myIndex = this.topX + 1;
  5622. this.myStar = 0;
  5623. }
  5624. onConstructor() {
  5625. this.ui = ui_UIRanking.createInstance();
  5626. this.contentPane = this.ui;
  5627. this.isEject = false;
  5628. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5629. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5630. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5631. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5632. this.ui.myNode.myList.setVirtual();
  5633. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5634. }
  5635. show() {
  5636. super.show();
  5637. this.getPaiHangBangDataFormJosnFile();
  5638. this.updateSelf();
  5639. let self = Moyu.getUserInfo();
  5640. if (!self.isAuth) {
  5641. Moyu.initUser(this, () => {
  5642. DataMgr.upRankData();
  5643. });
  5644. }
  5645. this.setGlobalFont(this.ui);
  5646. }
  5647. getPaiHangBangDataFormJosnFile() {
  5648. const rankingList = cfgTable.paiHangBangData.list;
  5649. this.updateItemData(rankingList);
  5650. }
  5651. updateSelfItem() {
  5652. console.log('zh:Moyu.platType =' + Moyu.platType);
  5653. let self = Moyu.getUserInfo();
  5654. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5655. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5656. if (this.myIndex > this.topX) {
  5657. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5658. }
  5659. else {
  5660. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5661. }
  5662. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5663. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5664. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5665. }
  5666. updateItemData(data) {
  5667. this.myStar = xGame.common.getAllStarNum();
  5668. if (this.rankList.length < 2) {
  5669. this.rankList = data;
  5670. let self = Moyu.getUserInfo();
  5671. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5672. self.headIcon = self.headIcon;
  5673. for (let i = 0; i < data.length; i++) {
  5674. let data = this.rankList[i];
  5675. if (data.userId == self.userId) {
  5676. this.rankList.splice(i, 1);
  5677. break;
  5678. }
  5679. }
  5680. for (let i = 0; i < data.length; i++) {
  5681. let data = this.rankList[i];
  5682. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5683. this.myIndex = i + 1;
  5684. let user = { headIcon: self.headIcon, nickName: "myself" };
  5685. let ud = { user: user, data: {} };
  5686. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5687. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5688. if (Moyu.platType < 11) {
  5689. user.headIcon = self.headIcon;
  5690. user.nickName = self.nickName;
  5691. }
  5692. this.rankList.splice(i, 0, md);
  5693. break;
  5694. }
  5695. }
  5696. }
  5697. this.updateSelfItem();
  5698. this.ui.myNode.myList.numItems = this.rankList.length;
  5699. }
  5700. updateItemUI(index, obj) {
  5701. let data = this.rankList[index];
  5702. let userData = JSON.parse(data.userData).user;
  5703. obj.nameTxt.text = userData.nickName.toString();
  5704. obj.valueTxt.text = data.rankScore;
  5705. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5706. obj.rankTxt.text = index + 1;
  5707. switch (index) {
  5708. case 0:
  5709. this.setImg(obj, 1, 0, 0);
  5710. obj.rankTxt.color = "#FFC047";
  5711. break;
  5712. case 1:
  5713. this.setImg(obj, 0, 1, 0);
  5714. obj.rankTxt.color = "#ACACAC";
  5715. break;
  5716. case 2:
  5717. this.setImg(obj, 0, 0, 1);
  5718. obj.rankTxt.color = "#D09672";
  5719. break;
  5720. default:
  5721. this.setImg(obj, 0, 0, 0);
  5722. obj.rankTxt.color = "#496FAB";
  5723. break;
  5724. }
  5725. }
  5726. setImg(obj, a, b, c) {
  5727. obj.img1.visible = a ? true : false;
  5728. obj.img2.visible = b ? true : false;
  5729. obj.img3.visible = c ? true : false;
  5730. }
  5731. changeList(type) {
  5732. this.rankType = type;
  5733. this.updateSelf();
  5734. }
  5735. changeSelfNode() {
  5736. this.showSelf = !this.showSelf;
  5737. this.updateSelf();
  5738. }
  5739. updateSelf() {
  5740. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5741. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5742. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5743. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5744. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5745. }
  5746. }
  5747. UIRanking.uiName = "UIRanking";
  5748. class ui_UISecretary extends fgui.GComponent {
  5749. static createInstance() {
  5750. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5751. }
  5752. onConstruct() {
  5753. this.n0 = (this.getChild("n0"));
  5754. this.myNode = (this.getChild("myNode"));
  5755. this.closeBtn = (this.getChild("closeBtn"));
  5756. this.t0 = this.getTransition("t0");
  5757. }
  5758. }
  5759. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5760. class UISecretary extends UIBase {
  5761. constructor() {
  5762. super();
  5763. this.curIndex = 1;
  5764. }
  5765. onConstructor() {
  5766. this.ui = ui_UISecretary.createInstance();
  5767. this.contentPane = this.ui;
  5768. this.isEject = false;
  5769. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5770. this.nodeObj = { left: null, right: null, cur: null };
  5771. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5772. }
  5773. show() {
  5774. super.show();
  5775. this.ui.t0.play();
  5776. this.updateData();
  5777. this.setGlobalFont(this.ui);
  5778. }
  5779. addSecretarySpine(node, spineName) {
  5780. if (spineName == "mishu") {
  5781. if (this.secretarySpine1) {
  5782. node.displayObject.destroyChildren();
  5783. this.playWoman(this.secretarySpine1, node.displayObject);
  5784. }
  5785. else {
  5786. let spine1 = new SpineMgr("mishu", () => {
  5787. this.secretarySpine1 = spine1;
  5788. this.playWoman(this.secretarySpine1, node.displayObject);
  5789. });
  5790. }
  5791. }
  5792. else {
  5793. if (this.secretarySpine2) {
  5794. node.displayObject.destroyChildren();
  5795. this.playWoman(this.secretarySpine2, node.displayObject);
  5796. }
  5797. else {
  5798. let spine2 = new SpineMgr("xiaomishu2", () => {
  5799. this.secretarySpine2 = spine2;
  5800. this.playWoman(this.secretarySpine2, node.displayObject);
  5801. });
  5802. }
  5803. }
  5804. }
  5805. playWoman(node, parent) {
  5806. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5807. let yy = this.ui.myNode.gameNode3.secretary.height;
  5808. let scale = 1.5;
  5809. if (node == this.secretarySpine2) {
  5810. scale = 1.2;
  5811. }
  5812. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5813. node.play(data, 0, true, parent);
  5814. }
  5815. turnLeft() {
  5816. this.curIndex--;
  5817. if (this.curIndex < 1) {
  5818. this.curIndex = 2;
  5819. }
  5820. let left = this.nodeObj.left;
  5821. let right = this.nodeObj.right;
  5822. let cur = this.nodeObj.cur;
  5823. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5824. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5825. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5826. this.updateData();
  5827. }));
  5828. this.ui.myNode.setChildIndex(right, 2);
  5829. this.nodeObj.left = cur;
  5830. this.nodeObj.right = left;
  5831. this.nodeObj.cur = right;
  5832. }
  5833. turnRight() {
  5834. this.curIndex++;
  5835. if (this.curIndex > 2) {
  5836. this.curIndex = 1;
  5837. }
  5838. let left = this.nodeObj.left;
  5839. let right = this.nodeObj.right;
  5840. let cur = this.nodeObj.cur;
  5841. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5842. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5843. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5844. this.updateData();
  5845. }));
  5846. this.ui.myNode.setChildIndex(left, 2);
  5847. this.nodeObj.left = right;
  5848. this.nodeObj.right = cur;
  5849. this.nodeObj.cur = left;
  5850. }
  5851. updateData() {
  5852. console.log('zh: updateData FFFFFFFFFF');
  5853. let data = cfgTable.secretaryshopData;
  5854. let children = this.ui.myNode._children;
  5855. let temp;
  5856. let curData;
  5857. for (let index = 0; index < children.length; index++) {
  5858. temp = children[index];
  5859. curData = data[1];
  5860. temp.heightTxt.text = curData.height;
  5861. temp.foodTxt.text = curData.food;
  5862. temp.historyTxt.text = curData.history;
  5863. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5864. this.addSecretarySpine(temp.secretary, curData.spine);
  5865. let womanIndex = curData.id - 1;
  5866. let getWoman = DataMgr.getSecretary(womanIndex);
  5867. let curUse = DataMgr.getCurSecretary();
  5868. if (getWoman) {
  5869. if (curUse == womanIndex) {
  5870. temp.purchaseBtn.c1.selectedIndex = 1;
  5871. }
  5872. else {
  5873. temp.purchaseBtn.c1.selectedIndex = 2;
  5874. }
  5875. }
  5876. else {
  5877. temp.purchaseBtn.c1.selectedIndex = 0;
  5878. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5879. }
  5880. temp.purchaseBtn.visible = false;
  5881. }
  5882. }
  5883. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5884. console.log('zh: 点击了clickSecretary ');
  5885. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5886. if (getWoman) {
  5887. if (curUse != womanIndex) {
  5888. console.log();
  5889. DataMgr.setCurSecretary(womanIndex);
  5890. this.updateData();
  5891. }
  5892. }
  5893. else {
  5894. console.log('zh:点击购买了');
  5895. let need = needDiamond;
  5896. if (DataMgr.diamondEnough(need)) {
  5897. DataMgr.setDiamond(-need);
  5898. DataMgr.setSecretary(womanIndex, 1);
  5899. DataMgr.setCurSecretary(womanIndex);
  5900. this.updateData();
  5901. }
  5902. else {
  5903. xGame.uiMgr.Show(UIAddProp, 1);
  5904. }
  5905. }
  5906. }
  5907. closeSelf() {
  5908. this.hide();
  5909. }
  5910. }
  5911. UISecretary.uiName = "UISecretary";
  5912. class ui_UIShop extends fgui.GComponent {
  5913. static createInstance() {
  5914. return (fgui.UIPackage.createObject("game", "UIShop"));
  5915. }
  5916. onConstruct() {
  5917. this.n48 = (this.getChild("n48"));
  5918. this.n0 = (this.getChild("n0"));
  5919. this.secretary = (this.getChild("secretary"));
  5920. this.talkNode = (this.getChild("talkNode"));
  5921. this.closeNode = (this.getChild("closeNode"));
  5922. this.moneyNode = (this.getChild("moneyNode"));
  5923. this.myNode = (this.getChild("myNode"));
  5924. }
  5925. }
  5926. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5927. class ui_UIMsg extends fgui.GComponent {
  5928. static createInstance() {
  5929. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5930. }
  5931. onConstruct() {
  5932. this.tipsNode = (this.getChild("tipsNode"));
  5933. }
  5934. }
  5935. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5936. class UIMsg extends UIBase {
  5937. constructor() {
  5938. super();
  5939. }
  5940. onConstructor() {
  5941. this.ui = ui_UIMsg.createInstance();
  5942. this.contentPane = this.ui;
  5943. this.isEject = false;
  5944. this.isMuti = true;
  5945. }
  5946. show(msg, callback) {
  5947. super.show();
  5948. this.ui.tipsNode.msgTxt.text = msg;
  5949. this.ui.alpha = 1;
  5950. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5951. this.hide();
  5952. callback && callback();
  5953. }), 1000);
  5954. this.setGlobalFont(this.ui);
  5955. }
  5956. }
  5957. UIMsg.uiName = "UIMsg";
  5958. class BallRodDisplay {
  5959. constructor(ui, index) {
  5960. this.index = 0;
  5961. this.uiIndex = 0;
  5962. this.ui = ui;
  5963. this.index = index;
  5964. this.initData();
  5965. }
  5966. initData() {
  5967. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5968. let data = cfgTable.ballrodData[this.index + 1];
  5969. this.ui.nameTxt.text = data.name;
  5970. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5971. this.ui.levelNode.c1.selectedIndex = data.quality;
  5972. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5973. if (data.spine) {
  5974. this.mySpine = new SpineMgr(data.spine, () => {
  5975. let xx = 150;
  5976. let yy = 70;
  5977. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5978. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5979. });
  5980. }
  5981. }
  5982. updateSelf() {
  5983. let get = DataMgr.getBallRod(this.index);
  5984. if (get == null)
  5985. get = 1;
  5986. let curUse = DataMgr.getCurBallRod();
  5987. if (get) {
  5988. if (curUse == this.index) {
  5989. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5990. }
  5991. else {
  5992. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5993. }
  5994. }
  5995. else {
  5996. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5997. }
  5998. }
  5999. buyBallRod() {
  6000. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6001. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  6002. switch (selectedIndex) {
  6003. case 0:
  6004. break;
  6005. case 1:
  6006. console.log('zh:点击了 USE THIS');
  6007. DataMgr.setCurBallRod(this.index);
  6008. let curUse = DataMgr.getCurBallRod();
  6009. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  6010. let ui = xGame.uiMgr.getUI(UIShop);
  6011. ui.updateBallRod();
  6012. break;
  6013. case 2:
  6014. let data = cfgTable.ballrodData[this.index + 1];
  6015. let need = data.price;
  6016. if (DataMgr.diamondEnough(need)) {
  6017. this.buyQiuGan(data);
  6018. DataMgr.setDiamond(-need);
  6019. DataMgr.setBallRod(this.index, 1);
  6020. DataMgr.setCurBallRod(this.index);
  6021. let ui = xGame.uiMgr.getUI(UIShop);
  6022. ui.updateBallRod();
  6023. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  6024. }
  6025. else {
  6026. xGame.uiMgr.Show(UIAddProp, 1);
  6027. }
  6028. break;
  6029. default:
  6030. break;
  6031. }
  6032. }
  6033. buyQiuGan(qgItem) {
  6034. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  6035. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6036. if (userInfo == null) {
  6037. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6038. return;
  6039. }
  6040. let reqData = xGame.httpMgr.getReqData();
  6041. let pd = JSON.parse(reqData);
  6042. pd.qiuGanData = qgItem;
  6043. reqData = JSON.stringify(pd);
  6044. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  6045. try {
  6046. console.log('zh:buySp res = ' + JSON.stringify(res));
  6047. let code = res.code;
  6048. let msg = res.msg;
  6049. if (code == 401) {
  6050. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6051. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.loginTimeOut);
  6052. return;
  6053. }
  6054. if (code == 200) {
  6055. xGame.uiMgr.Show(UIMsg, msg);
  6056. DataMgr.getUserZiChanInfo(false);
  6057. }
  6058. else {
  6059. xGame.uiMgr.Show(UIMsg, msg);
  6060. }
  6061. }
  6062. catch (error) {
  6063. console.log('error=' + error);
  6064. alert(error);
  6065. }
  6066. finally {
  6067. }
  6068. });
  6069. }
  6070. logEventForGouMaiGan(qiuGanName) {
  6071. const ev = {
  6072. value: qiuGanName
  6073. };
  6074. const jsonStr = JSON.stringify(ev);
  6075. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  6076. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  6077. }
  6078. }
  6079. class DaoJuDisplay {
  6080. constructor(ui, index) {
  6081. this.index = 0;
  6082. this.uiIndex = 0;
  6083. this.ggSpid = "";
  6084. this.spid = 0;
  6085. this.ui = ui;
  6086. this.index = index;
  6087. this.initData();
  6088. }
  6089. initData() {
  6090. this.ui.btn_buy.onClick(this, this.gotoBuy);
  6091. let data = cfgTable.daoJuData[this.index + 1];
  6092. this.ui.nameTxt.text = data.spbt;
  6093. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  6094. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  6095. this.ggSpid = data.ggSpid;
  6096. this.spid = data.spid;
  6097. let baseUrl = "asset/sound/ogg/";
  6098. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  6099. }
  6100. gotoBuy() {
  6101. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6102. if (userInfo != null) {
  6103. let token = userInfo.token;
  6104. let ggSpid = this.ggSpid;
  6105. let spid = this.spid;
  6106. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  6107. console.log('zh:gotoBuy1 spid =' + spid);
  6108. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  6109. return;
  6110. }
  6111. else {
  6112. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6113. }
  6114. }
  6115. gotoBuy1() {
  6116. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6117. let djItem = cfgTable.daoJuData[this.index + 1];
  6118. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  6119. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6120. if (userInfo == null) {
  6121. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6122. return;
  6123. }
  6124. let reqData = xGame.httpMgr.getReqData();
  6125. let pd = JSON.parse(reqData);
  6126. pd.spItem = djItem;
  6127. reqData = JSON.stringify(pd);
  6128. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  6129. try {
  6130. console.log('zh:buySp res = ' + JSON.stringify(res));
  6131. let code = res.code;
  6132. let msg = res.msg;
  6133. if (code == 401) {
  6134. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6135. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6136. return;
  6137. }
  6138. if (code == 200) {
  6139. xGame.uiMgr.Show(UIMsg, msg);
  6140. DataMgr.getUserZiChanInfo(false);
  6141. }
  6142. else {
  6143. xGame.uiMgr.Show(UIMsg, msg);
  6144. }
  6145. }
  6146. catch (error) {
  6147. console.log('error=' + error);
  6148. alert(error);
  6149. }
  6150. finally {
  6151. }
  6152. });
  6153. }
  6154. }
  6155. class UIShop extends UIBase {
  6156. constructor() {
  6157. super();
  6158. this.itemNums = 0;
  6159. this.itemNumsForDj = 0;
  6160. this.curType = "";
  6161. }
  6162. onConstructor() {
  6163. this.ui = ui_UIShop.createInstance();
  6164. this.contentPane = this.ui;
  6165. this.isEject = false;
  6166. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6167. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6168. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6169. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6170. this.addUIClick(this.ui, this.interuptSecretary);
  6171. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6172. this.ballRodArr = [];
  6173. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6174. this.ui.myNode.myList.numItems = this.itemNums;
  6175. this.loadDjdata_old();
  6176. }
  6177. loadDjdata_old() {
  6178. let fff = cfgTable.daoJuData;
  6179. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6180. this.daoJuArr = [];
  6181. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6182. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6183. }
  6184. getProductList() {
  6185. let reqData = xGame.httpMgr.getReqData();
  6186. let pd = JSON.parse(reqData);
  6187. pd.splx = "Consumable";
  6188. reqData = JSON.stringify(pd);
  6189. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6190. try {
  6191. let code = res.code;
  6192. let msg = res.msg;
  6193. if (code == 401) {
  6194. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6195. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6196. return;
  6197. }
  6198. if (code == 200) {
  6199. let data = res.data;
  6200. for (let index = 0; index < data.length; index++) {
  6201. let element = data[index];
  6202. cfgTable.daoJuData[element.spid] = element;
  6203. }
  6204. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6205. }
  6206. else {
  6207. xGame.uiMgr.Show(UIMsg, msg);
  6208. }
  6209. }
  6210. catch (error) {
  6211. console.log('error=' + error);
  6212. alert(error);
  6213. }
  6214. finally {
  6215. }
  6216. });
  6217. }
  6218. show(type) {
  6219. super.show();
  6220. this.curType = type == 0 ? "qiugan" : "daoju";
  6221. this.switchBtn("");
  6222. this.playSecretaryIdle();
  6223. this.updateBallRod();
  6224. this.setGlobalFont(this.ui);
  6225. }
  6226. test123() {
  6227. console.log('zh:test123 ');
  6228. }
  6229. switchBtn(type) {
  6230. console.log('zh:1111切換 sel type=' + type);
  6231. if (type == "") {
  6232. type = this.curType;
  6233. }
  6234. else {
  6235. if (this.curType == type) {
  6236. return;
  6237. }
  6238. else {
  6239. this.curType = type;
  6240. }
  6241. }
  6242. if (type == "qiugan") {
  6243. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6244. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6245. this.ui.myNode.c1.selectedIndex = 0;
  6246. this.ui.myNode.myList.visible = true;
  6247. this.ui.myNode.djList.visible = false;
  6248. }
  6249. else {
  6250. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6251. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6252. this.ui.myNode.c1.selectedIndex = 1;
  6253. this.ui.myNode.myList.visible = false;
  6254. this.ui.myNode.djList.visible = true;
  6255. }
  6256. }
  6257. updateBallRod() {
  6258. for (let index = 0; index < this.ballRodArr.length; index++) {
  6259. this.ballRodArr[index].updateSelf();
  6260. }
  6261. }
  6262. renderBallRod(sort, obj) {
  6263. let index = this.getIndexBySort(sort + 1) - 1;
  6264. let ballRod = new BallRodDisplay(obj, index);
  6265. this.ballRodArr.push(ballRod);
  6266. }
  6267. renderDaoJu(idx, obj) {
  6268. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6269. let b = new DaoJuDisplay(obj, index);
  6270. this.daoJuArr.push(b);
  6271. }
  6272. getIndexBySort(sort) {
  6273. let object = cfgTable.ballrodData;
  6274. for (const key in object) {
  6275. if (object[key].sort == sort) {
  6276. return parseInt(key);
  6277. }
  6278. }
  6279. }
  6280. getIndexBySortForDj(idx) {
  6281. let object = cfgTable.daoJuData;
  6282. for (const key in object) {
  6283. if (object[key].idx == idx) {
  6284. return parseInt(key);
  6285. }
  6286. }
  6287. }
  6288. playSecretaryIdle() {
  6289. let parent = this.ui.secretary.displayObject;
  6290. parent.destroyChildren();
  6291. let xx = this.ui.secretary.width / 2;
  6292. let yy = this.ui.secretary.height;
  6293. let scale = xGame.common.getSecretaryScale();
  6294. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6295. xGame.common.secretary.play(data, 0, true, parent);
  6296. }
  6297. interuptSecretary() {
  6298. Laya.timer.clearAll(this);
  6299. this.playSecretaryRandomSound();
  6300. }
  6301. playSecretaryRandomSound() {
  6302. if (this.isHide)
  6303. return;
  6304. let time = xGame.common.randomNum(45000, 60000);
  6305. Laya.timer.once(time, this, () => {
  6306. if (this.isHide)
  6307. return;
  6308. let index = xGame.common.randomNum(4, 7);
  6309. xGame.soundMgr.playSound("s_main0" + index);
  6310. let words = 1;
  6311. switch (index) {
  6312. case 4:
  6313. words = 5;
  6314. break;
  6315. case 5:
  6316. words = 3;
  6317. break;
  6318. case 6:
  6319. words = 6;
  6320. break;
  6321. case 7:
  6322. words = 7;
  6323. break;
  6324. default:
  6325. break;
  6326. }
  6327. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6328. this.playSecretaryRandomSound();
  6329. });
  6330. }
  6331. closeSelf() {
  6332. this.hide();
  6333. }
  6334. }
  6335. UIShop.uiName = "UIShop";
  6336. class ui_UISign extends fgui.GComponent {
  6337. static createInstance() {
  6338. return (fgui.UIPackage.createObject("game", "UISign"));
  6339. }
  6340. onConstruct() {
  6341. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  6342. this.n6 = (this.getChild("n6"));
  6343. this.closeNode = (this.getChild("closeNode"));
  6344. this.myNode = (this.getChild("myNode"));
  6345. this.moneyNode = (this.getChild("moneyNode"));
  6346. this.secretary = (this.getChild("secretary"));
  6347. this.talkNode = (this.getChild("talkNode"));
  6348. this.tripleBtn = (this.getChild("tripleBtn"));
  6349. this.normalBtn = (this.getChild("normalBtn"));
  6350. this.tipsNode = (this.getChild("tipsNode"));
  6351. this.againBtn = (this.getChild("againBtn"));
  6352. this.t0 = this.getTransition("t0");
  6353. }
  6354. }
  6355. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6356. class SignMax {
  6357. constructor(ui) {
  6358. this.ui = ui;
  6359. }
  6360. updateSelf(index, sameDay, curDayIndex) {
  6361. let data = cfgTable.signData[index + 1];
  6362. this.ui.titleTxt.text = data.title;
  6363. let arr1 = data.award[0].split('-');
  6364. let arr2 = data.award[1].split('-');
  6365. let num1 = parseInt(arr1[1]);
  6366. let num2 = parseInt(arr2[1]);
  6367. this.ui.numTxt1.text = num1 + "";
  6368. this.ui.numTxt2.text = num2 + "";
  6369. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6370. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6371. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6372. this.ui.numTxt1.visible = false;
  6373. }
  6374. else {
  6375. this.ui.numTxt1.visible = true;
  6376. }
  6377. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6378. this.ui.numTxt2.visible = false;
  6379. }
  6380. else {
  6381. this.ui.numTxt2.visible = true;
  6382. }
  6383. if (index < curDayIndex) {
  6384. this.ui.c1.selectedIndex = 1;
  6385. }
  6386. else if (index == curDayIndex) {
  6387. if (sameDay) {
  6388. this.ui.c1.selectedIndex = 2;
  6389. }
  6390. else {
  6391. this.ui.c1.selectedIndex = 2;
  6392. }
  6393. }
  6394. else {
  6395. this.ui.c1.selectedIndex = 0;
  6396. }
  6397. }
  6398. }
  6399. class SignNormal {
  6400. constructor(ui) {
  6401. this.ui = ui;
  6402. }
  6403. updateSelf(index, sameDay, curDayIndex) {
  6404. let data = cfgTable.signData[index + 1];
  6405. this.ui.titleTxt.text = data.title;
  6406. let arr = data.award[0].split('-');
  6407. let type = parseInt(arr[0]);
  6408. let num = parseInt(arr[1]);
  6409. this.ui.numTxt.text = num + "";
  6410. if (type > 2) {
  6411. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6412. this.ui.myIcon.rotation = 0;
  6413. }
  6414. else {
  6415. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6416. this.ui.myIcon.rotation = 0;
  6417. }
  6418. if (xGame.common.signAwardContainsRod(data.award)) {
  6419. this.ui.numTxt.visible = false;
  6420. }
  6421. else {
  6422. this.ui.numTxt.visible = true;
  6423. }
  6424. if (index < curDayIndex) {
  6425. this.ui.c1.selectedIndex = 1;
  6426. }
  6427. else if (index == curDayIndex) {
  6428. if (sameDay) {
  6429. this.ui.c1.selectedIndex = 2;
  6430. }
  6431. else {
  6432. this.ui.c1.selectedIndex = 2;
  6433. }
  6434. }
  6435. else {
  6436. this.ui.c1.selectedIndex = 0;
  6437. }
  6438. }
  6439. }
  6440. class UISign extends UIBase {
  6441. constructor() {
  6442. super();
  6443. this.curDayIndex = 0;
  6444. this.starX = 0;
  6445. }
  6446. onConstructor() {
  6447. this.ui = ui_UISign.createInstance();
  6448. this.contentPane = this.ui;
  6449. this.isEject = false;
  6450. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6451. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6452. this.initSignItem();
  6453. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6454. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6455. }
  6456. show() {
  6457. super.show();
  6458. this.ui.t0.play();
  6459. this.playSecretaryIdle();
  6460. this.updateSign();
  6461. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  6462. this.setGlobalFont(this.ui);
  6463. }
  6464. initSignItem() {
  6465. this.signArr = [];
  6466. for (let index = 0; index < 6; index++) {
  6467. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6468. this.signArr.push(temp);
  6469. }
  6470. this.signMax = new SignMax(this.ui.myNode.day7);
  6471. if (Moyu.isKs)
  6472. this.ui.closeNode.closeBtn.x += 100;
  6473. }
  6474. updateSign() {
  6475. let sameDay = xGame.common.judgeSameDay();
  6476. let max = 7;
  6477. this.curDayIndex = DataMgr.getSignData();
  6478. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6479. this.curDayIndex = 0;
  6480. if (!sameDay) {
  6481. this.ui.normalBtn.visible = true;
  6482. this.ui.tipsNode.visible = false;
  6483. this.ui.againBtn.visible = false;
  6484. }
  6485. else {
  6486. this.ui.normalBtn.visible = false;
  6487. let again = DataMgr.getExtraSign();
  6488. let isCurrency = false;
  6489. let index = this.curDayIndex;
  6490. if (index == 0)
  6491. index = 7;
  6492. let award = cfgTable.signData[index].award;
  6493. let num = award[0].split("-")[0];
  6494. if (num == "1" || num == "2")
  6495. isCurrency = true;
  6496. let showAgain = again == 0 && isCurrency;
  6497. this.ui.againBtn.visible = showAgain;
  6498. this.ui.tipsNode.visible = !showAgain;
  6499. }
  6500. for (let index = 0; index < this.signArr.length; index++) {
  6501. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6502. }
  6503. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6504. }
  6505. playSecretaryIdle() {
  6506. let parent = this.ui.secretary.displayObject;
  6507. parent.destroyChildren();
  6508. let xx = this.ui.secretary.width / 2;
  6509. let yy = this.ui.secretary.height;
  6510. let scale = xGame.common.getSecretaryScale();
  6511. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6512. xGame.common.secretary.play(data, 0, true, parent);
  6513. }
  6514. closeSelf() {
  6515. this.hide();
  6516. }
  6517. normalGetAward() {
  6518. let sameDay = xGame.common.judgeSameDay();
  6519. if (!sameDay) {
  6520. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6521. let temp;
  6522. let type;
  6523. let num;
  6524. let arr = [];
  6525. for (let index = 0; index < award.length; index++) {
  6526. temp = award[index].split("-");
  6527. type = parseInt(temp[0]);
  6528. num = parseInt(temp[1]);
  6529. let awardType = new AwardType();
  6530. awardType.num = num;
  6531. awardType.type = type;
  6532. arr.push(awardType);
  6533. }
  6534. xGame.common.getAward(arr, (watchVideo) => {
  6535. this.curDayIndex++;
  6536. if (this.curDayIndex > 7)
  6537. this.curDayIndex = 0;
  6538. DataMgr.setSignData(this.curDayIndex);
  6539. this.updateSignData2Server(this.curDayIndex);
  6540. DataMgr.setSignTime(new Date().getTime());
  6541. if (watchVideo) {
  6542. DataMgr.setExtraSign(1);
  6543. Moyu.sendDataEvent("signIn1");
  6544. }
  6545. this.updateSign();
  6546. });
  6547. }
  6548. }
  6549. againGetAward() {
  6550. Moyu.sendDataEvent("signIn2");
  6551. console.log('zh:qjff_AD_for_uisign');
  6552. if (Laya.Browser.onAndroid) {
  6553. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6554. if (!boo) {
  6555. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6556. return;
  6557. }
  6558. }
  6559. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6560. }
  6561. else {
  6562. console.log('zh:AD 失败,直接发放奖励');
  6563. this.qjff_AD_for_uisign();
  6564. }
  6565. }
  6566. qjff_AD_for_uisign() {
  6567. let index = this.curDayIndex;
  6568. if (index == 0)
  6569. index = 7;
  6570. let award = cfgTable.signData[index].award;
  6571. let temp;
  6572. let type;
  6573. let num;
  6574. for (let index = 0; index < award.length; index++) {
  6575. temp = award[index].split("-");
  6576. type = parseInt(temp[0]);
  6577. num = parseInt(temp[1]) * 3;
  6578. xGame.common.playObjFlyAnim(num, type);
  6579. }
  6580. DataMgr.setExtraSign(1);
  6581. this.updateSign();
  6582. }
  6583. updateSignData2Server(day) {
  6584. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6585. if (userInfo == null) {
  6586. return;
  6587. }
  6588. let reqData = xGame.httpMgr.getReqData();
  6589. let pd = JSON.parse(reqData);
  6590. pd.signData = day;
  6591. reqData = JSON.stringify(pd);
  6592. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  6593. try {
  6594. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  6595. let code = res.code;
  6596. let msg = res.msg;
  6597. if (code == 401) {
  6598. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6599. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6600. return;
  6601. }
  6602. if (code == 200) {
  6603. let data = res.data;
  6604. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  6605. }
  6606. else {
  6607. xGame.uiMgr.Show(UIMsg, msg);
  6608. }
  6609. }
  6610. catch (error) {
  6611. console.log('error=' + error);
  6612. alert(error);
  6613. }
  6614. finally {
  6615. }
  6616. });
  6617. }
  6618. }
  6619. UISign.uiName = "UISign";
  6620. class ui_UISkill extends fgui.GComponent {
  6621. static createInstance() {
  6622. return (fgui.UIPackage.createObject("game", "UISkill"));
  6623. }
  6624. onConstruct() {
  6625. this.n48 = (this.getChild("n48"));
  6626. this.n0 = (this.getChild("n0"));
  6627. this.secretary = (this.getChild("secretary"));
  6628. this.talkNode = (this.getChild("talkNode"));
  6629. this.closeNode = (this.getChild("closeNode"));
  6630. this.moneyNode = (this.getChild("moneyNode"));
  6631. this.skillNode = (this.getChild("skillNode"));
  6632. this.guideNode = (this.getChild("guideNode"));
  6633. }
  6634. }
  6635. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6636. class SkillDisplay {
  6637. constructor(ui, data, uiIndex) {
  6638. this.starX = 0;
  6639. this.starY = 0;
  6640. this.index = 0;
  6641. this.ui = ui;
  6642. this.data = data;
  6643. this.index = uiIndex;
  6644. this.initSelf();
  6645. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6646. }
  6647. initSelf() {
  6648. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6649. this.ui.nameTxt.text = this.data.name;
  6650. this.ui.describeTxt.text = this.data.describe;
  6651. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6652. this.ui.startBtn.onClick(this, this.startGame);
  6653. this.updateSelf();
  6654. }
  6655. updateSelf() {
  6656. this.checkTry();
  6657. let level = DataMgr.getBigSkillByIndex(this.index);
  6658. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6659. }
  6660. checkTry() {
  6661. let index = this.index;
  6662. let level = DataMgr.getBigSkillByIndex(index);
  6663. if (level == null) {
  6664. DataMgr.setBigSkill(index, 1, false);
  6665. level = 1;
  6666. }
  6667. this.ui.levelTxt.text = "LV." + level;
  6668. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6669. this.ui.tryNode.visible = true;
  6670. else
  6671. this.ui.tryNode.visible = false;
  6672. }
  6673. clickAddLevel() {
  6674. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6675. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6676. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6677. if (Laya.Browser.onAndroid) {
  6678. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6679. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6680. }
  6681. else {
  6682. console.log('zh:AD 失败,直接发放奖励');
  6683. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6684. }
  6685. }
  6686. else {
  6687. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6688. }
  6689. }
  6690. qjff_AD_for_skilldisplay_clickAddLevel() {
  6691. DataMgr.setBigSkill(this.data.index, 1);
  6692. this.updateSelf();
  6693. xGame.common.upSkillLevel = true;
  6694. }
  6695. startGame() {
  6696. console.log('zh:rod skill startgame');
  6697. if (this.data.index == 3) {
  6698. alert('Coming soon!');
  6699. return;
  6700. }
  6701. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6702. let needCoin = xGame.common.bigMoveNeedCoin;
  6703. xGame.common.passAwardCoin = 2000;
  6704. let guide = DataMgr.getSkillGuide();
  6705. console.log('zh:startGame guide=' + guide);
  6706. xGame.common.temSelfLevel = 0;
  6707. if (guide == 0) {
  6708. needCoin = 0;
  6709. xGame.common.temSelfLevel = 100;
  6710. }
  6711. if (DataMgr.coinEnough(needCoin)) {
  6712. DataMgr.setCoin(-needCoin);
  6713. xGame.common.curPlayerSkillType = this.index;
  6714. if (guide == 0)
  6715. xGame.common.curPlayerSkillType = 0;
  6716. console.log('zh: skilldisplay 1');
  6717. xGame.uiMgr.Show(UIGame);
  6718. xGame.uiMgr.Hide(UIMain);
  6719. xGame.uiMgr.Show(UIMatching, () => {
  6720. xGame.common.gameUI.ui.alpha = 1;
  6721. xGame.common.gameUI.startGame();
  6722. xGame.uiMgr.Hide(UISkill);
  6723. });
  6724. this.logEventForRod_start();
  6725. }
  6726. else {
  6727. console.log('zh: skilldisplay 2');
  6728. xGame.uiMgr.Show(UIAddProp, 0);
  6729. Moyu.sendDataEvent("AddCoinVideo");
  6730. }
  6731. }
  6732. logEventForRod_start() {
  6733. let gfmsIdx = xGame.common.curPlayerSkillType;
  6734. console.log('zh:选择的技能=' + gfmsIdx);
  6735. let gfmc = 'Skyfall Shot';
  6736. if (gfmsIdx == 0) {
  6737. gfmc = 'Skyfall Shot';
  6738. }
  6739. if (gfmsIdx == 1) {
  6740. gfmc = 'Surging break';
  6741. }
  6742. if (gfmsIdx == 2) {
  6743. gfmc = 'Frost Lock';
  6744. }
  6745. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6746. let jsonStr = {
  6747. "count": 0,
  6748. "name": gfmc
  6749. };
  6750. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6751. const d = LocalStorageManager.getItem(keyStr);
  6752. jsonStr.count = d.count + 1;
  6753. LocalStorageManager.setItem(keyStr, jsonStr);
  6754. }
  6755. else {
  6756. LocalStorageManager.setItem(keyStr, jsonStr);
  6757. }
  6758. const reqStr = JSON.stringify(jsonStr);
  6759. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6760. }
  6761. }
  6762. class UISkill extends UIBase {
  6763. constructor() {
  6764. super();
  6765. this.skillData = [];
  6766. }
  6767. onConstructor() {
  6768. this.ui = ui_UISkill.createInstance();
  6769. this.contentPane = this.ui;
  6770. this.isEject = false;
  6771. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6772. this.initSkillData();
  6773. console.log('zh:aaaaaa1111111111');
  6774. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6775. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6776. console.log('zh:aaaaaa22222222');
  6777. this.displayList = [];
  6778. this.ui.skillNode.skillList.numItems = 3;
  6779. this.addUIClick(this.ui, this.interuptSecretary);
  6780. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6781. this.ui.talkNode.visible = false;
  6782. if (Moyu.isKs)
  6783. this.ui.closeNode.closeBtn.x += 100;
  6784. }
  6785. show() {
  6786. super.show();
  6787. this.playSecretaryIdle();
  6788. this.moneyNode.ui.c1.selectedIndex = 1;
  6789. Laya.timer.clearAll(this);
  6790. xGame.soundMgr.playSound("s_start");
  6791. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6792. let guide = DataMgr.getSkillGuide();
  6793. this.ui.guideNode.visible = guide == 0;
  6794. let item = this.getSkillItemByUIIndex(0);
  6795. if (guide == 0) {
  6796. item.ui.c1.selectedIndex = 1;
  6797. }
  6798. else {
  6799. item.ui.c1.selectedIndex = 0;
  6800. }
  6801. this.ui.guideNode.guideBtn.visible = guide == 0;
  6802. for (let index = 0; index < this.displayList.length; index++) {
  6803. this.displayList[index].checkTry();
  6804. }
  6805. this.setGlobalFont(this.ui);
  6806. }
  6807. getSkillItemByUIIndex(cur) {
  6808. for (let index = 0; index < this.displayList.length; index++) {
  6809. if (this.displayList[index].index == cur) {
  6810. return this.displayList[index];
  6811. }
  6812. }
  6813. }
  6814. enterGuideLevel() {
  6815. let item = this.getSkillItemByUIIndex(0);
  6816. item.startGame();
  6817. if (DataMgr.getNewUser())
  6818. Moyu.sendDataEvent("gameStart1");
  6819. }
  6820. initSkillData() {
  6821. this.skillData = [];
  6822. let nameList = xGame.common.skillNameList;
  6823. let iconList = xGame.common.skillIconList;
  6824. let describeList = [
  6825. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6826. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6827. "The power of frost descends—freezing the flow and taking full control of the game!"
  6828. ];
  6829. console.log('zh:initSkillData 111111111');
  6830. let data;
  6831. for (let index = 0; index < nameList.length; index++) {
  6832. data = {};
  6833. data.name = nameList[index];
  6834. data.icon = iconList[index];
  6835. data.describe = describeList[index];
  6836. data.index = index;
  6837. this.skillData.push(data);
  6838. }
  6839. }
  6840. updateSkillItem(index, target) {
  6841. if (this.displayList[index] == null) {
  6842. let uiIndex;
  6843. switch (index) {
  6844. case 0:
  6845. uiIndex = 1;
  6846. break;
  6847. case 1:
  6848. uiIndex = 0;
  6849. break;
  6850. case 2:
  6851. uiIndex = 2;
  6852. break;
  6853. case 3:
  6854. uiIndex = 3;
  6855. break;
  6856. default:
  6857. break;
  6858. }
  6859. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6860. this.displayList.push(temp);
  6861. }
  6862. }
  6863. playSecretaryIdle() {
  6864. let parent = this.ui.secretary.displayObject;
  6865. parent.destroyChildren();
  6866. let xx = this.ui.secretary.width / 2;
  6867. let yy = this.ui.secretary.height;
  6868. let scale = xGame.common.getSecretaryScale();
  6869. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6870. xGame.common.secretary.play(data, 0, true, parent);
  6871. }
  6872. returnUIMain() {
  6873. this.hide();
  6874. xGame.common.stopGirlPop(this.ui.talkNode);
  6875. xGame.uiMgr.Show(UIMain);
  6876. }
  6877. interuptSecretary() {
  6878. Laya.timer.clearAll(this);
  6879. this.playSecretaryRandomSound();
  6880. }
  6881. playSecretaryRandomSound() {
  6882. if (this.isHide)
  6883. return;
  6884. let time = xGame.common.randomNum(45000, 60000);
  6885. Laya.timer.once(time, this, () => {
  6886. if (this.isHide)
  6887. return;
  6888. let index = xGame.common.randomNum(4, 7);
  6889. xGame.soundMgr.playSound("s_main0" + index);
  6890. let words = 1;
  6891. switch (index) {
  6892. case 4:
  6893. words = 5;
  6894. break;
  6895. case 5:
  6896. words = 3;
  6897. break;
  6898. case 6:
  6899. words = 6;
  6900. break;
  6901. case 7:
  6902. words = 7;
  6903. break;
  6904. default:
  6905. break;
  6906. }
  6907. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6908. this.playSecretaryRandomSound();
  6909. });
  6910. }
  6911. }
  6912. UISkill.uiName = "UISkill";
  6913. class ui_UIModeSelection extends fgui.GComponent {
  6914. static createInstance() {
  6915. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6916. }
  6917. onConstruct() {
  6918. this.n19 = (this.getChild("n19"));
  6919. this.closeBtn = (this.getChild("closeBtn"));
  6920. this.myNode = (this.getChild("myNode"));
  6921. this.t0 = this.getTransition("t0");
  6922. }
  6923. }
  6924. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6925. class UIModeSelection extends UIBase {
  6926. constructor() {
  6927. super();
  6928. }
  6929. onConstructor() {
  6930. this.ui = ui_UIModeSelection.createInstance();
  6931. this.contentPane = this.ui;
  6932. this.isEject = false;
  6933. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6934. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6935. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6936. this.addUIClick(this.ui.closeBtn, this.hide);
  6937. this.peopleArr = [65, 990, 580];
  6938. this.peopleOffest = [5, 10, 10];
  6939. }
  6940. show(callback) {
  6941. this.updateSelf();
  6942. super.show();
  6943. this.ui.t0.play();
  6944. this.callback = callback;
  6945. this.setGlobalFont(this.ui);
  6946. }
  6947. updateSelf() {
  6948. let cfg = cfgTable.modeselectData;
  6949. for (let index = 1; index <= 3; index++) {
  6950. let node = this.ui.myNode["type" + index];
  6951. node.need.text = cfg[index].need;
  6952. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6953. node.peopleTxt.text = this.getRandPeople(index - 1);
  6954. }
  6955. }
  6956. enterGame(type) {
  6957. console.log('zh: 进入经典模式 type: ' + type);
  6958. xGame.common.classicRoomType = type;
  6959. let cfg = cfgTable.modeselectData[type];
  6960. let need = cfg.need;
  6961. xGame.common.passAwardCoin = cfg.award;
  6962. if (DataMgr.coinEnough(need)) {
  6963. DataMgr.setCoin(-need);
  6964. this.ui.myNode["type" + type].t0.play();
  6965. Laya.timer.once(200, this, () => {
  6966. this.callback && this.callback();
  6967. });
  6968. this.logEventForClassic_start();
  6969. }
  6970. else {
  6971. Moyu.sendDataEvent("AddCoinVideo");
  6972. xGame.uiMgr.Show(UIAddProp, 0);
  6973. }
  6974. }
  6975. getRandPeople(index) {
  6976. let rand = this.peopleOffest[index];
  6977. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6978. }
  6979. logEventForClassic_start() {
  6980. let rtype = xGame.common.classicRoomType;
  6981. let msmc = '';
  6982. if (rtype == 1) {
  6983. msmc = 'beginner';
  6984. }
  6985. if (rtype == 2) {
  6986. msmc = 'expert';
  6987. }
  6988. if (rtype == 3) {
  6989. msmc = 'master';
  6990. }
  6991. let keyStr = 'sjmd_classic_start_' + rtype;
  6992. let jsonStr = {
  6993. "difficulty": msmc,
  6994. "classic_count": 1,
  6995. "difficulty_count": 1
  6996. };
  6997. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6998. const d = LocalStorageManager.getItem(keyStr);
  6999. jsonStr.classic_count = d.classic_count + 1;
  7000. jsonStr.difficulty_count = d.difficulty_count + 1;
  7001. LocalStorageManager.setItem(keyStr, jsonStr);
  7002. }
  7003. else {
  7004. LocalStorageManager.setItem(keyStr, jsonStr);
  7005. }
  7006. const reqStr = JSON.stringify(jsonStr);
  7007. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  7008. }
  7009. }
  7010. UIModeSelection.uiName = "UIModeSelection";
  7011. class ui_UIReg extends fgui.GComponent {
  7012. static createInstance() {
  7013. return (fgui.UIPackage.createObject("game", "UIReg"));
  7014. }
  7015. onConstruct() {
  7016. this.n38 = (this.getChild("n38"));
  7017. this.n51 = (this.getChild("n51"));
  7018. this.closeBtn = (this.getChild("closeBtn"));
  7019. this.lab_tip = (this.getChild("lab_tip"));
  7020. this.txt_ua = (this.getChild("txt_ua"));
  7021. this.txt_up1 = (this.getChild("txt_up1"));
  7022. this.txt_up2 = (this.getChild("txt_up2"));
  7023. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  7024. this.btn_reg = (this.getChild("btn_reg"));
  7025. }
  7026. }
  7027. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  7028. class ui_UILogin extends fgui.GComponent {
  7029. static createInstance() {
  7030. return (fgui.UIPackage.createObject("game", "UILogin"));
  7031. }
  7032. onConstruct() {
  7033. this.c1 = this.getController("c1");
  7034. this.n18 = (this.getChild("n18"));
  7035. this.n21 = (this.getChild("n21"));
  7036. this.closeBtn = (this.getChild("closeBtn"));
  7037. this.txt_ua = (this.getChild("txt_ua"));
  7038. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  7039. this.btn_login = (this.getChild("btn_login"));
  7040. this.txt_up = (this.getChild("txt_up"));
  7041. }
  7042. }
  7043. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  7044. class UILogin extends UIBase {
  7045. constructor() {
  7046. super();
  7047. this.fontStr = 'big-john-woff2-2';
  7048. try {
  7049. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  7050. console.log("zh: constructor加载arial字体成功");
  7051. }
  7052. catch (error) {
  7053. console.log("zh: constructor加载arial字体失败");
  7054. }
  7055. }
  7056. onFontLoaded() {
  7057. try {
  7058. Laya.Text.defaultFont = this.fontStr;
  7059. this.ui.txt_ua.font = this.fontStr;
  7060. this.ui.txt_up.font = this.fontStr;
  7061. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  7062. }
  7063. catch (error) {
  7064. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  7065. }
  7066. }
  7067. onConstructor() {
  7068. this.ui = ui_UILogin.createInstance();
  7069. this.contentPane = this.ui;
  7070. this.isEject = false;
  7071. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7072. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  7073. this.addUIClick(this.ui.btn_login, this.userLogin);
  7074. }
  7075. show() {
  7076. super.show();
  7077. this.x = (Laya.stage.width - this.width) / 2;
  7078. this.y = (Laya.stage.height - this.height) / 2;
  7079. this.onFontLoaded();
  7080. }
  7081. closeSelf() {
  7082. this.hide();
  7083. }
  7084. userLogin() {
  7085. let ua = this.ui.txt_ua.text;
  7086. let up = this.ui.txt_up.text;
  7087. console.log('zh:ua font' + this.ui.txt_ua.font);
  7088. if (ua && up) {
  7089. let reqData = JSON.stringify({
  7090. username: ua.trim(),
  7091. password: up.trim(),
  7092. fromMark: 'app_game'
  7093. });
  7094. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  7095. try {
  7096. console.log('zh:res = ' + JSON.stringify(res));
  7097. let code = res.code;
  7098. let msg = res.msg;
  7099. if (code == 200) {
  7100. let keyStr = keyForLoginInfo;
  7101. let jsonStr = {
  7102. "username": res.username,
  7103. "token": res.token,
  7104. "buySpids": { 1: false, 7: false }
  7105. };
  7106. LocalStorageManager.setItem(keyStr, jsonStr);
  7107. let myu = Moyu.getUserInfo();
  7108. console.log('zh:myu = ' + JSON.stringify(myu));
  7109. DataMgr.updateUserNickName(res.username);
  7110. Moyu.updateUserInfo(res.username);
  7111. xGame.uiMgr.Show(UIMsg, msg);
  7112. DataMgr.loadUserSpOrderForAd();
  7113. DataMgr.getUserZiChanInfo(false);
  7114. xGame.eventMgr.event(LOGIN_IN);
  7115. this.closeSelf();
  7116. }
  7117. else {
  7118. xGame.uiMgr.Show(UIMsg, msg);
  7119. }
  7120. }
  7121. catch (error) {
  7122. console.log('error=' + error);
  7123. alert(error);
  7124. }
  7125. finally {
  7126. }
  7127. });
  7128. }
  7129. else {
  7130. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7131. }
  7132. }
  7133. gotoRegPage() {
  7134. this.closeSelf();
  7135. xGame.uiMgr.Show(UIReg);
  7136. }
  7137. }
  7138. UILogin.uiName = "UILogin";
  7139. class UIReg extends UIBase {
  7140. constructor() {
  7141. super();
  7142. this.fontStr = 'big-john-woff2-2';
  7143. try {
  7144. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  7145. console.log("zh: constructor加载arial字体成功");
  7146. }
  7147. catch (error) {
  7148. console.log("zh: constructor加载arial字体失败");
  7149. }
  7150. }
  7151. onFontLoaded() {
  7152. try {
  7153. Laya.Text.defaultFont = this.fontStr;
  7154. this.ui.txt_ua.font = this.fontStr;
  7155. this.ui.txt_up1.font = this.fontStr;
  7156. this.ui.txt_up2.font = this.fontStr;
  7157. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  7158. }
  7159. catch (error) {
  7160. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  7161. }
  7162. }
  7163. onConstructor() {
  7164. this.ui = ui_UIReg.createInstance();
  7165. this.contentPane = this.ui;
  7166. this.isEject = false;
  7167. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7168. this.addUIClick(this.ui.btn_reg, this.regUser);
  7169. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  7170. }
  7171. show() {
  7172. super.show();
  7173. this.x = (Laya.stage.width - this.width) / 2;
  7174. this.y = (Laya.stage.height - this.height) / 2;
  7175. this.onFontLoaded();
  7176. }
  7177. closeSelf() {
  7178. this.hide();
  7179. }
  7180. regUser() {
  7181. this.ui.lab_tip.visible = false;
  7182. let ua = this.ui.txt_ua.text;
  7183. let up1 = this.ui.txt_up1.text;
  7184. let up2 = this.ui.txt_up2.text;
  7185. if (ua && up1 && up2 && up1 == up2) {
  7186. let reqData = JSON.stringify({
  7187. username: ua.trim(),
  7188. password: up1.trim(),
  7189. fromMark: 'app_game'
  7190. });
  7191. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  7192. try {
  7193. console.log('zh:res = ' + JSON.stringify(res));
  7194. let code = res.code;
  7195. let msg = res.msg;
  7196. xGame.uiMgr.Show(UIMsg, msg);
  7197. if (code == 200) {
  7198. this.ui.lab_tip.color = "#FFFFFF";
  7199. xGame.uiMgr.Show(UIMsg, msg);
  7200. this.closeSelf();
  7201. }
  7202. else {
  7203. this.ui.lab_tip.color = "#FF0000";
  7204. xGame.uiMgr.Show(UIMsg, msg);
  7205. }
  7206. }
  7207. catch (error) {
  7208. console.log('error=' + error);
  7209. alert(error);
  7210. }
  7211. finally {
  7212. }
  7213. });
  7214. }
  7215. else {
  7216. if (up1 != up2) {
  7217. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  7218. }
  7219. else {
  7220. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7221. }
  7222. }
  7223. }
  7224. gotoLogin() {
  7225. this.closeSelf();
  7226. xGame.uiMgr.Show(UILogin);
  7227. }
  7228. }
  7229. UIReg.uiName = "UIReg";
  7230. class ui_UIGetAward extends fgui.GComponent {
  7231. static createInstance() {
  7232. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7233. }
  7234. onConstruct() {
  7235. this.n4 = (this.getChild("n4"));
  7236. this.n0 = (this.getChild("n0"));
  7237. this.myList = (this.getChild("myList"));
  7238. this.n1 = (this.getChild("n1"));
  7239. this.eftNode = (this.getChild("eftNode"));
  7240. this.btnNode = (this.getChild("btnNode"));
  7241. this.t0 = this.getTransition("t0");
  7242. }
  7243. }
  7244. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7245. class UIGetAward extends UIBase {
  7246. constructor() {
  7247. super();
  7248. this.showTriple = true;
  7249. }
  7250. onConstructor() {
  7251. this.ui = ui_UIGetAward.createInstance();
  7252. this.contentPane = this.ui;
  7253. this.isEject = false;
  7254. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7255. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7256. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7257. }
  7258. show(arr, showTriple, callback) {
  7259. super.show();
  7260. this.ui.t0.play();
  7261. this.ui.eftNode.visible = true;
  7262. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7263. this.ui.eftNode.visible = false;
  7264. }), 1, 0, 0, 0.9);
  7265. this.awardArr = arr;
  7266. this.showTriple = showTriple;
  7267. this.callback = callback;
  7268. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7269. this.ui.myList.numItems = arr.length;
  7270. xGame.soundMgr.playSound("getaward");
  7271. this.setGlobalFont(this.ui);
  7272. }
  7273. updateSelf(index, obj) {
  7274. let temp = this.awardArr[index];
  7275. let icon = this.getIcon(temp.type);
  7276. let str = icon;
  7277. if (temp.type > 2) {
  7278. str = "s" + icon;
  7279. }
  7280. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7281. obj.myIcon.rotation = 0;
  7282. obj.numTxt.text = temp.num + "";
  7283. obj.numTxt.visible = temp.type > 2 ? false : true;
  7284. obj.nameTxt.text = this.getNameStr(temp.type);
  7285. }
  7286. renderItem(index, obj) {
  7287. this.updateSelf(index, obj);
  7288. }
  7289. tripleGetAward() {
  7290. console.log('zh:qjff_AD_for_uigetAward');
  7291. if (Laya.Browser.onAndroid) {
  7292. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7293. if (!boo) {
  7294. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7295. return;
  7296. }
  7297. }
  7298. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7299. }
  7300. else {
  7301. console.log('zh:AD 失败,直接发放奖励');
  7302. this.qjff_AD_for_uigetAward();
  7303. }
  7304. }
  7305. qjff_AD_for_uigetAward() {
  7306. this.getAward(3);
  7307. }
  7308. normalGetAward() {
  7309. if (PlatMgr.isMisVideo())
  7310. this.tripleGetAward();
  7311. else
  7312. this.getAward();
  7313. }
  7314. getAward(times = 1) {
  7315. this.hide();
  7316. for (let index = 0; index < this.awardArr.length; index++) {
  7317. this.awardArr[index].num *= times;
  7318. }
  7319. this.callback && this.callback(times != 1);
  7320. }
  7321. getIcon(type) {
  7322. switch (type) {
  7323. case Prop.diamond:
  7324. return "ty_zs";
  7325. case Prop.coin:
  7326. return "ty_jb";
  7327. case Prop.gan1:
  7328. return "qg1";
  7329. case Prop.gan2:
  7330. return "qg2";
  7331. case Prop.gan3:
  7332. return "qg3";
  7333. case Prop.gan4:
  7334. return "qg4";
  7335. default:
  7336. break;
  7337. }
  7338. }
  7339. getNameStr(type) {
  7340. switch (type) {
  7341. case Prop.diamond:
  7342. return "Diamond";
  7343. case Prop.coin:
  7344. return "Coins";
  7345. case Prop.gan1:
  7346. case Prop.gan2:
  7347. case Prop.gan3:
  7348. case Prop.gan4:
  7349. return cfgTable.ballrodData[type - 1].name;
  7350. default:
  7351. break;
  7352. }
  7353. }
  7354. }
  7355. UIGetAward.uiName = "UIGetAward";
  7356. class ui_UIRepentProp extends fgui.GComponent {
  7357. static createInstance() {
  7358. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7359. }
  7360. onConstruct() {
  7361. this.c1 = this.getController("c1");
  7362. this.n11 = (this.getChild("n11"));
  7363. this.regretNode = (this.getChild("regretNode"));
  7364. this.helpLineNode = (this.getChild("helpLineNode"));
  7365. this.t0 = this.getTransition("t0");
  7366. }
  7367. }
  7368. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7369. class UIRepentProp extends UIBase {
  7370. constructor() {
  7371. super();
  7372. this.viewType = 0;
  7373. this.regretType = 0;
  7374. }
  7375. onConstructor() {
  7376. this.ui = ui_UIRepentProp.createInstance();
  7377. this.contentPane = this.ui;
  7378. this.isEject = false;
  7379. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7380. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7381. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7382. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7383. }
  7384. show(viewType, regretType, callback) {
  7385. PlatMgr.showInsert(true);
  7386. this.viewType = viewType;
  7387. this.regretType = regretType;
  7388. this.callback = callback;
  7389. super.show();
  7390. this.ui.t0.play();
  7391. this.ui.c1.selectedIndex = this.viewType;
  7392. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7393. if (this.viewType == 0) {
  7394. let guide = DataMgr.getGuideHelpLine();
  7395. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7396. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7397. }
  7398. xGame.common.gameMgr.gamePause = true;
  7399. this.setGlobalFont(this.ui);
  7400. }
  7401. hideSelf() {
  7402. xGame.common.gameMgr.gamePause = false;
  7403. this.callback && this.callback(false);
  7404. this.hide();
  7405. }
  7406. videoRegret() {
  7407. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7408. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7409. }
  7410. else {
  7411. console.log('zh:AD 失败,直接发放奖励');
  7412. this.qjff_AD_for_UIrepentProp_videoRegret();
  7413. }
  7414. }
  7415. qjff_AD_for_UIrepentProp_videoRegret() {
  7416. this.callback && this.callback(true);
  7417. this.hideSelf();
  7418. }
  7419. videoAddHelpLine() {
  7420. let guide = DataMgr.getGuideHelpLine();
  7421. if (guide == 0) {
  7422. this.callback && this.callback(true);
  7423. this.hideSelf();
  7424. DataMgr.setGuideHelpLine();
  7425. xGame.common.gameUI.ui.guideNode.visible = false;
  7426. }
  7427. else {
  7428. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7429. if (Laya.Browser.onAndroid) {
  7430. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7431. if (!boo) {
  7432. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7433. return;
  7434. }
  7435. }
  7436. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7437. }
  7438. else {
  7439. console.log('zh:AD 失败,直接发放奖励');
  7440. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7441. }
  7442. }
  7443. }
  7444. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7445. this.callback && this.callback(true);
  7446. this.hideSelf();
  7447. }
  7448. }
  7449. UIRepentProp.uiName = "UIRepentProp";
  7450. class ui_UITips extends fgui.GComponent {
  7451. static createInstance() {
  7452. return (fgui.UIPackage.createObject("game", "UITips"));
  7453. }
  7454. onConstruct() {
  7455. this.n0 = (this.getChild("n0"));
  7456. this.myNode = (this.getChild("myNode"));
  7457. this.t0 = this.getTransition("t0");
  7458. }
  7459. }
  7460. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7461. class UITips extends UIBase {
  7462. constructor() {
  7463. super();
  7464. this.type = 0;
  7465. }
  7466. onConstructor() {
  7467. this.ui = ui_UITips.createInstance();
  7468. this.contentPane = this.ui;
  7469. this.isEject = false;
  7470. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7471. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7472. }
  7473. show(tipsTxt, womanTxt, type) {
  7474. super.show();
  7475. this.ui.t0.play();
  7476. this.ui.myNode.tipsTxt.text = tipsTxt;
  7477. this.ui.myNode.womanTxt.text = womanTxt;
  7478. PlatMgr.showInsert(true);
  7479. this.ui.myNode.c1.selectedIndex = type;
  7480. this.type = type;
  7481. switch (this.type) {
  7482. case TipsType.exitGame:
  7483. xGame.common.gameMgr.gamePause = true;
  7484. break;
  7485. case TipsType.foul:
  7486. Laya.timer.once(200, this, () => {
  7487. if (xGame.common.gameMgr) {
  7488. xGame.common.gameMgr.gamePause = true;
  7489. }
  7490. else {
  7491. console.log("zh:gameMgr is null");
  7492. }
  7493. });
  7494. break;
  7495. default:
  7496. break;
  7497. }
  7498. this.setGlobalFont(this.ui);
  7499. }
  7500. clickLeftBtn() {
  7501. this.hide();
  7502. xGame.common.gameMgr.gamePause = false;
  7503. switch (this.type) {
  7504. case TipsType.exitGame:
  7505. break;
  7506. case TipsType.foul:
  7507. break;
  7508. default:
  7509. break;
  7510. }
  7511. }
  7512. clickRightBtn() {
  7513. this.hide();
  7514. switch (this.type) {
  7515. case TipsType.exitGame:
  7516. xGame.eventMgr.event(RESET_GAME);
  7517. xGame.uiMgr.Show(UIMain);
  7518. Moyu.recordEnd(this, null);
  7519. xGame.common.longHelpLine = false;
  7520. break;
  7521. case TipsType.foul:
  7522. if (xGame.common.gameMgr) {
  7523. xGame.common.gameMgr.gamePause = false;
  7524. }
  7525. Laya.timer.clearAll(this);
  7526. break;
  7527. default:
  7528. break;
  7529. }
  7530. }
  7531. }
  7532. UITips.uiName = "UITips";
  7533. class UIMain extends UIBase {
  7534. constructor() {
  7535. super();
  7536. this.firstEnter = true;
  7537. this.moni_click_count = 0;
  7538. }
  7539. nativeCallJs(msg) {
  7540. let t = msg;
  7541. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7542. switch (t) {
  7543. case 'qjff_chouJiang':
  7544. let dui = xGame.uiMgr.getUI(UIDraw);
  7545. dui.qjff_chouJiang();
  7546. break;
  7547. case 'qjff_AD_for_uisign':
  7548. let dui2 = xGame.uiMgr.getUI(UISign);
  7549. dui2.qjff_AD_for_uisign();
  7550. break;
  7551. case 'qjff_AD_for_uitry':
  7552. let dui3 = xGame.uiMgr.getUI(UITry);
  7553. dui3.qjff_AD_for_uitry();
  7554. break;
  7555. case 'qjff_AD_for_uipower':
  7556. let dui4 = xGame.uiMgr.getUI(UIPower);
  7557. dui4.qjff_AD_for_uipower();
  7558. break;
  7559. case 'qjff_AD_for_uigetAward':
  7560. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7561. dui5.qjff_AD_for_uigetAward();
  7562. break;
  7563. case 'qjff_AD_for_uiGameEnd':
  7564. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7565. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7566. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7567. break;
  7568. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7569. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7570. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7571. break;
  7572. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7573. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7574. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7575. break;
  7576. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7577. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7578. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7579. break;
  7580. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7581. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7582. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7583. break;
  7584. case 'qjff_AD_for_UIBOX_onOpenBox':
  7585. let dui11 = xGame.uiMgr.getUI(UIBox);
  7586. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7587. break;
  7588. case 'qjff_AD_for_UIAddCoin':
  7589. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7590. dui12.qjff_AD_for_UIAddCoin();
  7591. break;
  7592. case 'app_sign_for_buyProduct_onSuccess':
  7593. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  7594. DataMgr.getUserZiChanInfo(false);
  7595. break;
  7596. case '222axxxxxx':
  7597. let dui15 = xGame.uiMgr.getUI(UISign);
  7598. dui15.qjff_AD_for_uisign();
  7599. break;
  7600. case '333axsxxxxxx':
  7601. let dui16 = xGame.uiMgr.getUI(UISign);
  7602. dui16.qjff_AD_for_uisign();
  7603. break;
  7604. default:
  7605. console.log('zh:未知的方法名字' + t);
  7606. break;
  7607. }
  7608. }
  7609. onConstructor() {
  7610. console.log('zh: UIMain onConstructor');
  7611. this.ui = ui_UIMain.createInstance();
  7612. this.contentPane = this.ui;
  7613. this.isEject = false;
  7614. this.addEvent();
  7615. this.addClickSpine();
  7616. this.settingNode = new SettingNode(this.ui.settingNode);
  7617. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7618. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7619. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7620. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7621. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7622. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7623. let curUse = DataMgr.getCurSecretary();
  7624. this.changeSecretary(curUse);
  7625. this.ui.talkNode.visible = false;
  7626. let guide = DataMgr.getSkillGuide();
  7627. if (xGame.common.isNewDay && guide == 1) {
  7628. xGame.common.isNewDay = false;
  7629. xGame.soundMgr.playSound("s_main01");
  7630. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7631. console.log("zh:播放小秘书每天语音");
  7632. }
  7633. this.onGetUserInfo();
  7634. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7635. DataMgr.getUserZiChanInfo(false);
  7636. }
  7637. this.ui.n83.visible = false;
  7638. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7639. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7640. let ua = d.username;
  7641. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7642. }
  7643. this.c_btn_for_user();
  7644. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7645. }
  7646. Logout() {
  7647. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7648. LocalStorageManager.removeItem(keyForLoginInfo);
  7649. this.freshUser();
  7650. }
  7651. JSBridgeUtils.instance.loginOutForApp();
  7652. this.setUserDefaultNickname();
  7653. DataMgr.setCoin2(4000);
  7654. DataMgr.setDiamond2(0);
  7655. this.setDefaultQiuGanInfo();
  7656. DataMgr.setPlaceBallLevelList("");
  7657. DataMgr.setChallengeMode_overLev(1);
  7658. this.setDefaultSignData();
  7659. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  7660. }
  7661. setDefaultSignData() {
  7662. DataMgr.setSignData(1);
  7663. DataMgr.setSignTime(new Date().getTime());
  7664. }
  7665. setDefaultQiuGanInfo() {
  7666. DataMgr.setBallRod(0, 1);
  7667. DataMgr.setBallRod(1, 0);
  7668. DataMgr.setBallRod(2, 0);
  7669. DataMgr.setBallRod(3, 0);
  7670. DataMgr.setBallRod(4, 0);
  7671. DataMgr.setBallRod(5, 1);
  7672. }
  7673. setUserDefaultNickname() {
  7674. let defUsername = "player";
  7675. this.ui.headNode.nameTxt.text = defUsername;
  7676. DataMgr.updateUserNickName(defUsername);
  7677. Moyu.updateUserInfo(defUsername);
  7678. }
  7679. gotoLogin() {
  7680. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  7681. xGame.uiMgr.Show(UILogin);
  7682. }
  7683. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  7684. this.Logout();
  7685. }
  7686. }
  7687. gotoRegUser() {
  7688. xGame.uiMgr.Show(UIReg);
  7689. }
  7690. showFuLiSp1() {
  7691. console.log('zh:福利1');
  7692. DataMgr.checkForShowFuLi17AndAlert(1);
  7693. }
  7694. showFuLiSp7() {
  7695. console.log('zh:福利7');
  7696. DataMgr.checkForShowFuLi17AndAlert(7);
  7697. }
  7698. c_btn_for_user() {
  7699. this.ui.n_dengLu.c1.selectedIndex = 0;
  7700. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7701. this.ui.n_dengLu.c1.selectedIndex = 1;
  7702. }
  7703. else {
  7704. this.ui.n_dengLu.c1.selectedIndex = 0;
  7705. }
  7706. }
  7707. changeSecretary(curUse) {
  7708. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7709. xGame.common.secretary && xGame.common.secretary.dispose();
  7710. this.addSecretarySpine(name);
  7711. }
  7712. addSecretarySpine(name) {
  7713. let spine = new SpineMgr(name, () => {
  7714. this.playSecretaryIdle();
  7715. });
  7716. xGame.common.secretary = spine;
  7717. }
  7718. addClickSpine() {
  7719. let clickSpine = new SpineMgr("dianji", () => {
  7720. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7721. let parent = Laya.stage;
  7722. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7723. clickSpine.play(data, 0, false, parent, (spine) => {
  7724. spine.destroy(true);
  7725. });
  7726. });
  7727. });
  7728. }
  7729. addEvent() {
  7730. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7731. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7732. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  7733. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7734. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7735. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7736. this.addUIClick(this.ui, this.interuptSecretary);
  7737. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7738. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7739. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7740. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7741. this.addUIClick(this.ui.signBtn, this.openSignView);
  7742. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7743. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7744. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  7745. this.addUIClick(this.ui.n_yd_challenge_1_btn, this.startPlaceBall);
  7746. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7747. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7748. }
  7749. show(showFailWords) {
  7750. super.show();
  7751. DataMgr.loadUserSpOrderForAd();
  7752. this.moneyNode.ui.c1.selectedIndex = 1;
  7753. this.playSecretaryIdle();
  7754. xGame.soundMgr.playMusic("caromhall01", 0);
  7755. Laya.timer.clearAll(this);
  7756. this.playSecretaryRandomSound();
  7757. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7758. if (showFailWords) {
  7759. console.log('zh:uimain.ts ');
  7760. setTimeout(() => {
  7761. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7762. let words = -1;
  7763. if (str == "s_main02") {
  7764. words = 2;
  7765. }
  7766. else {
  7767. words = 3;
  7768. }
  7769. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7770. xGame.soundMgr.playSound(str);
  7771. }, 300);
  7772. }
  7773. this.showGuide();
  7774. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7775. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7776. let guide = DataMgr.getSkillGuide();
  7777. if (guide == 1) {
  7778. let randTime = xGame.common.randomNum(300, 800);
  7779. if (this.firstEnter) {
  7780. console.log("zh: firstEnter");
  7781. this.firstEnter = false;
  7782. randTime += 900;
  7783. }
  7784. else {
  7785. console.log("zh: no firstEnter");
  7786. }
  7787. Laya.timer.once(randTime, this, () => {
  7788. });
  7789. Laya.timer.once(1000, this, () => {
  7790. console.log('zh: 1秒后 showFuLiSp7');
  7791. this.showFuLiSp7();
  7792. });
  7793. this.showTipForGuest();
  7794. }
  7795. this.setGlobalFont(this.ui);
  7796. this.yinDaoForLianxi();
  7797. }
  7798. yinDaoForLianxi() {
  7799. let g = DataMgr.getSkillGuide();
  7800. if (g === 0) {
  7801. console.log('zh:默认的引导还没有完毕');
  7802. return;
  7803. }
  7804. let lianXiGuide = DataMgr.getLianXiGuide();
  7805. if (lianXiGuide == 0) {
  7806. let x = this.ui.placeBallBtn.x;
  7807. let y = this.ui.placeBallBtn.y;
  7808. this.ui.n_yd_lxms_1.visible = true;
  7809. this.ui.n_yd_challenge_1_hand.x = x + 150;
  7810. this.ui.n_yd_challenge_1_hand.y = y;
  7811. this.ui.n_yd_challenge_1_btn.x = x;
  7812. this.ui.n_yd_challenge_1_btn.y = y;
  7813. console.log('zh:yinDaoForLianxi set ok');
  7814. }
  7815. else {
  7816. this.ui.n_yd_lxms_1.visible = false;
  7817. }
  7818. }
  7819. showTipForGuest() {
  7820. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7821. if (userInfo == null) {
  7822. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  7823. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  7824. let woman = "this is an important notice.";
  7825. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7826. return;
  7827. }
  7828. }
  7829. checkActive(show) {
  7830. }
  7831. showGuide() {
  7832. let guide = DataMgr.getSkillGuide();
  7833. this.ui.guideBtn.visible = guide == 0;
  7834. this.ui.enterGuide.visible = false;
  7835. this.ui.secretaryGuide.visible = guide == 0;
  7836. if (guide == 0) {
  7837. console.log("zh:显示引导");
  7838. xGame.soundMgr.playSound("s_guide");
  7839. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7840. }
  7841. else {
  7842. console.log("zh:不需要显示引导");
  7843. }
  7844. }
  7845. ensureSecretary() {
  7846. console.log('zh: ensureSecretary ');
  7847. this.ui.secretaryGuide.visible = false;
  7848. this.ui.enterGuide.visible = true;
  7849. this.ui.wordsNode.t0.play();
  7850. if (DataMgr.getNewUser())
  7851. Moyu.sendDataEvent("gameReady");
  7852. }
  7853. playSecretaryIdle() {
  7854. let parent = this.ui.secretary.displayObject;
  7855. parent.destroyChildren();
  7856. let xx = this.ui.secretary.width / 2;
  7857. let yy = this.ui.secretary.height;
  7858. let scale = xGame.common.getSecretaryScale();
  7859. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7860. xGame.common.secretary.play(data, 0, true, parent);
  7861. }
  7862. startGame(type) {
  7863. if (!this.isReadyForLoadNetSource()) {
  7864. return;
  7865. }
  7866. xGame.common.gameMode = type;
  7867. Moyu.sendDataEvent("PlayGame", { type: type });
  7868. let gm = xGame.common.gameMode;
  7869. console.log('zh:进入游戏gameMode =' + gm);
  7870. switch (gm) {
  7871. case GameMode.classic:
  7872. console.log('zh:进入经典模式111111111');
  7873. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7874. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7875. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  7876. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7877. console.log('zh:判断是否可以玩该模式classic =NO');
  7878. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7879. xGame.uiMgr.Show(UIMsg, tipStr);
  7880. return;
  7881. }
  7882. else {
  7883. console.log('zh:可以玩该模式classic');
  7884. this.beginGame();
  7885. }
  7886. }
  7887. else {
  7888. console.log('zh:不需要判断是否可以玩该classic');
  7889. let challengeTimes = DataMgr.getChallengeTimes();
  7890. if (challengeTimes == 0) {
  7891. xGame.uiMgr.Show(UIInvitation);
  7892. }
  7893. else {
  7894. this.beginGame();
  7895. }
  7896. }
  7897. break;
  7898. case GameMode.bigMove:
  7899. console.info('zh:bigMove check 大招');
  7900. let guide = DataMgr.getSkillGuide();
  7901. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7902. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7903. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7904. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7905. console.log('zh:提示不可以玩');
  7906. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7907. xGame.uiMgr.Show(UIMsg, tipStr);
  7908. return;
  7909. }
  7910. else {
  7911. console.log('zh:可以玩该模式 bigMove');
  7912. this.beginGame();
  7913. if (DataMgr.getNewUser())
  7914. Moyu.sendDataEvent("gameStart0");
  7915. }
  7916. }
  7917. else {
  7918. this.beginGame();
  7919. if (DataMgr.getNewUser())
  7920. Moyu.sendDataEvent("gameStart0");
  7921. }
  7922. break;
  7923. default:
  7924. console.error('zh:未知错误!!!!');
  7925. break;
  7926. }
  7927. }
  7928. beginGame(isNice = false) {
  7929. console.log('zh:beginGame ');
  7930. let guide = DataMgr.getSkillGuide();
  7931. if (guide == 1) {
  7932. console.log('zh:非新手引导,showInternAd ');
  7933. JSBridgeUtils.instance.showInternAd('beginGame');
  7934. }
  7935. else {
  7936. console.log('zh:新手引导,不显示AD ');
  7937. }
  7938. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  7939. console.log('zh:beginGame 1');
  7940. if (xGame.common.gameMode == GameMode.classic) {
  7941. console.log('zh:beginGame 2');
  7942. if (isNice) {
  7943. console.log('zh:进入巅峰赛');
  7944. this.enterClassic();
  7945. }
  7946. else {
  7947. console.log('zh:beginGame 3-1');
  7948. xGame.uiMgr.Show(UIModeSelection, () => {
  7949. console.log('zh:beginGame 3-2');
  7950. this.enterClassic();
  7951. });
  7952. }
  7953. }
  7954. else if (xGame.common.gameMode == GameMode.bigMove) {
  7955. console.log('zh:beginGame 5');
  7956. this.ui.enterGuide.visible = false;
  7957. xGame.uiMgr.Show(UISkill);
  7958. }
  7959. }
  7960. enterClassic() {
  7961. console.log('zh:beginGame 7');
  7962. xGame.uiMgr.Show(UIGame);
  7963. xGame.uiMgr.Show(UIMatching, () => {
  7964. if (!this.isHide)
  7965. this.hide();
  7966. xGame.common.gameUI.ui.alpha = 1;
  7967. console.log('zh:beginGame 8');
  7968. xGame.common.gameUI.startGame();
  7969. xGame.uiMgr.Hide(UIGameEnd);
  7970. });
  7971. }
  7972. start_debug_for_moni_payOk() {
  7973. let ccc = this.moni_click_count + 1;
  7974. this.moni_click_count = ccc;
  7975. if (ccc % 5 == 0) {
  7976. console.log('zh:start_debug_for_moni_payOk');
  7977. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7978. if (userInfo != null) {
  7979. let token = userInfo.token;
  7980. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7981. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  7982. alert('模拟支付OK');
  7983. return;
  7984. }
  7985. else {
  7986. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7987. }
  7988. }
  7989. }
  7990. startGlobal() {
  7991. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7992. }
  7993. startWeekly() {
  7994. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7995. }
  7996. zhouSaiMonth() {
  7997. console.log('zh: zhouSaiMonth 被调用');
  7998. }
  7999. isReadyForLoadNetSource() {
  8000. let reqCount = xGame.cfgMgr.httpReqCount;
  8001. let ok = xGame.cfgMgr.httpReqOkCount;
  8002. if (reqCount > ok) {
  8003. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  8004. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  8005. Laya.timer.once(5000, this, () => {
  8006. let retryCount = 0;
  8007. const maxRetries = 3;
  8008. const tryFetchConfig = () => {
  8009. try {
  8010. xGame.cfgMgr.getConfigFromServer();
  8011. }
  8012. catch (error) {
  8013. if (retryCount < maxRetries) {
  8014. retryCount++;
  8015. console.log(`🔄 第${retryCount}次重试获取配置...`);
  8016. Laya.timer.once(5000, this, tryFetchConfig);
  8017. }
  8018. else {
  8019. console.error("❌ 达到最大重试次数,配置获取失败");
  8020. }
  8021. }
  8022. };
  8023. tryFetchConfig();
  8024. });
  8025. return false;
  8026. }
  8027. return true;
  8028. }
  8029. startPlaceBall() {
  8030. if (!this.isReadyForLoadNetSource()) {
  8031. return;
  8032. }
  8033. xGame.uiMgr.Show(UILevelDisplay);
  8034. }
  8035. hide() {
  8036. console.log('zh:uimain hide ...');
  8037. super.hide();
  8038. xGame.common.stopGirlPop(this.ui.talkNode);
  8039. }
  8040. onGetUserInfo(force = false) {
  8041. if (Moyu.isWx) {
  8042. let info = Moyu.getSystemInfo();
  8043. if (info)
  8044. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  8045. }
  8046. else {
  8047. Moyu.initUser(this, this.freshUser, force);
  8048. }
  8049. this.freshUser();
  8050. console.log('zh:5秒后更新用户信息');
  8051. setTimeout(() => {
  8052. DataMgr.getUserZiChanInfo(true);
  8053. }, 5000);
  8054. }
  8055. event_login_in() {
  8056. console.log("zh:event_login_in被触发");
  8057. this.freshUser();
  8058. }
  8059. freshUser() {
  8060. let user = Moyu.getUserInfo();
  8061. if (!user.isAuth) {
  8062. user.headIcon = 'res/ty_touxiang.png';
  8063. }
  8064. else {
  8065. DataMgr.upRankData();
  8066. }
  8067. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  8068. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  8069. let keyStr = keyForLoginInfo;
  8070. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8071. const d = LocalStorageManager.getItem(keyStr);
  8072. let ua = d.username;
  8073. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  8074. }
  8075. else {
  8076. }
  8077. this.c_btn_for_user();
  8078. }
  8079. interuptSecretary() {
  8080. Laya.timer.clearAll(this);
  8081. this.playSecretaryRandomSound();
  8082. }
  8083. playSecretaryRandomSound() {
  8084. if (this.isHide)
  8085. return;
  8086. let time = xGame.common.randomNum(45000, 60000);
  8087. Laya.timer.once(time, this, () => {
  8088. if (this.isHide)
  8089. return;
  8090. let index = xGame.common.randomNum(4, 7);
  8091. xGame.soundMgr.playSound("s_main0" + index);
  8092. let words = 1;
  8093. switch (index) {
  8094. case 4:
  8095. words = 5;
  8096. break;
  8097. case 5:
  8098. words = 3;
  8099. break;
  8100. case 6:
  8101. words = 6;
  8102. break;
  8103. case 7:
  8104. words = 7;
  8105. break;
  8106. default:
  8107. break;
  8108. }
  8109. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8110. this.playSecretaryRandomSound();
  8111. });
  8112. }
  8113. openSecretaryView() {
  8114. xGame.uiMgr.Show(UISecretary);
  8115. Moyu.sendDataEvent("secretary");
  8116. }
  8117. openShopView() {
  8118. xGame.uiMgr.Show(UIShop, 1);
  8119. }
  8120. openShopView0() {
  8121. xGame.uiMgr.Show(UIShop, 0);
  8122. }
  8123. openSignView() {
  8124. xGame.uiMgr.Show(UISign);
  8125. }
  8126. openDrawView() {
  8127. xGame.uiMgr.Show(UIDraw);
  8128. }
  8129. openRanking() {
  8130. console.log('zh:phb openRanking');
  8131. xGame.uiMgr.Show(UIRanking);
  8132. Moyu.sendDataEvent("rankingList");
  8133. }
  8134. }
  8135. UIMain.uiName = "UIMain";
  8136. class UIGameEnd extends UIBase {
  8137. constructor() {
  8138. super();
  8139. this.success = false;
  8140. this.awardCoinNum = 1000;
  8141. this.awardDiamondNum = 10;
  8142. }
  8143. onConstructor() {
  8144. this.ui = ui_UIGameEnd.createInstance();
  8145. this.contentPane = this.ui;
  8146. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8147. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8148. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8149. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8150. this.ui.talkNode.visible = false;
  8151. if (Moyu.isKs)
  8152. this.ui.closeNode.closeBtn.x += 100;
  8153. }
  8154. updateType() {
  8155. switch (xGame.common.gameMode) {
  8156. case GameMode.classic:
  8157. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8158. this.ui.coinNode.visible = this.success;
  8159. if (!this.success) {
  8160. Laya.timer.once(500, this, () => {
  8161. xGame.uiMgr.Show(UIAddCoin);
  8162. });
  8163. }
  8164. else {
  8165. this.logEventForClassic_win();
  8166. }
  8167. this.logEventForClassic_complete();
  8168. this.ui.isGetAward.visible = false;
  8169. this.ui.leftBtn.c1.selectedIndex = 3;
  8170. this.ui.rightBtn.c1.selectedIndex = 0;
  8171. this.moneyNode.ui.c1.selectedIndex = 1;
  8172. break;
  8173. case GameMode.bigMove:
  8174. console.log('zh:招法模式 aaaaaa bigMove');
  8175. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8176. this.ui.coinNode.visible = this.success;
  8177. if (xGame.common.gameMode == GameMode.bigMove) {
  8178. if (this.success) {
  8179. DataMgr.setSkillSuccessTimes(1, true);
  8180. DataMgr.setSkillAccTimes(1);
  8181. }
  8182. else {
  8183. DataMgr.setSkillSuccessTimes(0, false);
  8184. }
  8185. }
  8186. this.logEventForRod_complete_N();
  8187. if (!this.success) {
  8188. Laya.timer.once(500, this, () => {
  8189. xGame.uiMgr.Show(UIAddCoin);
  8190. });
  8191. }
  8192. else {
  8193. this.logEventForRod_win();
  8194. }
  8195. this.ui.isGetAward.visible = false;
  8196. this.ui.leftBtn.c1.selectedIndex = 3;
  8197. this.ui.rightBtn.c1.selectedIndex = 0;
  8198. this.moneyNode.ui.c1.selectedIndex = 1;
  8199. break;
  8200. case GameMode.placeBall:
  8201. this.ui.coinNode.visible = false;
  8202. if (this.success) {
  8203. if (xGame.common.placeBallStarNum == 3) {
  8204. this.ui.c1.selectedIndex = 2;
  8205. }
  8206. else {
  8207. this.ui.c1.selectedIndex = 3;
  8208. }
  8209. let level = xGame.common.placeBallCurLevel;
  8210. if (level > 59) {
  8211. this.logEventForChallenge_level_complete(level);
  8212. }
  8213. else {
  8214. this.logEventForChallenge_level_N(level);
  8215. }
  8216. }
  8217. else {
  8218. this.ui.c1.selectedIndex = 4;
  8219. }
  8220. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8221. if (cfg.type == PlaceBallType.challenge) {
  8222. this.ui.c1.selectedIndex = 2;
  8223. }
  8224. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8225. this.updatePlaceBallBtn();
  8226. this.updatePlaceBallStarNum();
  8227. this.updatePlaceBallAwardState();
  8228. this.moneyNode.ui.c1.selectedIndex = 2;
  8229. this.moneyNode.checkPowerTime();
  8230. this.moneyNode.powerChange();
  8231. DataMgr.upRankData();
  8232. break;
  8233. default:
  8234. break;
  8235. }
  8236. }
  8237. logEventForRod_complete_N() {
  8238. let gfmsIdx = xGame.common.curPlayerSkillType;
  8239. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8240. let gfmc = 'Skyfall Shot';
  8241. if (gfmsIdx == 0) {
  8242. gfmc = 'Skyfall Shot';
  8243. }
  8244. if (gfmsIdx == 1) {
  8245. gfmc = 'Surging break';
  8246. }
  8247. if (gfmsIdx == 2) {
  8248. gfmc = 'Frost Lock';
  8249. }
  8250. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8251. console.log('zh:logEventForRod_complete_N level = ' + level);
  8252. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8253. let jsonStr = {
  8254. "count": 0,
  8255. "name": gfmc
  8256. };
  8257. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8258. const d = LocalStorageManager.getItem(keyStr);
  8259. jsonStr.count = d.count + 1;
  8260. LocalStorageManager.setItem(keyStr, jsonStr);
  8261. }
  8262. else {
  8263. LocalStorageManager.setItem(keyStr, jsonStr);
  8264. }
  8265. const d2 = LocalStorageManager.getItem(keyStr);
  8266. let count = d2.count;
  8267. console.log('zh:logEventForRod_complete_N count = ' + count);
  8268. if (count % 5 == 0) {
  8269. const reqStr = JSON.stringify(jsonStr);
  8270. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8271. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8272. }
  8273. }
  8274. logEventForRod_win() {
  8275. console.log('zh:logEventForRod_win,胜利');
  8276. let gfmsIdx = xGame.common.curPlayerSkillType;
  8277. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8278. let gfmc = 'Skyfall Shot';
  8279. if (gfmsIdx == 0) {
  8280. gfmc = 'Skyfall Shot';
  8281. }
  8282. if (gfmsIdx == 1) {
  8283. gfmc = 'Surging break';
  8284. }
  8285. if (gfmsIdx == 2) {
  8286. gfmc = 'Frost Lock';
  8287. }
  8288. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8289. console.log('zh:logEventForRod_win level = ' + level);
  8290. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8291. let jsonStr = {
  8292. "count": 1,
  8293. "name": gfmc + ' Lev' + level
  8294. };
  8295. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8296. const d = LocalStorageManager.getItem(keyStr);
  8297. jsonStr.count = d.count + 1;
  8298. LocalStorageManager.setItem(keyStr, jsonStr);
  8299. }
  8300. else {
  8301. LocalStorageManager.setItem(keyStr, jsonStr);
  8302. }
  8303. const reqStr = JSON.stringify(jsonStr);
  8304. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8305. }
  8306. logEventForClassic_win() {
  8307. console.log('zh:logEventForClassic_win,胜利');
  8308. let rtype = xGame.common.classicRoomType;
  8309. let msmc = '';
  8310. if (rtype == 1) {
  8311. msmc = 'beginner';
  8312. }
  8313. if (rtype == 2) {
  8314. msmc = 'expert';
  8315. }
  8316. if (rtype == 3) {
  8317. msmc = 'master';
  8318. }
  8319. let keyStr = 'sjmd_classic_win_' + rtype;
  8320. let jsonStr = {
  8321. "difficulty": msmc,
  8322. "classic_count": 1,
  8323. "difficulty_count": 1
  8324. };
  8325. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8326. const d = LocalStorageManager.getItem(keyStr);
  8327. jsonStr.classic_count = d.classic_count + 1;
  8328. jsonStr.difficulty_count = d.difficulty_count + 1;
  8329. LocalStorageManager.setItem(keyStr, jsonStr);
  8330. }
  8331. else {
  8332. LocalStorageManager.setItem(keyStr, jsonStr);
  8333. }
  8334. const reqStr = JSON.stringify(jsonStr);
  8335. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8336. }
  8337. logEventForClassic_complete() {
  8338. console.log('zh:logEventForClassic_complete,胜利');
  8339. let rtype = xGame.common.classicRoomType;
  8340. let msmc = '';
  8341. if (rtype == 1) {
  8342. msmc = 'beginner';
  8343. }
  8344. if (rtype == 2) {
  8345. msmc = 'expert';
  8346. }
  8347. if (rtype == 3) {
  8348. msmc = 'master';
  8349. }
  8350. let keyStr = 'sjmd_classic_complete_' + rtype;
  8351. let jsonStr = {
  8352. "msmc": msmc,
  8353. "count": 0
  8354. };
  8355. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8356. const d = LocalStorageManager.getItem(keyStr);
  8357. jsonStr.count = d.count + 1;
  8358. LocalStorageManager.setItem(keyStr, jsonStr);
  8359. }
  8360. else {
  8361. LocalStorageManager.setItem(keyStr, jsonStr);
  8362. }
  8363. if (jsonStr.count % 5 == 0) {
  8364. const reqStr = JSON.stringify(jsonStr);
  8365. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8366. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8367. }
  8368. }
  8369. updatePlaceBallBtn() {
  8370. this.ui.leftBtn.c1.selectedIndex = 5;
  8371. if (this.success) {
  8372. this.ui.rightBtn.c1.selectedIndex = 14;
  8373. }
  8374. else {
  8375. if (xGame.common.placeBallStarNum == 3) {
  8376. this.ui.rightBtn.c1.selectedIndex = 14;
  8377. }
  8378. else {
  8379. this.ui.rightBtn.c1.selectedIndex = 1;
  8380. }
  8381. }
  8382. }
  8383. updatePlaceBallStarNum() {
  8384. let starNum = xGame.common.placeBallStarNum;
  8385. if (starNum == 0)
  8386. this.ui.starNumNode.c1.selectedIndex = 3;
  8387. else {
  8388. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8389. }
  8390. }
  8391. updatePlaceBallAwardState() {
  8392. let level = xGame.common.placeBallCurLevel;
  8393. let starNum = xGame.common.placeBallStarNum;
  8394. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8395. let data = cfgTable.placeballData[level].award;
  8396. let cfg = cfgTable.placeballData[level];
  8397. this.awardDiamondNum = data[1];
  8398. this.awardCoinNum = data[0];
  8399. if (cfg.type == PlaceBallType.challenge) {
  8400. this.awardDiamondNum = 0;
  8401. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8402. }
  8403. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8404. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8405. if (cfg.type == PlaceBallType.challenge) {
  8406. this.ui.awardNode.coinNode.visible = true;
  8407. }
  8408. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8409. this.ui.awardNode.diamondNode.x = 265;
  8410. this.ui.awardNode.coinNode.x = 354;
  8411. }
  8412. else {
  8413. this.ui.awardNode.diamondNode.x = 291;
  8414. this.ui.awardNode.coinNode.x = 291;
  8415. }
  8416. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8417. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8418. if (this.awardCoinNum == 0) {
  8419. this.ui.awardNode.coinNode.numTxt.text = "";
  8420. }
  8421. if (getAward) {
  8422. this.ui.isGetAward.visible = true;
  8423. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8424. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8425. }
  8426. else {
  8427. this.ui.isGetAward.visible = false;
  8428. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8429. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8430. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8431. }
  8432. else {
  8433. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8434. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8435. }
  8436. }
  8437. }
  8438. show(success) {
  8439. super.show();
  8440. xGame.eventMgr.event(RESET_GAME);
  8441. this.success = success;
  8442. Laya.timer.clearAll(this);
  8443. this.playSecretaryAni();
  8444. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8445. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8446. offsetTime = Math.floor(offsetTime / 1000);
  8447. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8448. this.updateType();
  8449. Laya.timer.once(200, this, () => {
  8450. this.addAward(() => {
  8451. this.updateType();
  8452. Laya.timer.once(500, this, () => {
  8453. this.showChallengeLevel();
  8454. });
  8455. });
  8456. });
  8457. if (this.success) {
  8458. JSBridgeUtils.instance.showInternAd('gameend_success');
  8459. console.log('zh:game end 成功');
  8460. xGame.soundMgr.playSound('slots_roll01');
  8461. xGame.soundMgr.playSound("s_win");
  8462. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8463. this.diyGameDataUtilForGameWin();
  8464. this.updateGamePlaceBallData2Server();
  8465. }
  8466. else {
  8467. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8468. console.log('zh:game end失败');
  8469. xGame.soundMgr.playSound('matchwin01');
  8470. xGame.soundMgr.playSound("s_lose");
  8471. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8472. }
  8473. console.log('zh:开始弹出福利框2个');
  8474. Laya.timer.once(1000, this, () => {
  8475. console.log('zh: 1秒后 showFuLiSp1');
  8476. DataMgr.checkForShowFuLi17AndAlert(1);
  8477. });
  8478. let challengeNum = DataMgr.getChallengeTimes();
  8479. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8480. DataMgr.setChallengeTimes(1);
  8481. }
  8482. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8483. DataMgr.setClassicTimes();
  8484. }
  8485. this.setGlobalFont(this.ui);
  8486. }
  8487. diyGameDataUtilForGameWin() {
  8488. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8489. switch (xGame.common.gameMode) {
  8490. case GameMode.classic:
  8491. console.log('zh:DiyGameDataUtilForGameWin 111');
  8492. case GameMode.bigMove:
  8493. console.log('zh:DiyGameDataUtilForGameWin 222');
  8494. this.restartGame();
  8495. break;
  8496. case GameMode.placeBall:
  8497. console.log('zh:DiyGameDataUtilForGameWin 333');
  8498. var level = xGame.common.placeBallCurLevel;
  8499. console.log('zh:练习模式 联系了多少LEV=' + level);
  8500. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8501. if (level > db_over_lev) {
  8502. DataMgr.setChallengeMode_overLev(level);
  8503. }
  8504. break;
  8505. default:
  8506. console.log('zh:DiyGameDataUtilForGameWin 444');
  8507. break;
  8508. }
  8509. }
  8510. updateGamePlaceBallData2Server() {
  8511. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8512. if (userInfo == null) {
  8513. return;
  8514. }
  8515. let pbdObj = DataMgr.getPlaceBallLevelList();
  8516. let reqData = xGame.httpMgr.getReqData();
  8517. let pd = JSON.parse(reqData);
  8518. pd.placeBallData = JSON.stringify(pbdObj);
  8519. reqData = JSON.stringify(pd);
  8520. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  8521. try {
  8522. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  8523. let code = res.code;
  8524. let msg = res.msg;
  8525. if (code == 401) {
  8526. Laya.LocalStorage.removeItem(keyForLoginInfo);
  8527. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8528. return;
  8529. }
  8530. if (code == 200) {
  8531. let data = res.data;
  8532. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  8533. }
  8534. else {
  8535. xGame.uiMgr.Show(UIMsg, msg);
  8536. }
  8537. }
  8538. catch (error) {
  8539. console.log('error=' + error);
  8540. alert(error);
  8541. }
  8542. finally {
  8543. }
  8544. });
  8545. }
  8546. showChallengeLevel() {
  8547. if (DataMgr.getChallengeTimes() != 0)
  8548. return;
  8549. let skill = DataMgr.getSkillAccTimes();
  8550. let put = DataMgr.getPlaceBallLevelList().length;
  8551. if (skill >= 3 || put >= 5) {
  8552. xGame.uiMgr.Show(UIInvitation);
  8553. this.hide();
  8554. }
  8555. }
  8556. addAward(callback) {
  8557. if (!this.success) {
  8558. callback && callback();
  8559. return;
  8560. }
  8561. switch (xGame.common.gameMode) {
  8562. case GameMode.classic:
  8563. this.awardCoinNum = xGame.common.passAwardCoin;
  8564. this.awardDiamondNum = 0;
  8565. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8566. break;
  8567. case GameMode.bigMove:
  8568. this.awardCoinNum = xGame.common.passAwardCoin;
  8569. this.awardDiamondNum = 0;
  8570. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8571. callback && callback();
  8572. break;
  8573. case GameMode.placeBall:
  8574. let level = xGame.common.placeBallCurLevel;
  8575. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8576. if (xGame.common.placeBallStarNum != 3) {
  8577. callback && callback();
  8578. return;
  8579. }
  8580. else {
  8581. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8582. if (getAward) {
  8583. callback && callback();
  8584. return;
  8585. }
  8586. }
  8587. let cfg = cfgTable.placeballData[level];
  8588. let data = cfgTable.placeballData[level].award;
  8589. this.awardCoinNum = data[0];
  8590. this.awardDiamondNum = data[1];
  8591. if (cfg.type == PlaceBallType.challenge) {
  8592. this.awardDiamondNum = 0;
  8593. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8594. }
  8595. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8596. let diamondAward;
  8597. if (this.awardDiamondNum > 0) {
  8598. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8599. xGame.common.getAward([diamondAward, coinAward], callback);
  8600. }
  8601. else {
  8602. xGame.common.getAward([coinAward], callback);
  8603. }
  8604. if (cfg.type == PlaceBallType.normal) {
  8605. DataMgr.setPlaceBallAward(level);
  8606. }
  8607. break;
  8608. default:
  8609. break;
  8610. }
  8611. }
  8612. playSecretaryAni_old() {
  8613. let parent = this.ui.secretary.displayObject;
  8614. parent.destroyChildren();
  8615. let xx = this.ui.secretary.width / 2;
  8616. let yy = this.ui.secretary.height;
  8617. let scale = xGame.common.getSecretaryScale();
  8618. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8619. if (this.success) {
  8620. let rand = Math.random() <= 0.5 ? 2 : 3;
  8621. xGame.common.secretary.play(data, rand, false, parent, () => {
  8622. xGame.common.secretary.play(data, 1, true, parent);
  8623. });
  8624. }
  8625. else {
  8626. xGame.common.secretary.play(data, 0, true, parent);
  8627. }
  8628. }
  8629. playSecretaryAni() {
  8630. let parent = this.ui.secretary.displayObject;
  8631. parent.destroyChildren();
  8632. let xx = this.ui.secretary.width / 2;
  8633. let yy = this.ui.secretary.height;
  8634. let scale = xGame.common.getSecretaryScale();
  8635. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8636. if (this.success) {
  8637. let rand = 0;
  8638. xGame.common.secretary.play(data, 0, true, parent);
  8639. }
  8640. else {
  8641. xGame.common.secretary.play(data, 0, true, parent);
  8642. }
  8643. }
  8644. restartGame() {
  8645. switch (xGame.common.gameMode) {
  8646. case GameMode.classic:
  8647. xGame.eventMgr.event(RESTART_GAME);
  8648. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8649. break;
  8650. case GameMode.bigMove:
  8651. this.hide();
  8652. xGame.eventMgr.event(RESTART_GAME);
  8653. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8654. break;
  8655. default:
  8656. break;
  8657. }
  8658. }
  8659. hide() {
  8660. super.hide();
  8661. xGame.common.stopGirlPop(this.ui.talkNode);
  8662. PlatMgr.showBanner(false);
  8663. }
  8664. returnHome() {
  8665. this.hide();
  8666. let showFailWords = !this.success;
  8667. xGame.uiMgr.Show(UIMain, showFailWords);
  8668. }
  8669. clickLeftBtn() {
  8670. switch (xGame.common.gameMode) {
  8671. case GameMode.classic:
  8672. case GameMode.bigMove:
  8673. this.returnHome();
  8674. break;
  8675. case GameMode.placeBall:
  8676. let level = xGame.common.placeBallCurLevel;
  8677. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8678. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8679. break;
  8680. default:
  8681. break;
  8682. }
  8683. }
  8684. powerStartPlaceBallLevel(level, btn) {
  8685. if (DataMgr.powerEnough()) {
  8686. btn.touchable = false;
  8687. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8688. btn.touchable = true;
  8689. DataMgr.setPower(-1);
  8690. xGame.eventMgr.event(POWER_TIME);
  8691. this.startPlaceBallLevel(level);
  8692. this.logEventForChallenge_level_start(level);
  8693. }));
  8694. }
  8695. else {
  8696. xGame.uiMgr.Show(UIPower, 0);
  8697. }
  8698. }
  8699. clickRightBtn() {
  8700. switch (xGame.common.gameMode) {
  8701. case GameMode.classic:
  8702. console.log('zh:clickRightBtn 111');
  8703. case GameMode.bigMove:
  8704. console.log('zh:clickRightBtn 222');
  8705. this.restartGame();
  8706. break;
  8707. case GameMode.placeBall:
  8708. console.log('zh:clickRightBtn 333');
  8709. let level = xGame.common.placeBallCurLevel;
  8710. let data = DataMgr.getPlaceBallLevel(level);
  8711. let curPss = data.play && !data.isCur;
  8712. if (curPss) {
  8713. console.log('zh:clickRightBtn 333-111');
  8714. console.log('zh:当前LV=' + level);
  8715. if (level == 60) {
  8716. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8717. Laya.timer.once(3000, this, () => {
  8718. this.returnHome();
  8719. });
  8720. }
  8721. else {
  8722. let lev = level + 1;
  8723. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8724. }
  8725. }
  8726. else {
  8727. console.log('zh:clickRightBtn 333-000');
  8728. Moyu.sendDataEvent("placeBallNextLevel");
  8729. console.log('zh:qjff_AD_for_uiGameEnd');
  8730. if (Laya.Browser.onAndroid) {
  8731. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8732. if (!boo) {
  8733. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8734. return;
  8735. }
  8736. }
  8737. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8738. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8739. }
  8740. else {
  8741. console.log('zh:AD 失败,直接发放奖励');
  8742. this.qjff_AD_for_uiGameEnd(level);
  8743. }
  8744. }
  8745. break;
  8746. default:
  8747. console.log('zh:clickRightBtn 444');
  8748. break;
  8749. }
  8750. }
  8751. logEventForChallenge_level_start(level) {
  8752. let keyStr = 'sjmd_challenge_level_start';
  8753. let jsonStr = {
  8754. "count": 0,
  8755. "gold_balance ": DataMgr.getCoin(),
  8756. "level": level,
  8757. "diamond_balance ": DataMgr.getDiamond()
  8758. };
  8759. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8760. const d = LocalStorageManager.getItem(keyStr);
  8761. if (level > d.level) {
  8762. jsonStr.count = d.count + 1;
  8763. LocalStorageManager.setItem(keyStr, jsonStr);
  8764. }
  8765. else {
  8766. }
  8767. }
  8768. else {
  8769. LocalStorageManager.setItem(keyStr, jsonStr);
  8770. }
  8771. const reqStr = JSON.stringify(jsonStr);
  8772. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8773. }
  8774. qjff_AD_for_uiGameEnd(level) {
  8775. DataMgr.setPlaceBallLevel(level, 1);
  8776. this.startPlaceBallLevel(level + 1);
  8777. }
  8778. startPlaceBallLevel(level) {
  8779. xGame.common.gameMode = GameMode.placeBall;
  8780. xGame.common.placeBallCurLevel = level;
  8781. xGame.uiMgr.Show(UIGame);
  8782. this.hide();
  8783. }
  8784. logEventForChallenge_level_complete(level) {
  8785. let keyStr = 'sjmd_challenge_level_complete';
  8786. let jsonStr = {
  8787. "count": 1,
  8788. "gold_balance ": DataMgr.getCoin(),
  8789. "level": level,
  8790. "diamond_balance ": DataMgr.getDiamond()
  8791. };
  8792. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8793. const d = LocalStorageManager.getItem(keyStr);
  8794. jsonStr.count = d.count + 1;
  8795. LocalStorageManager.setItem(keyStr, jsonStr);
  8796. }
  8797. else {
  8798. LocalStorageManager.setItem(keyStr, jsonStr);
  8799. }
  8800. const reqStr = JSON.stringify(jsonStr);
  8801. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8802. }
  8803. logEventForChallenge_level_N(level) {
  8804. console.log('zh:logEventForChallenge_level_N ' + level);
  8805. let keyStr = 'sjmd_challenge_level_N';
  8806. if (LocalStorageManager.hasKey(keyStr)) {
  8807. let lev = LocalStorageManager.getItem(keyStr);
  8808. if (level > lev) {
  8809. LocalStorageManager.setItem(keyStr, level);
  8810. }
  8811. if ((level) % 5 == 0) {
  8812. console.log('zh:每5关上报1次');
  8813. let sjmc = 'challenge_level_' + level;
  8814. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8815. let sjmcForFirebase = 'challenge_level_' + level;
  8816. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8817. }
  8818. else {
  8819. console.log('zh:5 no 上报');
  8820. }
  8821. }
  8822. else {
  8823. LocalStorageManager.setItem(keyStr, level);
  8824. }
  8825. }
  8826. }
  8827. UIGameEnd.uiName = "UIGameEnd";
  8828. class ui_UIVideoShare extends fgui.GComponent {
  8829. static createInstance() {
  8830. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8831. }
  8832. onConstruct() {
  8833. this.n10 = (this.getChild("n10"));
  8834. this.myNode = (this.getChild("myNode"));
  8835. this.t0 = this.getTransition("t0");
  8836. }
  8837. }
  8838. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8839. class UIVideoShare extends UIBase {
  8840. constructor() {
  8841. super();
  8842. this.success = false;
  8843. this.awardNum = 0;
  8844. this.isShared = true;
  8845. }
  8846. onConstructor() {
  8847. this.ui = ui_UIVideoShare.createInstance();
  8848. this.contentPane = this.ui;
  8849. this.isEject = false;
  8850. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8851. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8852. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8853. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8854. }
  8855. show(success) {
  8856. super.show();
  8857. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8858. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8859. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8860. this.success = success;
  8861. let time = xGame.common.randomNum(600, 1500);
  8862. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8863. if (success)
  8864. xGame.soundMgr.playSound("applause");
  8865. this.ui.t0.play();
  8866. this.checkShareState();
  8867. let times = DataMgr.getDailyVideoShareTimes();
  8868. this.awardNum = times == 0 ? 2000 : 200;
  8869. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8870. this.setGlobalFont(this.ui);
  8871. }
  8872. checkShareState() {
  8873. if (PlatMgr.forceShare == 0) {
  8874. this.ui.myNode.closeBtn.visible = true;
  8875. this.ui.myNode.tipsNode.visible = false;
  8876. this.ui.myNode.closeBtn.x = 90;
  8877. this.ui.myNode.shareBtn.x = 342;
  8878. }
  8879. else if (PlatMgr.forceShare == 1) {
  8880. this.ui.myNode.closeBtn.visible = false;
  8881. this.ui.myNode.tipsNode.visible = true;
  8882. this.ui.myNode.shareBtn.x = 218;
  8883. this.isShared = true;
  8884. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8885. }
  8886. }
  8887. checkForceShare() {
  8888. this.isShared = !this.isShared;
  8889. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8890. }
  8891. videoShare() {
  8892. if (PlatMgr.forceShare == 1) {
  8893. if (this.isShared) {
  8894. this.shareGame();
  8895. }
  8896. else {
  8897. this.hideSelf();
  8898. }
  8899. }
  8900. else {
  8901. this.shareGame();
  8902. }
  8903. }
  8904. shareGame() {
  8905. Moyu.sendDataEvent("VideoShare");
  8906. if (Moyu.canShare() > 100) {
  8907. Moyu.shareGame((success) => {
  8908. if (success) {
  8909. DataMgr.setDailyVideoShareTimes(1);
  8910. DataMgr.setCoin(this.awardNum);
  8911. }
  8912. this.hideSelf();
  8913. }, this);
  8914. }
  8915. else {
  8916. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8917. this.hideSelf();
  8918. }
  8919. }
  8920. hideSelf() {
  8921. this.hide();
  8922. xGame.uiMgr.Show(UIGameEnd, this.success);
  8923. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8924. xGame.common.screenImg.destroy();
  8925. xGame.common.screenImg = null;
  8926. }
  8927. }
  8928. }
  8929. UIVideoShare.uiName = "UIVideoShare";
  8930. class GameMgr {
  8931. constructor() {
  8932. this.selfCamp = "";
  8933. this.selfFoulNum = 0;
  8934. this.selfBallArr = [];
  8935. this.selfTimer = 0;
  8936. this.selfScore = 0;
  8937. this.aiCamp = "";
  8938. this.aiFoulNum = 0;
  8939. this.aiBallArr = [];
  8940. this.aiTimer = 0;
  8941. this.aiScore = 0;
  8942. this.aiSkillLevelNum = 1;
  8943. this.targertScore = 0;
  8944. this.setTime = 30;
  8945. this.selfTurnRate = 0.5;
  8946. this.accTime = 0;
  8947. this.curFoul = "";
  8948. this.maxFoulTimes = 3;
  8949. this.isFirstInGame = true;
  8950. this.firstColliObj = null;
  8951. this.inHoleBalls = [];
  8952. this.blackNum = 8;
  8953. this.success = false;
  8954. this.holePosList = [];
  8955. this.posObj = {};
  8956. this._selfTurn = false;
  8957. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8958. this.ensureBallType = false;
  8959. this.isOpenBall = true;
  8960. this.finishOneShoot = true;
  8961. this.isEnd = false;
  8962. this.isChangeTurn = false;
  8963. this.isInterrupt = false;
  8964. this.aiPlayedBreakArmy = false;
  8965. this.isTouchedBall = false;
  8966. this.finishBalls = 0;
  8967. this.needBalls = 0;
  8968. this.allBallNum = 0;
  8969. this.placeBallPosData = {};
  8970. this.curHP = 0;
  8971. this.showLongView = false;
  8972. this.firstShoot = true;
  8973. this._gamePause = false;
  8974. this.trunCount = 0;
  8975. this.isBlackInHole = false;
  8976. this.isEnter = true;
  8977. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8978. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8979. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8980. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8981. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8982. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8983. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8984. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8985. }
  8986. get gamePause() {
  8987. return this._gamePause;
  8988. }
  8989. set gamePause(v) {
  8990. if (v) {
  8991. Laya.physicsTimer.pause();
  8992. }
  8993. else {
  8994. Laya.physicsTimer.resume();
  8995. }
  8996. this._gamePause = v;
  8997. }
  8998. get selfTurn() {
  8999. return this._selfTurn;
  9000. }
  9001. set selfTurn(val) {
  9002. this.trunCount++;
  9003. this._selfTurn = val;
  9004. if (val) {
  9005. xGame.common.d2World.d2Gan.ui.self.visible = true;
  9006. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9007. }
  9008. else {
  9009. xGame.common.d2World.d2Gan.ui.self.visible = false;
  9010. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  9011. if (this.trunCount > 1)
  9012. PlatMgr.openBox();
  9013. }
  9014. }
  9015. resetGame() {
  9016. this.inHoleBalls = [];
  9017. this.isFirstInGame = true;
  9018. this.firstColliObj = null;
  9019. this.aiCamp = "";
  9020. this.selfCamp = "";
  9021. this.aiFoulNum = 0;
  9022. this.selfFoulNum = 0;
  9023. this.selfBallArr = [];
  9024. this.aiBallArr = [];
  9025. this.gamePause = false;
  9026. this.ensureBallType = false;
  9027. this.isInterrupt = false;
  9028. this.updateLeftBall();
  9029. this.clearTime();
  9030. this.aiPlayedBreakArmy = false;
  9031. this.isBlackInHole = false;
  9032. this.placeBallPosData = {};
  9033. if (xGame.common.d3World.knifeRoot) {
  9034. xGame.common.d3World.knifeRoot.destroyChildren();
  9035. }
  9036. }
  9037. gameReady() {
  9038. this.trunCount = 0;
  9039. this.firstColliObj = null;
  9040. this.isFirstInGame = true;
  9041. this.selfTurn = Math.random() <= this.selfTurnRate;
  9042. let challengeNum = DataMgr.getChallengeTimes();
  9043. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9044. this.selfTurn = true;
  9045. }
  9046. if (xGame.common.gameMode == GameMode.placeBall)
  9047. this.selfTurn = true;
  9048. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  9049. this.selfTurn = true;
  9050. }
  9051. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  9052. this.checkGuide();
  9053. this.checkGuideForPlaceBall();
  9054. if (xGame.common.uiRodMethod)
  9055. xGame.common.uiRodMethod.resetRod();
  9056. xGame.common.d2World.getHelpLine();
  9057. this.isOpenBall = true;
  9058. this.isTouchedBall = false;
  9059. xGame.common.aiPlayer.stopRun();
  9060. this.setTime = 30;
  9061. let ui = xGame.common.gameUI.ui;
  9062. switch (xGame.common.gameMode) {
  9063. case GameMode.classic:
  9064. xGame.common.aiPlayer.init();
  9065. this.blackNum = 8;
  9066. this.placeRootBall();
  9067. this.peoplePlay(9, 10);
  9068. ui.wordsBtn.visible = true;
  9069. ui.aiWordsBtn.visible = true;
  9070. xGame.common.talkMgr.changeAIState(true);
  9071. DataMgr.gameData.gameCount++;
  9072. DataMgr.saveGameData();
  9073. break;
  9074. case GameMode.bigMove:
  9075. this.blackNum = -1;
  9076. this.selfScore = 0;
  9077. this.aiScore = 0;
  9078. xGame.common.aiPlayer.init();
  9079. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  9080. this.updateSelfScore();
  9081. this.updateAIScore();
  9082. this.updateTargetSroce();
  9083. this.placeRootBall();
  9084. this.peoplePlay(9, 10);
  9085. ui.wordsBtn.visible = true;
  9086. ui.aiWordsBtn.visible = true;
  9087. xGame.common.talkMgr.changeAIState(true);
  9088. if (DataMgr.getSkillGuide() < 1)
  9089. DataMgr.gameData.gameCount = 0;
  9090. else {
  9091. DataMgr.gameData.gameCount++;
  9092. DataMgr.saveGameData();
  9093. PlatMgr.openTry();
  9094. }
  9095. if (xGame.common.d3World.knifeRoot) {
  9096. xGame.common.d3World.knifeRoot.destroyChildren();
  9097. }
  9098. break;
  9099. case GameMode.placeBall:
  9100. this.blackNum = -1;
  9101. this.selfTurn = true;
  9102. this.setTime = 10000;
  9103. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9104. this.curHP = this.placeBallData.hp;
  9105. if (this.placeBallData.ball == -1)
  9106. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9107. else
  9108. this.needBalls = this.placeBallData.ball;
  9109. console.log("需要的进球数目", this.needBalls);
  9110. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9111. this.finishBalls = 0;
  9112. this.placeBallPosData = {};
  9113. this.updatePlaceBallPos();
  9114. this.updatePlaceBallState();
  9115. this.finishOneShoot = true;
  9116. xGame.common.gameUI.ui.moveNode.visible = false;
  9117. this.isOpenBall = false;
  9118. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9119. ui.wordsBtn.visible = false;
  9120. ui.aiWordsBtn.visible = false;
  9121. xGame.common.talkMgr.changeAIState(false);
  9122. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9123. PlatMgr.openBox();
  9124. });
  9125. break;
  9126. default:
  9127. break;
  9128. }
  9129. this.showLongView = false;
  9130. xGame.common.wordsMgr.comboTimes = 1;
  9131. let guide = DataMgr.getSkillGuide();
  9132. if (guide)
  9133. xGame.eventMgr.event(WAIT_SHOOT);
  9134. xGame.common.upSkillLevel = false;
  9135. xGame.common.gameStartTime = new Date().getTime();
  9136. this.firstShoot = true;
  9137. }
  9138. checkGuide() {
  9139. console.log('zh: 检查引导123');
  9140. let guide = DataMgr.getSkillGuide();
  9141. let gameUI = xGame.common.gameUI.ui;
  9142. gameUI.guide1.visible = false;
  9143. gameUI.guide2.visible = false;
  9144. gameUI.guide3.visible = false;
  9145. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9146. this.selfTurn = true;
  9147. }
  9148. else {
  9149. return;
  9150. }
  9151. let oneBall = this.getOneBall();
  9152. gameUI.guide1.visible = true;
  9153. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9154. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9155. }
  9156. checkGuideForPlaceBall() {
  9157. console.log('zh: 检查引导123 checkGuideForPlaceBall');
  9158. let gameUI = xGame.common.gameUI.ui;
  9159. let guide = DataMgr.getLianXiGuide();
  9160. console.log('zh:checkGuideForPlaceBall =', guide);
  9161. console.log('zh:xGame.common.gameMode=' + xGame.common.gameMode);
  9162. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  9163. this.selfTurn = true;
  9164. gameUI.n_lxms_yd1.visible = true;
  9165. }
  9166. else {
  9167. gameUI.n_lxms_yd1.visible = false;
  9168. return;
  9169. }
  9170. let oneBall = this.getOneBallForPlaceBall();
  9171. gameUI.n_lxms_yd1.visible = true;
  9172. gameUI.n_lxms_yd1.fingerNode.x = oneBall.gameObj.x;
  9173. gameUI.n_lxms_yd1.fingerNode.y = oneBall.gameObj.y;
  9174. }
  9175. getOneBall() {
  9176. let arr = xGame.common.d2World.ballArr;
  9177. for (let index = 0; index < arr.length; index++) {
  9178. if (arr[index].number == 0)
  9179. continue;
  9180. return arr[index];
  9181. }
  9182. }
  9183. getOneBallForPlaceBall() {
  9184. let arr = xGame.common.d2World.ballArr;
  9185. return arr[2];
  9186. }
  9187. updateSelfScore() {
  9188. let ui = xGame.common.gameUI.ui.topNode;
  9189. ui.selfScoreTxt.text = this.selfScore + "";
  9190. }
  9191. updateAIScore() {
  9192. let ui = xGame.common.gameUI.ui.topNode;
  9193. ui.aiScoreTxt.text = this.aiScore + "";
  9194. }
  9195. updateTargetSroce() {
  9196. let ui = xGame.common.gameUI.ui.topNode;
  9197. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9198. }
  9199. updateLeftBall() {
  9200. let topUI = xGame.common.gameUI.ui.topNode;
  9201. topUI.selfBallList.numItems = this.selfBallArr.length;
  9202. topUI.aiBallList.numItems = this.aiBallArr.length;
  9203. }
  9204. ballShoot() {
  9205. this.clearTime();
  9206. this.finishOneShoot = false;
  9207. xGame.common.gameUI.ui.moveNode.visible = false;
  9208. if (xGame.common.gameUI.ui.guideNode.visible) {
  9209. xGame.common.gameUI.ui.guideNode.visible = false;
  9210. }
  9211. if (this.firstShoot) {
  9212. this.firstShoot = false;
  9213. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9214. }
  9215. }
  9216. ensureCamp(number) {
  9217. this.ensureBallType = true;
  9218. this.isOpenBall = false;
  9219. if (xGame.common.gameMode != GameMode.classic)
  9220. return;
  9221. let full = [1, 2, 3, 4, 5, 6, 7];
  9222. let flower = [9, 10, 11, 12, 13, 14, 15];
  9223. let sayWords = "";
  9224. if (this.selfTurn) {
  9225. if (number <= 7) {
  9226. this.selfCamp = ballCamp.full;
  9227. this.selfBallArr = full;
  9228. this.aiCamp = ballCamp.flower;
  9229. this.aiBallArr = flower;
  9230. sayWords = cfgTable.wordsData[3].msg;
  9231. }
  9232. else {
  9233. this.selfCamp = ballCamp.flower;
  9234. this.selfBallArr = flower;
  9235. this.aiCamp = ballCamp.full;
  9236. this.aiBallArr = full;
  9237. sayWords = cfgTable.wordsData[4].msg;
  9238. }
  9239. }
  9240. else {
  9241. if (number <= 7) {
  9242. this.selfCamp = ballCamp.flower;
  9243. this.selfBallArr = flower;
  9244. this.aiCamp = ballCamp.full;
  9245. this.aiBallArr = full;
  9246. sayWords = cfgTable.wordsData[2].msg;
  9247. }
  9248. else {
  9249. this.selfCamp = ballCamp.full;
  9250. this.selfBallArr = full;
  9251. this.aiCamp = ballCamp.flower;
  9252. this.aiBallArr = flower;
  9253. sayWords = cfgTable.wordsData[1].msg;
  9254. }
  9255. }
  9256. this.updateLeftBall();
  9257. xGame.uiMgr.Show(UIMsg, sayWords);
  9258. }
  9259. updatePlaceBallState() {
  9260. let ui = xGame.common.gameUI.ui;
  9261. switch (this.placeBallData.type) {
  9262. case PlaceBallType.normal:
  9263. let normal = ui.placeNormalNode;
  9264. normal.hpTxt.text = this.curHP + "";
  9265. this.updatePlaceBallStar(normal);
  9266. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9267. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9268. break;
  9269. case PlaceBallType.challenge:
  9270. let challenge = ui.placeChallengeNode;
  9271. challenge.hpTxt.text = "Shots:" + this.curHP;
  9272. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9273. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9274. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9275. break;
  9276. default:
  9277. break;
  9278. }
  9279. }
  9280. playSubHpAni() {
  9281. let ui = xGame.common.gameUI.ui;
  9282. switch (this.placeBallData.type) {
  9283. case PlaceBallType.normal:
  9284. let normal = ui.placeNormalNode;
  9285. normal.hpTxt.visible = false;
  9286. normal.starAni.c1.selectedIndex = 1;
  9287. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9288. normal.hpTxt.visible = true;
  9289. normal.starAni.c1.selectedIndex = 0;
  9290. }));
  9291. break;
  9292. default:
  9293. break;
  9294. }
  9295. }
  9296. getEndStarNum() {
  9297. let num;
  9298. let level = xGame.common.placeBallCurLevel;
  9299. if (this.curHP == this.placeBallData.hp) {
  9300. num = 3;
  9301. }
  9302. else if (this.curHP <= 1) {
  9303. num = 1;
  9304. }
  9305. else {
  9306. num = 2;
  9307. }
  9308. if (!this.success) {
  9309. num = 0;
  9310. }
  9311. else {
  9312. DataMgr.setPlaceBallLevel(level, num);
  9313. }
  9314. let myType = cfgTable.placeballData[level].type;
  9315. if (this.success && myType == 1) {
  9316. num = 3;
  9317. }
  9318. xGame.common.placeBallStarNum = num;
  9319. }
  9320. updatePlaceBallStar(node) {
  9321. let star = 0;
  9322. if (this.curHP == this.placeBallData.hp) {
  9323. star = 3;
  9324. }
  9325. else if (this.curHP >= 2) {
  9326. star = 2;
  9327. }
  9328. else if (this.curHP == 1) {
  9329. star = 1;
  9330. }
  9331. else {
  9332. star = 0;
  9333. }
  9334. let temp;
  9335. for (let index = 1; index <= 3; index++) {
  9336. temp = node["star" + index];
  9337. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9338. }
  9339. node.myProgress.value = (star / 3) * 100;
  9340. }
  9341. openRegretView(isFoul, GoalNum, challenge = false) {
  9342. let regretType = -1;
  9343. if (isFoul) {
  9344. regretType = 1;
  9345. }
  9346. else {
  9347. if (GoalNum <= 0) {
  9348. regretType = 0;
  9349. }
  9350. }
  9351. if (challenge) {
  9352. regretType = 1;
  9353. }
  9354. if (regretType != -1) {
  9355. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9356. if (success) {
  9357. this.curHP++;
  9358. this.updatePlaceBallState();
  9359. this.setPlaceBallAllPos();
  9360. xGame.common.gameUI.ui.moveNode.visible = false;
  9361. }
  9362. else {
  9363. if (this.curHP <= 0) {
  9364. this.success = false;
  9365. this.gameEnd();
  9366. }
  9367. this.playSubHpAni();
  9368. }
  9369. this.updatePlaceBallState();
  9370. this.updatePlaceBallPos();
  9371. });
  9372. }
  9373. }
  9374. setPlaceBallAllPos() {
  9375. let allBall = xGame.common.d2World.ballArr;
  9376. let cfgArr = this.placeBallPosData;
  9377. let temp;
  9378. let obj;
  9379. for (let index = 0; index < allBall.length; index++) {
  9380. temp = allBall[index];
  9381. if (temp.destroyed)
  9382. continue;
  9383. obj = cfgArr[temp.myUNID];
  9384. if (obj && obj.src && !obj.src.destroyed) {
  9385. temp.gameObj.x = obj.posX;
  9386. temp.gameObj.y = obj.posY;
  9387. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9388. }
  9389. }
  9390. xGame.common.d2World.getHelpLine();
  9391. }
  9392. updatePlaceBallPos() {
  9393. let arr = xGame.common.d2World.ballArr;
  9394. let temp;
  9395. for (let index = 0; index < arr.length; index++) {
  9396. temp = arr[index];
  9397. if (!this.placeBallPosData[temp.myUNID]) {
  9398. this.placeBallPosData[temp.myUNID] = {
  9399. src: temp,
  9400. posX: temp.gameObj.x,
  9401. posY: temp.gameObj.y
  9402. };
  9403. }
  9404. else {
  9405. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9406. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9407. }
  9408. }
  9409. let check;
  9410. for (const key in this.placeBallPosData) {
  9411. check = this.placeBallPosData[key];
  9412. if (check.src.destroyed) {
  9413. delete this.placeBallPosData[key];
  9414. }
  9415. }
  9416. }
  9417. gameRun(type) {
  9418. if (this.gamePause)
  9419. return;
  9420. this.curFoul = this.getFoulType();
  9421. if (type) {
  9422. xGame.common.d2World.d2Gan.shoot();
  9423. xGame.common.gameUI.forceCancel();
  9424. this.curFoul = type;
  9425. }
  9426. this.isEnd = false;
  9427. this.isChangeTurn = true;
  9428. if (xGame.common.gameMode == GameMode.classic) {
  9429. this.judgeClassic(this.curFoul);
  9430. this.checkClassicWords(() => {
  9431. xGame.common.destroyClassicEmotion();
  9432. if (this.isEnd) {
  9433. if (this.isBlackInHole) {
  9434. xGame.common.gameUI.ui.blackAni.visible = true;
  9435. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9436. xGame.common.gameUI.ui.blackAni.visible = false;
  9437. this.gameEnd();
  9438. }));
  9439. }
  9440. else {
  9441. this.gameEnd();
  9442. }
  9443. }
  9444. else {
  9445. this.waitShoot();
  9446. xGame.eventMgr.event(WAIT_SHOOT);
  9447. }
  9448. });
  9449. }
  9450. else if (xGame.common.gameMode == GameMode.bigMove) {
  9451. xGame.common.aiPlayer.stopRun();
  9452. let scoreArr = this.getScore(this.curFoul);
  9453. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9454. this.isEnd = true;
  9455. }
  9456. this.checkBigSkillWords(() => {
  9457. if (this.isEnd) {
  9458. this.gameEnd();
  9459. }
  9460. else {
  9461. this.waitShoot();
  9462. xGame.eventMgr.event(WAIT_SHOOT);
  9463. }
  9464. });
  9465. }
  9466. else if (xGame.common.gameMode == GameMode.placeBall) {
  9467. xGame.common.destroyAwardSpine();
  9468. let isFoul = this.curFoul == FoulType.rootHole;
  9469. let GoalNum = this.inHoleBalls.length;
  9470. if (this.inHoleBalls.indexOf(0) > -1)
  9471. GoalNum -= 1;
  9472. if (isFoul) {
  9473. this.placeRootBall();
  9474. }
  9475. console.log("neeballs", this.needBalls);
  9476. console.log("当前完成的goalNum", GoalNum);
  9477. this.finishBalls += GoalNum;
  9478. console.log("当前完成的finishballs", this.finishBalls);
  9479. let need = this.needBalls;
  9480. if (this.placeBallData.type == PlaceBallType.challenge) {
  9481. need += 100;
  9482. }
  9483. if (this.finishBalls >= need) {
  9484. this.success = true;
  9485. this.gameEnd();
  9486. }
  9487. else {
  9488. switch (this.placeBallData.type) {
  9489. case PlaceBallType.normal:
  9490. if (!isFoul && GoalNum > 0) {
  9491. this.updatePlaceBallPos();
  9492. this.updatePlaceBallState();
  9493. }
  9494. else {
  9495. this.curHP--;
  9496. this.openRegretView(isFoul, GoalNum);
  9497. }
  9498. this.waitShoot();
  9499. xGame.eventMgr.event(WAIT_SHOOT);
  9500. break;
  9501. case PlaceBallType.challenge:
  9502. this.curHP--;
  9503. this.updatePlaceBallState();
  9504. if (isFoul) {
  9505. this.openRegretView(isFoul, GoalNum, true);
  9506. }
  9507. else {
  9508. this.updatePlaceBallPos();
  9509. if (this.curHP <= 0) {
  9510. this.success = true;
  9511. this.gameEnd();
  9512. }
  9513. }
  9514. this.waitShoot();
  9515. xGame.eventMgr.event(WAIT_SHOOT);
  9516. break;
  9517. default:
  9518. break;
  9519. }
  9520. }
  9521. }
  9522. }
  9523. checkClassicWords(callback) {
  9524. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9525. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9526. let type = this.getClassicWordsType();
  9527. if (condition && type != -1) {
  9528. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9529. xGame.soundMgr.playSound(str);
  9530. xGame.common.wordsMgr.playClassicWords(type, callback);
  9531. }
  9532. else {
  9533. Laya.timer.once(300, this, () => {
  9534. callback && callback();
  9535. });
  9536. }
  9537. }
  9538. getClassicWordsType() {
  9539. let d2world = xGame.common.d2World;
  9540. let type = -1;
  9541. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9542. type = ClassicWordsType.perfectShow;
  9543. return type;
  9544. }
  9545. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9546. type = ClassicWordsType.directShoot;
  9547. return type;
  9548. }
  9549. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9550. type = ClassicWordsType.anotherShoot;
  9551. return type;
  9552. }
  9553. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9554. type = ClassicWordsType.bigPower;
  9555. return type;
  9556. }
  9557. let minSpeed = 1;
  9558. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9559. type = ClassicWordsType.hardShoot;
  9560. return type;
  9561. }
  9562. if (this.inHoleBalls.length > 0) {
  9563. type = ClassicWordsType.directShoot;
  9564. return type;
  9565. }
  9566. return type;
  9567. }
  9568. checkBigSkillWords(callback) {
  9569. if (this.curFoul == FoulType.timeOut) {
  9570. callback && callback();
  9571. }
  9572. else {
  9573. let playSkill = false;
  9574. if (this.selfTurn) {
  9575. playSkill = true;
  9576. }
  9577. else {
  9578. if (!this.aiPlayedBreakArmy) {
  9579. this.aiPlayedBreakArmy = true;
  9580. playSkill = true;
  9581. }
  9582. if (this.aiCurSkill != SkillType.breakArmy) {
  9583. playSkill = true;
  9584. }
  9585. }
  9586. if (xGame.common.skillMgr.playedLastSkill) {
  9587. xGame.common.skillMgr.playedLastSkill = false;
  9588. playSkill = false;
  9589. }
  9590. if (playSkill) {
  9591. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9592. let selfExtra = 0;
  9593. let aiExtra = 0;
  9594. if (this.selfTurn)
  9595. selfExtra += extraScore;
  9596. else
  9597. aiExtra += extraScore;
  9598. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9599. this.isEnd = true;
  9600. }
  9601. this.playBigSkillTimes(callback);
  9602. });
  9603. }
  9604. else {
  9605. this.playBigSkillTimes(callback);
  9606. }
  9607. }
  9608. }
  9609. playBigSkillTimes(callback) {
  9610. let length = this.inHoleBalls.length;
  9611. if (this.inHoleBalls.indexOf(0) > -1) {
  9612. length = this.inHoleBalls.length - 1;
  9613. }
  9614. if (length <= 0) {
  9615. callback && callback();
  9616. return;
  9617. }
  9618. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9619. callback && callback();
  9620. });
  9621. }
  9622. playSkillTips() {
  9623. let levelNum = 0;
  9624. let curType;
  9625. if (this.selfTurn) {
  9626. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9627. curType = this.selfCurSkill;
  9628. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9629. levelNum += 5;
  9630. }
  9631. }
  9632. else {
  9633. levelNum = this.aiSkillLevelNum;
  9634. curType = this.aiCurSkill;
  9635. }
  9636. let str = ``;
  9637. switch (curType) {
  9638. case SkillType.highSpace:
  9639. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9640. break;
  9641. case SkillType.breakArmy:
  9642. str = `You pocketed ${levelNum} extra balls`;
  9643. break;
  9644. case SkillType.ice:
  9645. str = `${levelNum * 2} extra balls were frozen`;
  9646. break;
  9647. case SkillType.fireworks:
  9648. str = `${levelNum} extra balls exploded `;
  9649. break;
  9650. case SkillType.GuanYu:
  9651. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9652. break;
  9653. default:
  9654. break;
  9655. }
  9656. xGame.uiMgr.Show(UIMsg, str);
  9657. }
  9658. getFoulType() {
  9659. let foulType = "";
  9660. if (this.firstColliObj == null) {
  9661. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9662. return FoulType.rootHole;
  9663. }
  9664. return FoulType.notTouch;
  9665. }
  9666. else {
  9667. if (this.selfTurn) {
  9668. if (this.selfBallArr.length > 0) {
  9669. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9670. foulType = FoulType.wrongTouch;
  9671. }
  9672. }
  9673. else {
  9674. if (this.ensureBallType) {
  9675. }
  9676. else {
  9677. if (this.firstColliObj == this.blackNum) {
  9678. foulType = FoulType.wrongTouch;
  9679. }
  9680. }
  9681. }
  9682. }
  9683. else {
  9684. if (this.aiBallArr.length > 0) {
  9685. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9686. foulType = FoulType.wrongTouch;
  9687. }
  9688. }
  9689. else {
  9690. if (this.ensureBallType) {
  9691. }
  9692. else {
  9693. if (this.firstColliObj == this.blackNum) {
  9694. foulType = FoulType.wrongTouch;
  9695. }
  9696. }
  9697. }
  9698. }
  9699. if (this.inHoleBalls.length <= 0) {
  9700. return foulType;
  9701. }
  9702. let temp;
  9703. if (this.inHoleBalls.indexOf(0) > -1) {
  9704. foulType = FoulType.rootHole;
  9705. }
  9706. else {
  9707. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9708. temp = this.inHoleBalls[index];
  9709. if (this.selfTurn) {
  9710. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9711. foulType = FoulType.wrongHole;
  9712. break;
  9713. }
  9714. }
  9715. else {
  9716. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9717. foulType = FoulType.wrongHole;
  9718. break;
  9719. }
  9720. }
  9721. }
  9722. }
  9723. let foo;
  9724. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9725. temp = this.inHoleBalls[index];
  9726. foo = this.selfBallArr.indexOf(temp);
  9727. if (foo > -1) {
  9728. this.selfBallArr.splice(foo, 1);
  9729. }
  9730. foo = this.aiBallArr.indexOf(temp);
  9731. if (foo > -1) {
  9732. this.aiBallArr.splice(foo, 1);
  9733. }
  9734. }
  9735. this.updateLeftBall();
  9736. }
  9737. return foulType;
  9738. }
  9739. judgeGameEndByBlack(arr) {
  9740. if (this.selfTurn) {
  9741. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9742. this.selfFoulNum = this.maxFoulTimes;
  9743. return true;
  9744. }
  9745. }
  9746. else {
  9747. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9748. this.aiFoulNum = this.maxFoulTimes;
  9749. return true;
  9750. }
  9751. }
  9752. }
  9753. judgeClassic(type) {
  9754. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9755. xGame.common.aiPlayer.stopRun();
  9756. if (this.judgeNormalSuccess()) {
  9757. this.isEnd = true;
  9758. return;
  9759. }
  9760. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9761. if (this.selfTurn) {
  9762. if (isFoul) {
  9763. this.selfFoulNum++;
  9764. }
  9765. if (this.selfFoulNum >= this.maxFoulTimes) {
  9766. this.success = false;
  9767. this.isEnd = true;
  9768. return;
  9769. }
  9770. }
  9771. else {
  9772. if (isFoul)
  9773. this.aiFoulNum++;
  9774. if (this.aiFoulNum >= this.maxFoulTimes) {
  9775. this.success = true;
  9776. this.isEnd = true;
  9777. return;
  9778. }
  9779. }
  9780. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9781. this.isChangeTurn = false;
  9782. }
  9783. else {
  9784. this.isInterrupt = true;
  9785. }
  9786. }
  9787. waitShoot() {
  9788. if (xGame.common.gameMode == GameMode.classic) {
  9789. switch (this.curFoul) {
  9790. case FoulType.timeOut:
  9791. case FoulType.rootHole:
  9792. this.selfTurn = !this.selfTurn;
  9793. this.peoplePlay(5, 6, true);
  9794. break;
  9795. case FoulType.notTouch:
  9796. this.selfTurn = !this.selfTurn;
  9797. this.peoplePlay(7, 7);
  9798. break;
  9799. case FoulType.wrongHole:
  9800. this.selfTurn = !this.selfTurn;
  9801. this.peoplePlay(11, 11);
  9802. break;
  9803. default:
  9804. if (this.inHoleBalls.length > 0) {
  9805. this.peoplePlay(0, 0, false, false);
  9806. }
  9807. else {
  9808. this.selfTurn = !this.selfTurn;
  9809. this.peoplePlay(7, 7);
  9810. }
  9811. break;
  9812. }
  9813. }
  9814. else if (xGame.common.gameMode == GameMode.bigMove) {
  9815. if (this.curFoul == FoulType.timeOut) {
  9816. this.selfTurn = !this.selfTurn;
  9817. this.peoplePlay(14, 15);
  9818. this.placeRootBall();
  9819. }
  9820. else {
  9821. this.selfTurn = !this.selfTurn;
  9822. if (this.curFoul == FoulType.rootHole) {
  9823. this.peoplePlay(12, 13);
  9824. this.placeRootBall();
  9825. }
  9826. else {
  9827. this.peoplePlay(0, 0, false, false);
  9828. }
  9829. }
  9830. }
  9831. else if (xGame.common.gameMode == GameMode.placeBall) {
  9832. this.finishOneShoot = true;
  9833. }
  9834. this.gameResult();
  9835. }
  9836. gameResult() {
  9837. this.firstColliObj = null;
  9838. this.inHoleBalls = [];
  9839. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9840. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9841. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9842. if (xGame.common.uiRodMethod)
  9843. xGame.common.uiRodMethod.resetRod();
  9844. xGame.common.d2World.rootBall.showSelf();
  9845. this.clearIceSkill();
  9846. if (this.selfTurn) {
  9847. PlatMgr.gameInsert();
  9848. }
  9849. xGame.common.d3World.knifeRoot.destroyChildren();
  9850. if (this.selfTurn) {
  9851. xGame.common.gameUI.showHelpLineGuide();
  9852. xGame.common.gameUI.setTurnAlpha(true);
  9853. }
  9854. else {
  9855. xGame.common.gameUI.setTurnAlpha(false);
  9856. }
  9857. }
  9858. getScore(type) {
  9859. let selfAdd = 0;
  9860. let aiAdd = 0;
  9861. if (type == FoulType.timeOut) {
  9862. if (this.selfTurn)
  9863. aiAdd += 3;
  9864. else
  9865. selfAdd += 3;
  9866. }
  9867. else {
  9868. if (this.inHoleBalls.length > 0) {
  9869. if (this.selfTurn) {
  9870. if (type == FoulType.rootHole) {
  9871. aiAdd += 3;
  9872. if (this.inHoleBalls.length - 1 > 0) {
  9873. selfAdd += this.inHoleBalls.length - 1;
  9874. }
  9875. }
  9876. else {
  9877. selfAdd += this.inHoleBalls.length;
  9878. }
  9879. }
  9880. else {
  9881. if (type == FoulType.rootHole) {
  9882. selfAdd += 3;
  9883. if (this.inHoleBalls.length - 1 > 0) {
  9884. aiAdd += this.inHoleBalls.length - 1;
  9885. }
  9886. }
  9887. else {
  9888. aiAdd += this.inHoleBalls.length;
  9889. }
  9890. }
  9891. }
  9892. }
  9893. return [selfAdd, aiAdd];
  9894. }
  9895. judgeScoreEnd(selfAdd, aiAdd) {
  9896. this.selfScore += selfAdd;
  9897. this.aiScore += aiAdd;
  9898. this.updateAIScore();
  9899. this.updateSelfScore();
  9900. if (this.selfScore >= this.targertScore) {
  9901. this.success = true;
  9902. return true;
  9903. }
  9904. if (this.aiScore >= this.targertScore) {
  9905. this.success = false;
  9906. return true;
  9907. }
  9908. let ballArr = xGame.common.d2World.ballArr;
  9909. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9910. if (this.selfScore > this.aiScore) {
  9911. this.success = true;
  9912. return true;
  9913. }
  9914. else if (this.selfScore < this.aiScore) {
  9915. this.success = false;
  9916. return true;
  9917. }
  9918. else {
  9919. if (this.selfTurn) {
  9920. this.success = false;
  9921. }
  9922. else {
  9923. this.success = true;
  9924. }
  9925. return true;
  9926. }
  9927. }
  9928. }
  9929. clearIceSkill() {
  9930. let arr = xGame.common.d2World.ballArr;
  9931. let temp;
  9932. if (this.selfTurn) {
  9933. if (this.selfCurSkill == SkillType.ice) {
  9934. for (let index = 0; index < arr.length; index++) {
  9935. temp = arr[index];
  9936. if (temp.ballFunc == "ice") {
  9937. temp.setBallFunc("normal", "self");
  9938. }
  9939. }
  9940. }
  9941. }
  9942. else {
  9943. if (this.aiCurSkill == SkillType.ice) {
  9944. for (let index = 0; index < arr.length; index++) {
  9945. temp = arr[index];
  9946. if (temp.ballFunc == "ice") {
  9947. temp.setBallFunc("normal", "ai");
  9948. }
  9949. }
  9950. }
  9951. }
  9952. }
  9953. judgeNormalSuccess() {
  9954. if (this.selfTurn) {
  9955. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9956. this.success = true;
  9957. return true;
  9958. }
  9959. }
  9960. else {
  9961. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9962. this.success = false;
  9963. return true;
  9964. }
  9965. }
  9966. }
  9967. gameEnd() {
  9968. if (Moyu.isTT) {
  9969. xGame.common.screenImg = getScreenImg();
  9970. }
  9971. console.log("游戏结束", this.success);
  9972. xGame.common.aiPlayer.stopRun();
  9973. if (xGame.common.gameMode == GameMode.placeBall) {
  9974. this.getEndStarNum();
  9975. this.updatePlaceBallState();
  9976. }
  9977. this.isEnter = false;
  9978. Moyu.recordEnd(this, () => {
  9979. if (this.isEnter)
  9980. return;
  9981. this.isEnter = true;
  9982. console.log("进入录结束回调");
  9983. this.enterNext();
  9984. });
  9985. Laya.timer.once(1000, this, () => {
  9986. if (this.isEnter)
  9987. return;
  9988. this.isEnter = true;
  9989. this.enterNext();
  9990. });
  9991. xGame.common.longHelpLine = false;
  9992. }
  9993. enterNext() {
  9994. Laya.timer.clearAll(this);
  9995. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9996. xGame.uiMgr.Show(UIVideoShare, this.success);
  9997. }
  9998. else {
  9999. xGame.uiMgr.Show(UIGameEnd, this.success);
  10000. }
  10001. }
  10002. aiLeave() {
  10003. let ui = xGame.common.gameUI.ui;
  10004. ui.topNode.aiNameTxt.text = "offline";
  10005. }
  10006. aiGameEnd(suc) {
  10007. this.success = suc;
  10008. xGame.common.aiPlayer.stopRun();
  10009. if (this.success) {
  10010. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  10011. Laya.timer.once(1000, this, () => {
  10012. this.clearTime();
  10013. this.gameEnd();
  10014. });
  10015. }
  10016. }
  10017. openTimer() {
  10018. let src = xGame.common.gameUI;
  10019. if (this.selfTurn) {
  10020. src.ui.topNode.selfProgress.visible = true;
  10021. src.ui.topNode.aiProgress.visible = false;
  10022. this.curTimer = src.ui.topNode.selfProgress;
  10023. }
  10024. else {
  10025. src.ui.topNode.selfProgress.visible = false;
  10026. src.ui.topNode.aiProgress.visible = true;
  10027. this.curTimer = src.ui.topNode.aiProgress;
  10028. }
  10029. this.accTime = 0;
  10030. Laya.timer.clearAll(this);
  10031. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  10032. this.curTimer.value = 100;
  10033. }
  10034. updateTime(dt) {
  10035. if (this.gamePause)
  10036. return;
  10037. this.accTime += dt;
  10038. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  10039. if (this.accTime >= this.setTime) {
  10040. this.clearTime();
  10041. console.log("时钟进入了gameRun");
  10042. this.gameRun(FoulType.timeOut);
  10043. }
  10044. }
  10045. clearTime() {
  10046. let src = xGame.common.gameUI;
  10047. src.ui.topNode.selfProgress.visible = false;
  10048. src.ui.topNode.aiProgress.visible = false;
  10049. Laya.timer.clearAll(this);
  10050. }
  10051. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  10052. let ui = xGame.common.gameUI.ui;
  10053. let selfMsg, aiMsg;
  10054. if (sayWords) {
  10055. selfMsg = cfgTable.wordsData[selfIndex].msg;
  10056. aiMsg = cfgTable.wordsData[aiIndex].msg;
  10057. if (Foul) {
  10058. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  10059. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  10060. this.placeRootBall();
  10061. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  10062. if (this.curFoul == FoulType.rootHole) {
  10063. if (!DataMgr.getRootBallFoul()) {
  10064. DataMgr.setRootBallFoul();
  10065. aiMsg = "";
  10066. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  10067. let woman = "Boss, pay attention next time~";
  10068. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10069. }
  10070. }
  10071. else if (this.curFoul == FoulType.timeOut) {
  10072. if (!DataMgr.getTimeoutFoul()) {
  10073. DataMgr.setTimeoutFoul();
  10074. aiMsg = "";
  10075. let tips = "Game timeout, 3 fouls, this game failed.";
  10076. let woman = "Boss, pay attention to the timeline~";
  10077. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10078. }
  10079. }
  10080. }
  10081. }
  10082. }
  10083. if (this.selfTurn) {
  10084. if (sayWords) {
  10085. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  10086. ui.selfTurn.visible = true;
  10087. ui.aiTurn.visible = false;
  10088. ui.selfTurn.t0.play();
  10089. Moyu.vibration();
  10090. });
  10091. }
  10092. }
  10093. else {
  10094. let aiNum = xGame.tools.random(1, 11);
  10095. let challengeNum = DataMgr.getChallengeTimes();
  10096. let delay = false;
  10097. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  10098. aiNum = 9;
  10099. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  10100. aiNum = 3;
  10101. if (challengeNum == 3) {
  10102. if (!this.showLongView) {
  10103. this.showLongView = true;
  10104. delay = true;
  10105. }
  10106. }
  10107. }
  10108. }
  10109. if (delay) {
  10110. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10111. if (success) {
  10112. xGame.common.longHelpLine = true;
  10113. xGame.common.d2World.getHelpLine();
  10114. }
  10115. else {
  10116. aiNum = 10;
  10117. }
  10118. xGame.common.aiPlayer.setAiLevel(aiNum);
  10119. if (sayWords) {
  10120. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10121. xGame.common.aiPlayer.runAI();
  10122. ui.selfTurn.visible = false;
  10123. ui.aiTurn.visible = true;
  10124. ui.aiTurn.t0.play();
  10125. });
  10126. }
  10127. else {
  10128. xGame.common.aiPlayer.runAI();
  10129. }
  10130. this.openTimer();
  10131. this.finishOneShoot = true;
  10132. if (this.selfTurn) {
  10133. ui.topNode.selfKuang.visible = true;
  10134. ui.topNode.aiKuang.visible = false;
  10135. ui.topNode.selfTips.visible = true;
  10136. ui.topNode.aiTips.visible = false;
  10137. }
  10138. else {
  10139. ui.topNode.selfKuang.visible = false;
  10140. ui.topNode.aiKuang.visible = true;
  10141. ui.topNode.selfTips.visible = false;
  10142. ui.topNode.aiTips.visible = true;
  10143. }
  10144. });
  10145. return;
  10146. }
  10147. if (xGame.common.gameMode == GameMode.classic) {
  10148. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10149. if (cfg) {
  10150. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10151. aiNum = aiLevel;
  10152. }
  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. }
  10167. this.openTimer();
  10168. this.finishOneShoot = true;
  10169. if (this.selfTurn) {
  10170. ui.topNode.selfKuang.visible = true;
  10171. ui.topNode.aiKuang.visible = false;
  10172. ui.topNode.selfTips.visible = true;
  10173. ui.topNode.aiTips.visible = false;
  10174. }
  10175. else {
  10176. ui.topNode.selfKuang.visible = false;
  10177. ui.topNode.aiKuang.visible = true;
  10178. ui.topNode.selfTips.visible = false;
  10179. ui.topNode.aiTips.visible = true;
  10180. }
  10181. }
  10182. placeRootBall() {
  10183. let rootBall = xGame.common.d2World.rootBall;
  10184. if (!rootBall)
  10185. return;
  10186. rootBall.gameObj.x = this.lastRootBallPos.x;
  10187. rootBall.gameObj.y = this.lastRootBallPos.y;
  10188. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10189. let moveNode = xGame.common.gameUI.ui.moveNode;
  10190. moveNode.visible = true;
  10191. moveNode.x = this.lastRootBallPos.x;
  10192. moveNode.y = this.lastRootBallPos.y;
  10193. if (!this.selfTurn) {
  10194. xGame.common.aiPlayer.resetRoot();
  10195. }
  10196. }
  10197. }
  10198. class ui_guanyuAni extends fgui.GComponent {
  10199. static createInstance() {
  10200. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10201. }
  10202. onConstruct() {
  10203. this.n0 = (this.getChild("n0"));
  10204. }
  10205. }
  10206. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10207. class UIFireworks extends UIBase {
  10208. constructor() {
  10209. super();
  10210. }
  10211. onConstructor() {
  10212. this.isEject = false;
  10213. }
  10214. show(callback) {
  10215. super.show();
  10216. }
  10217. }
  10218. UIFireworks.uiName = "UIFireworks";
  10219. class ui_UIGuanYu extends fgui.GComponent {
  10220. static createInstance() {
  10221. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10222. }
  10223. onConstruct() {
  10224. this.n2 = (this.getChild("n2"));
  10225. this.n1 = (this.getChild("n1"));
  10226. this.n3 = (this.getChild("n3"));
  10227. this.n4 = (this.getChild("n4"));
  10228. this.n5 = (this.getChild("n5"));
  10229. this.n6 = (this.getChild("n6"));
  10230. this.n8 = (this.getChild("n8"));
  10231. this.n7 = (this.getChild("n7"));
  10232. this.t0 = this.getTransition("t0");
  10233. }
  10234. }
  10235. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10236. class UIGuanYu extends UIBase {
  10237. constructor() {
  10238. super();
  10239. }
  10240. onConstructor() {
  10241. this.ui = ui_UIGuanYu.createInstance();
  10242. this.contentPane = this.ui;
  10243. this.isEject = false;
  10244. }
  10245. show(callback) {
  10246. super.show();
  10247. this.ui.t0.play(Laya.Handler.create(this, () => {
  10248. callback && callback();
  10249. this.hide();
  10250. }));
  10251. this.setGlobalFont(this.ui);
  10252. }
  10253. }
  10254. UIGuanYu.uiName = "UIGuanYu";
  10255. class SkillMgr {
  10256. constructor() {
  10257. this.leveNum = 0;
  10258. this.extraScore = 0;
  10259. this.selfTurn = false;
  10260. this.playedLastSkill = false;
  10261. this.tweenArr = [];
  10262. this._finishNum = 0;
  10263. this._curFinish = 0;
  10264. this._rootX = 0;
  10265. this._rootY = 0;
  10266. this.knifeTimes = 0;
  10267. this.knifeV2 = new Laya.Vector2();
  10268. this.knifeV3 = new Laya.Vector3();
  10269. this.rtStarX = 0;
  10270. this.rtStarY = 0;
  10271. this.addBigSkillSpine();
  10272. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10273. }
  10274. addBigSkillSpine() {
  10275. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10276. console.log("extra2 success");
  10277. });
  10278. }
  10279. runBigSkill(callback) {
  10280. this.tweenArr = [];
  10281. this.callback = callback;
  10282. this.judgeSkill();
  10283. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10284. let guide = DataMgr.getSkillGuide();
  10285. if (!xGame.common.gameMgr.selfTurn) {
  10286. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10287. }
  10288. else {
  10289. if (xGame.common.temSelfLevel != 0) {
  10290. this.leveNum = xGame.common.temSelfLevel;
  10291. }
  10292. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10293. this.leveNum += 5;
  10294. }
  10295. }
  10296. if (guide == 0) {
  10297. DataMgr.setSkillGuide(1);
  10298. if (DataMgr.getNewUser()) {
  10299. Moyu.sendDataEvent("gameFirstPlay");
  10300. DataMgr.setNewUser();
  10301. }
  10302. }
  10303. this.playSpineAni(() => {
  10304. switch (this.curSkill) {
  10305. case SkillType.highSpace:
  10306. this.runHighSpace();
  10307. break;
  10308. case SkillType.breakArmy:
  10309. this.runBreakArmy();
  10310. break;
  10311. case SkillType.ice:
  10312. this.runIce();
  10313. break;
  10314. case SkillType.fireworks:
  10315. this.runFireworks();
  10316. break;
  10317. case SkillType.GuanYu:
  10318. this.runGuanYu();
  10319. break;
  10320. default:
  10321. break;
  10322. }
  10323. });
  10324. }
  10325. judgeSkill() {
  10326. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10327. let gameMgr = xGame.common.gameMgr;
  10328. let type;
  10329. for (let index = 0; index < typeArr.length; index++) {
  10330. type = typeArr[index];
  10331. if (gameMgr.selfTurn) {
  10332. if (gameMgr.selfCurSkill == type) {
  10333. this.selfTurn = true;
  10334. this.curSkill = type;
  10335. return;
  10336. }
  10337. }
  10338. else {
  10339. if (gameMgr.aiCurSkill == type) {
  10340. this.selfTurn = false;
  10341. this.curSkill = type;
  10342. return;
  10343. }
  10344. }
  10345. }
  10346. }
  10347. playSpineAni(callback) {
  10348. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10349. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10350. parent.destroyChildren();
  10351. let aniIndex = 0;
  10352. let skillSpine;
  10353. switch (this.curSkill) {
  10354. case SkillType.highSpace:
  10355. aniIndex = 1;
  10356. xGame.soundMgr.playSound("skill01");
  10357. skillSpine = this.skillSpine2;
  10358. data.scaleX = 0.5;
  10359. data.scaleY = 0.5;
  10360. skillSpine.play(data, 1, false, parent, () => {
  10361. callback && callback();
  10362. });
  10363. break;
  10364. case SkillType.breakArmy:
  10365. aniIndex = 2;
  10366. xGame.soundMgr.playSound("skill02");
  10367. skillSpine = this.skillSpine2;
  10368. data.scaleX = 0.5;
  10369. data.scaleY = 0.5;
  10370. skillSpine.play(data, 2, false, parent, () => {
  10371. callback && callback();
  10372. });
  10373. break;
  10374. case SkillType.ice:
  10375. aniIndex = 0;
  10376. xGame.soundMgr.playSound("skill03");
  10377. skillSpine = this.skillSpine2;
  10378. data.scaleX = 0.5;
  10379. data.scaleY = 0.5;
  10380. skillSpine.play(data, 0, false, parent, () => {
  10381. callback && callback();
  10382. });
  10383. break;
  10384. case SkillType.fireworks:
  10385. xGame.soundMgr.playSound("skill_04_01");
  10386. xGame.soundMgr.playSound("skill04");
  10387. xGame.uiMgr.Show(UIFireworks, callback);
  10388. break;
  10389. case SkillType.GuanYu:
  10390. xGame.soundMgr.playSound("skill05_1");
  10391. xGame.soundMgr.playSound("skill05");
  10392. xGame.uiMgr.Show(UIGuanYu, callback);
  10393. break;
  10394. default:
  10395. break;
  10396. }
  10397. }
  10398. getAllBallArr() {
  10399. let arr = xGame.common.d2World.ballArr;
  10400. let outArr = [];
  10401. for (let index = 0; index < arr.length; index++) {
  10402. if (arr[index] instanceof D2RootBallSrc)
  10403. continue;
  10404. if (arr[index].ballFunc == "ice")
  10405. continue;
  10406. if (arr[index].destroyed)
  10407. continue;
  10408. outArr.push(arr[index]);
  10409. }
  10410. return outArr;
  10411. }
  10412. getOneArr(deletObj) {
  10413. let allArr = this.getAllBallArr();
  10414. let temp;
  10415. for (let index = 0; index < allArr.length; index++) {
  10416. temp = allArr[index];
  10417. if (temp.id == deletObj.id) {
  10418. allArr.splice(index, 1);
  10419. break;
  10420. }
  10421. }
  10422. return allArr;
  10423. }
  10424. getNearBallBag(ball) {
  10425. let ui = xGame.common.gameUI.ui;
  10426. let circleArr = [];
  10427. for (let index = 1; index <= 6; index++) {
  10428. circleArr.push(ui.border["circle" + index]);
  10429. }
  10430. let outIndex = 0;
  10431. let temp;
  10432. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10433. ;
  10434. let dis = 0;
  10435. for (let index = 1; index < circleArr.length; index++) {
  10436. temp = circleArr[index];
  10437. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10438. if (dis < min) {
  10439. min = dis;
  10440. outIndex = index;
  10441. }
  10442. }
  10443. return [circleArr[outIndex], outIndex];
  10444. }
  10445. ballFlyToBag(ballArr, time = 300) {
  10446. let temp;
  10447. let hole;
  10448. this._finishNum = ballArr.length;
  10449. this._curFinish = 0;
  10450. let holeObj = {};
  10451. let holeCfg = {
  10452. "1": 0,
  10453. "2": 0,
  10454. "3": 0,
  10455. "4": 0,
  10456. "5": 0,
  10457. "6": 0
  10458. };
  10459. for (let index = 0; index < ballArr.length; index++) {
  10460. temp = ballArr[index];
  10461. temp.outColli.isSensor = true;
  10462. temp.innerColli.isSensor = true;
  10463. temp.isRunSkillAni = true;
  10464. let holeArr = this.getNearBallBag(temp);
  10465. hole = holeArr[0];
  10466. holeObj[index] = holeArr[1];
  10467. temp.d3BallSrc.scaleXYZ = 0.5;
  10468. this.tweenArr.push(temp.d3BallSrc, temp);
  10469. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10470. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10471. }));
  10472. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10473. let mIndex = holeObj[this._curFinish];
  10474. let isDone = holeCfg[mIndex];
  10475. if (isDone) {
  10476. ballArr[this._curFinish].checkWrongBall(false);
  10477. }
  10478. else {
  10479. holeCfg[mIndex] = 1;
  10480. ballArr[this._curFinish].checkWrongBall();
  10481. }
  10482. this._curFinish++;
  10483. if (this._curFinish >= this._finishNum) {
  10484. if (this.curSkill == SkillType.highSpace) {
  10485. }
  10486. else if (this.curSkill == SkillType.breakArmy) {
  10487. let rootBall = xGame.common.d2World.rootBall;
  10488. rootBall.gameObj.x = this._rootX;
  10489. rootBall.gameObj.y = this._rootY;
  10490. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10491. xGame.common.d2World.d2Gan.ui.visible = true;
  10492. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10493. xGame.common.d2World.getHelpLine();
  10494. this.callback && this.callback(this.extraScore);
  10495. }
  10496. }
  10497. }));
  10498. }
  10499. }
  10500. runHighSpace() {
  10501. let rootBall = xGame.common.d2World.rootBall;
  10502. rootBall.showSelf();
  10503. let d3Src = rootBall.d3BallSrc;
  10504. let allArr = this.getAllBallArr();
  10505. if (allArr.length <= 0) {
  10506. this.callback && this.callback(0);
  10507. return;
  10508. }
  10509. let selectBall = xGame.common.d2World.targetBall;
  10510. let wrong = selectBall && selectBall.destroyed;
  10511. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10512. selectBall = xGame.common.getRandArrEle(allArr);
  10513. }
  10514. let targetD3Src = selectBall.d3BallSrc;
  10515. xGame.common.d2World.d2Gan.ui.visible = false;
  10516. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10517. d3Src.scaleXYZ = 0.5;
  10518. this.tweenArr.push(d3Src);
  10519. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10520. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10521. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10522. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10523. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10524. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10525. let outArr = [selectBall];
  10526. let other = this.leveNum - 1;
  10527. if (other > 0) {
  10528. let nearArr = this.getOneArr(selectBall);
  10529. if (nearArr.length > 0) {
  10530. xGame.common.botherArr(nearArr);
  10531. if (other >= nearArr.length)
  10532. other = nearArr.length;
  10533. for (let index = 0; index < other; index++) {
  10534. outArr.push(nearArr[index]);
  10535. }
  10536. }
  10537. }
  10538. xGame.common.extraMoveNum = other + 1;
  10539. this.extraScore = other + 1;
  10540. this._rootX = selectBall.gameObj.x;
  10541. this._rootY = selectBall.gameObj.y;
  10542. rootBall.gameObj.x = this._rootX;
  10543. rootBall.gameObj.y = this._rootY;
  10544. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10545. Laya.Tween.clearAll(d3Src);
  10546. this.addRandomForce(outArr);
  10547. }));
  10548. }));
  10549. }
  10550. addRandomForce(outArr) {
  10551. if (outArr.length > 0) {
  10552. xGame.common.d2World.openCheckStill = true;
  10553. this.playedLastSkill = true;
  10554. }
  10555. let temp;
  10556. for (let index = 0; index < outArr.length; index++) {
  10557. let angle = xGame.common.randomNum(0, 360);
  10558. let linearPercent = xGame.common.randomNum(65, 100);
  10559. temp = outArr[index];
  10560. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10561. }
  10562. }
  10563. setLinearSpeed(angle, rigy, linearPercent) {
  10564. let sin = Math.sin(angle * Math.PI / 180);
  10565. let cos = Math.cos(angle * Math.PI / 180);
  10566. let maxSpeed = 4;
  10567. let speed = new Laya.Vector2();
  10568. speed.x = maxSpeed * linearPercent * sin;
  10569. speed.y = -maxSpeed * linearPercent * cos;
  10570. rigy.applyLinearImpulseToCenter(speed);
  10571. }
  10572. runBreakArmy() {
  10573. xGame.common.d2World.d2Gan.ui.visible = false;
  10574. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10575. let gameUI = xGame.common.gameUI.ui;
  10576. gameUI.skillRod.visible = true;
  10577. gameUI.skillRod.rotation = 110;
  10578. let outArr = this.getAllBallArr();
  10579. if (outArr.length <= 0) {
  10580. gameUI.skillRod.visible = false;
  10581. this.callback && this.callback(0);
  10582. return;
  10583. }
  10584. xGame.common.botherArr(outArr);
  10585. if (this.leveNum >= outArr.length)
  10586. this.leveNum = outArr.length;
  10587. let deleteNum = outArr.length - this.leveNum;
  10588. outArr.splice(0, deleteNum);
  10589. this.extraScore = this.leveNum;
  10590. let potX = gameUI.skillRod.x;
  10591. let potY = gameUI.skillRod.y;
  10592. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10593. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10594. let disArr = [];
  10595. for (let index = 0; index < outArr.length; index++) {
  10596. let obj = outArr[index];
  10597. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10598. dis = Math.pow(dis, 0.5);
  10599. disArr.push(dis);
  10600. }
  10601. this.tweenArr.push(gameUI.skillRod);
  10602. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10603. })).update = Laya.Handler.create(this, (e, t, c) => {
  10604. let angle = gameUI.skillRod.rotation;
  10605. let xx;
  10606. let yy;
  10607. let temp;
  10608. for (let index = 0; index < outArr.length; index++) {
  10609. temp = outArr[index];
  10610. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10611. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10612. yy -= 20;
  10613. temp.gameObj.x = xx;
  10614. temp.gameObj.y = yy;
  10615. temp.d3BallSrc.setTransPos(xx, yy);
  10616. }
  10617. if (angle <= 60) {
  10618. Laya.Tween.clearAll(gameUI.skillRod);
  10619. this.ballFlyToBag(outArr, 150);
  10620. gameUI.skillRod.visible = false;
  10621. }
  10622. }, null, false);
  10623. }
  10624. runIce() {
  10625. let ballArr = xGame.common.d2World.ballArr;
  10626. this.leveNum *= 2;
  10627. if (this.leveNum >= ballArr.length - 1)
  10628. this.leveNum = ballArr.length - 1;
  10629. let tempArr = [];
  10630. let outArr = [];
  10631. for (let index = 0; index < ballArr.length; index++) {
  10632. if (ballArr[index] instanceof D2RootBallSrc)
  10633. continue;
  10634. tempArr.push(ballArr[index]);
  10635. }
  10636. if (tempArr.length <= 0) {
  10637. this.callback && this.callback(0);
  10638. return;
  10639. }
  10640. xGame.common.botherArr(tempArr);
  10641. for (let index = 0; index < this.leveNum; index++) {
  10642. outArr.push(tempArr[index]);
  10643. }
  10644. this.extraScore = this.leveNum;
  10645. let temp;
  10646. for (let index = 0; index < outArr.length; index++) {
  10647. temp = outArr[index];
  10648. temp.d3BallSrc.playIceEft();
  10649. }
  10650. Laya.timer.once(2000, this, () => {
  10651. for (let index = 0; index < outArr.length; index++) {
  10652. temp = outArr[index];
  10653. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10654. temp.setBallFunc("ice", str);
  10655. }
  10656. this.callback && this.callback(0);
  10657. });
  10658. }
  10659. runFireworks() {
  10660. let allArr = this.getAllBallArr();
  10661. if (allArr.length <= 0) {
  10662. this.callback && this.callback(0);
  10663. return;
  10664. }
  10665. xGame.common.d2World.d2Gan.ui.visible = false;
  10666. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10667. let outArr = [];
  10668. let other = this.leveNum;
  10669. if (other > 0) {
  10670. if (allArr.length > 0) {
  10671. xGame.common.botherArr(allArr);
  10672. if (other >= allArr.length)
  10673. other = allArr.length;
  10674. for (let index = 0; index < other; index++) {
  10675. outArr.push(allArr[index]);
  10676. }
  10677. }
  10678. }
  10679. xGame.common.extraMoveNum = other;
  10680. this.extraScore = other;
  10681. this.addRandmomFireworks(outArr);
  10682. }
  10683. addRandmomFireworks(outArr) {
  10684. Laya.timer.once(1100, this, () => {
  10685. if (outArr.length > 0) {
  10686. xGame.common.d2World.openCheckStill = true;
  10687. this.playedLastSkill = true;
  10688. }
  10689. });
  10690. xGame.soundMgr.playSound("skill_04_02");
  10691. let temp;
  10692. let delay = -200;
  10693. for (let index = 0; index < outArr.length; index++) {
  10694. temp = outArr[index];
  10695. delay += 200;
  10696. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10697. let angle = xGame.common.randomNum(0, 360);
  10698. angle = this.getFireworksAngle(obj);
  10699. let linearPercent = xGame.common.randomNum(45, 80);
  10700. if (!obj.destroyed)
  10701. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10702. });
  10703. }
  10704. }
  10705. getFireworksAngle(obj) {
  10706. let rootBall = xGame.common.d2World.rootBall;
  10707. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10708. }
  10709. resetGame() {
  10710. Laya.timer.clearAll(this);
  10711. if (this.tweenArr) {
  10712. for (let index = 0; index < this.tweenArr.length; index++) {
  10713. Laya.Tween.clearAll(this.tweenArr[index]);
  10714. }
  10715. }
  10716. this.tweenArr = null;
  10717. }
  10718. runGuanYu() {
  10719. xGame.common.d2World.d2Gan.ui.visible = false;
  10720. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10721. let rootBall = xGame.common.d2World.rootBall;
  10722. if (rootBall.isInHole) {
  10723. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10724. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10725. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10726. rootBall.showSelf();
  10727. }
  10728. this.rtStarX = rootBall.gameObj.x;
  10729. this.rtStarY = rootBall.gameObj.y;
  10730. this.knifeTimes = 0;
  10731. this.playedLastSkill = true;
  10732. rootBall.forceRun = true;
  10733. rootBall.rigy.type = "static";
  10734. xGame.common.d2World.openCheckStill = true;
  10735. this.guanyuRandomKnife();
  10736. }
  10737. guanyuRandomKnife() {
  10738. let rootBall = xGame.common.d2World.rootBall;
  10739. let dir = this.getRandDir();
  10740. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10741. console.log("当前angle", angle);
  10742. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10743. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10744. let dis = 324;
  10745. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10746. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10747. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10748. this.rtStarX = rootBall.gameObj.x;
  10749. this.rtStarY = rootBall.gameObj.y;
  10750. this.knifeTimes++;
  10751. let skillLevel;
  10752. if (xGame.common.gameMgr.selfTurn) {
  10753. skillLevel = DataMgr.getBigSkillByIndex(4);
  10754. }
  10755. else {
  10756. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10757. }
  10758. if (!skillLevel)
  10759. skillLevel = 1;
  10760. skillLevel += 2;
  10761. if (this.knifeTimes < skillLevel) {
  10762. Laya.timer.once(400, this, () => {
  10763. this.guanyuRandomKnife();
  10764. });
  10765. }
  10766. else {
  10767. rootBall.forceRun = false;
  10768. rootBall.rigy.type = "dynamic";
  10769. xGame.common.extraMoveNum = skillLevel;
  10770. }
  10771. }));
  10772. }
  10773. getRandDir() {
  10774. let rootBall = xGame.common.d2World.rootBall;
  10775. let allBall = this.getAllBallArr();
  10776. let target = xGame.common.getRandArrEle(allBall);
  10777. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10778. return this.knifeV2;
  10779. }
  10780. cloneKnife(x, y, rotation) {
  10781. let parent = xGame.common.d3World.knifeRoot;
  10782. let prefab = xGame.common.d3World.knife;
  10783. let clone = prefab.clone();
  10784. parent.addChild(clone);
  10785. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10786. clone.transform.localPositionX = this.knifeV3.x;
  10787. clone.transform.localPositionY = 0;
  10788. clone.transform.localPositionZ = this.knifeV3.z;
  10789. clone.transform.localRotationEulerX = 0;
  10790. clone.transform.localRotationEulerY = rotation;
  10791. clone.transform.localRotationEulerZ = 0;
  10792. clone.active = true;
  10793. return clone;
  10794. }
  10795. cloneGuanYuEft(x, y, angle) {
  10796. return;
  10797. let parent = xGame.common.gameUI.ui.guanyuNode;
  10798. let eft = new ui_guanyuAni();
  10799. eft.parent = parent;
  10800. eft.x = x;
  10801. eft.y = y;
  10802. eft.rotation = angle;
  10803. }
  10804. }
  10805. class ui_UIWordsList extends fgui.GComponent {
  10806. static createInstance() {
  10807. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10808. }
  10809. onConstruct() {
  10810. this.c1 = this.getController("c1");
  10811. this.n74 = (this.getChild("n74"));
  10812. this.clickNode = (this.getChild("clickNode"));
  10813. this.myNode = (this.getChild("myNode"));
  10814. this.n68 = (this.getChild("n68"));
  10815. this.n66 = (this.getChild("n66"));
  10816. this.n55 = (this.getChild("n55"));
  10817. this.wordsBtn = (this.getChild("wordsBtn"));
  10818. this.emotionBtn = (this.getChild("emotionBtn"));
  10819. this.mybggg = (this.getChild("mybggg"));
  10820. this.wordsList = (this.getChild("wordsList"));
  10821. this.emotionList = (this.getChild("emotionList"));
  10822. this.myRoot = (this.getChild("myRoot"));
  10823. }
  10824. }
  10825. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10826. class EmotionDisplay {
  10827. constructor(index, ui) {
  10828. this.ui = ui;
  10829. this.index = index;
  10830. this.ui.onClick(this, this.clickSelf);
  10831. this.updateSelf();
  10832. }
  10833. updateSelf() {
  10834. let data = cfgTable.emotionData[this.index + 1];
  10835. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10836. }
  10837. clickSelf() {
  10838. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10839. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10840. xGame.common.talkMgr.closeTalkView();
  10841. }
  10842. }
  10843. class WordsDisplay {
  10844. constructor(index, ui) {
  10845. this.ui = ui;
  10846. this.index = index;
  10847. this.ui.onClick(this, this.clickSelf);
  10848. this.updateSelf();
  10849. }
  10850. updateSelf() {
  10851. let data = cfgTable.talkwordsData[this.index + 1];
  10852. this.ui.txt.text = data.msg;
  10853. }
  10854. clickSelf() {
  10855. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10856. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10857. xGame.common.talkMgr.closeTalkView();
  10858. }
  10859. }
  10860. class UIWordsList extends UIBase {
  10861. constructor() {
  10862. super();
  10863. }
  10864. onConstructor() {
  10865. this.ui = ui_UIWordsList.createInstance();
  10866. this.contentPane = this.ui;
  10867. this.isEject = false;
  10868. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10869. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10870. this.addUIClick(this.ui.clickNode, this.hide);
  10871. this.initTalkList();
  10872. this.initEmotionList();
  10873. }
  10874. show() {
  10875. super.show();
  10876. this.setGlobalFont(this.ui);
  10877. }
  10878. initTalkList() {
  10879. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10880. let data = cfgTable.talkwordsData;
  10881. let length = Object.keys(data).length;
  10882. this.ui.wordsList.numItems = length;
  10883. }
  10884. initEmotionList() {
  10885. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10886. let data = cfgTable.emotionData;
  10887. let length = Object.keys(data).length;
  10888. this.ui.emotionList.numItems = length;
  10889. }
  10890. renderTalkItem(index, obj) {
  10891. let temp = new WordsDisplay(index, obj);
  10892. }
  10893. renderEmotionItem(index, obj) {
  10894. let temp = new EmotionDisplay(index, obj);
  10895. }
  10896. openTalkList() {
  10897. this.ui.c1.selectedIndex = 0;
  10898. }
  10899. openEmotionList() {
  10900. this.ui.c1.selectedIndex = 1;
  10901. }
  10902. }
  10903. UIWordsList.uiName = "UIWordsList";
  10904. class TalkMgr {
  10905. constructor() {
  10906. this.aiSpeak = true;
  10907. this.emotionList = [];
  10908. this.talkList = [];
  10909. this.addEvent();
  10910. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10911. this.emotionList = [];
  10912. this.talkList = [];
  10913. for (let k in cfgTable.emotionData) {
  10914. this.emotionList.push(cfgTable.emotionData[k].id);
  10915. }
  10916. for (let k in cfgTable.talkwordsData) {
  10917. this.talkList.push(cfgTable.talkwordsData[k].id);
  10918. }
  10919. }
  10920. addEvent() {
  10921. let ui = xGame.common.gameUI.ui;
  10922. ui.wordsBtn.visible = true;
  10923. ui.wordsBtn.onClick(this, this.openTalkView);
  10924. ui.aiWordsBtn.visible = true;
  10925. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10926. }
  10927. openTalkView() {
  10928. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10929. xGame.uiMgr.Show(UIWordsList);
  10930. }
  10931. closeTalkView() {
  10932. xGame.uiMgr.Hide(UIWordsList);
  10933. }
  10934. clickAIState() {
  10935. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10936. this.aiSpeak = !this.aiSpeak;
  10937. this.changeAIState(this.aiSpeak);
  10938. }
  10939. changeAIState(speak) {
  10940. this.aiSpeak = speak;
  10941. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10942. if (speak) {
  10943. btn.c1.selectedIndex = 0;
  10944. }
  10945. else {
  10946. btn.c1.selectedIndex = 1;
  10947. }
  10948. }
  10949. showSelfTalk(wordsId) {
  10950. let ui = xGame.common.gameUI.ui;
  10951. ui.selfTalk.visible = true;
  10952. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10953. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10954. ui.selfTalk.t0.play();
  10955. }
  10956. showSelfEmotion(emotionId) {
  10957. let ui = xGame.common.gameUI.ui;
  10958. ui.selfTalk.visible = true;
  10959. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10960. this.selfSpine && this.selfSpine.dispose();
  10961. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10962. let spineData = cfgTable.emotionData[emotionId].spine;
  10963. this.selfSpine = new SpineMgr(spineData, () => {
  10964. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10965. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10966. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10967. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10968. });
  10969. ui.selfTalk.t0.play();
  10970. }
  10971. showAITalk(wordsId) {
  10972. if (!this.aiSpeak)
  10973. return;
  10974. if (DataMgr.gameData.gameCount < 2)
  10975. return;
  10976. if (wordsId < 1)
  10977. wordsId = this.getRandTalk();
  10978. let ui = xGame.common.gameUI.ui;
  10979. ui.aiTalk.visible = true;
  10980. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10981. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10982. ui.aiTalk.t0.play();
  10983. }
  10984. getRandTalk() {
  10985. let rand = xGame.tools.random(0, this.talkList.length);
  10986. return this.emotionList[rand];
  10987. }
  10988. getRandEmotion() {
  10989. let rand = xGame.tools.random(0, this.emotionList.length);
  10990. return this.emotionList[rand];
  10991. }
  10992. showAIEmotion(emotionId) {
  10993. if (!this.aiSpeak)
  10994. return;
  10995. if (DataMgr.gameData.gameCount < 2)
  10996. return;
  10997. if (emotionId < 1)
  10998. emotionId = this.getRandEmotion();
  10999. let ui = xGame.common.gameUI.ui;
  11000. ui.aiTalk.visible = true;
  11001. ui.aiTalk.myNode.c1.selectedIndex = 0;
  11002. this.aiSpine && this.aiSpine.dispose();
  11003. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11004. let spineData = cfgTable.emotionData[emotionId].spine;
  11005. this.aiSpine = new SpineMgr(spineData, () => {
  11006. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  11007. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  11008. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  11009. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  11010. });
  11011. ui.aiTalk.t0.play();
  11012. }
  11013. resetGame() {
  11014. let ui = xGame.common.gameUI.ui;
  11015. ui.aiTalk.visible = false;
  11016. ui.selfTalk.visible = false;
  11017. this.aiSpine && this.aiSpine.dispose();
  11018. this.selfSpine && this.selfSpine.dispose();
  11019. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11020. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  11021. this.closeTalkView();
  11022. }
  11023. }
  11024. class WordsMgr {
  11025. constructor() {
  11026. this.comboTimes = 1;
  11027. this.skillTimes = 0;
  11028. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  11029. this.comboSpine = new SpineMgr("yxz_liangan");
  11030. this.skillSpine = new SpineMgr("yiganxqiu");
  11031. this.scoreSpine = new SpineMgr("defen");
  11032. }
  11033. setClassicCombo(isInterrupt) {
  11034. if (isInterrupt) {
  11035. this.comboTimes = 0;
  11036. }
  11037. }
  11038. playClassicWords(type, callback) {
  11039. this.callback = callback;
  11040. let aniIndex = type;
  11041. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11042. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11043. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  11044. mySpine.destroy(true);
  11045. this.playClassicTimes();
  11046. });
  11047. }
  11048. playClassicTimes() {
  11049. this.comboTimes++;
  11050. if (this.comboTimes <= 1) {
  11051. this.callback && this.callback();
  11052. }
  11053. else {
  11054. let aniIndex = this.comboTimes - 1;
  11055. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11056. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11057. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  11058. mySpine.destroy(true);
  11059. this.callback && this.callback();
  11060. });
  11061. }
  11062. }
  11063. playBigSkillTimes(times, callback) {
  11064. if (times <= 0) {
  11065. callback && callback();
  11066. return;
  11067. }
  11068. this.callback = callback;
  11069. let pre = "sz_0";
  11070. let aniIndex = 0;
  11071. this.getWordsImg(times, pre, () => {
  11072. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11073. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11074. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  11075. let r1 = ``;
  11076. let r2 = ``;
  11077. if (times <= 9) {
  11078. r1 = `res/d2Res/${pre}${times}.png`;
  11079. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11080. aniIndex = 0;
  11081. }
  11082. else {
  11083. r1 = `res/d2Res/${pre}${times % 10}.png`;
  11084. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  11085. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  11086. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  11087. aniIndex = 1;
  11088. }
  11089. this.skillSpine.play(data, aniIndex, false, parent, () => {
  11090. mySpine.destroy(true);
  11091. xGame.common.gameMgr.playSkillTips();
  11092. this.playScore(times);
  11093. xGame.common.playRandomMutiBallBigSkillSound();
  11094. }, mySpine);
  11095. });
  11096. }
  11097. playScore(score) {
  11098. let pre = "sz_";
  11099. let aniIndex = 0;
  11100. this.getWordsImg(score, pre, () => {
  11101. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11102. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11103. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  11104. let r1 = ``;
  11105. let r2 = ``;
  11106. if (score <= 9) {
  11107. r1 = `res/d2Res/${pre}${score}.png`;
  11108. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11109. aniIndex = 0;
  11110. }
  11111. else {
  11112. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11113. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11114. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11115. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11116. aniIndex = 1;
  11117. }
  11118. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11119. mySpine.destroy(true);
  11120. this.callback && this.callback();
  11121. }, mySpine);
  11122. });
  11123. }
  11124. getWordsImg(number, pre = "", callback) {
  11125. let arr = [];
  11126. if (number <= 9) {
  11127. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11128. }
  11129. else {
  11130. 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 });
  11131. }
  11132. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11133. callback && callback();
  11134. }));
  11135. }
  11136. }
  11137. class ui_UIRodMethod extends fgui.GComponent {
  11138. static createInstance() {
  11139. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11140. }
  11141. onConstruct() {
  11142. this.n24 = (this.getChild("n24"));
  11143. this.white = (this.getChild("white"));
  11144. this.dot = (this.getChild("dot"));
  11145. this.sureBtn = (this.getChild("sureBtn"));
  11146. this.n20 = (this.getChild("n20"));
  11147. this.n21 = (this.getChild("n21"));
  11148. this.n22 = (this.getChild("n22"));
  11149. this.n23 = (this.getChild("n23"));
  11150. this.n5 = (this.getChild("n5"));
  11151. this.n14 = (this.getChild("n14"));
  11152. this.t0 = this.getTransition("t0");
  11153. }
  11154. }
  11155. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11156. class UIRodMethod extends UIBase {
  11157. constructor() {
  11158. super();
  11159. this.isPressd = false;
  11160. }
  11161. onConstructor() {
  11162. this.ui = ui_UIRodMethod.createInstance();
  11163. this.contentPane = this.ui;
  11164. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11165. this.moveDir = new Laya.Vector2();
  11166. this.moveDest = new Laya.Vector2();
  11167. this.centerPos = new Laya.Vector2();
  11168. xGame.common.uiRodMethod = this;
  11169. }
  11170. show() {
  11171. super.show();
  11172. xGame.common.gameMgr.gamePause = true;
  11173. this.openPressDotEvent();
  11174. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11175. this.centerPos.x = this.ui.white.x;
  11176. this.centerPos.y = this.ui.white.y;
  11177. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11178. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11179. this.setDot();
  11180. this.setGlobalFont(this.ui);
  11181. }
  11182. setDot() {
  11183. this.ui.dot.x = this.moveDest.x;
  11184. this.ui.dot.y = this.moveDest.y;
  11185. }
  11186. closeSelf() {
  11187. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11188. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11189. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11190. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11191. xGame.common.gameMgr.gamePause = false;
  11192. this.hide();
  11193. }
  11194. openPressDotEvent() {
  11195. this.closePressDotEvent();
  11196. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11197. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11198. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11199. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11200. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11201. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11202. }
  11203. closePressDotEvent() {
  11204. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11205. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11206. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11207. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11208. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11209. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11210. }
  11211. onDown(e) {
  11212. if (e.type == Laya.Event.MOUSE_DOWN)
  11213. this.isPressd = true;
  11214. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11215. this.isPressd = false;
  11216. if (!this.isPressd)
  11217. return;
  11218. this.moveDest.x = e.stageX;
  11219. this.moveDest.y = e.stageY;
  11220. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11221. if (dis > 6724) {
  11222. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11223. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11224. }
  11225. this.setDot();
  11226. }
  11227. resetRod() {
  11228. this.ui.dot.x = this.ui.white.x;
  11229. this.ui.dot.y = this.ui.white.y;
  11230. this.gameRod.dot.x = this.gameRod.bg.x;
  11231. this.gameRod.dot.y = this.gameRod.bg.y;
  11232. xGame.common.rodOffest.x = 0;
  11233. xGame.common.rodOffest.y = 0;
  11234. }
  11235. }
  11236. UIRodMethod.uiName = "UIRodMethod";
  11237. class UIGame extends UIBase {
  11238. constructor() {
  11239. super();
  11240. this.powerNum = 0;
  11241. this.isD3Inited = false;
  11242. this.isPrePlay = false;
  11243. this.isMoveRod = false;
  11244. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11245. this.rulerDis = 20;
  11246. this.rulerOffset = 0;
  11247. }
  11248. onConstructor() {
  11249. this.ui = ui_UIGame.createInstance();
  11250. this.contentPane = this.ui;
  11251. this.ui.x += xGame.common.sysOffestNum;
  11252. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11253. this.isEject = false;
  11254. xGame.common.gameUI = this;
  11255. this.initSelf();
  11256. }
  11257. isTurnSelf() {
  11258. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11259. return true;
  11260. }
  11261. }
  11262. initSelf() {
  11263. let topUI = this.ui.topNode;
  11264. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11265. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11266. this.barInfo = {};
  11267. this.barInfo.curY = 0;
  11268. this.barInfo.height = this.ui.powerNode.height;
  11269. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11270. this.barInfo.powerStartY = this.ui.powerNode.y;
  11271. xGame.common.aiPlayer = new AIPlayer();
  11272. xGame.common.gameMgr = new GameMgr();
  11273. xGame.common.skillMgr = new SkillMgr();
  11274. xGame.common.wordsMgr = new WordsMgr();
  11275. xGame.common.talkMgr = new TalkMgr();
  11276. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11277. });
  11278. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11279. });
  11280. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11281. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11282. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11283. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11284. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11285. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11286. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11287. }
  11288. getGanZiImg() {
  11289. let index = DataMgr.getCurBallRod();
  11290. let data = cfgTable.ballrodData[index + 1];
  11291. let gan_url = xGame.common.getGameIconUrl(data.img);
  11292. this.ui.powerNode.showImg.url = gan_url;
  11293. }
  11294. returnHome() {
  11295. let tips = "Are you sure to exit the game?";
  11296. let woman = "Boss, why don't you play for a while longer?";
  11297. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11298. }
  11299. addRodMethodClick() {
  11300. if (this.isTurnSelf()) {
  11301. xGame.uiMgr.Show(UIRodMethod);
  11302. }
  11303. }
  11304. clickHelpLineBtn(force = false) {
  11305. if (!this.isTurnSelf())
  11306. return;
  11307. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11308. if (success) {
  11309. xGame.common.longHelpLine = true;
  11310. xGame.common.d2World.getHelpLine();
  11311. Moyu.sendDataEvent("guideNum");
  11312. }
  11313. else {
  11314. }
  11315. });
  11316. }
  11317. renderSelfDisplayBalls(index, target) {
  11318. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11319. target.myImg.url = xGame.common.getGameIconUrl(str);
  11320. }
  11321. renderAIDisplayBalls(index, target) {
  11322. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11323. target.myImg.url = xGame.common.getGameIconUrl(str);
  11324. ;
  11325. }
  11326. updateMode() {
  11327. if (xGame.common.gameMode == GameMode.classic) {
  11328. this.ui.topNode.scoreNode.visible = false;
  11329. }
  11330. else if (xGame.common.gameMode == GameMode.bigMove) {
  11331. this.ui.topNode.scoreNode.visible = true;
  11332. }
  11333. }
  11334. show() {
  11335. super.show();
  11336. this.ui.alpha = 0;
  11337. this.updateSelf();
  11338. xGame.common.gameMgr.gamePause = false;
  11339. xGame.common.gameUI.ui.blackAni.visible = false;
  11340. xGame.common.gameUI.ui.whiteAni.visible = false;
  11341. this.ui.powerEft.visible = false;
  11342. this.ui.colorNode.visible = false;
  11343. this.updateHead();
  11344. let curUse = DataMgr.getCurBallRod();
  11345. this.getGanZiImg();
  11346. this.yinDaoForLianxi();
  11347. this.setGlobalFont(this.ui);
  11348. }
  11349. yinDaoForLianxi() {
  11350. let g = DataMgr.getSkillGuide();
  11351. if (g === 0) {
  11352. console.log('zh:默认的引导还没有完毕');
  11353. return;
  11354. }
  11355. let lianXiGuide = DataMgr.getLianXiGuide();
  11356. console.log('zh:lianXiGuide=', lianXiGuide);
  11357. if (lianXiGuide === 0) {
  11358. this.ui.n_lxms_yd1.visible = true;
  11359. console.log('zh:yinDaoForLianxi 111 set ok');
  11360. }
  11361. else {
  11362. this.ui.n_lxms_yd1.visible = false;
  11363. console.log('zh:无需引导11');
  11364. }
  11365. DataMgr.setLianXiGuide(0);
  11366. }
  11367. updateSelf() {
  11368. if (xGame.common.gameMode == GameMode.classic) {
  11369. this.ui.c1.selectedIndex = 0;
  11370. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11371. this.ui.topNode.middleNode.visible = true;
  11372. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11373. }
  11374. else if (xGame.common.gameMode == GameMode.bigMove) {
  11375. this.ui.c1.selectedIndex = 0;
  11376. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11377. this.ui.topNode.middleNode.visible = false;
  11378. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11379. let rand = xGame.common.randomNum(1, max);
  11380. let guide = DataMgr.getSkillGuide();
  11381. if (guide == 0)
  11382. rand = 1;
  11383. xGame.common.bigMoveLevelIndex = rand;
  11384. }
  11385. else if (xGame.common.gameMode == GameMode.placeBall) {
  11386. console.log('zh:练习模式...');
  11387. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11388. this.ui.c1.selectedIndex = 1 + data.type;
  11389. this.ui.alpha = 1;
  11390. this.startGame();
  11391. }
  11392. this.updateMode();
  11393. this.initD3world();
  11394. this.initD2world();
  11395. }
  11396. startGame() {
  11397. this.ui.snowNode.visible = Math.random() <= 0.1;
  11398. this.ui.d2Node.visible = false;
  11399. xGame.common.d3World.d3Hand.gameObj.active = false;
  11400. xGame.common.d3World.tableSrc.init();
  11401. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11402. this.cameraViewChange(() => {
  11403. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11404. switch (xGame.common.gameMode) {
  11405. case GameMode.classic:
  11406. xGame.common.d3World.d3Hand.gameObj.active = true;
  11407. this.playPutBallD3Ani();
  11408. break;
  11409. case GameMode.bigMove:
  11410. this.enterGame();
  11411. Laya.timer.once(500, this, () => {
  11412. this.ui.topNode.middleNode.visible = true;
  11413. this.ui.topNode.middleNode.t0.play();
  11414. });
  11415. break;
  11416. case GameMode.placeBall:
  11417. this.enterGame();
  11418. break;
  11419. default:
  11420. break;
  11421. }
  11422. });
  11423. PlatMgr.showBanner(false);
  11424. }
  11425. enterGame() {
  11426. this.ui.d2Node.visible = true;
  11427. xGame.common.d3World.d3Hand.gameObj.active = false;
  11428. xGame.common.showOneCamera("mainCamera");
  11429. Moyu.recordGame(30, true);
  11430. if (!this.isPrePlay) {
  11431. this.isPrePlay = true;
  11432. xGame.common.d3World.prePlayEft();
  11433. }
  11434. xGame.common.gameMgr.gameReady();
  11435. this.openAllEvent();
  11436. this.ui.snowNode.visible = false;
  11437. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11438. this.ui.helpBtn.visible = condition;
  11439. }
  11440. showHelpLineGuide() {
  11441. let longGuide = DataMgr.getGuideHelpLine();
  11442. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11443. this.ui.helpBtn.visible = true;
  11444. this.ui.guideNode.visible = true;
  11445. }
  11446. }
  11447. setTurnAlpha(alpha) {
  11448. this.ui.keduNode.alpha = alpha;
  11449. this.ui.ganNode.alpha = alpha;
  11450. this.ui.rodMethodNode.alpha = alpha;
  11451. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11452. }
  11453. cameraViewChange(callback) {
  11454. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11455. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11456. xGame.common.showOneCamera("visitAngle");
  11457. cameraSrc.localRotationEulerY = 180;
  11458. cameraSrc.localRotationEulerZ = 0;
  11459. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11460. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11461. callback && callback();
  11462. }));
  11463. }));
  11464. }
  11465. playPutBallD3Ani() {
  11466. xGame.common.showOneCamera("mainCamera");
  11467. let handSrc = xGame.common.d3World.d3Hand;
  11468. handSrc.gameObj.active = true;
  11469. handSrc.transform.localPositionZ = 3;
  11470. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11471. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11472. handSrc.gameObj.active = false;
  11473. this.enterGame();
  11474. }), 400);
  11475. }));
  11476. }
  11477. updateHead() {
  11478. let user = Moyu.getUserInfo();
  11479. this.ui.topNode.selfNameTxt.text = user.nickName;
  11480. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11481. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11482. if (DataMgr.getSkillGuide() < 1) {
  11483. this.ui.topNode.aiNameTxt.text = 'billiards';
  11484. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11485. }
  11486. else {
  11487. this.ui.topNode.aiNameTxt.text = aiData.name;
  11488. let randNo = Math.floor(Math.random() * 10) + 1;
  11489. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11490. }
  11491. }
  11492. initD2world() {
  11493. let node = this.ui.d2Root.displayObject;
  11494. let src = node.getComponent(D2World);
  11495. if (!src) {
  11496. xGame.common.d2World = node.addComponent(D2World);
  11497. }
  11498. xGame.common.d2World.initSelf();
  11499. }
  11500. initD3world() {
  11501. if (this.isD3Inited)
  11502. return;
  11503. this.isD3Inited = true;
  11504. let scene3D = xGame.common.d3Scene;
  11505. this.ui.d3Root.displayObject.addChild(scene3D);
  11506. scene3D.active = true;
  11507. xGame.common.d3World.tableSrc.setBorderPos();
  11508. }
  11509. onRootMove(e) {
  11510. let rootBall = xGame.common.d2World.rootBall;
  11511. this.ui.moveNode.x = e.x;
  11512. this.ui.moveNode.y = e.y;
  11513. rootBall.gameObj.x = e.x;
  11514. rootBall.gameObj.y = e.y;
  11515. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11516. }
  11517. aiRootMove(move) {
  11518. if (move)
  11519. this.hideBallUI();
  11520. else {
  11521. this.showBallUI();
  11522. xGame.common.d2World.getHelpLine();
  11523. }
  11524. }
  11525. aiForce(type, force = 0) {
  11526. this.pressTarget = PressType.powerNode;
  11527. if (type == 1)
  11528. this.onEventUp({ force: true });
  11529. else if (type == 2)
  11530. this.onEventMove({ stageY: force, force: true });
  11531. }
  11532. onEventPress(e) {
  11533. if (e.stopPropagation)
  11534. e.stopPropagation();
  11535. if (!this.isTurnSelf())
  11536. return;
  11537. let target = e.target;
  11538. switch (target) {
  11539. case this.ui.myPowerNode.displayObject:
  11540. this.pressTarget = PressType.powerNode;
  11541. this.barInfo.curY = e.stageY;
  11542. this.updateBarInfo();
  11543. break;
  11544. case this.ui.moveNode.displayObject:
  11545. this.pressTarget = PressType.moveNode;
  11546. this.hideBallUI();
  11547. this.eventObj.curX = this.ui.moveNode.x;
  11548. this.eventObj.curY = this.ui.moveNode.y;
  11549. this.ui.moveNode.finger.visible = false;
  11550. this.eventObj.lastX = e.stageX;
  11551. this.eventObj.lastY = e.stageY;
  11552. break;
  11553. case this.ui.rulerClickNode.displayObject:
  11554. this.pressTarget = PressType.rulerNode;
  11555. this.eventObj.lastY = e.stageY;
  11556. break;
  11557. case this.ui.d2Root.displayObject:
  11558. this.pressTarget = PressType.d2Root;
  11559. this.eventObj.lastX = e.stageX;
  11560. this.eventObj.lastY = e.stageY;
  11561. this.eventObj.starX = e.stageX;
  11562. this.eventObj.starY = e.stageY;
  11563. this.eventObj.curX = 0;
  11564. this.eventObj.curY = 0;
  11565. xGame.common.d2World.d2Gan.setGanLastInfo();
  11566. this.rulerOffset = 0;
  11567. break;
  11568. default:
  11569. break;
  11570. }
  11571. }
  11572. onEventMove(e) {
  11573. if (e.stopPropagation)
  11574. e.stopPropagation();
  11575. if (e && e.force) {
  11576. }
  11577. else {
  11578. if (!this.isTurnSelf())
  11579. return;
  11580. }
  11581. switch (this.pressTarget) {
  11582. case PressType.powerNode:
  11583. this.barInfo.curY = e.stageY;
  11584. this.updateBarInfo();
  11585. this.isMoveRod = true;
  11586. break;
  11587. case PressType.moveNode:
  11588. let rootBall = xGame.common.d2World.rootBall;
  11589. let radius = rootBall.gameObj.width / 2;
  11590. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11591. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11592. let border = xGame.common.d2World.borderRect;
  11593. if (curX <= border.x + radius)
  11594. curX = border.x + radius;
  11595. else if (curX >= border.x + border.width - radius)
  11596. curX = border.x + border.width - radius;
  11597. if (curY <= border.y + radius)
  11598. curY = border.y + radius;
  11599. else if (curY >= border.y + border.height - radius)
  11600. curY = border.y + border.height - radius;
  11601. if (xGame.common.gameMgr.isOpenBall) {
  11602. if (curX >= border.x + border.openBallW - radius)
  11603. curX = border.x + border.openBallW - radius;
  11604. }
  11605. this.ui.moveNode.x = curX;
  11606. this.ui.moveNode.y = curY;
  11607. rootBall.gameObj.x = curX;
  11608. rootBall.gameObj.y = curY;
  11609. rootBall.d3BallSrc.setTransPos(curX, curY);
  11610. this.isMoveRod = true;
  11611. break;
  11612. case PressType.rulerNode:
  11613. let yy = e.stageY - this.eventObj.lastY;
  11614. this.eventObj.lastY = e.stageY;
  11615. let ruler1 = this.ui.rulerNode.img1;
  11616. let ruler2 = this.ui.rulerNode.img2;
  11617. ruler1.y += yy;
  11618. ruler2.y += yy;
  11619. this.rulerOffset += yy;
  11620. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11621. this.rulerOffset = 0;
  11622. xGame.soundMgr.playSound("inch", 1, 10);
  11623. }
  11624. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11625. let h = ruler1.height;
  11626. this.checkGuide();
  11627. this.checkGuideForLxms();
  11628. this.isMoveRod = true;
  11629. if (ruler1.y >= h) {
  11630. ruler1.y = -h;
  11631. ruler2.y = 0;
  11632. return;
  11633. }
  11634. else if (ruler1.y <= -h) {
  11635. ruler1.y = h;
  11636. ruler2.y = 0;
  11637. return;
  11638. }
  11639. if (ruler2.y >= h) {
  11640. ruler2.y = -h;
  11641. ruler1.y = 0;
  11642. return;
  11643. }
  11644. else if (ruler2.y <= -h) {
  11645. ruler2.y = h;
  11646. ruler1.y = 0;
  11647. return;
  11648. }
  11649. break;
  11650. case PressType.d2Root:
  11651. this.eventObj.curX = e.stageX;
  11652. this.eventObj.curY = e.stageY;
  11653. let offset = this.checkRodMoveDir();
  11654. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11655. this.eventObj.lastX = e.stageX;
  11656. this.eventObj.lastY = e.stageY;
  11657. break;
  11658. default:
  11659. break;
  11660. }
  11661. }
  11662. onEventUp(e) {
  11663. if (e.stopPropagation)
  11664. e.stopPropagation();
  11665. if (e && e.force) {
  11666. }
  11667. else {
  11668. if (!this.isTurnSelf())
  11669. return;
  11670. }
  11671. switch (this.pressTarget) {
  11672. case PressType.powerNode:
  11673. this.ui.powerNode.value = 0;
  11674. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11675. this.ui.powerTxt.text = "";
  11676. if (this.powerNum > 0) {
  11677. xGame.eventMgr.event(BALL_SHOOT);
  11678. xGame.common.d2World.shoot(this.powerNum);
  11679. xGame.common.d2World.d2Gan.shoot();
  11680. xGame.common.d2World.d2HelpLine.shoot();
  11681. this.finishGuide();
  11682. this.finishGuideForLxms();
  11683. this.ui.powerEft.visible = false;
  11684. this.ui.colorNode.visible = false;
  11685. let ganStr = "";
  11686. if (this.powerNum <= 30) {
  11687. ganStr = "gan_30";
  11688. }
  11689. else if (this.powerNum <= 60) {
  11690. ganStr = "gan_50";
  11691. }
  11692. else {
  11693. ganStr = "gan_80";
  11694. }
  11695. xGame.soundMgr.playSound(ganStr);
  11696. }
  11697. break;
  11698. case PressType.moveNode:
  11699. let rootBall = xGame.common.d2World.rootBall;
  11700. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11701. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11702. let isIntersect = this.judgeBallIntersect();
  11703. if (isIntersect) {
  11704. this.ui.moveNode.x = lastX;
  11705. this.ui.moveNode.y = lastY;
  11706. rootBall.gameObj.x = lastX;
  11707. rootBall.gameObj.y = lastY;
  11708. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11709. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11710. }
  11711. else {
  11712. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11713. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11714. }
  11715. this.showBallUI();
  11716. this.ui.moveNode.finger.visible = true;
  11717. xGame.common.d2World.getHelpLine();
  11718. break;
  11719. case PressType.rulerNode:
  11720. break;
  11721. case PressType.d2Root:
  11722. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11723. if (dis <= 25) {
  11724. this.moveToClickDot(e);
  11725. }
  11726. break;
  11727. default:
  11728. break;
  11729. }
  11730. this.pressTarget = -1;
  11731. }
  11732. checkGuide() {
  11733. let guide = DataMgr.getSkillGuide();
  11734. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11735. xGame.common.guideStep++;
  11736. xGame.common.gameUI.ui.guide2.visible = false;
  11737. xGame.common.gameUI.ui.guide3.visible = true;
  11738. }
  11739. }
  11740. checkGuideForLxms() {
  11741. let guide = DataMgr.getLianXiGuide();
  11742. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 2) {
  11743. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  11744. xGame.common.gameUI.ui.n_lxms_yd3.visible = true;
  11745. xGame.common.guideStepForLianXi = 3;
  11746. }
  11747. }
  11748. finishGuide() {
  11749. let guide = DataMgr.getSkillGuide();
  11750. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11751. xGame.common.guideStep = 10;
  11752. this.closeAllGuide();
  11753. console.log('zh: 新手引导完毕');
  11754. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11755. }
  11756. }
  11757. finishGuideForLxms() {
  11758. let guide = DataMgr.getLianXiGuide();
  11759. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  11760. xGame.common.guideStepForLianXi = 3;
  11761. DataMgr.setLianXiGuide(1);
  11762. this.closeAllGuideForLxms();
  11763. console.log('zh: lxms新手引导完毕');
  11764. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11765. }
  11766. }
  11767. closeAllGuide() {
  11768. xGame.common.gameUI.ui.guide1.visible = false;
  11769. xGame.common.gameUI.ui.guide2.visible = false;
  11770. xGame.common.gameUI.ui.guide3.visible = false;
  11771. }
  11772. closeAllGuideForLxms() {
  11773. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  11774. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  11775. xGame.common.gameUI.ui.n_lxms_yd3.visible = false;
  11776. }
  11777. updateBarInfo() {
  11778. let star = this.ui.powerNode.y;
  11779. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11780. if (rate >= 1)
  11781. rate = 1;
  11782. if (rate <= 0)
  11783. rate = 0;
  11784. this.powerNum = Math.ceil(rate * 100);
  11785. this.ui.powerNode.value = this.powerNum;
  11786. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11787. this.ui.colorNode.value = this.powerNum;
  11788. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11789. this.ui.powerEft.visible = this.powerNum != 0;
  11790. this.ui.colorNode.visible = this.powerNum != 0;
  11791. this.ui.powerTxt.text = this.powerNum + "";
  11792. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11793. }
  11794. forceCancel() {
  11795. this.ui.powerNode.value = 0;
  11796. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11797. this.ui.powerTxt.text = "";
  11798. }
  11799. checkRodMoveDir() {
  11800. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11801. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11802. if (tempX >= 0 && tempY <= 0) {
  11803. return this.checkDir();
  11804. }
  11805. else if (tempX < 0 && tempY < 0) {
  11806. return this.checkDir(1, -1);
  11807. }
  11808. else if (tempX < 0 && tempY > 0) {
  11809. return this.checkDir(-1, -1);
  11810. }
  11811. else {
  11812. return this.checkDir(-1, 1);
  11813. }
  11814. }
  11815. checkDir(flagX = 1, flagY = 1) {
  11816. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11817. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11818. if (offsetY == 0) {
  11819. return offsetX * flagX;
  11820. }
  11821. if (offsetX == 0) {
  11822. return offsetY * flagY;
  11823. }
  11824. let angle = offsetY / offsetX;
  11825. if (Math.abs(angle) >= 1) {
  11826. return offsetY * flagY;
  11827. }
  11828. else {
  11829. return offsetX * flagX;
  11830. }
  11831. }
  11832. judgeBallIntersect() {
  11833. let rootBall = xGame.common.d2World.rootBall;
  11834. let ballArr = xGame.common.d2World.ballArr;
  11835. let radius = rootBall.gameObj.width / 2;
  11836. let temp;
  11837. let isIntersect = false;
  11838. for (let index = 0; index < ballArr.length; index++) {
  11839. temp = ballArr[index];
  11840. if (temp.number == rootBall.number)
  11841. continue;
  11842. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11843. if (isIntersect) {
  11844. break;
  11845. }
  11846. }
  11847. return isIntersect;
  11848. }
  11849. hideBallUI() {
  11850. let d2Gan = xGame.common.d2World.d2Gan;
  11851. if (!d2Gan.ui.isDisposed)
  11852. d2Gan.ui.visible = false;
  11853. let d2Help = xGame.common.d2World.d2HelpLine;
  11854. if (!d2Help.ui.isDisposed)
  11855. d2Help.ui.visible = false;
  11856. let rootBall = xGame.common.d2World.rootBall;
  11857. if (!rootBall.destroyed) {
  11858. rootBall.gameObj.active = false;
  11859. }
  11860. }
  11861. showBallUI() {
  11862. let d2Gan = xGame.common.d2World.d2Gan;
  11863. if (!d2Gan.ui.isDisposed)
  11864. d2Gan.ui.visible = true;
  11865. let d2Help = xGame.common.d2World.d2HelpLine;
  11866. if (!d2Help.ui.isDisposed)
  11867. d2Help.ui.visible = true;
  11868. let rootBall = xGame.common.d2World.rootBall;
  11869. if (!rootBall.destroyed) {
  11870. rootBall.gameObj.active = true;
  11871. }
  11872. }
  11873. moveToClickDot(e) {
  11874. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11875. let root = xGame.common.d2World.rootBall.gameObj;
  11876. let xx = e.stageX - xGame.common.sysOffestNum;
  11877. let yy = e.stageY;
  11878. let x = xx - root.x;
  11879. let y = yy - root.y;
  11880. let angle = xGame.common.getfguiRotation(x, y);
  11881. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11882. xGame.common.d2World.getHelpLine();
  11883. }
  11884. this.isMoveRod = false;
  11885. xGame.common.clickedBall = false;
  11886. }
  11887. openAllEvent() {
  11888. this.closeAllEvent();
  11889. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11890. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11891. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11892. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11893. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11894. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11895. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11896. }
  11897. closeAllEvent() {
  11898. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11899. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11900. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11901. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11902. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11903. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11904. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11905. }
  11906. resetGame() {
  11907. this.closeAllEvent();
  11908. this.hideBallUI();
  11909. xGame.common.gameMgr.gamePause = true;
  11910. }
  11911. }
  11912. UIGame.uiName = "UIGame";
  11913. class UIAddProp extends UIBase {
  11914. constructor() {
  11915. super();
  11916. this.curType = "";
  11917. }
  11918. onConstructor() {
  11919. this.ui = ui_UIAddProp.createInstance();
  11920. this.contentPane = this.ui;
  11921. this.isEject = false;
  11922. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11923. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11924. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11925. this.updateUI();
  11926. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11927. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11928. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11929. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11930. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11931. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11932. }
  11933. show(type) {
  11934. super.show();
  11935. this.curType = type == 0 ? "coin" : "diamond";
  11936. this.switchBtn("");
  11937. this.ui.t0.play();
  11938. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11939. PlatMgr.showInsert(true);
  11940. this.setGlobalFont(this.ui);
  11941. }
  11942. closeSelf() {
  11943. this.hide();
  11944. }
  11945. updateUI() {
  11946. let data = cfgTable.moneyData;
  11947. let temp;
  11948. let obj;
  11949. for (const key in data) {
  11950. temp = data[key];
  11951. obj = this.ui.myNode["node" + key];
  11952. if (parseInt(key) <= 2) {
  11953. obj.diamondTxt.text = "+" + temp.num;
  11954. }
  11955. else {
  11956. obj.coinTxt.text = temp.num;
  11957. obj.diamondTxt.text = temp.get.split('_')[1];
  11958. }
  11959. }
  11960. this.updateDiamondShare();
  11961. }
  11962. updateDiamondShare() {
  11963. let data = DataMgr.getShareDiamondTimes();
  11964. if (data >= xGame.common.maxShareDiamondTimes) {
  11965. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11966. this.ui.myNode.node1.touchable = false;
  11967. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11968. }
  11969. else {
  11970. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11971. this.ui.myNode.node1.touchable = true;
  11972. }
  11973. }
  11974. switchBtn(type) {
  11975. if (type == "")
  11976. type = this.curType;
  11977. else {
  11978. if (this.curType == type) {
  11979. return;
  11980. }
  11981. else {
  11982. this.curType = type;
  11983. }
  11984. }
  11985. if (type == "coin") {
  11986. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11987. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11988. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11989. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11990. this.ui.myNode.c1.selectedIndex = 0;
  11991. }
  11992. else {
  11993. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11994. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11995. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11996. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11997. this.ui.myNode.c1.selectedIndex = 1;
  11998. }
  11999. }
  12000. convertCoin(index) {
  12001. let data = cfgTable.moneyData[index];
  12002. let coinNum = data.num;
  12003. let str = data.get.split('_')[1];
  12004. let needDiamond = parseInt(str);
  12005. if (DataMgr.diamondEnough(needDiamond)) {
  12006. DataMgr.setDiamond(-needDiamond);
  12007. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  12008. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  12009. }
  12010. else {
  12011. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  12012. this.switchBtn("diamond");
  12013. }
  12014. }
  12015. videoGetDiamond() {
  12016. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  12017. if (Laya.Browser.onAndroid) {
  12018. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12019. if (!boo) {
  12020. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12021. return;
  12022. }
  12023. }
  12024. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  12025. }
  12026. else {
  12027. console.log('zh:AD 失败,直接发放奖励');
  12028. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  12029. }
  12030. }
  12031. qjff_AD_for_uiAddProp_videoGetDiamond() {
  12032. let num = cfgTable.moneyData[2].num;
  12033. xGame.common.playObjFlyAnim(num, Prop.diamond);
  12034. this.closeSelf();
  12035. }
  12036. videoGetCoin() {
  12037. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  12038. if (Laya.Browser.onAndroid) {
  12039. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12040. if (!boo) {
  12041. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12042. return;
  12043. }
  12044. }
  12045. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  12046. }
  12047. else {
  12048. console.log('zh:AD 失败,直接发放奖励');
  12049. this.qjff_AD_for_uiAddProp_videoGetCoin();
  12050. }
  12051. }
  12052. qjff_AD_for_uiAddProp_videoGetCoin() {
  12053. xGame.common.playObjFlyAnim(2000, Prop.coin);
  12054. this.closeSelf();
  12055. }
  12056. shareGetDiamond() {
  12057. let times = DataMgr.getShareDiamondTimes();
  12058. if (times >= xGame.common.maxShareDiamondTimes) {
  12059. console.log('zh: 233333333333 maxShareDiamondTimes');
  12060. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  12061. }
  12062. else {
  12063. console.log('zh:33333333333333ad');
  12064. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  12065. if (Laya.Browser.onAndroid) {
  12066. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12067. if (!boo) {
  12068. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12069. return;
  12070. }
  12071. }
  12072. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  12073. }
  12074. else {
  12075. console.log('zh:AD 失败,直接发放奖励');
  12076. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  12077. }
  12078. }
  12079. }
  12080. qjff_AD_for_uiAddProp_shareGetDiamond() {
  12081. let diamond = xGame.common.randomNum(50, 100);
  12082. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  12083. DataMgr.setShareDiamondTimes(1);
  12084. this.updateDiamondShare();
  12085. }
  12086. openPutBallView() {
  12087. let end = xGame.uiMgr.getUI(UIGameEnd);
  12088. let skill = xGame.uiMgr.getUI(UISkill);
  12089. let level = xGame.uiMgr.getUI(UILevelDisplay);
  12090. let uigame = xGame.uiMgr.getUI(UIGame);
  12091. if (end && !end.isHide) {
  12092. xGame.uiMgr.Hide(UIGameEnd);
  12093. xGame.uiMgr.Show(UIMain);
  12094. }
  12095. if (skill && !skill.isHide)
  12096. xGame.uiMgr.Hide(UISkill);
  12097. if (uigame && !uigame.isHide)
  12098. xGame.uiMgr.Hide(UIGame);
  12099. if (level && !level.isHide) {
  12100. }
  12101. else {
  12102. xGame.uiMgr.Show(UILevelDisplay);
  12103. }
  12104. this.closeSelf();
  12105. }
  12106. }
  12107. UIAddProp.uiName = "UIAddProp";
  12108. class MoneyNode {
  12109. constructor(ui) {
  12110. this.leftTime = 0;
  12111. this.ui = ui;
  12112. this.ui.addCoinBtn.onClick(this, this.addCoin);
  12113. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  12114. this.ui.addPowerBtn.onClick(this, this.addPower);
  12115. this.ui.c1.selectedIndex = 1;
  12116. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  12117. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  12118. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  12119. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  12120. this.coinChange();
  12121. this.diamondChange();
  12122. this.powerChange();
  12123. }
  12124. addPower() {
  12125. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12126. xGame.uiMgr.Show(UIPower);
  12127. }
  12128. powerChange() {
  12129. let powerNum = DataMgr.getPower();
  12130. this.ui.powerTxt.text = powerNum + "";
  12131. }
  12132. checkPowerTime() {
  12133. let cur = new Date().getTime();
  12134. let last = DataMgr.getPowerTime();
  12135. if (last == 0) {
  12136. last = cur;
  12137. DataMgr.setPowerTime(cur);
  12138. }
  12139. let power = DataMgr.getPower();
  12140. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  12141. Laya.timer.clearAll(this);
  12142. if (power >= xGame.common.natureMaxPower) {
  12143. this.ui.powerTimeTxt.text = "";
  12144. DataMgr.setPowerTime(cur);
  12145. return;
  12146. }
  12147. if (power + offset >= xGame.common.natureMaxPower) {
  12148. DataMgr.setPower(xGame.common.natureMaxPower, false);
  12149. this.ui.powerTimeTxt.text = "";
  12150. DataMgr.setPowerTime(cur);
  12151. }
  12152. else {
  12153. if (offset > 0) {
  12154. DataMgr.setPower(offset);
  12155. DataMgr.setPowerTime(cur);
  12156. }
  12157. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12158. this.leftTime = xGame.common.powerRecoverNum - time;
  12159. if (this.leftTime <= 0)
  12160. this.leftTime = 0;
  12161. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12162. Laya.timer.loop(1000, this, this.updatePowerTime);
  12163. }
  12164. }
  12165. updatePowerTime() {
  12166. this.leftTime -= 1;
  12167. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12168. if (this.leftTime <= 0) {
  12169. this.checkPowerTime();
  12170. }
  12171. }
  12172. coinChange() {
  12173. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12174. }
  12175. diamondChange() {
  12176. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12177. }
  12178. addCoin() {
  12179. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12180. Moyu.sendDataEvent("AddCoinBtn");
  12181. xGame.uiMgr.Show(UIAddProp, 0);
  12182. }
  12183. addDiamond() {
  12184. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12185. Moyu.sendDataEvent("AddDiamondBtn");
  12186. xGame.uiMgr.Show(UIAddProp, 1);
  12187. }
  12188. }
  12189. class UIDraw extends UIBase {
  12190. constructor() {
  12191. super();
  12192. this.curKey = 0;
  12193. }
  12194. onConstructor() {
  12195. this.ui = ui_UIDraw.createInstance();
  12196. this.contentPane = this.ui;
  12197. this.isEject = false;
  12198. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12199. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12200. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12201. this.initDraw();
  12202. this.initUI();
  12203. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12204. }
  12205. show() {
  12206. super.show();
  12207. this.ui.t0.play();
  12208. this.playSecretaryIdle();
  12209. this.updateDraw();
  12210. this.checkFree();
  12211. if (PlatMgr.bannerDelay > 0) {
  12212. this.ui.closeNode.closeBtn.visible = false;
  12213. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12214. this.ui.closeNode.closeBtn.visible = true;
  12215. });
  12216. }
  12217. PlatMgr.showRateBanner();
  12218. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12219. this.setGlobalFont(this.ui);
  12220. }
  12221. hide() {
  12222. Laya.timer.clearAll(this);
  12223. super.hide();
  12224. }
  12225. checkFree() {
  12226. let isFree = DataMgr.getDailyfreeDrawTimes();
  12227. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12228. }
  12229. initDraw() {
  12230. this.drawObj = [];
  12231. let data = cfgTable.drawData;
  12232. let temp;
  12233. let weight = 0;
  12234. for (const key in data) {
  12235. temp = data[key];
  12236. weight += temp.weight;
  12237. this.drawObj.push(weight);
  12238. }
  12239. this.allWeight = weight;
  12240. }
  12241. initUI() {
  12242. let data = cfgTable.drawData;
  12243. let temp;
  12244. let img;
  12245. let txt;
  12246. for (const key in data) {
  12247. temp = data[key];
  12248. img = this.ui.myNode.rotNode["img" + key];
  12249. txt = this.ui.myNode.rotNode["txt" + key];
  12250. img.url = xGame.common.getGameIconUrl(temp.icon);
  12251. txt.visible = true;
  12252. if (temp.award > 2) {
  12253. img.rotation = 0;
  12254. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12255. }
  12256. else {
  12257. img.rotation = temp.rotation;
  12258. txt.text = temp.num;
  12259. }
  12260. }
  12261. }
  12262. getCurkey() {
  12263. let rand = Math.random() * this.allWeight;
  12264. let temp;
  12265. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12266. temp = this.drawObj[index];
  12267. if (index == 0) {
  12268. if (rand < temp) {
  12269. return index + 1;
  12270. }
  12271. }
  12272. else {
  12273. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12274. return index + 1;
  12275. }
  12276. }
  12277. }
  12278. return 2;
  12279. }
  12280. startDraw() {
  12281. console.log('zh:开始抽奖');
  12282. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12283. if (freeTimes > 0) {
  12284. console.log('zh:freeTimes=' + freeTimes);
  12285. this.beginDraw();
  12286. DataMgr.setDailyfreeDrawTimes(0);
  12287. this.checkFree();
  12288. }
  12289. else {
  12290. if (Laya.Browser.onAndroid) {
  12291. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12292. if (!boo) {
  12293. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12294. return;
  12295. }
  12296. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12297. }
  12298. else {
  12299. console.log('zh:AD 失败,直接发放奖励');
  12300. this.qjff_chouJiang();
  12301. }
  12302. }
  12303. else {
  12304. this.qjff_chouJiang();
  12305. }
  12306. }
  12307. }
  12308. qjff_chouJiang() {
  12309. this.beginDraw();
  12310. }
  12311. beginDraw() {
  12312. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12313. this.ui.drawBtn.touchable = false;
  12314. this.curKey = this.getCurkey();
  12315. console.log("zh:当前key", this.curKey);
  12316. let cell = 60;
  12317. let lap = 3;
  12318. let angle = cell * (this.curKey - 1) + lap * 360;
  12319. let target = this.ui.myNode.rotNode;
  12320. target.rotation = 0;
  12321. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12322. console.log("zh:旋转完成");
  12323. this.ui.drawBtn.touchable = true;
  12324. this.getAward();
  12325. }));
  12326. }
  12327. getAward() {
  12328. let data = cfgTable.drawData[this.curKey];
  12329. let temp = new AwardType();
  12330. temp.type = data.award;
  12331. temp.num = data.num;
  12332. xGame.common.getAward([temp], () => {
  12333. DataMgr.setDrawTimes(1);
  12334. this.updateDraw();
  12335. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12336. });
  12337. }
  12338. updateDraw() {
  12339. let drawTimes = DataMgr.getDrawTimes();
  12340. let awardTimes = DataMgr.getDrawAwardTimes();
  12341. if (Math.floor(drawTimes / 3) > awardTimes) {
  12342. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12343. this.ui.extraNode.boxBtn.touchable = true;
  12344. this.ui.extraNode.tipsTxt.text = "3/3";
  12345. this.ui.extraNode.barNode.width = 265;
  12346. this.getExtraAward();
  12347. }
  12348. else {
  12349. this.ui.extraNode.boxBtn.t0.stop();
  12350. this.ui.extraNode.boxBtn.touchable = false;
  12351. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12352. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12353. }
  12354. let data = cfgTable.drawData[1];
  12355. if (awardTimes == 0) {
  12356. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12357. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12358. this.ui.myNode.rotNode.img1.rotation = 0;
  12359. }
  12360. else {
  12361. let award = data.nextid;
  12362. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12363. this.ui.myNode.rotNode.txt1.text = award[1];
  12364. this.ui.myNode.rotNode.img1.rotation = 0;
  12365. }
  12366. }
  12367. getExtraAward() {
  12368. let drawTimes = DataMgr.getDrawTimes();
  12369. let awardTimes = DataMgr.getDrawAwardTimes();
  12370. let data = cfgTable.drawData[1];
  12371. let award = new AwardType();
  12372. if (awardTimes == 0) {
  12373. award.num = data.num;
  12374. award.type = data.award;
  12375. xGame.common.getAward([award], () => {
  12376. let all = Math.floor(drawTimes / 3);
  12377. DataMgr.setDrawAwardTimes(all);
  12378. this.updateDraw();
  12379. });
  12380. }
  12381. else {
  12382. award.num = parseInt(data.nextid[1]);
  12383. award.type = parseInt(data.nextid[0]);
  12384. xGame.common.getAward([award], () => {
  12385. let all = Math.floor(drawTimes / 3);
  12386. DataMgr.setDrawAwardTimes(all);
  12387. this.updateDraw();
  12388. });
  12389. }
  12390. }
  12391. closeSelf() {
  12392. this.hide();
  12393. }
  12394. playSecretaryIdle() {
  12395. let parent = this.ui.secretary.displayObject;
  12396. parent.destroyChildren();
  12397. let xx = this.ui.secretary.width / 2;
  12398. let yy = this.ui.secretary.height;
  12399. let scale = xGame.common.getSecretaryScale();
  12400. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12401. xGame.common.secretary.play(data, 0, true, parent);
  12402. }
  12403. }
  12404. UIDraw.uiName = "UIDraw";
  12405. class ui_UIFlyEft extends fgui.GComponent {
  12406. static createInstance() {
  12407. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12408. }
  12409. onConstruct() {
  12410. this.n0 = (this.getChild("n0"));
  12411. this.n1 = (this.getChild("n1"));
  12412. this.n2 = (this.getChild("n2"));
  12413. this.n3 = (this.getChild("n3"));
  12414. this.n4 = (this.getChild("n4"));
  12415. this.n5 = (this.getChild("n5"));
  12416. this.n6 = (this.getChild("n6"));
  12417. this.n7 = (this.getChild("n7"));
  12418. this.iconNode = (this.getChild("iconNode"));
  12419. this.txt = (this.getChild("txt"));
  12420. this.txtNode = (this.getChild("txtNode"));
  12421. }
  12422. }
  12423. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12424. class UIFlyEft extends UIBase {
  12425. constructor() {
  12426. super();
  12427. this.max = 8;
  12428. this.delay = 0;
  12429. }
  12430. onConstructor() {
  12431. this.ui = ui_UIFlyEft.createInstance();
  12432. this.contentPane = this.ui;
  12433. this.isEject = false;
  12434. this.isMuti = true;
  12435. this.ui.x += xGame.common.sysOffestNum;
  12436. }
  12437. getArrPos() {
  12438. if (this.iconPos && this.iconPos.length > 0)
  12439. return;
  12440. this.iconPos = [];
  12441. let temp;
  12442. for (let index = 0; index < this.max; index++) {
  12443. temp = this.ui["n" + index];
  12444. this.iconPos.push([temp.x, temp.y]);
  12445. }
  12446. }
  12447. show(stPos, edPos, num, type, callback) {
  12448. super.show();
  12449. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12450. this.getArrPos();
  12451. this.updateUI(type);
  12452. this.updatePos();
  12453. this.runFly(edPos, callback);
  12454. this.runWorlds(stPos, num);
  12455. this.setGlobalFont(this.ui);
  12456. }
  12457. updateUI(type) {
  12458. let temp;
  12459. let str;
  12460. for (let index = 0; index < this.max; index++) {
  12461. temp = this.ui["n" + index];
  12462. str = this.getIconStr(type);
  12463. temp.url = xGame.common.getGameIconUrl(str);
  12464. }
  12465. }
  12466. getIconStr(type) {
  12467. switch (type) {
  12468. case Prop.diamond:
  12469. return "ty_zs";
  12470. case Prop.coin:
  12471. return "ty_jb";
  12472. default:
  12473. break;
  12474. }
  12475. }
  12476. updatePos() {
  12477. let temp;
  12478. for (let index = 0; index < this.max; index++) {
  12479. temp = this.ui["n" + index];
  12480. temp.x = this.iconPos[index][0];
  12481. temp.y = this.iconPos[index][1];
  12482. }
  12483. }
  12484. runFly(endPos, callback) {
  12485. let all = 0;
  12486. let temp;
  12487. for (let index = 0; index < this.max; index++) {
  12488. temp = this.ui["n" + index];
  12489. temp.visible = true;
  12490. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12491. temp.visible = false;
  12492. all++;
  12493. if (all >= this.max) {
  12494. callback && callback();
  12495. }
  12496. }), 20 * index);
  12497. }
  12498. }
  12499. runWorlds(stPos, num) {
  12500. let str = "+" + num;
  12501. this.ui.txt.text = str;
  12502. let starX = stPos.x;
  12503. let starY = stPos.y + 50;
  12504. this.ui.txt.x = starX;
  12505. this.ui.txt.y = starY;
  12506. this.ui.txt.visible = true;
  12507. this.ui.txt.alpha = 1;
  12508. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12509. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12510. this.ui.txt.visible = false;
  12511. this.hide();
  12512. }));
  12513. }));
  12514. }
  12515. }
  12516. UIFlyEft.uiName = "UIFlyEft";
  12517. class Common {
  12518. constructor() {
  12519. this.convertNum = 0.025;
  12520. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12521. this.scaleV3One = new Laya.Vector3();
  12522. this.scaleV3Two = new Laya.Vector3();
  12523. this.posV4 = new Laya.Vector4();
  12524. this.showDebug = false;
  12525. this.openGuide = true;
  12526. this.rodOffest = new Laya.Vector2(0, 0);
  12527. this.rodAngle = 0;
  12528. this.gameMode = GameMode.classic;
  12529. this.bigMoveLevelIndex = 1;
  12530. this.bigMoveNeedCoin = 1000;
  12531. this.classicNiceNeddCoin = 1000;
  12532. this.passAwardCoin = 2000;
  12533. this.classicRoomType = 1;
  12534. this.maxPower = 20;
  12535. this.natureMaxPower = 5;
  12536. this.videoPower = 2;
  12537. this.powerRecoverNum = 900;
  12538. this.curPlayerSkillType = 0;
  12539. this.isNewDay = false;
  12540. this.clickedBall = false;
  12541. this.placeBallCurLevel = 0;
  12542. this.placeBallStarNum = 0;
  12543. this.longHelpLine = false;
  12544. this.maxShareDiamondTimes = 3;
  12545. this.guideStep = 0;
  12546. this.guideStepForLianXi = 0;
  12547. this.temSelfLevel = 0;
  12548. this.extraMoveNum = 0;
  12549. this.curRankID = 0;
  12550. this.rankID = {
  12551. normalStar: 12000,
  12552. wxStar: 12001
  12553. };
  12554. this.skillNameList = ["Skyfall Shot", "Surging Break", "Frost Lock"];
  12555. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12556. this.btnClickStr = "buttonclick";
  12557. this.maxSkillLevel = 10;
  12558. this.upSkillLevel = false;
  12559. this.gameStartTime = 0;
  12560. this._sysOffestNum = 0;
  12561. this.angleV2 = new Laya.Vector2();
  12562. this.rootV = new Laya.Vector2(0, 1);
  12563. this.tempDir1 = new Laya.Vector2();
  12564. this.tempDir2 = new Laya.Vector2();
  12565. this.ballSize = 33;
  12566. this.stPos = new Laya.Point();
  12567. this.edPos = new Laya.Point();
  12568. Common._instance = this;
  12569. window["common"] = this;
  12570. }
  12571. static getInstance() {
  12572. if (!this._instance) {
  12573. this._instance = new Common();
  12574. }
  12575. return this._instance;
  12576. }
  12577. get sysOffestNum() {
  12578. if (this._sysOffestNum == 0) {
  12579. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12580. }
  12581. return this._sysOffestNum;
  12582. }
  12583. testShader() {
  12584. let test = new LightShader();
  12585. test.texture = "res/d3Res/ballTexture/ball1.png";
  12586. Laya.stage.addChild(test);
  12587. }
  12588. playScale(node) {
  12589. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12590. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12591. }));
  12592. }));
  12593. }
  12594. setGroup(colli, ...group) {
  12595. let out = 0;
  12596. for (let index = 0; index < group.length; index++) {
  12597. if (index == 0) {
  12598. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12599. }
  12600. else {
  12601. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12602. }
  12603. }
  12604. colli.collisionGroup = out;
  12605. }
  12606. setCanGroupWith(colli, ...group) {
  12607. let out = 0;
  12608. for (let index = 0; index < group.length; index++) {
  12609. if (index == 0) {
  12610. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12611. }
  12612. else {
  12613. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12614. }
  12615. }
  12616. colli.canCollideWith = out;
  12617. }
  12618. loadPrefab(name, callback) {
  12619. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12620. let prefab = new Laya.Prefab();
  12621. prefab.json = obj;
  12622. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12623. callback && callback(img);
  12624. }));
  12625. }
  12626. pos2to3Convert(x, y, d3Pos) {
  12627. x = x + this.sysOffestNum;
  12628. d3Pos.setValue(x, y, 0);
  12629. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12630. if (success) {
  12631. }
  12632. else {
  12633. console.error("转换出错了。。。。。。。。");
  12634. }
  12635. }
  12636. scale2to3Convert(num) {
  12637. this.scaleV3One.setValue(0, 0, 0);
  12638. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12639. this.scaleV3Two.setValue(0, num, 0);
  12640. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12641. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12642. return outNum;
  12643. }
  12644. pos3to2Convert(d3Pos) {
  12645. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12646. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12647. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12648. d3Pos.x -= this.sysOffestNum;
  12649. }
  12650. scale3to2Convert(num) {
  12651. let scale = this.scale2to3Convert(1);
  12652. let d2Out = num / scale;
  12653. return d2Out;
  12654. }
  12655. getCollider(type, restitution = 0.9, density = 10) {
  12656. let colli;
  12657. if (type == "box")
  12658. colli = new Laya.BoxCollider();
  12659. else
  12660. colli = new Laya.CircleCollider();
  12661. colli.friction = 0;
  12662. colli.restitution = restitution;
  12663. colli.density = density;
  12664. return colli;
  12665. }
  12666. getRigbody() {
  12667. let rigy = new Laya.RigidBody();
  12668. rigy.bullet = true;
  12669. rigy.allowRotation = false;
  12670. rigy.allowSleep = false;
  12671. rigy.gravityScale = 0;
  12672. return rigy;
  12673. }
  12674. getfguiRotation(x, y) {
  12675. this.angleV2.setValue(x, y);
  12676. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12677. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12678. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12679. angle = -angle;
  12680. }
  12681. return 180 + angle;
  12682. }
  12683. getAngle(x, y) {
  12684. this.angleV2.setValue(x, y);
  12685. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12686. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12687. return angle;
  12688. }
  12689. randomNum(a, b) {
  12690. return a + Math.floor((b - a + 1) * Math.random());
  12691. }
  12692. getRandArrEle(arr) {
  12693. return arr[Math.floor(arr.length * Math.random())];
  12694. }
  12695. getSign(val) {
  12696. return val >= 0 ? 1 : -1;
  12697. }
  12698. botherArr(arr) {
  12699. let times = arr.length + 2;
  12700. let length = arr.length;
  12701. let a;
  12702. let b;
  12703. let temp;
  12704. for (let index = 0; index < times; index++) {
  12705. a = Math.floor(Math.random() * length);
  12706. b = Math.floor(Math.random() * length);
  12707. temp = arr[a];
  12708. arr[a] = arr[b];
  12709. arr[b] = temp;
  12710. }
  12711. }
  12712. getGameIconUrl(id) {
  12713. return "ui://game/" + id;
  12714. }
  12715. getComponentUrl(id) {
  12716. return "ui://game/" + id;
  12717. }
  12718. getAnimation() {
  12719. }
  12720. judgeSkillType(type = SkillType.highSpace) {
  12721. if (this.gameMode == GameMode.classic)
  12722. return;
  12723. let gameMgr = this.gameMgr;
  12724. if (gameMgr.selfTurn) {
  12725. if (gameMgr.selfCurSkill == type) {
  12726. return true;
  12727. }
  12728. }
  12729. else {
  12730. if (gameMgr.aiCurSkill == type) {
  12731. return true;
  12732. }
  12733. }
  12734. }
  12735. ballColliHole(collider) {
  12736. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12737. xGame.common.gameMgr.isFirstInGame = false;
  12738. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12739. }
  12740. collider.owner.mySrc.checkWrongBall();
  12741. }
  12742. getArrMaxEle(arr) {
  12743. let max = -Infinity;
  12744. for (let index = 0; index < arr.length; index++) {
  12745. max = Math.max(arr[index], max);
  12746. }
  12747. return max;
  12748. }
  12749. getArrMinEle(arr) {
  12750. let min = Infinity;
  12751. for (let index = 0; index < arr.length; index++) {
  12752. min = Math.min(arr[index], min);
  12753. }
  12754. return min;
  12755. }
  12756. playRandomMutiBallBigSkillSound() {
  12757. if (Math.random() <= 0.5)
  12758. return;
  12759. let rand = this.randomNum(1, 6);
  12760. let str = "ganfa0" + rand;
  12761. xGame.soundMgr.playSound(str);
  12762. }
  12763. showOneCamera(type) {
  12764. let object = xGame.common.d3World.cameraObj;
  12765. for (const key in object) {
  12766. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12767. object[key].init();
  12768. object[key].owner.active = key == type;
  12769. }
  12770. }
  12771. }
  12772. checkBallOverBorder(x, y) {
  12773. let radius = 17;
  12774. let condition = this._checkBorder(x + radius, y) ||
  12775. this._checkBorder(x - radius, y) ||
  12776. this._checkBorder(x, y + radius) ||
  12777. this._checkBorder(x, y - radius);
  12778. if (condition) {
  12779. return true;
  12780. }
  12781. }
  12782. _checkBorder(x, y) {
  12783. let borderRect = this.d2World.borderRect;
  12784. let xOffest = 20;
  12785. let yOffest = 20;
  12786. if (y <= borderRect.y - yOffest) {
  12787. return true;
  12788. }
  12789. if (y >= borderRect.y + borderRect.height + yOffest) {
  12790. return true;
  12791. }
  12792. if (x <= borderRect.x - xOffest) {
  12793. return true;
  12794. }
  12795. if (x >= borderRect.x + borderRect.width + xOffest) {
  12796. return true;
  12797. }
  12798. }
  12799. initWeight(cfg) {
  12800. let allCfgData = { data: {}, allWeightNum: 0 };
  12801. let weightCfg = allCfgData.data;
  12802. let weight = 0;
  12803. for (const key in cfg) {
  12804. weightCfg[key] = {};
  12805. weightCfg[key].id = cfg[key].id;
  12806. weightCfg[key].minWeight = weight;
  12807. weight += cfg[key].weight;
  12808. weightCfg[key].maxWeight = weight;
  12809. }
  12810. allCfgData.allWeightNum = weight;
  12811. return allCfgData;
  12812. }
  12813. getRandomWeightData(cfg) {
  12814. let weightCfg = cfg.data;
  12815. let allWeightNum = cfg.allWeightNum;
  12816. let rand = Math.floor(Math.random() * allWeightNum);
  12817. for (const key in weightCfg) {
  12818. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12819. return weightCfg[key];
  12820. }
  12821. }
  12822. return weightCfg[1];
  12823. }
  12824. showGirlTalkPop(wordsIndex, node, msgNode) {
  12825. node.visible = true;
  12826. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12827. node.t0.play(Laya.Handler.create(this, () => {
  12828. node.visible = false;
  12829. }));
  12830. }
  12831. stopGirlPop(node) {
  12832. node.t0.stop();
  12833. node.visible = false;
  12834. }
  12835. createHead(loader, url, size = 107) {
  12836. if (Laya.Browser.name == "Browser") {
  12837. loader.url = url;
  12838. return;
  12839. }
  12840. else {
  12841. console.log('zh:url=', url);
  12842. loader.url = url;
  12843. }
  12844. }
  12845. addTestCoin(num) {
  12846. DataMgr.setCoin(num);
  12847. }
  12848. addTestDiamond(num) {
  12849. DataMgr.setDiamond(num);
  12850. }
  12851. addTestSkill() {
  12852. DataMgr.setBigSkill(0, 99);
  12853. DataMgr.setBigSkill(1, 99);
  12854. DataMgr.setBigSkill(2, 99);
  12855. }
  12856. playClassicEmotion(number, x, y) {
  12857. if (this.gameMode == GameMode.bigMove)
  12858. return;
  12859. let randIndex = this.randomNum(0, 2);
  12860. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12861. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12862. if (this.gameMgr.selfTurn) {
  12863. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12864. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12865. }
  12866. else {
  12867. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12868. }
  12869. else {
  12870. if (number == this.gameMgr.blackNum) {
  12871. if (this.gameMgr.selfBallArr.length == 0) {
  12872. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12873. }
  12874. else {
  12875. }
  12876. }
  12877. else {
  12878. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12879. }
  12880. }
  12881. }
  12882. }
  12883. else {
  12884. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12885. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12886. }
  12887. else {
  12888. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12889. }
  12890. else {
  12891. if (number == this.gameMgr.blackNum) {
  12892. if (this.gameMgr.aiBallArr.length == 0) {
  12893. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12894. }
  12895. else {
  12896. }
  12897. }
  12898. else {
  12899. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12900. }
  12901. }
  12902. }
  12903. }
  12904. }
  12905. playHappySound(number) {
  12906. if (this.gameMode != GameMode.classic)
  12907. return;
  12908. if (number == 8)
  12909. return;
  12910. let play = false;
  12911. if (this.gameMgr.selfTurn) {
  12912. if (this.gameMgr.ensureBallType) {
  12913. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12914. play = true;
  12915. }
  12916. }
  12917. else {
  12918. play = true;
  12919. }
  12920. }
  12921. else {
  12922. if (this.gameMgr.ensureBallType) {
  12923. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12924. play = true;
  12925. }
  12926. }
  12927. else {
  12928. play = true;
  12929. }
  12930. }
  12931. if (play)
  12932. xGame.soundMgr.playSound("applause");
  12933. }
  12934. destroyClassicEmotion() {
  12935. if (this.gameMode == GameMode.bigMove)
  12936. return;
  12937. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12938. parent.destroyChildren();
  12939. }
  12940. playAwardSpine(x, y) {
  12941. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12942. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12943. this.awardSpine.play(data, 0, false, parent);
  12944. }
  12945. destroyAwardSpine() {
  12946. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12947. parent.destroyChildren();
  12948. }
  12949. isBlock(bx, by, hx, hy, except = null) {
  12950. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12951. let balls = xGame.common.d2World.ballArr;
  12952. let outArr = [];
  12953. for (let index = 0; index < balls.length; index++) {
  12954. let obj = balls[index];
  12955. if (obj.number == 0)
  12956. continue;
  12957. if (obj == except)
  12958. continue;
  12959. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12960. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12961. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12962. if (num >= 1)
  12963. num = 1;
  12964. if (num < 0)
  12965. continue;
  12966. let gap = Math.sin(Math.acos(num)) * dis;
  12967. if (gap < this.ballSize) {
  12968. outArr.push({
  12969. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12970. disHon: Math.cos(Math.acos(num)) * dis,
  12971. disVer: Math.sin(Math.acos(num)) * dis,
  12972. src: balls[index],
  12973. dir: this.tempDir1
  12974. });
  12975. }
  12976. }
  12977. if (outArr.length > 0) {
  12978. outArr.sort((a, b) => { return a.dis - b.dis; });
  12979. return outArr[0];
  12980. }
  12981. }
  12982. AngleBetween(vector1, vector2) {
  12983. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12984. return rad * (180 / Math.PI);
  12985. }
  12986. getSecretaryScale() {
  12987. if (this.secretary.spineName == "mishu") {
  12988. return 1.28;
  12989. }
  12990. else {
  12991. return 1.024;
  12992. }
  12993. }
  12994. signAwardContainsRod(arr) {
  12995. let temp;
  12996. for (let index = 0; index < arr.length; index++) {
  12997. temp = arr[index].split('-')[0];
  12998. if (parseInt(temp) > 2) {
  12999. return true;
  13000. }
  13001. }
  13002. }
  13003. judgeSameDay() {
  13004. let lastTime = DataMgr.getSignTime();
  13005. let curTime = new Date().getTime();
  13006. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  13007. return true;
  13008. }
  13009. return false;
  13010. }
  13011. getAward(arr, callback) {
  13012. let showTriple = arr[0].type <= 2;
  13013. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  13014. let temp;
  13015. for (let index = 0; index < arr.length; index++) {
  13016. temp = arr[index];
  13017. switch (temp.type) {
  13018. case 1:
  13019. this.playObjFlyAnim(temp.num, temp.type);
  13020. break;
  13021. case 2:
  13022. this.playObjFlyAnim(temp.num, temp.type);
  13023. break;
  13024. case 3:
  13025. case 4:
  13026. case 5:
  13027. case 6:
  13028. DataMgr.setBallRod(temp.type - 2, 1);
  13029. DataMgr.setCurBallRod(temp.type - 2);
  13030. break;
  13031. default:
  13032. break;
  13033. }
  13034. }
  13035. callback && callback(watchVideo);
  13036. });
  13037. }
  13038. getMoneyNode() {
  13039. let moneyNode;
  13040. let sign = xGame.uiMgr.getUI(UISign);
  13041. let draw = xGame.uiMgr.getUI(UIDraw);
  13042. let end = xGame.uiMgr.getUI(UIGameEnd);
  13043. let skill = xGame.uiMgr.getUI(UISkill);
  13044. if (sign && !sign.isHide)
  13045. moneyNode = sign.ui.moneyNode;
  13046. if (draw && !draw.isHide)
  13047. moneyNode = draw.ui.moneyNode;
  13048. if (end && !end.isHide)
  13049. moneyNode = end.ui.moneyNode;
  13050. if (skill && !skill.isHide)
  13051. moneyNode = skill.ui.moneyNode;
  13052. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  13053. let main = xGame.uiMgr.getUI(UIMain);
  13054. if (condition1 && main && !main.isHide) {
  13055. moneyNode = main.ui.moneyNode;
  13056. }
  13057. return moneyNode;
  13058. }
  13059. playObjFlyAnim(num, type, callback = null) {
  13060. this.stPos.x = Laya.stage.width / 2;
  13061. this.stPos.y = Laya.stage.height / 2;
  13062. let moneyNode = this.getMoneyNode();
  13063. switch (type) {
  13064. case Prop.diamond:
  13065. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  13066. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  13067. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  13068. this.edPos.x /= 2;
  13069. this.edPos.y /= 2;
  13070. break;
  13071. case Prop.coin:
  13072. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  13073. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  13074. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  13075. this.edPos.x /= 2;
  13076. this.edPos.y /= 2;
  13077. break;
  13078. default:
  13079. break;
  13080. }
  13081. xGame.soundMgr.playSound("coinbag");
  13082. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  13083. switch (type) {
  13084. case Prop.diamond:
  13085. DataMgr.setDiamond(num);
  13086. break;
  13087. case Prop.coin:
  13088. DataMgr.setCoin(num);
  13089. break;
  13090. default:
  13091. break;
  13092. }
  13093. callback && callback();
  13094. });
  13095. }
  13096. autoPopUIView() {
  13097. let arr = [];
  13098. let sign = this.judgeSameDay() ? false : true;
  13099. if (sign)
  13100. arr.push("sign");
  13101. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  13102. if (draw)
  13103. arr.push("draw");
  13104. if (arr.length <= 0)
  13105. return;
  13106. let str = this.getRandArrEle(arr);
  13107. switch (str) {
  13108. case "sign":
  13109. xGame.uiMgr.Show(UISign);
  13110. break;
  13111. case "draw":
  13112. xGame.uiMgr.Show(UIDraw);
  13113. break;
  13114. default:
  13115. break;
  13116. }
  13117. }
  13118. getMSTime(time) {
  13119. let min = Math.floor(time / 60);
  13120. let sec = Math.floor((time - min * 60));
  13121. if (sec < 10)
  13122. sec = "0" + sec;
  13123. if (min < 10)
  13124. min = "0" + min;
  13125. return `${min}:${sec}`;
  13126. }
  13127. testPower() {
  13128. DataMgr.setPower(0, false);
  13129. }
  13130. getAllStarNum() {
  13131. let data = DataMgr.getPlaceBallLevelList();
  13132. let out = 0;
  13133. for (let index = 0; index < data.length; index++) {
  13134. out += data[index].star;
  13135. }
  13136. return out;
  13137. }
  13138. recoverCameraView() {
  13139. Laya.timer.once(900, this, () => {
  13140. xGame.common.showOneCamera("mainCamera");
  13141. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  13142. xGame.common.gameUI.ui.d2Node.alpha = 1;
  13143. xGame.common.gameUI.ui.border.alpha = 0;
  13144. if (Laya.physicsTimer.scale < 1) {
  13145. Laya.physicsTimer.scale = 1;
  13146. }
  13147. }
  13148. });
  13149. }
  13150. getClassicLevel() {
  13151. let successTimes = DataMgr.getClassicTimes();
  13152. let needKey = "";
  13153. let lastKey = "";
  13154. let cfg = cfgTable.classictimesData;
  13155. let data;
  13156. for (const key in cfg) {
  13157. data = cfg[key];
  13158. if (successTimes <= data.times) {
  13159. needKey = key;
  13160. }
  13161. lastKey = key;
  13162. }
  13163. if (needKey == "")
  13164. needKey = lastKey;
  13165. return cfg[needKey];
  13166. }
  13167. }
  13168. Common._instance = null;
  13169. class ui_Component92 extends fgui.GComponent {
  13170. static createInstance() {
  13171. return (fgui.UIPackage.createObject("game", "Component92"));
  13172. }
  13173. onConstruct() {
  13174. this.n0 = (this.getChild("n0"));
  13175. }
  13176. }
  13177. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13178. class ui_Component129 extends fgui.GProgressBar {
  13179. static createInstance() {
  13180. return (fgui.UIPackage.createObject("game", "Component129"));
  13181. }
  13182. onConstruct() {
  13183. this.bar_v = (this.getChild("bar_v"));
  13184. this.n84 = (this.getChild("n84"));
  13185. }
  13186. }
  13187. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13188. class ui_Component130 extends fgui.GComponent {
  13189. static createInstance() {
  13190. return (fgui.UIPackage.createObject("game", "Component130"));
  13191. }
  13192. onConstruct() {
  13193. this.ani = (this.getChild("ani"));
  13194. this.t0 = this.getTransition("t0");
  13195. }
  13196. }
  13197. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13198. class ui_powerEft extends fgui.GComponent {
  13199. static createInstance() {
  13200. return (fgui.UIPackage.createObject("game", "powerEft"));
  13201. }
  13202. onConstruct() {
  13203. this.ani = (this.getChild("ani"));
  13204. this.n88 = (this.getChild("n88"));
  13205. this.n89 = (this.getChild("n89"));
  13206. }
  13207. }
  13208. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13209. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13210. static createInstance() {
  13211. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13212. }
  13213. onConstruct() {
  13214. this.c1 = this.getController("c1");
  13215. this.n2 = (this.getChild("n2"));
  13216. this.n22 = (this.getChild("n22"));
  13217. this.n23 = (this.getChild("n23"));
  13218. this.n15 = (this.getChild("n15"));
  13219. this.challenge = (this.getChild("challenge"));
  13220. this.n17 = (this.getChild("n17"));
  13221. this.n3 = (this.getChild("n3"));
  13222. this.starNode = (this.getChild("starNode"));
  13223. this.levelTxt = (this.getChild("levelTxt"));
  13224. this.n14 = (this.getChild("n14"));
  13225. this.n19 = (this.getChild("n19"));
  13226. this.n20 = (this.getChild("n20"));
  13227. this.n21 = (this.getChild("n21"));
  13228. this.special = (this.getChild("special"));
  13229. }
  13230. }
  13231. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13232. class ui_Component79 extends fgui.GComponent {
  13233. static createInstance() {
  13234. return (fgui.UIPackage.createObject("game", "Component79"));
  13235. }
  13236. onConstruct() {
  13237. this.c1 = this.getController("c1");
  13238. this.n7 = (this.getChild("n7"));
  13239. this.n8 = (this.getChild("n8"));
  13240. this.n9 = (this.getChild("n9"));
  13241. this.n10 = (this.getChild("n10"));
  13242. this.n11 = (this.getChild("n11"));
  13243. this.n12 = (this.getChild("n12"));
  13244. }
  13245. }
  13246. ui_Component79.URL = "ui://isxx5ak7avag477";
  13247. class ui_Component80 extends fgui.GComponent {
  13248. static createInstance() {
  13249. return (fgui.UIPackage.createObject("game", "Component80"));
  13250. }
  13251. onConstruct() {
  13252. this.n0 = (this.getChild("n0"));
  13253. this.n1 = (this.getChild("n1"));
  13254. this.myList = (this.getChild("myList"));
  13255. this.guide2 = (this.getChild("guide2"));
  13256. this.yd = (this.getChild("yd"));
  13257. this.yd_zzq_btn = (this.getChild("yd_zzq_btn"));
  13258. this.n_yd = (this.getChild("n_yd"));
  13259. this.t0 = this.getTransition("t0");
  13260. }
  13261. }
  13262. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13263. class ui_SignNormal extends fgui.GComponent {
  13264. static createInstance() {
  13265. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13266. }
  13267. onConstruct() {
  13268. this.c1 = this.getController("c1");
  13269. this.n7 = (this.getChild("n7"));
  13270. this.n15 = (this.getChild("n15"));
  13271. this.titleTxt = (this.getChild("titleTxt"));
  13272. this.n8 = (this.getChild("n8"));
  13273. this.myIcon = (this.getChild("myIcon"));
  13274. this.numTxt = (this.getChild("numTxt"));
  13275. this.n12 = (this.getChild("n12"));
  13276. this.n13 = (this.getChild("n13"));
  13277. this.n17 = (this.getChild("n17"));
  13278. this.n14 = (this.getChild("n14"));
  13279. }
  13280. }
  13281. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13282. class ui_Button_reg extends fgui.GButton {
  13283. static createInstance() {
  13284. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13285. }
  13286. onConstruct() {
  13287. this.button = this.getController("button");
  13288. this.n6 = (this.getChild("n6"));
  13289. }
  13290. }
  13291. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13292. class ui_screenNode extends fgui.GComponent {
  13293. static createInstance() {
  13294. return (fgui.UIPackage.createObject("game", "screenNode"));
  13295. }
  13296. onConstruct() {
  13297. this.n9 = (this.getChild("n9"));
  13298. this.screenImg = (this.getChild("screenImg"));
  13299. }
  13300. }
  13301. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13302. class ui_GetAwrad_com1 extends fgui.GComponent {
  13303. static createInstance() {
  13304. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13305. }
  13306. onConstruct() {
  13307. this.n38 = (this.getChild("n38"));
  13308. this.n39 = (this.getChild("n39"));
  13309. this.n40 = (this.getChild("n40"));
  13310. this.t0 = this.getTransition("t0");
  13311. this.t1 = this.getTransition("t1");
  13312. }
  13313. }
  13314. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13315. class ui_GetAwrad_com2 extends fgui.GComponent {
  13316. static createInstance() {
  13317. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13318. }
  13319. onConstruct() {
  13320. this.n39 = (this.getChild("n39"));
  13321. this.n40 = (this.getChild("n40"));
  13322. this.t0 = this.getTransition("t0");
  13323. }
  13324. }
  13325. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13326. class ui_Component128 extends fgui.GComponent {
  13327. static createInstance() {
  13328. return (fgui.UIPackage.createObject("game", "Component128"));
  13329. }
  13330. onConstruct() {
  13331. this.n38 = (this.getChild("n38"));
  13332. this.n40 = (this.getChild("n40"));
  13333. }
  13334. }
  13335. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13336. class ui_Component100_1 extends fgui.GComponent {
  13337. static createInstance() {
  13338. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13339. }
  13340. onConstruct() {
  13341. this.myNode = (this.getChild("myNode"));
  13342. this.t0 = this.getTransition("t0");
  13343. }
  13344. }
  13345. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13346. class ui_Component142 extends fgui.GComponent {
  13347. static createInstance() {
  13348. return (fgui.UIPackage.createObject("game", "Component142"));
  13349. }
  13350. onConstruct() {
  13351. this.n41 = (this.getChild("n41"));
  13352. this.n42 = (this.getChild("n42"));
  13353. }
  13354. }
  13355. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13356. class ui_main_guang extends fgui.GComponent {
  13357. static createInstance() {
  13358. return (fgui.UIPackage.createObject("game", "main_guang"));
  13359. }
  13360. onConstruct() {
  13361. this.n1 = (this.getChild("n1"));
  13362. this.n2 = (this.getChild("n2"));
  13363. this.n3 = (this.getChild("n3"));
  13364. this.n4 = (this.getChild("n4"));
  13365. this.n5 = (this.getChild("n5"));
  13366. this.n6 = (this.getChild("n6"));
  13367. this.n8 = (this.getChild("n8"));
  13368. this.t0 = this.getTransition("t0");
  13369. }
  13370. }
  13371. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13372. class ui_try_com1 extends fgui.GComponent {
  13373. static createInstance() {
  13374. return (fgui.UIPackage.createObject("game", "try_com1"));
  13375. }
  13376. onConstruct() {
  13377. this.c1 = this.getController("c1");
  13378. this.n0 = (this.getChild("n0"));
  13379. this.n2 = (this.getChild("n2"));
  13380. this.cancelBtn = (this.getChild("cancelBtn"));
  13381. this.videoBtn = (this.getChild("videoBtn"));
  13382. this.n9 = (this.getChild("n9"));
  13383. this.n24 = (this.getChild("n24"));
  13384. this.titleTxt = (this.getChild("titleTxt"));
  13385. this.n32 = (this.getChild("n32"));
  13386. this.n29 = (this.getChild("n29"));
  13387. this.n36 = (this.getChild("n36"));
  13388. this.txtTime = (this.getChild("txtTime"));
  13389. this.t0 = this.getTransition("t0");
  13390. }
  13391. }
  13392. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13393. class ui_try_com2 extends fgui.GComponent {
  13394. static createInstance() {
  13395. return (fgui.UIPackage.createObject("game", "try_com2"));
  13396. }
  13397. onConstruct() {
  13398. this.skillicon = (this.getChild("skillicon"));
  13399. this.n35 = (this.getChild("n35"));
  13400. this.n31 = (this.getChild("n31"));
  13401. this.n32 = (this.getChild("n32"));
  13402. this.n33 = (this.getChild("n33"));
  13403. this.n34 = (this.getChild("n34"));
  13404. }
  13405. }
  13406. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13407. class ui_try_com3 extends fgui.GComponent {
  13408. static createInstance() {
  13409. return (fgui.UIPackage.createObject("game", "try_com3"));
  13410. }
  13411. onConstruct() {
  13412. this.n33 = (this.getChild("n33"));
  13413. this.n34 = (this.getChild("n34"));
  13414. this.n35 = (this.getChild("n35"));
  13415. this.t0 = this.getTransition("t0");
  13416. }
  13417. }
  13418. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13419. class ui_huihe1 extends fgui.GComponent {
  13420. static createInstance() {
  13421. return (fgui.UIPackage.createObject("game", "huihe1"));
  13422. }
  13423. onConstruct() {
  13424. this.n0 = (this.getChild("n0"));
  13425. this.n1 = (this.getChild("n1"));
  13426. this.t0 = this.getTransition("t0");
  13427. }
  13428. }
  13429. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13430. class ui_huihe2 extends fgui.GComponent {
  13431. static createInstance() {
  13432. return (fgui.UIPackage.createObject("game", "huihe2"));
  13433. }
  13434. onConstruct() {
  13435. this.n0 = (this.getChild("n0"));
  13436. this.n1 = (this.getChild("n1"));
  13437. this.t0 = this.getTransition("t0");
  13438. }
  13439. }
  13440. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13441. class ui_Component143 extends fgui.GComponent {
  13442. static createInstance() {
  13443. return (fgui.UIPackage.createObject("game", "Component143"));
  13444. }
  13445. onConstruct() {
  13446. this.n3 = (this.getChild("n3"));
  13447. this.n4 = (this.getChild("n4"));
  13448. this.n5 = (this.getChild("n5"));
  13449. this.n6 = (this.getChild("n6"));
  13450. this.n7 = (this.getChild("n7"));
  13451. this.n8 = (this.getChild("n8"));
  13452. this.n9 = (this.getChild("n9"));
  13453. this.n10 = (this.getChild("n10"));
  13454. this.t0 = this.getTransition("t0");
  13455. }
  13456. }
  13457. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13458. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13459. static createInstance() {
  13460. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13461. }
  13462. onConstruct() {
  13463. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13464. }
  13465. }
  13466. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13467. class ui_dh_jingbi2 extends fgui.GComponent {
  13468. static createInstance() {
  13469. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13470. }
  13471. onConstruct() {
  13472. this.n0 = (this.getChild("n0"));
  13473. this.n1 = (this.getChild("n1"));
  13474. this.n2 = (this.getChild("n2"));
  13475. this.n3 = (this.getChild("n3"));
  13476. this.n4 = (this.getChild("n4"));
  13477. this.n5 = (this.getChild("n5"));
  13478. this.n6 = (this.getChild("n6"));
  13479. this.n8 = (this.getChild("n8"));
  13480. this.n10 = (this.getChild("n10"));
  13481. this.t0 = this.getTransition("t0");
  13482. }
  13483. }
  13484. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13485. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13486. static createInstance() {
  13487. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13488. }
  13489. onConstruct() {
  13490. this.n1 = (this.getChild("n1"));
  13491. this.n4 = (this.getChild("n4"));
  13492. this.t0 = this.getTransition("t0");
  13493. }
  13494. }
  13495. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13496. class ui_dh_jingbi3 extends fgui.GComponent {
  13497. static createInstance() {
  13498. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13499. }
  13500. onConstruct() {
  13501. this.n0 = (this.getChild("n0"));
  13502. this.n1 = (this.getChild("n1"));
  13503. this.n2 = (this.getChild("n2"));
  13504. this.n3 = (this.getChild("n3"));
  13505. this.n4 = (this.getChild("n4"));
  13506. this.n5 = (this.getChild("n5"));
  13507. this.n6 = (this.getChild("n6"));
  13508. this.n8 = (this.getChild("n8"));
  13509. this.n10 = (this.getChild("n10"));
  13510. this.t0 = this.getTransition("t0");
  13511. }
  13512. }
  13513. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13514. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13515. static createInstance() {
  13516. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13517. }
  13518. onConstruct() {
  13519. this.n3 = (this.getChild("n3"));
  13520. this.n1 = (this.getChild("n1"));
  13521. this.t0 = this.getTransition("t0");
  13522. }
  13523. }
  13524. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13525. class ui_hb_jinbi1 extends fgui.GButton {
  13526. static createInstance() {
  13527. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13528. }
  13529. onConstruct() {
  13530. this.n20 = (this.getChild("n20"));
  13531. this.n25 = (this.getChild("n25"));
  13532. this.coinTxt = (this.getChild("coinTxt"));
  13533. this.n28 = (this.getChild("n28"));
  13534. this.n32 = (this.getChild("n32"));
  13535. this.n38 = (this.getChild("n38"));
  13536. this.n45 = (this.getChild("n45"));
  13537. this.getTips = (this.getChild("getTips"));
  13538. this.n39 = (this.getChild("n39"));
  13539. this.diamondTxt = (this.getChild("diamondTxt"));
  13540. this.n41 = (this.getChild("n41"));
  13541. this.n42 = (this.getChild("n42"));
  13542. this.n46 = (this.getChild("n46"));
  13543. this.n47 = (this.getChild("n47"));
  13544. this.n48 = (this.getChild("n48"));
  13545. this.t0 = this.getTransition("t0");
  13546. }
  13547. }
  13548. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13549. class ui_hb_jinbi2 extends fgui.GButton {
  13550. static createInstance() {
  13551. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13552. }
  13553. onConstruct() {
  13554. this.n20 = (this.getChild("n20"));
  13555. this.n25 = (this.getChild("n25"));
  13556. this.coinTxt = (this.getChild("coinTxt"));
  13557. this.n28 = (this.getChild("n28"));
  13558. this.n32 = (this.getChild("n32"));
  13559. this.n38 = (this.getChild("n38"));
  13560. this.n39 = (this.getChild("n39"));
  13561. this.diamondTxt = (this.getChild("diamondTxt"));
  13562. this.n41 = (this.getChild("n41"));
  13563. this.n42 = (this.getChild("n42"));
  13564. this.n43 = (this.getChild("n43"));
  13565. this.n44 = (this.getChild("n44"));
  13566. this.n45 = (this.getChild("n45"));
  13567. this.t0 = this.getTransition("t0");
  13568. }
  13569. }
  13570. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13571. class ui_hb_jinbi3 extends fgui.GButton {
  13572. static createInstance() {
  13573. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13574. }
  13575. onConstruct() {
  13576. this.n20 = (this.getChild("n20"));
  13577. this.n25 = (this.getChild("n25"));
  13578. this.coinTxt = (this.getChild("coinTxt"));
  13579. this.n28 = (this.getChild("n28"));
  13580. this.n32 = (this.getChild("n32"));
  13581. this.n38 = (this.getChild("n38"));
  13582. this.n39 = (this.getChild("n39"));
  13583. this.diamondTxt = (this.getChild("diamondTxt"));
  13584. this.n41 = (this.getChild("n41"));
  13585. this.n42 = (this.getChild("n42"));
  13586. this.n43 = (this.getChild("n43"));
  13587. this.n44 = (this.getChild("n44"));
  13588. this.n45 = (this.getChild("n45"));
  13589. this.t0 = this.getTransition("t0");
  13590. }
  13591. }
  13592. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13593. class ui_Component104 extends fgui.GComponent {
  13594. static createInstance() {
  13595. return (fgui.UIPackage.createObject("game", "Component104"));
  13596. }
  13597. onConstruct() {
  13598. this.c1 = this.getController("c1");
  13599. this.n12 = (this.getChild("n12"));
  13600. this.coinBtn = (this.getChild("coinBtn"));
  13601. this.diamondBtn = (this.getChild("diamondBtn"));
  13602. this.node3 = (this.getChild("node3"));
  13603. this.node4 = (this.getChild("node4"));
  13604. this.node5 = (this.getChild("node5"));
  13605. this.node1 = (this.getChild("node1"));
  13606. this.node2 = (this.getChild("node2"));
  13607. this.node6 = (this.getChild("node6"));
  13608. this.t0 = this.getTransition("t0");
  13609. }
  13610. }
  13611. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13612. class ui_Component105 extends fgui.GButton {
  13613. static createInstance() {
  13614. return (fgui.UIPackage.createObject("game", "Component105"));
  13615. }
  13616. onConstruct() {
  13617. this.c1 = this.getController("c1");
  13618. this.n49 = (this.getChild("n49"));
  13619. this.n18 = (this.getChild("n18"));
  13620. this.n46 = (this.getChild("n46"));
  13621. this.n48 = (this.getChild("n48"));
  13622. }
  13623. }
  13624. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13625. class ui_Component106 extends fgui.GButton {
  13626. static createInstance() {
  13627. return (fgui.UIPackage.createObject("game", "Component106"));
  13628. }
  13629. onConstruct() {
  13630. this.c1 = this.getController("c1");
  13631. this.n49 = (this.getChild("n49"));
  13632. this.n18 = (this.getChild("n18"));
  13633. this.n46 = (this.getChild("n46"));
  13634. this.n48 = (this.getChild("n48"));
  13635. }
  13636. }
  13637. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13638. class ui_hb_zs1 extends fgui.GButton {
  13639. static createInstance() {
  13640. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13641. }
  13642. onConstruct() {
  13643. this.c1 = this.getController("c1");
  13644. this.n20 = (this.getChild("n20"));
  13645. this.n21 = (this.getChild("n21"));
  13646. this.n26 = (this.getChild("n26"));
  13647. this.n27 = (this.getChild("n27"));
  13648. this.shareTxt = (this.getChild("shareTxt"));
  13649. this.n32 = (this.getChild("n32"));
  13650. this.n38 = (this.getChild("n38"));
  13651. this.n39 = (this.getChild("n39"));
  13652. this.n44 = (this.getChild("n44"));
  13653. this.diamondTxt = (this.getChild("diamondTxt"));
  13654. this.n41 = (this.getChild("n41"));
  13655. this.n45 = (this.getChild("n45"));
  13656. this.n47 = (this.getChild("n47"));
  13657. this.n48 = (this.getChild("n48"));
  13658. this.randTxt = (this.getChild("randTxt"));
  13659. this.n50 = (this.getChild("n50"));
  13660. this.t0 = this.getTransition("t0");
  13661. }
  13662. }
  13663. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13664. class ui_dh_zs1 extends fgui.GComponent {
  13665. static createInstance() {
  13666. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13667. }
  13668. onConstruct() {
  13669. this.n10 = (this.getChild("n10"));
  13670. this.n9 = (this.getChild("n9"));
  13671. this.n1 = (this.getChild("n1"));
  13672. this.n2 = (this.getChild("n2"));
  13673. this.n3 = (this.getChild("n3"));
  13674. this.n4 = (this.getChild("n4"));
  13675. this.n5 = (this.getChild("n5"));
  13676. this.n6 = (this.getChild("n6"));
  13677. this.n8 = (this.getChild("n8"));
  13678. this.n11 = (this.getChild("n11"));
  13679. this.t0 = this.getTransition("t0");
  13680. }
  13681. }
  13682. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13683. class ui_dh_zs1_1 extends fgui.GComponent {
  13684. static createInstance() {
  13685. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13686. }
  13687. onConstruct() {
  13688. this.n3 = (this.getChild("n3"));
  13689. this.n1 = (this.getChild("n1"));
  13690. this.t0 = this.getTransition("t0");
  13691. }
  13692. }
  13693. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13694. class ui_hb_zs2 extends fgui.GButton {
  13695. static createInstance() {
  13696. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13697. }
  13698. onConstruct() {
  13699. this.n20 = (this.getChild("n20"));
  13700. this.n21 = (this.getChild("n21"));
  13701. this.n26 = (this.getChild("n26"));
  13702. this.n27 = (this.getChild("n27"));
  13703. this.n32 = (this.getChild("n32"));
  13704. this.n38 = (this.getChild("n38"));
  13705. this.n39 = (this.getChild("n39"));
  13706. this.n44 = (this.getChild("n44"));
  13707. this.diamondTxt = (this.getChild("diamondTxt"));
  13708. this.n41 = (this.getChild("n41"));
  13709. this.n45 = (this.getChild("n45"));
  13710. this.t0 = this.getTransition("t0");
  13711. }
  13712. }
  13713. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13714. class ui_hb_zs3 extends fgui.GButton {
  13715. static createInstance() {
  13716. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13717. }
  13718. onConstruct() {
  13719. this.n20 = (this.getChild("n20"));
  13720. this.n21 = (this.getChild("n21"));
  13721. this.n26 = (this.getChild("n26"));
  13722. this.n27 = (this.getChild("n27"));
  13723. this.n32 = (this.getChild("n32"));
  13724. this.n38 = (this.getChild("n38"));
  13725. this.n47 = (this.getChild("n47"));
  13726. this.t0 = this.getTransition("t0");
  13727. }
  13728. }
  13729. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13730. class ui_dh_zs2 extends fgui.GComponent {
  13731. static createInstance() {
  13732. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13733. }
  13734. onConstruct() {
  13735. this.n10 = (this.getChild("n10"));
  13736. this.n9 = (this.getChild("n9"));
  13737. this.n1 = (this.getChild("n1"));
  13738. this.n2 = (this.getChild("n2"));
  13739. this.n3 = (this.getChild("n3"));
  13740. this.n4 = (this.getChild("n4"));
  13741. this.n5 = (this.getChild("n5"));
  13742. this.n6 = (this.getChild("n6"));
  13743. this.n8 = (this.getChild("n8"));
  13744. this.n11 = (this.getChild("n11"));
  13745. this.t0 = this.getTransition("t0");
  13746. }
  13747. }
  13748. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13749. class ui_dh_zs2_1 extends fgui.GComponent {
  13750. static createInstance() {
  13751. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13752. }
  13753. onConstruct() {
  13754. this.n3 = (this.getChild("n3"));
  13755. this.n1 = (this.getChild("n1"));
  13756. this.t0 = this.getTransition("t0");
  13757. }
  13758. }
  13759. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13760. class ui_dh_zs3 extends fgui.GComponent {
  13761. static createInstance() {
  13762. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13763. }
  13764. onConstruct() {
  13765. this.n10 = (this.getChild("n10"));
  13766. this.n9 = (this.getChild("n9"));
  13767. this.n1 = (this.getChild("n1"));
  13768. this.n2 = (this.getChild("n2"));
  13769. this.n3 = (this.getChild("n3"));
  13770. this.n4 = (this.getChild("n4"));
  13771. this.n5 = (this.getChild("n5"));
  13772. this.n6 = (this.getChild("n6"));
  13773. this.n8 = (this.getChild("n8"));
  13774. this.n11 = (this.getChild("n11"));
  13775. this.t0 = this.getTransition("t0");
  13776. }
  13777. }
  13778. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13779. class ui_dh_zs3_1 extends fgui.GComponent {
  13780. static createInstance() {
  13781. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13782. }
  13783. onConstruct() {
  13784. this.n3 = (this.getChild("n3"));
  13785. this.n1 = (this.getChild("n1"));
  13786. this.t0 = this.getTransition("t0");
  13787. }
  13788. }
  13789. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13790. class ui_Component107 extends fgui.GComponent {
  13791. static createInstance() {
  13792. return (fgui.UIPackage.createObject("game", "Component107"));
  13793. }
  13794. onConstruct() {
  13795. this.n18 = (this.getChild("n18"));
  13796. this.n19 = (this.getChild("n19"));
  13797. this.n20 = (this.getChild("n20"));
  13798. this.n21 = (this.getChild("n21"));
  13799. this.n22 = (this.getChild("n22"));
  13800. this.levelTxt = (this.getChild("levelTxt"));
  13801. this.t0 = this.getTransition("t0");
  13802. }
  13803. }
  13804. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13805. class ui_box_com1 extends fgui.GComponent {
  13806. static createInstance() {
  13807. return (fgui.UIPackage.createObject("game", "box_com1"));
  13808. }
  13809. onConstruct() {
  13810. this.n14 = (this.getChild("n14"));
  13811. this.n6 = (this.getChild("n6"));
  13812. this.t0 = this.getTransition("t0");
  13813. }
  13814. }
  13815. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13816. class ui_box_com2 extends fgui.GProgressBar {
  13817. static createInstance() {
  13818. return (fgui.UIPackage.createObject("game", "box_com2"));
  13819. }
  13820. onConstruct() {
  13821. this.bg0 = (this.getChild("bg0"));
  13822. this.bg = (this.getChild("bg"));
  13823. this.bar = (this.getChild("bar"));
  13824. this.n7 = (this.getChild("n7"));
  13825. this.n8 = (this.getChild("n8"));
  13826. this.n10 = (this.getChild("n10"));
  13827. this.n11 = (this.getChild("n11"));
  13828. this.n12 = (this.getChild("n12"));
  13829. }
  13830. }
  13831. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13832. class ui_box_com4 extends fgui.GComponent {
  13833. static createInstance() {
  13834. return (fgui.UIPackage.createObject("game", "box_com4"));
  13835. }
  13836. onConstruct() {
  13837. this.n8 = (this.getChild("n8"));
  13838. this.t0 = this.getTransition("t0");
  13839. }
  13840. }
  13841. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13842. class ui_box_com3 extends fgui.GComponent {
  13843. static createInstance() {
  13844. return (fgui.UIPackage.createObject("game", "box_com3"));
  13845. }
  13846. onConstruct() {
  13847. this.n2 = (this.getChild("n2"));
  13848. this.n3 = (this.getChild("n3"));
  13849. this.n4 = (this.getChild("n4"));
  13850. this.n5 = (this.getChild("n5"));
  13851. this.t0 = this.getTransition("t0");
  13852. this.t1 = this.getTransition("t1");
  13853. }
  13854. }
  13855. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13856. class ui_Component97 extends fgui.GComponent {
  13857. static createInstance() {
  13858. return (fgui.UIPackage.createObject("game", "Component97"));
  13859. }
  13860. onConstruct() {
  13861. this.c1 = this.getController("c1");
  13862. this.n46 = (this.getChild("n46"));
  13863. this.diamondNode = (this.getChild("diamondNode"));
  13864. this.coinNode = (this.getChild("coinNode"));
  13865. this.t0 = this.getTransition("t0");
  13866. }
  13867. }
  13868. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13869. class ui_Component98 extends fgui.GButton {
  13870. static createInstance() {
  13871. return (fgui.UIPackage.createObject("game", "Component98"));
  13872. }
  13873. onConstruct() {
  13874. this.n8 = (this.getChild("n8"));
  13875. this.n40 = (this.getChild("n40"));
  13876. }
  13877. }
  13878. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13879. class ui_Component28_11 extends fgui.GButton {
  13880. static createInstance() {
  13881. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13882. }
  13883. onConstruct() {
  13884. this.c1 = this.getController("c1");
  13885. this.n12 = (this.getChild("n12"));
  13886. this.n17 = (this.getChild("n17"));
  13887. this.n13 = (this.getChild("n13"));
  13888. this.diamondTxt = (this.getChild("diamondTxt"));
  13889. this.n15 = (this.getChild("n15"));
  13890. this.n16 = (this.getChild("n16"));
  13891. }
  13892. }
  13893. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13894. class ui_Component58_11 extends fgui.GComponent {
  13895. static createInstance() {
  13896. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13897. }
  13898. onConstruct() {
  13899. this.c1 = this.getController("c1");
  13900. this.n23 = (this.getChild("n23"));
  13901. this.n41 = (this.getChild("n41"));
  13902. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13903. this.n_daoju = (this.getChild("n_daoju"));
  13904. this.myList = (this.getChild("myList"));
  13905. this.djList = (this.getChild("djList"));
  13906. this.t0 = this.getTransition("t0");
  13907. }
  13908. }
  13909. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13910. class ui_Component100 extends fgui.GComponent {
  13911. static createInstance() {
  13912. return (fgui.UIPackage.createObject("game", "Component100"));
  13913. }
  13914. onConstruct() {
  13915. this.c1 = this.getController("c1");
  13916. this.n75 = (this.getChild("n75"));
  13917. this.n76 = (this.getChild("n76"));
  13918. this.n80 = (this.getChild("n80"));
  13919. this.txt = (this.getChild("txt"));
  13920. this.spineRoot = (this.getChild("spineRoot"));
  13921. }
  13922. }
  13923. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13924. class ui_Component101 extends fgui.GComponent {
  13925. static createInstance() {
  13926. return (fgui.UIPackage.createObject("game", "Component101"));
  13927. }
  13928. onConstruct() {
  13929. this.c1 = this.getController("c1");
  13930. this.n36 = (this.getChild("n36"));
  13931. this.n35 = (this.getChild("n35"));
  13932. this.n33 = (this.getChild("n33"));
  13933. this.n34 = (this.getChild("n34"));
  13934. }
  13935. }
  13936. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13937. class ui_Component53 extends fgui.GComponent {
  13938. static createInstance() {
  13939. return (fgui.UIPackage.createObject("game", "Component53"));
  13940. }
  13941. onConstruct() {
  13942. this.n0 = (this.getChild("n0"));
  13943. this.n1 = (this.getChild("n1"));
  13944. this.n2 = (this.getChild("n2"));
  13945. this.n3 = (this.getChild("n3"));
  13946. this.n4 = (this.getChild("n4"));
  13947. this.n5 = (this.getChild("n5"));
  13948. this.n6 = (this.getChild("n6"));
  13949. this.n7 = (this.getChild("n7"));
  13950. this.n8 = (this.getChild("n8"));
  13951. this.n9 = (this.getChild("n9"));
  13952. this.n10 = (this.getChild("n10"));
  13953. this.n11 = (this.getChild("n11"));
  13954. this.n12 = (this.getChild("n12"));
  13955. this.n13 = (this.getChild("n13"));
  13956. this.n14 = (this.getChild("n14"));
  13957. this.n15 = (this.getChild("n15"));
  13958. this.n16 = (this.getChild("n16"));
  13959. this.n19 = (this.getChild("n19"));
  13960. this.n20 = (this.getChild("n20"));
  13961. this.n21 = (this.getChild("n21"));
  13962. this.n22 = (this.getChild("n22"));
  13963. this.n23 = (this.getChild("n23"));
  13964. this.n24 = (this.getChild("n24"));
  13965. this.n25 = (this.getChild("n25"));
  13966. this.n26 = (this.getChild("n26"));
  13967. this.n27 = (this.getChild("n27"));
  13968. this.n28 = (this.getChild("n28"));
  13969. this.n29 = (this.getChild("n29"));
  13970. this.n30 = (this.getChild("n30"));
  13971. this.n31 = (this.getChild("n31"));
  13972. this.n32 = (this.getChild("n32"));
  13973. this.n33 = (this.getChild("n33"));
  13974. this.n34 = (this.getChild("n34"));
  13975. this.n35 = (this.getChild("n35"));
  13976. this.t0 = this.getTransition("t0");
  13977. }
  13978. }
  13979. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13980. class ui_Component58 extends fgui.GComponent {
  13981. static createInstance() {
  13982. return (fgui.UIPackage.createObject("game", "Component58"));
  13983. }
  13984. onConstruct() {
  13985. this.n23 = (this.getChild("n23"));
  13986. this.n41 = (this.getChild("n41"));
  13987. this.n8 = (this.getChild("n8"));
  13988. this.skillList = (this.getChild("skillList"));
  13989. this.t0 = this.getTransition("t0");
  13990. }
  13991. }
  13992. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13993. class ui_Component59 extends fgui.GComponent {
  13994. static createInstance() {
  13995. return (fgui.UIPackage.createObject("game", "Component59"));
  13996. }
  13997. onConstruct() {
  13998. this.n3 = (this.getChild("n3"));
  13999. this.msgTxt = (this.getChild("msgTxt"));
  14000. this.t0 = this.getTransition("t0");
  14001. }
  14002. }
  14003. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  14004. class ui_Component_lc2 extends fgui.GComponent {
  14005. static createInstance() {
  14006. return (fgui.UIPackage.createObject("game", "Component_lc2"));
  14007. }
  14008. onConstruct() {
  14009. this.n0 = (this.getChild("n0"));
  14010. this.n1_bai = (this.getChild("n1_bai"));
  14011. }
  14012. }
  14013. ui_Component_lc2.URL = "ui://isxx5ak7ggd1v5ay";
  14014. class ui_Component_shou2 extends fgui.GComponent {
  14015. static createInstance() {
  14016. return (fgui.UIPackage.createObject("game", "Component_shou2"));
  14017. }
  14018. onConstruct() {
  14019. this.n57 = (this.getChild("n57"));
  14020. this.n54 = (this.getChild("n54"));
  14021. this.n55 = (this.getChild("n55"));
  14022. this.n56 = (this.getChild("n56"));
  14023. this.t1 = this.getTransition("t1");
  14024. }
  14025. }
  14026. ui_Component_shou2.URL = "ui://isxx5ak7ggd1v5b0";
  14027. class ui_RulerNode extends fgui.GComponent {
  14028. static createInstance() {
  14029. return (fgui.UIPackage.createObject("game", "RulerNode"));
  14030. }
  14031. onConstruct() {
  14032. this.n6 = (this.getChild("n6"));
  14033. this.n4 = (this.getChild("n4"));
  14034. this.img1 = (this.getChild("img1"));
  14035. this.img2 = (this.getChild("img2"));
  14036. }
  14037. }
  14038. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  14039. class ui_Component108 extends fgui.GComponent {
  14040. static createInstance() {
  14041. return (fgui.UIPackage.createObject("game", "Component108"));
  14042. }
  14043. onConstruct() {
  14044. this.n19 = (this.getChild("n19"));
  14045. this.t0 = this.getTransition("t0");
  14046. }
  14047. }
  14048. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  14049. class ui_Component63 extends fgui.GComponent {
  14050. static createInstance() {
  14051. return (fgui.UIPackage.createObject("game", "Component63"));
  14052. }
  14053. onConstruct() {
  14054. this.n66 = (this.getChild("n66"));
  14055. this.n56 = (this.getChild("n56"));
  14056. this.n63 = (this.getChild("n63"));
  14057. this.n65 = (this.getChild("n65"));
  14058. this.t0 = this.getTransition("t0");
  14059. }
  14060. }
  14061. ui_Component63.URL = "ui://isxx5ak7h657452";
  14062. class ui_topNode extends fgui.GComponent {
  14063. static createInstance() {
  14064. return (fgui.UIPackage.createObject("game", "topNode"));
  14065. }
  14066. onConstruct() {
  14067. this.selfProgress = (this.getChild("selfProgress"));
  14068. this.aiProgress = (this.getChild("aiProgress"));
  14069. this.selfKuang = (this.getChild("selfKuang"));
  14070. this.aiKuang = (this.getChild("aiKuang"));
  14071. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  14072. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  14073. this.n33 = (this.getChild("n33"));
  14074. this.n34 = (this.getChild("n34"));
  14075. this.selfNameTxt = (this.getChild("selfNameTxt"));
  14076. this.aiNameTxt = (this.getChild("aiNameTxt"));
  14077. this.selfBallList = (this.getChild("selfBallList"));
  14078. this.aiBallList = (this.getChild("aiBallList"));
  14079. this.middleNode = (this.getChild("middleNode"));
  14080. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  14081. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  14082. this.scoreNode = (this.getChild("scoreNode"));
  14083. this.selfTips = (this.getChild("selfTips"));
  14084. this.aiTips = (this.getChild("aiTips"));
  14085. }
  14086. }
  14087. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  14088. class ui_selfProgress extends fgui.GProgressBar {
  14089. static createInstance() {
  14090. return (fgui.UIPackage.createObject("game", "selfProgress"));
  14091. }
  14092. onConstruct() {
  14093. this.n3 = (this.getChild("n3"));
  14094. this.bar = (this.getChild("bar"));
  14095. }
  14096. }
  14097. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  14098. class ui_aiProgress extends fgui.GProgressBar {
  14099. static createInstance() {
  14100. return (fgui.UIPackage.createObject("game", "aiProgress"));
  14101. }
  14102. onConstruct() {
  14103. this.n3 = (this.getChild("n3"));
  14104. this.bar = (this.getChild("bar"));
  14105. }
  14106. }
  14107. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  14108. class ui_ballDisplay extends fgui.GComponent {
  14109. static createInstance() {
  14110. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  14111. }
  14112. onConstruct() {
  14113. this.myImg = (this.getChild("myImg"));
  14114. }
  14115. }
  14116. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  14117. class ui_moveNode extends fgui.GComponent {
  14118. static createInstance() {
  14119. return (fgui.UIPackage.createObject("game", "moveNode"));
  14120. }
  14121. onConstruct() {
  14122. this.n8 = (this.getChild("n8"));
  14123. this.finger = (this.getChild("finger"));
  14124. }
  14125. }
  14126. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  14127. class ui_cancelBtn extends fgui.GButton {
  14128. static createInstance() {
  14129. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  14130. }
  14131. onConstruct() {
  14132. this.c1 = this.getController("c1");
  14133. this.n0 = (this.getChild("n0"));
  14134. this.n1 = (this.getChild("n1"));
  14135. }
  14136. }
  14137. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  14138. class ui_shareBtn extends fgui.GButton {
  14139. static createInstance() {
  14140. return (fgui.UIPackage.createObject("game", "shareBtn"));
  14141. }
  14142. onConstruct() {
  14143. this.c1 = this.getController("c1");
  14144. this.n2 = (this.getChild("n2"));
  14145. this.n1 = (this.getChild("n1"));
  14146. this.n3 = (this.getChild("n3"));
  14147. this.n4 = (this.getChild("n4"));
  14148. this.n5 = (this.getChild("n5"));
  14149. this.n6 = (this.getChild("n6"));
  14150. }
  14151. }
  14152. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  14153. class ui_share2Btn extends fgui.GButton {
  14154. static createInstance() {
  14155. return (fgui.UIPackage.createObject("game", "share2Btn"));
  14156. }
  14157. onConstruct() {
  14158. this.n3 = (this.getChild("n3"));
  14159. }
  14160. }
  14161. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  14162. class ui_rodMethodNode extends fgui.GComponent {
  14163. static createInstance() {
  14164. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  14165. }
  14166. onConstruct() {
  14167. this.bg = (this.getChild("bg"));
  14168. this.dot = (this.getChild("dot"));
  14169. }
  14170. }
  14171. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  14172. class ui_sureBtn extends fgui.GButton {
  14173. static createInstance() {
  14174. return (fgui.UIPackage.createObject("game", "sureBtn"));
  14175. }
  14176. onConstruct() {
  14177. this.n2 = (this.getChild("n2"));
  14178. this.n1 = (this.getChild("n1"));
  14179. }
  14180. }
  14181. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  14182. class ui_Component18 extends fgui.GComponent {
  14183. static createInstance() {
  14184. return (fgui.UIPackage.createObject("game", "Component18"));
  14185. }
  14186. onConstruct() {
  14187. this.c1 = this.getController("c1");
  14188. this.nameTxt = (this.getChild("nameTxt"));
  14189. this.headImg = (this.getChild("headImg"));
  14190. this.n24 = (this.getChild("n24"));
  14191. this.skillImg = (this.getChild("skillImg"));
  14192. this.skillTxt = (this.getChild("skillTxt"));
  14193. }
  14194. }
  14195. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14196. class ui_Component45 extends fgui.GComponent {
  14197. static createInstance() {
  14198. return (fgui.UIPackage.createObject("game", "Component45"));
  14199. }
  14200. onConstruct() {
  14201. this.c1 = this.getController("c1");
  14202. this.n40 = (this.getChild("n40"));
  14203. this.n41 = (this.getChild("n41"));
  14204. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14205. this.n42 = (this.getChild("n42"));
  14206. this.awardTxt = (this.getChild("awardTxt"));
  14207. this.n44 = (this.getChild("n44"));
  14208. this.t0 = this.getTransition("t0");
  14209. }
  14210. }
  14211. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14212. class ui_emotionDisplay extends fgui.GButton {
  14213. static createInstance() {
  14214. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14215. }
  14216. onConstruct() {
  14217. this.myIcon = (this.getChild("myIcon"));
  14218. }
  14219. }
  14220. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14221. class ui_Component49 extends fgui.GButton {
  14222. static createInstance() {
  14223. return (fgui.UIPackage.createObject("game", "Component49"));
  14224. }
  14225. onConstruct() {
  14226. this.n69 = (this.getChild("n69"));
  14227. this.n56 = (this.getChild("n56"));
  14228. }
  14229. }
  14230. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14231. class ui_Component50 extends fgui.GButton {
  14232. static createInstance() {
  14233. return (fgui.UIPackage.createObject("game", "Component50"));
  14234. }
  14235. onConstruct() {
  14236. this.n54 = (this.getChild("n54"));
  14237. this.n65 = (this.getChild("n65"));
  14238. }
  14239. }
  14240. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14241. class ui_Component51 extends fgui.GButton {
  14242. static createInstance() {
  14243. return (fgui.UIPackage.createObject("game", "Component51"));
  14244. }
  14245. onConstruct() {
  14246. this.c1 = this.getController("c1");
  14247. this.n51 = (this.getChild("n51"));
  14248. this.n54 = (this.getChild("n54"));
  14249. }
  14250. }
  14251. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14252. class ui_Button5 extends fgui.GButton {
  14253. static createInstance() {
  14254. return (fgui.UIPackage.createObject("game", "Button5"));
  14255. }
  14256. onConstruct() {
  14257. this.c1 = this.getController("c1");
  14258. this.n0 = (this.getChild("n0"));
  14259. this.n2 = (this.getChild("n2"));
  14260. }
  14261. }
  14262. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14263. class ui_Component124 extends fgui.GComponent {
  14264. static createInstance() {
  14265. return (fgui.UIPackage.createObject("game", "Component124"));
  14266. }
  14267. onConstruct() {
  14268. this.n22 = (this.getChild("n22"));
  14269. this.shareNode = (this.getChild("shareNode"));
  14270. }
  14271. }
  14272. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14273. class ui_Component125 extends fgui.GComponent {
  14274. static createInstance() {
  14275. return (fgui.UIPackage.createObject("game", "Component125"));
  14276. }
  14277. onConstruct() {
  14278. this.n29 = (this.getChild("n29"));
  14279. this.coinTxt = (this.getChild("coinTxt"));
  14280. }
  14281. }
  14282. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14283. class ui_Component52 extends fgui.GButton {
  14284. static createInstance() {
  14285. return (fgui.UIPackage.createObject("game", "Component52"));
  14286. }
  14287. onConstruct() {
  14288. this.n35 = (this.getChild("n35"));
  14289. this.n36 = (this.getChild("n36"));
  14290. }
  14291. }
  14292. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14293. class ui_Component_denglu extends fgui.GComponent {
  14294. static createInstance() {
  14295. return (fgui.UIPackage.createObject("game", "Component_denglu"));
  14296. }
  14297. onConstruct() {
  14298. this.c1 = this.getController("c1");
  14299. this.n102 = (this.getChild("n102"));
  14300. this.n103 = (this.getChild("n103"));
  14301. }
  14302. }
  14303. ui_Component_denglu.URL = "ui://isxx5ak7ijwrv5a0";
  14304. class ui_UIFuli1 extends fgui.GComponent {
  14305. static createInstance() {
  14306. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  14307. }
  14308. onConstruct() {
  14309. this.n1 = (this.getChild("n1"));
  14310. this.n2 = (this.getChild("n2"));
  14311. }
  14312. }
  14313. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  14314. class ui_Component_fl_1 extends fgui.GComponent {
  14315. static createInstance() {
  14316. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14317. }
  14318. onConstruct() {
  14319. this.n_zzq_fl1 = (this.getChild("n_zzq_fl1"));
  14320. this.txt_price = (this.getChild("txt_price"));
  14321. this.n_no = (this.getChild("n_no"));
  14322. this.n_buy = (this.getChild("n_buy"));
  14323. }
  14324. }
  14325. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14326. class ui_Component_fl_2 extends fgui.GComponent {
  14327. static createInstance() {
  14328. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14329. }
  14330. onConstruct() {
  14331. this.n_zzq_fl2 = (this.getChild("n_zzq_fl2"));
  14332. this.txt_price = (this.getChild("txt_price"));
  14333. this.n_no = (this.getChild("n_no"));
  14334. this.n_buy = (this.getChild("n_buy"));
  14335. }
  14336. }
  14337. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14338. class ui_UIFuli2 extends fgui.GComponent {
  14339. static createInstance() {
  14340. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  14341. }
  14342. onConstruct() {
  14343. this.n1 = (this.getChild("n1"));
  14344. this.n2 = (this.getChild("n2"));
  14345. }
  14346. }
  14347. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  14348. class ui_drawBtn extends fgui.GButton {
  14349. static createInstance() {
  14350. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14351. }
  14352. onConstruct() {
  14353. this.c1 = this.getController("c1");
  14354. this.n2 = (this.getChild("n2"));
  14355. this.n1 = (this.getChild("n1"));
  14356. this.n5 = (this.getChild("n5"));
  14357. }
  14358. }
  14359. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14360. class ui_Component43 extends fgui.GButton {
  14361. static createInstance() {
  14362. return (fgui.UIPackage.createObject("game", "Component43"));
  14363. }
  14364. onConstruct() {
  14365. this.n49 = (this.getChild("n49"));
  14366. }
  14367. }
  14368. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14369. class ui_wordsDisplay extends fgui.GComponent {
  14370. static createInstance() {
  14371. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14372. }
  14373. onConstruct() {
  14374. this.txt = (this.getChild("txt"));
  14375. this.n63 = (this.getChild("n63"));
  14376. }
  14377. }
  14378. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14379. class ui_Component_phb extends fgui.GComponent {
  14380. static createInstance() {
  14381. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14382. }
  14383. onConstruct() {
  14384. this.n3 = (this.getChild("n3"));
  14385. this.n4 = (this.getChild("n4"));
  14386. }
  14387. }
  14388. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14389. class ui_Component3 extends fgui.GComponent {
  14390. static createInstance() {
  14391. return (fgui.UIPackage.createObject("game", "Component3"));
  14392. }
  14393. onConstruct() {
  14394. this.n26 = (this.getChild("n26"));
  14395. this.n24 = (this.getChild("n24"));
  14396. this.nameTxt = (this.getChild("nameTxt"));
  14397. this.headRoot = (this.getChild("headRoot"));
  14398. }
  14399. }
  14400. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14401. class ui_Component4 extends fgui.GComponent {
  14402. static createInstance() {
  14403. return (fgui.UIPackage.createObject("game", "Component4"));
  14404. }
  14405. onConstruct() {
  14406. this.headImg = (this.getChild("headImg"));
  14407. }
  14408. }
  14409. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14410. class ui_Component7 extends fgui.GButton {
  14411. static createInstance() {
  14412. return (fgui.UIPackage.createObject("game", "Component7"));
  14413. }
  14414. onConstruct() {
  14415. this.n17 = (this.getChild("n17"));
  14416. }
  14417. }
  14418. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14419. class ui_Component8 extends fgui.GButton {
  14420. static createInstance() {
  14421. return (fgui.UIPackage.createObject("game", "Component8"));
  14422. }
  14423. onConstruct() {
  14424. this.n19 = (this.getChild("n19"));
  14425. }
  14426. }
  14427. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14428. class ui_Component10 extends fgui.GButton {
  14429. static createInstance() {
  14430. return (fgui.UIPackage.createObject("game", "Component10"));
  14431. }
  14432. onConstruct() {
  14433. this.c1 = this.getController("c1");
  14434. this.n40 = (this.getChild("n40"));
  14435. }
  14436. }
  14437. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14438. class ui_Component11 extends fgui.GButton {
  14439. static createInstance() {
  14440. return (fgui.UIPackage.createObject("game", "Component11"));
  14441. }
  14442. onConstruct() {
  14443. this.n34 = (this.getChild("n34"));
  14444. }
  14445. }
  14446. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14447. class ui_Component12 extends fgui.GButton {
  14448. static createInstance() {
  14449. return (fgui.UIPackage.createObject("game", "Component12"));
  14450. }
  14451. onConstruct() {
  14452. this.n35 = (this.getChild("n35"));
  14453. }
  14454. }
  14455. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14456. class ui_Component13 extends fgui.GButton {
  14457. static createInstance() {
  14458. return (fgui.UIPackage.createObject("game", "Component13"));
  14459. }
  14460. onConstruct() {
  14461. this.n27 = (this.getChild("n27"));
  14462. this.n36 = (this.getChild("n36"));
  14463. }
  14464. }
  14465. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14466. class ui_dh_js_tuowei extends fgui.GComponent {
  14467. static createInstance() {
  14468. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14469. }
  14470. onConstruct() {
  14471. this.n19 = (this.getChild("n19"));
  14472. this.n18 = (this.getChild("n18"));
  14473. this.n0 = (this.getChild("n0"));
  14474. this.n3 = (this.getChild("n3"));
  14475. this.n4 = (this.getChild("n4"));
  14476. this.n5 = (this.getChild("n5"));
  14477. this.n6 = (this.getChild("n6"));
  14478. this.n8 = (this.getChild("n8"));
  14479. this.n9 = (this.getChild("n9"));
  14480. this.n10 = (this.getChild("n10"));
  14481. this.n11 = (this.getChild("n11"));
  14482. this.n12 = (this.getChild("n12"));
  14483. this.n13 = (this.getChild("n13"));
  14484. this.n14 = (this.getChild("n14"));
  14485. this.n15 = (this.getChild("n15"));
  14486. this.n20 = (this.getChild("n20"));
  14487. this.t0 = this.getTransition("t0");
  14488. this.t1 = this.getTransition("t1");
  14489. }
  14490. }
  14491. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14492. class ui_dh_js_tw_g extends fgui.GComponent {
  14493. static createInstance() {
  14494. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14495. }
  14496. onConstruct() {
  14497. this.n0 = (this.getChild("n0"));
  14498. this.n1 = (this.getChild("n1"));
  14499. this.t0 = this.getTransition("t0");
  14500. }
  14501. }
  14502. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14503. class ui_dh_js_xingxing extends fgui.GComponent {
  14504. static createInstance() {
  14505. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14506. }
  14507. onConstruct() {
  14508. this.n1 = (this.getChild("n1"));
  14509. this.n2 = (this.getChild("n2"));
  14510. this.n3 = (this.getChild("n3"));
  14511. this.n4 = (this.getChild("n4"));
  14512. this.n0 = (this.getChild("n0"));
  14513. this.t2 = this.getTransition("t2");
  14514. this.t1 = this.getTransition("t1");
  14515. }
  14516. }
  14517. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14518. class ui_dh_zy_jiazai extends fgui.GComponent {
  14519. static createInstance() {
  14520. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14521. }
  14522. onConstruct() {
  14523. this.c1 = this.getController("c1");
  14524. this.n0 = (this.getChild("n0"));
  14525. this.n1 = (this.getChild("n1"));
  14526. this.n2 = (this.getChild("n2"));
  14527. this.n4 = (this.getChild("n4"));
  14528. this.n5 = (this.getChild("n5"));
  14529. this.n6 = (this.getChild("n6"));
  14530. this.n8 = (this.getChild("n8"));
  14531. this.n7 = (this.getChild("n7"));
  14532. this.t0 = this.getTransition("t0");
  14533. }
  14534. }
  14535. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14536. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14537. static createInstance() {
  14538. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14539. }
  14540. onConstruct() {
  14541. this.c1 = this.getController("c1");
  14542. this.n3 = (this.getChild("n3"));
  14543. this.n5 = (this.getChild("n5"));
  14544. this.n4 = (this.getChild("n4"));
  14545. this.n0 = (this.getChild("n0"));
  14546. this.n1 = (this.getChild("n1"));
  14547. this.n2 = (this.getChild("n2"));
  14548. }
  14549. }
  14550. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14551. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14552. static createInstance() {
  14553. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14554. }
  14555. onConstruct() {
  14556. this.n19 = (this.getChild("n19"));
  14557. this.n21 = (this.getChild("n21"));
  14558. this.n0 = (this.getChild("n0"));
  14559. this.n3 = (this.getChild("n3"));
  14560. this.n4 = (this.getChild("n4"));
  14561. this.n5 = (this.getChild("n5"));
  14562. this.n6 = (this.getChild("n6"));
  14563. this.n8 = (this.getChild("n8"));
  14564. this.n9 = (this.getChild("n9"));
  14565. this.n10 = (this.getChild("n10"));
  14566. this.n11 = (this.getChild("n11"));
  14567. this.n12 = (this.getChild("n12"));
  14568. this.n13 = (this.getChild("n13"));
  14569. this.n14 = (this.getChild("n14"));
  14570. this.n15 = (this.getChild("n15"));
  14571. this.n23 = (this.getChild("n23"));
  14572. this.t0 = this.getTransition("t0");
  14573. this.t1 = this.getTransition("t1");
  14574. }
  14575. }
  14576. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14577. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14578. static createInstance() {
  14579. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14580. }
  14581. onConstruct() {
  14582. this.n1 = (this.getChild("n1"));
  14583. this.n2 = (this.getChild("n2"));
  14584. this.t0 = this.getTransition("t0");
  14585. }
  14586. }
  14587. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14588. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14589. static createInstance() {
  14590. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14591. }
  14592. onConstruct() {
  14593. this.n4 = (this.getChild("n4"));
  14594. this.n2 = (this.getChild("n2"));
  14595. this.n3 = (this.getChild("n3"));
  14596. this.idle = this.getTransition("idle");
  14597. this.attack = this.getTransition("attack");
  14598. }
  14599. }
  14600. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14601. class ui_special extends fgui.GComponent {
  14602. static createInstance() {
  14603. return (fgui.UIPackage.createObject("game", "special"));
  14604. }
  14605. onConstruct() {
  14606. this.n18 = (this.getChild("n18"));
  14607. this.n19 = (this.getChild("n19"));
  14608. this.n20 = (this.getChild("n20"));
  14609. this.n21 = (this.getChild("n21"));
  14610. this.n22 = (this.getChild("n22"));
  14611. this.levelTxt = (this.getChild("levelTxt"));
  14612. this.n24 = (this.getChild("n24"));
  14613. this.n25 = (this.getChild("n25"));
  14614. this.t0 = this.getTransition("t0");
  14615. }
  14616. }
  14617. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14618. class ui_Component145 extends fgui.GComponent {
  14619. static createInstance() {
  14620. return (fgui.UIPackage.createObject("game", "Component145"));
  14621. }
  14622. onConstruct() {
  14623. this.guanyuNode = (this.getChild("guanyuNode"));
  14624. }
  14625. }
  14626. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14627. class ui_longBtn extends fgui.GButton {
  14628. static createInstance() {
  14629. return (fgui.UIPackage.createObject("game", "longBtn"));
  14630. }
  14631. onConstruct() {
  14632. this.c1 = this.getController("c1");
  14633. this.n2 = (this.getChild("n2"));
  14634. this.n1 = (this.getChild("n1"));
  14635. this.n4 = (this.getChild("n4"));
  14636. }
  14637. }
  14638. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14639. class ui_Component146 extends fgui.GComponent {
  14640. static createInstance() {
  14641. return (fgui.UIPackage.createObject("game", "Component146"));
  14642. }
  14643. onConstruct() {
  14644. this.n89 = (this.getChild("n89"));
  14645. this.n90 = (this.getChild("n90"));
  14646. this.guideBtn = (this.getChild("guideBtn"));
  14647. }
  14648. }
  14649. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14650. class ui_Component146_11 extends fgui.GComponent {
  14651. static createInstance() {
  14652. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14653. }
  14654. onConstruct() {
  14655. this.n89 = (this.getChild("n89"));
  14656. this.n90 = (this.getChild("n90"));
  14657. this.guideBtn = (this.getChild("guideBtn"));
  14658. }
  14659. }
  14660. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14661. class ui_Component111_1 extends fgui.GComponent {
  14662. static createInstance() {
  14663. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14664. }
  14665. onConstruct() {
  14666. this.n68 = (this.getChild("n68"));
  14667. this.myMask = (this.getChild("myMask"));
  14668. }
  14669. }
  14670. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14671. class ui_Component64_1 extends fgui.GComponent {
  14672. static createInstance() {
  14673. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14674. }
  14675. onConstruct() {
  14676. this.n57 = (this.getChild("n57"));
  14677. this.n54 = (this.getChild("n54"));
  14678. this.n55 = (this.getChild("n55"));
  14679. this.n56 = (this.getChild("n56"));
  14680. this.t1 = this.getTransition("t1");
  14681. }
  14682. }
  14683. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14684. class ui_ModeSelection_com123 extends fgui.GComponent {
  14685. static createInstance() {
  14686. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14687. }
  14688. onConstruct() {
  14689. this.type1 = (this.getChild("type1"));
  14690. this.type2 = (this.getChild("type2"));
  14691. this.type3 = (this.getChild("type3"));
  14692. this.n38 = (this.getChild("n38"));
  14693. this.t0 = this.getTransition("t0");
  14694. }
  14695. }
  14696. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14697. class ui_Component132_2 extends fgui.GComponent {
  14698. static createInstance() {
  14699. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14700. }
  14701. onConstruct() {
  14702. this.n25 = (this.getChild("n25"));
  14703. this.n26 = (this.getChild("n26"));
  14704. this.n27 = (this.getChild("n27"));
  14705. this.t0 = this.getTransition("t0");
  14706. }
  14707. }
  14708. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14709. class ui_UIPower$1 extends fgui.GComponent {
  14710. static createInstance() {
  14711. return (fgui.UIPackage.createObject("game", "UIPower"));
  14712. }
  14713. onConstruct() {
  14714. this.n11 = (this.getChild("n11"));
  14715. this.myNode = (this.getChild("myNode"));
  14716. this.t0 = this.getTransition("t0");
  14717. }
  14718. }
  14719. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14720. class ui_Component133 extends fgui.GComponent {
  14721. static createInstance() {
  14722. return (fgui.UIPackage.createObject("game", "Component133"));
  14723. }
  14724. onConstruct() {
  14725. this.n29 = (this.getChild("n29"));
  14726. this.n30 = (this.getChild("n30"));
  14727. }
  14728. }
  14729. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14730. class ui_Component134 extends fgui.GComponent {
  14731. static createInstance() {
  14732. return (fgui.UIPackage.createObject("game", "Component134"));
  14733. }
  14734. onConstruct() {
  14735. this.n30 = (this.getChild("n30"));
  14736. this.n31 = (this.getChild("n31"));
  14737. this.t0 = this.getTransition("t0");
  14738. }
  14739. }
  14740. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14741. class ui_Component135 extends fgui.GComponent {
  14742. static createInstance() {
  14743. return (fgui.UIPackage.createObject("game", "Component135"));
  14744. }
  14745. onConstruct() {
  14746. this.n30 = (this.getChild("n30"));
  14747. this.t0 = this.getTransition("t0");
  14748. }
  14749. }
  14750. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14751. class ui_Component137 extends fgui.GComponent {
  14752. static createInstance() {
  14753. return (fgui.UIPackage.createObject("game", "Component137"));
  14754. }
  14755. onConstruct() {
  14756. this.n28 = (this.getChild("n28"));
  14757. this.n29 = (this.getChild("n29"));
  14758. this.n30 = (this.getChild("n30"));
  14759. this.n32 = (this.getChild("n32"));
  14760. }
  14761. }
  14762. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14763. class ui_dh_zuanshi extends fgui.GButton {
  14764. static createInstance() {
  14765. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14766. }
  14767. onConstruct() {
  14768. this.n1 = (this.getChild("n1"));
  14769. this.n2 = (this.getChild("n2"));
  14770. this.n0 = (this.getChild("n0"));
  14771. this.n3 = (this.getChild("n3"));
  14772. this.n4 = (this.getChild("n4"));
  14773. }
  14774. }
  14775. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14776. class ui_Component138 extends fgui.GComponent {
  14777. static createInstance() {
  14778. return (fgui.UIPackage.createObject("game", "Component138"));
  14779. }
  14780. onConstruct() {
  14781. this.n1 = (this.getChild("n1"));
  14782. this.n2 = (this.getChild("n2"));
  14783. this.t0 = this.getTransition("t0");
  14784. }
  14785. }
  14786. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14787. class ui_Component139 extends fgui.GComponent {
  14788. static createInstance() {
  14789. return (fgui.UIPackage.createObject("game", "Component139"));
  14790. }
  14791. onConstruct() {
  14792. this.n0 = (this.getChild("n0"));
  14793. this.t0 = this.getTransition("t0");
  14794. }
  14795. }
  14796. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14797. class ui_Component140 extends fgui.GComponent {
  14798. static createInstance() {
  14799. return (fgui.UIPackage.createObject("game", "Component140"));
  14800. }
  14801. onConstruct() {
  14802. this.n2 = (this.getChild("n2"));
  14803. this.n3 = (this.getChild("n3"));
  14804. this.t0 = this.getTransition("t0");
  14805. }
  14806. }
  14807. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14808. class ui_Component141 extends fgui.GComponent {
  14809. static createInstance() {
  14810. return (fgui.UIPackage.createObject("game", "Component141"));
  14811. }
  14812. onConstruct() {
  14813. this.n0 = (this.getChild("n0"));
  14814. this.t0 = this.getTransition("t0");
  14815. }
  14816. }
  14817. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14818. class ui_powerNode extends fgui.GProgressBar {
  14819. static createInstance() {
  14820. return (fgui.UIPackage.createObject("game", "powerNode"));
  14821. }
  14822. onConstruct() {
  14823. this.n2 = (this.getChild("n2"));
  14824. this.bar_v = (this.getChild("bar_v"));
  14825. this.showImg = (this.getChild("showImg"));
  14826. this.n12 = (this.getChild("n12"));
  14827. }
  14828. }
  14829. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14830. class ui_dh_jingbi1 extends fgui.GComponent {
  14831. static createInstance() {
  14832. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14833. }
  14834. onConstruct() {
  14835. this.n0 = (this.getChild("n0"));
  14836. this.n1 = (this.getChild("n1"));
  14837. this.n2 = (this.getChild("n2"));
  14838. this.n3 = (this.getChild("n3"));
  14839. this.n4 = (this.getChild("n4"));
  14840. this.n5 = (this.getChild("n5"));
  14841. this.n6 = (this.getChild("n6"));
  14842. this.n8 = (this.getChild("n8"));
  14843. this.t0 = this.getTransition("t0");
  14844. }
  14845. }
  14846. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14847. class ui_Component94 extends fgui.GButton {
  14848. static createInstance() {
  14849. return (fgui.UIPackage.createObject("game", "Component94"));
  14850. }
  14851. onConstruct() {
  14852. this.n77 = (this.getChild("n77"));
  14853. }
  14854. }
  14855. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14856. class ui_Component95 extends fgui.GButton {
  14857. static createInstance() {
  14858. return (fgui.UIPackage.createObject("game", "Component95"));
  14859. }
  14860. onConstruct() {
  14861. this.n77 = (this.getChild("n77"));
  14862. }
  14863. }
  14864. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14865. class ui_Component126 extends fgui.GComponent {
  14866. static createInstance() {
  14867. return (fgui.UIPackage.createObject("game", "Component126"));
  14868. }
  14869. onConstruct() {
  14870. this.c1 = this.getController("c1");
  14871. this.normalBtn = (this.getChild("normalBtn"));
  14872. this.tripleBtn = (this.getChild("tripleBtn"));
  14873. }
  14874. }
  14875. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14876. class ui_Component60 extends fgui.GComponent {
  14877. static createInstance() {
  14878. return (fgui.UIPackage.createObject("game", "Component60"));
  14879. }
  14880. onConstruct() {
  14881. this.c1 = this.getController("c1");
  14882. this.n48 = (this.getChild("n48"));
  14883. this.womanTxt = (this.getChild("womanTxt"));
  14884. this.t0 = this.getTransition("t0");
  14885. }
  14886. }
  14887. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14888. class ui_Button_h extends fgui.GButton {
  14889. static createInstance() {
  14890. return (fgui.UIPackage.createObject("game", "Button_h"));
  14891. }
  14892. onConstruct() {
  14893. this.button = this.getController("button");
  14894. this.n0 = (this.getChild("n0"));
  14895. }
  14896. }
  14897. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14898. class ui_Button_lv extends fgui.GButton {
  14899. static createInstance() {
  14900. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14901. }
  14902. onConstruct() {
  14903. this.button = this.getController("button");
  14904. this.n0 = (this.getChild("n0"));
  14905. }
  14906. }
  14907. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14908. class ui_Component98_3 extends fgui.GButton {
  14909. static createInstance() {
  14910. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14911. }
  14912. onConstruct() {
  14913. this.c1 = this.getController("c1");
  14914. this.n8 = (this.getChild("n8"));
  14915. this.n41 = (this.getChild("n41"));
  14916. this.n40 = (this.getChild("n40"));
  14917. }
  14918. }
  14919. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14920. class ui_ModeSelection_com1 extends fgui.GButton {
  14921. static createInstance() {
  14922. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14923. }
  14924. onConstruct() {
  14925. this.n34 = (this.getChild("n34"));
  14926. this.n36 = (this.getChild("n36"));
  14927. this.n22 = (this.getChild("n22"));
  14928. this.n20 = (this.getChild("n20"));
  14929. this.n23 = (this.getChild("n23"));
  14930. this.n24 = (this.getChild("n24"));
  14931. this.n26 = (this.getChild("n26"));
  14932. this.n33 = (this.getChild("n33"));
  14933. this.coinImg = (this.getChild("coinImg"));
  14934. this.need = (this.getChild("need"));
  14935. this.n35 = (this.getChild("n35"));
  14936. this.n29 = (this.getChild("n29"));
  14937. this.tipsTxt = (this.getChild("tipsTxt"));
  14938. this.n30 = (this.getChild("n30"));
  14939. this.peopleTxt = (this.getChild("peopleTxt"));
  14940. this.t0 = this.getTransition("t0");
  14941. }
  14942. }
  14943. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14944. class ui_ModeSelection_com2 extends fgui.GButton {
  14945. static createInstance() {
  14946. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14947. }
  14948. onConstruct() {
  14949. this.n36 = (this.getChild("n36"));
  14950. this.n34 = (this.getChild("n34"));
  14951. this.n22 = (this.getChild("n22"));
  14952. this.n20 = (this.getChild("n20"));
  14953. this.n23 = (this.getChild("n23"));
  14954. this.n24 = (this.getChild("n24"));
  14955. this.n26 = (this.getChild("n26"));
  14956. this.n33 = (this.getChild("n33"));
  14957. this.coinImg = (this.getChild("coinImg"));
  14958. this.need = (this.getChild("need"));
  14959. this.n35 = (this.getChild("n35"));
  14960. this.n29 = (this.getChild("n29"));
  14961. this.tipsTxt = (this.getChild("tipsTxt"));
  14962. this.n30 = (this.getChild("n30"));
  14963. this.peopleTxt = (this.getChild("peopleTxt"));
  14964. this.t0 = this.getTransition("t0");
  14965. }
  14966. }
  14967. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14968. class ui_ModeSelection_com3 extends fgui.GButton {
  14969. static createInstance() {
  14970. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14971. }
  14972. onConstruct() {
  14973. this.n34 = (this.getChild("n34"));
  14974. this.n36 = (this.getChild("n36"));
  14975. this.n22 = (this.getChild("n22"));
  14976. this.n20 = (this.getChild("n20"));
  14977. this.n23 = (this.getChild("n23"));
  14978. this.n24 = (this.getChild("n24"));
  14979. this.n26 = (this.getChild("n26"));
  14980. this.n33 = (this.getChild("n33"));
  14981. this.coinImg = (this.getChild("coinImg"));
  14982. this.need = (this.getChild("need"));
  14983. this.n35 = (this.getChild("n35"));
  14984. this.n29 = (this.getChild("n29"));
  14985. this.tipsTxt = (this.getChild("tipsTxt"));
  14986. this.n30 = (this.getChild("n30"));
  14987. this.peopleTxt = (this.getChild("peopleTxt"));
  14988. this.t0 = this.getTransition("t0");
  14989. }
  14990. }
  14991. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14992. class ui_Invitation_com1 extends fgui.GComponent {
  14993. static createInstance() {
  14994. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14995. }
  14996. onConstruct() {
  14997. this.n14 = (this.getChild("n14"));
  14998. this.n13 = (this.getChild("n13"));
  14999. this.n3 = (this.getChild("n3"));
  15000. this.n1 = (this.getChild("n1"));
  15001. this.n6 = (this.getChild("n6"));
  15002. this.n7 = (this.getChild("n7"));
  15003. this.enterBtn = (this.getChild("enterBtn"));
  15004. this.n11 = (this.getChild("n11"));
  15005. this.n12 = (this.getChild("n12"));
  15006. this.n15 = (this.getChild("n15"));
  15007. this.t0 = this.getTransition("t0");
  15008. this.t1 = this.getTransition("t1");
  15009. }
  15010. }
  15011. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  15012. class ui_Component87_1 extends fgui.GComponent {
  15013. static createInstance() {
  15014. return (fgui.UIPackage.createObject("game", "Component87_1"));
  15015. }
  15016. onConstruct() {
  15017. this.n74 = (this.getChild("n74"));
  15018. this.n73 = (this.getChild("n73"));
  15019. this.ballTxt = (this.getChild("ballTxt"));
  15020. this.n76 = (this.getChild("n76"));
  15021. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15022. this.levelTxt = (this.getChild("levelTxt"));
  15023. this.n87 = (this.getChild("n87"));
  15024. this.n84 = (this.getChild("n84"));
  15025. this.hpTxt = (this.getChild("hpTxt"));
  15026. this.n89 = (this.getChild("n89"));
  15027. this.tipsTxt = (this.getChild("tipsTxt"));
  15028. }
  15029. }
  15030. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  15031. class ui_Component_lc3 extends fgui.GComponent {
  15032. static createInstance() {
  15033. return (fgui.UIPackage.createObject("game", "Component_lc3"));
  15034. }
  15035. onConstruct() {
  15036. this.n0 = (this.getChild("n0"));
  15037. this.n2 = (this.getChild("n2"));
  15038. this.n1_bai = (this.getChild("n1_bai"));
  15039. }
  15040. }
  15041. ui_Component_lc3.URL = "ui://isxx5ak7lvbnv5b1";
  15042. class ui_Component_shou3 extends fgui.GComponent {
  15043. static createInstance() {
  15044. return (fgui.UIPackage.createObject("game", "Component_shou3"));
  15045. }
  15046. onConstruct() {
  15047. this.n57 = (this.getChild("n57"));
  15048. this.n54 = (this.getChild("n54"));
  15049. this.n55 = (this.getChild("n55"));
  15050. this.n56 = (this.getChild("n56"));
  15051. this.t1 = this.getTransition("t1");
  15052. }
  15053. }
  15054. ui_Component_shou3.URL = "ui://isxx5ak7lvbnv5b2";
  15055. class ui_sqg1 extends fgui.GComponent {
  15056. static createInstance() {
  15057. return (fgui.UIPackage.createObject("game", "sqg1"));
  15058. }
  15059. onConstruct() {
  15060. this.n1 = (this.getChild("n1"));
  15061. this.n0 = (this.getChild("n0"));
  15062. }
  15063. }
  15064. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  15065. class ui_sqg2 extends fgui.GComponent {
  15066. static createInstance() {
  15067. return (fgui.UIPackage.createObject("game", "sqg2"));
  15068. }
  15069. onConstruct() {
  15070. this.n1 = (this.getChild("n1"));
  15071. this.n0 = (this.getChild("n0"));
  15072. }
  15073. }
  15074. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  15075. class ui_sqg3 extends fgui.GComponent {
  15076. static createInstance() {
  15077. return (fgui.UIPackage.createObject("game", "sqg3"));
  15078. }
  15079. onConstruct() {
  15080. this.n1 = (this.getChild("n1"));
  15081. this.n0 = (this.getChild("n0"));
  15082. }
  15083. }
  15084. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  15085. class ui_sqg4 extends fgui.GComponent {
  15086. static createInstance() {
  15087. return (fgui.UIPackage.createObject("game", "sqg4"));
  15088. }
  15089. onConstruct() {
  15090. this.n1 = (this.getChild("n1"));
  15091. this.n0 = (this.getChild("n0"));
  15092. }
  15093. }
  15094. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  15095. class ui_Component36 extends fgui.GButton {
  15096. static createInstance() {
  15097. return (fgui.UIPackage.createObject("game", "Component36"));
  15098. }
  15099. onConstruct() {
  15100. this.c1 = this.getController("c1");
  15101. this.n53 = (this.getChild("n53"));
  15102. this.n56 = (this.getChild("n56"));
  15103. }
  15104. }
  15105. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  15106. class ui_Component37 extends fgui.GButton {
  15107. static createInstance() {
  15108. return (fgui.UIPackage.createObject("game", "Component37"));
  15109. }
  15110. onConstruct() {
  15111. this.c1 = this.getController("c1");
  15112. this.n52 = (this.getChild("n52"));
  15113. this.n54 = (this.getChild("n54"));
  15114. }
  15115. }
  15116. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  15117. class ui_UISetting extends fgui.GComponent {
  15118. static createInstance() {
  15119. return (fgui.UIPackage.createObject("game", "UISetting"));
  15120. }
  15121. onConstruct() {
  15122. this.c1 = this.getController("c1");
  15123. this.n4 = (this.getChild("n4"));
  15124. this.soundBtn = (this.getChild("soundBtn"));
  15125. this.shakeBtn = (this.getChild("shakeBtn"));
  15126. this.clickNode = (this.getChild("clickNode"));
  15127. this.xyBtn = (this.getChild("xyBtn"));
  15128. }
  15129. }
  15130. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  15131. class ui_Component39 extends fgui.GComponent {
  15132. static createInstance() {
  15133. return (fgui.UIPackage.createObject("game", "Component39"));
  15134. }
  15135. onConstruct() {
  15136. this.n5 = (this.getChild("n5"));
  15137. this.n6 = (this.getChild("n6"));
  15138. this.n7 = (this.getChild("n7"));
  15139. this.t0 = this.getTransition("t0");
  15140. }
  15141. }
  15142. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  15143. class ui_Component40 extends fgui.GButton {
  15144. static createInstance() {
  15145. return (fgui.UIPackage.createObject("game", "Component40"));
  15146. }
  15147. onConstruct() {
  15148. this.n46 = (this.getChild("n46"));
  15149. this.n47 = (this.getChild("n47"));
  15150. }
  15151. }
  15152. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  15153. class ui_Component41 extends fgui.GComponent {
  15154. static createInstance() {
  15155. return (fgui.UIPackage.createObject("game", "Component41"));
  15156. }
  15157. onConstruct() {
  15158. this.c1 = this.getController("c1");
  15159. this.n0 = (this.getChild("n0"));
  15160. this.titleTxt = (this.getChild("titleTxt"));
  15161. this.n2 = (this.getChild("n2"));
  15162. this.msgTips = (this.getChild("msgTips"));
  15163. this.numTxt = (this.getChild("numTxt"));
  15164. this.n18 = (this.getChild("n18"));
  15165. this.cancelBtn = (this.getChild("cancelBtn"));
  15166. this.videoBtn = (this.getChild("videoBtn"));
  15167. this.n10 = (this.getChild("n10"));
  15168. }
  15169. }
  15170. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  15171. class ui_Component42 extends fgui.GComponent {
  15172. static createInstance() {
  15173. return (fgui.UIPackage.createObject("game", "Component42"));
  15174. }
  15175. onConstruct() {
  15176. this.c1 = this.getController("c1");
  15177. this.n1 = (this.getChild("n1"));
  15178. this.n2 = (this.getChild("n2"));
  15179. this.n3 = (this.getChild("n3"));
  15180. this.tipsTxt = (this.getChild("tipsTxt"));
  15181. this.cancelBtn = (this.getChild("cancelBtn"));
  15182. this.sureBtn = (this.getChild("sureBtn"));
  15183. this.n11 = (this.getChild("n11"));
  15184. this.n13 = (this.getChild("n13"));
  15185. this.n14 = (this.getChild("n14"));
  15186. this.womanTxt = (this.getChild("womanTxt"));
  15187. this.t0 = this.getTransition("t0");
  15188. }
  15189. }
  15190. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  15191. class ui_dh_js_shengli extends fgui.GComponent {
  15192. static createInstance() {
  15193. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  15194. }
  15195. onConstruct() {
  15196. this.n3 = (this.getChild("n3"));
  15197. this.n4 = (this.getChild("n4"));
  15198. this.n1 = (this.getChild("n1"));
  15199. this.n2 = (this.getChild("n2"));
  15200. this.n5 = (this.getChild("n5"));
  15201. this.n6 = (this.getChild("n6"));
  15202. this.n7 = (this.getChild("n7"));
  15203. this.n8 = (this.getChild("n8"));
  15204. this.attack = this.getTransition("attack");
  15205. this.idle = this.getTransition("idle");
  15206. }
  15207. }
  15208. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  15209. class ui_dh_js_shengli_g extends fgui.GComponent {
  15210. static createInstance() {
  15211. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  15212. }
  15213. onConstruct() {
  15214. this.n3 = (this.getChild("n3"));
  15215. this.n1 = (this.getChild("n1"));
  15216. this.t0 = this.getTransition("t0");
  15217. }
  15218. }
  15219. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15220. class ui_dh_js_shibai extends fgui.GComponent {
  15221. static createInstance() {
  15222. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15223. }
  15224. onConstruct() {
  15225. this.n0 = (this.getChild("n0"));
  15226. this.n1 = (this.getChild("n1"));
  15227. this.n2 = (this.getChild("n2"));
  15228. this.n3 = (this.getChild("n3"));
  15229. this.idle = this.getTransition("idle");
  15230. this.attack = this.getTransition("attack");
  15231. }
  15232. }
  15233. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15234. class ui_dh_zy_ganfa extends fgui.GButton {
  15235. static createInstance() {
  15236. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15237. }
  15238. onConstruct() {
  15239. this.n0 = (this.getChild("n0"));
  15240. }
  15241. }
  15242. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15243. class ui_dh_zy_sc_guang extends fgui.GButton {
  15244. static createInstance() {
  15245. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15246. }
  15247. onConstruct() {
  15248. this.n0 = (this.getChild("n0"));
  15249. this.n2 = (this.getChild("n2"));
  15250. }
  15251. }
  15252. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15253. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15254. static createInstance() {
  15255. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15256. }
  15257. onConstruct() {
  15258. this.n0 = (this.getChild("n0"));
  15259. this.n3 = (this.getChild("n3"));
  15260. }
  15261. }
  15262. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15263. class ui_dh_zy_wanfa extends fgui.GButton {
  15264. static createInstance() {
  15265. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15266. }
  15267. onConstruct() {
  15268. this.n0 = (this.getChild("n0"));
  15269. }
  15270. }
  15271. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15272. class ui_Button_login extends fgui.GButton {
  15273. static createInstance() {
  15274. return (fgui.UIPackage.createObject("game", "Button_login"));
  15275. }
  15276. onConstruct() {
  15277. this.button = this.getController("button");
  15278. this.n5 = (this.getChild("n5"));
  15279. }
  15280. }
  15281. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15282. class ui_Component53_1 extends fgui.GComponent {
  15283. static createInstance() {
  15284. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15285. }
  15286. onConstruct() {
  15287. this.n0 = (this.getChild("n0"));
  15288. this.n1 = (this.getChild("n1"));
  15289. this.n2 = (this.getChild("n2"));
  15290. this.n3 = (this.getChild("n3"));
  15291. this.n4 = (this.getChild("n4"));
  15292. this.n5 = (this.getChild("n5"));
  15293. this.n6 = (this.getChild("n6"));
  15294. this.n7 = (this.getChild("n7"));
  15295. this.n8 = (this.getChild("n8"));
  15296. this.n9 = (this.getChild("n9"));
  15297. this.n10 = (this.getChild("n10"));
  15298. this.n11 = (this.getChild("n11"));
  15299. this.n12 = (this.getChild("n12"));
  15300. this.n13 = (this.getChild("n13"));
  15301. this.n14 = (this.getChild("n14"));
  15302. this.n15 = (this.getChild("n15"));
  15303. this.n16 = (this.getChild("n16"));
  15304. this.n19 = (this.getChild("n19"));
  15305. this.n20 = (this.getChild("n20"));
  15306. this.n21 = (this.getChild("n21"));
  15307. this.n22 = (this.getChild("n22"));
  15308. this.n23 = (this.getChild("n23"));
  15309. this.n24 = (this.getChild("n24"));
  15310. this.n25 = (this.getChild("n25"));
  15311. this.n26 = (this.getChild("n26"));
  15312. this.n27 = (this.getChild("n27"));
  15313. this.n28 = (this.getChild("n28"));
  15314. this.n29 = (this.getChild("n29"));
  15315. this.n30 = (this.getChild("n30"));
  15316. this.n31 = (this.getChild("n31"));
  15317. this.n32 = (this.getChild("n32"));
  15318. this.n33 = (this.getChild("n33"));
  15319. this.n34 = (this.getChild("n34"));
  15320. this.n35 = (this.getChild("n35"));
  15321. this.t0 = this.getTransition("t0");
  15322. }
  15323. }
  15324. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15325. class ui_Component30 extends fgui.GComponent {
  15326. static createInstance() {
  15327. return (fgui.UIPackage.createObject("game", "Component30"));
  15328. }
  15329. onConstruct() {
  15330. this.c1 = this.getController("c1");
  15331. this.n46 = (this.getChild("n46"));
  15332. this.n47 = (this.getChild("n47"));
  15333. this.numTxt = (this.getChild("numTxt"));
  15334. this.n50 = (this.getChild("n50"));
  15335. this.n53 = (this.getChild("n53"));
  15336. this.n54 = (this.getChild("n54"));
  15337. this.n55 = (this.getChild("n55"));
  15338. this.n56 = (this.getChild("n56"));
  15339. }
  15340. }
  15341. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15342. class ui_Component30_1 extends fgui.GComponent {
  15343. static createInstance() {
  15344. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15345. }
  15346. onConstruct() {
  15347. this.c1 = this.getController("c1");
  15348. this.n46 = (this.getChild("n46"));
  15349. this.n47 = (this.getChild("n47"));
  15350. this.numTxt = (this.getChild("numTxt"));
  15351. this.n50 = (this.getChild("n50"));
  15352. this.n51 = (this.getChild("n51"));
  15353. this.n52 = (this.getChild("n52"));
  15354. this.n53 = (this.getChild("n53"));
  15355. this.n54 = (this.getChild("n54"));
  15356. }
  15357. }
  15358. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15359. class ui_Component31 extends fgui.GComponent {
  15360. static createInstance() {
  15361. return (fgui.UIPackage.createObject("game", "Component31"));
  15362. }
  15363. onConstruct() {
  15364. this.n55 = (this.getChild("n55"));
  15365. this.n54 = (this.getChild("n54"));
  15366. this.conditionTxt = (this.getChild("conditionTxt"));
  15367. this.n57 = (this.getChild("n57"));
  15368. this.t0 = this.getTransition("t0");
  15369. }
  15370. }
  15371. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15372. class ui_Component32 extends fgui.GComponent {
  15373. static createInstance() {
  15374. return (fgui.UIPackage.createObject("game", "Component32"));
  15375. }
  15376. onConstruct() {
  15377. this.n5 = (this.getChild("n5"));
  15378. this.n6 = (this.getChild("n6"));
  15379. this.n7 = (this.getChild("n7"));
  15380. this.t0 = this.getTransition("t0");
  15381. }
  15382. }
  15383. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15384. class ui_AwardItem extends fgui.GComponent {
  15385. static createInstance() {
  15386. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15387. }
  15388. onConstruct() {
  15389. this.n9 = (this.getChild("n9"));
  15390. this.myIcon = (this.getChild("myIcon"));
  15391. this.numTxt = (this.getChild("numTxt"));
  15392. this.nameTxt = (this.getChild("nameTxt"));
  15393. this.n16 = (this.getChild("n16"));
  15394. this.n17 = (this.getChild("n17"));
  15395. }
  15396. }
  15397. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15398. class ui_ranking_com1 extends fgui.GButton {
  15399. static createInstance() {
  15400. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15401. }
  15402. onConstruct() {
  15403. this.c1 = this.getController("c1");
  15404. this.n49 = (this.getChild("n49"));
  15405. this.n18 = (this.getChild("n18"));
  15406. this.n46 = (this.getChild("n46"));
  15407. this.n48 = (this.getChild("n48"));
  15408. this.n50 = (this.getChild("n50"));
  15409. }
  15410. }
  15411. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15412. class ui_ranking_com2 extends fgui.GButton {
  15413. static createInstance() {
  15414. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15415. }
  15416. onConstruct() {
  15417. this.c1 = this.getController("c1");
  15418. this.n49 = (this.getChild("n49"));
  15419. this.n18 = (this.getChild("n18"));
  15420. this.n46 = (this.getChild("n46"));
  15421. this.n48 = (this.getChild("n48"));
  15422. this.n50 = (this.getChild("n50"));
  15423. }
  15424. }
  15425. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15426. class ui_ranking_com3 extends fgui.GComponent {
  15427. static createInstance() {
  15428. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15429. }
  15430. onConstruct() {
  15431. this.n17 = (this.getChild("n17"));
  15432. this.myIcon = (this.getChild("myIcon"));
  15433. }
  15434. }
  15435. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15436. class ui_ranking_com4 extends fgui.GComponent {
  15437. static createInstance() {
  15438. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15439. }
  15440. onConstruct() {
  15441. this.n16 = (this.getChild("n16"));
  15442. this.head = (this.getChild("head"));
  15443. }
  15444. }
  15445. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15446. class ui_ranking_com5 extends fgui.GComponent {
  15447. static createInstance() {
  15448. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15449. }
  15450. onConstruct() {
  15451. this.c1 = this.getController("c1");
  15452. this.c2 = this.getController("c2");
  15453. this.n2 = (this.getChild("n2"));
  15454. this.n3 = (this.getChild("n3"));
  15455. this.levelBtn = (this.getChild("levelBtn"));
  15456. this.starBtn = (this.getChild("starBtn"));
  15457. this.n23 = (this.getChild("n23"));
  15458. this.n24 = (this.getChild("n24"));
  15459. this.n25 = (this.getChild("n25"));
  15460. this.myList = (this.getChild("myList"));
  15461. this.selfNode = (this.getChild("selfNode"));
  15462. this.n9 = (this.getChild("n9"));
  15463. this.n12 = (this.getChild("n12"));
  15464. this.n13 = (this.getChild("n13"));
  15465. this.n14 = (this.getChild("n14"));
  15466. this.n39 = (this.getChild("n39"));
  15467. this.n41 = (this.getChild("n41"));
  15468. this.n42 = (this.getChild("n42"));
  15469. this.n45 = (this.getChild("n45"));
  15470. this.changeBtn = (this.getChild("changeBtn"));
  15471. this.closeBtn = (this.getChild("closeBtn"));
  15472. this.t0 = this.getTransition("t0");
  15473. }
  15474. }
  15475. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15476. class ui_RankItem extends fgui.GComponent {
  15477. static createInstance() {
  15478. return (fgui.UIPackage.createObject("game", "RankItem"));
  15479. }
  15480. onConstruct() {
  15481. this.n10 = (this.getChild("n10"));
  15482. this.n11 = (this.getChild("n11"));
  15483. this.rankTxt = (this.getChild("rankTxt"));
  15484. this.headNode = (this.getChild("headNode"));
  15485. this.nameTxt = (this.getChild("nameTxt"));
  15486. this.n19 = (this.getChild("n19"));
  15487. this.valueTxt = (this.getChild("valueTxt"));
  15488. this.img1 = (this.getChild("img1"));
  15489. this.img2 = (this.getChild("img2"));
  15490. this.img3 = (this.getChild("img3"));
  15491. }
  15492. }
  15493. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15494. class ui_ranking_com9 extends fgui.GComponent {
  15495. static createInstance() {
  15496. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15497. }
  15498. onConstruct() {
  15499. this.c1 = this.getController("c1");
  15500. this.n27 = (this.getChild("n27"));
  15501. this.n28 = (this.getChild("n28"));
  15502. this.headNode = (this.getChild("headNode"));
  15503. this.rankTxt = (this.getChild("rankTxt"));
  15504. this.nameTxt = (this.getChild("nameTxt"));
  15505. this.n34 = (this.getChild("n34"));
  15506. this.valueTxt = (this.getChild("valueTxt"));
  15507. this.n36 = (this.getChild("n36"));
  15508. this.n37 = (this.getChild("n37"));
  15509. this.n38 = (this.getChild("n38"));
  15510. this.n39 = (this.getChild("n39"));
  15511. this.n40 = (this.getChild("n40"));
  15512. }
  15513. }
  15514. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15515. class ui_ranking_com10 extends fgui.GComponent {
  15516. static createInstance() {
  15517. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15518. }
  15519. onConstruct() {
  15520. this.n23 = (this.getChild("n23"));
  15521. this.n24 = (this.getChild("n24"));
  15522. }
  15523. }
  15524. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15525. class ui_ranking_com11 extends fgui.GComponent {
  15526. static createInstance() {
  15527. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15528. }
  15529. onConstruct() {
  15530. this.n24 = (this.getChild("n24"));
  15531. this.n25 = (this.getChild("n25"));
  15532. this.t0 = this.getTransition("t0");
  15533. }
  15534. }
  15535. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15536. class ui_ranking_com13 extends fgui.GButton {
  15537. static createInstance() {
  15538. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15539. }
  15540. onConstruct() {
  15541. this.c1 = this.getController("c1");
  15542. this.n44 = (this.getChild("n44"));
  15543. this.n45 = (this.getChild("n45"));
  15544. this.n46 = (this.getChild("n46"));
  15545. }
  15546. }
  15547. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15548. class ui_Component122 extends fgui.GComponent {
  15549. static createInstance() {
  15550. return (fgui.UIPackage.createObject("game", "Component122"));
  15551. }
  15552. onConstruct() {
  15553. this.gameNode3 = (this.getChild("gameNode3"));
  15554. }
  15555. }
  15556. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15557. class ui_skillItem extends fgui.GComponent {
  15558. static createInstance() {
  15559. return (fgui.UIPackage.createObject("game", "skillItem"));
  15560. }
  15561. onConstruct() {
  15562. this.c1 = this.getController("c1");
  15563. this.n31 = (this.getChild("n31"));
  15564. this.n6 = (this.getChild("n6"));
  15565. this.skillImg = (this.getChild("skillImg"));
  15566. this.nameTxt = (this.getChild("nameTxt"));
  15567. this.levelTxt = (this.getChild("levelTxt"));
  15568. this.n28 = (this.getChild("n28"));
  15569. this.describeTxt = (this.getChild("describeTxt"));
  15570. this.n32 = (this.getChild("n32"));
  15571. this.mutiBtn = (this.getChild("mutiBtn"));
  15572. this.tryNode = (this.getChild("tryNode"));
  15573. this.normalBtn = (this.getChild("normalBtn"));
  15574. this.startBtn = (this.getChild("startBtn"));
  15575. this.n42 = (this.getChild("n42"));
  15576. this.n43 = (this.getChild("n43"));
  15577. this.n44 = (this.getChild("n44"));
  15578. }
  15579. }
  15580. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15581. class ui_Component26 extends fgui.GButton {
  15582. static createInstance() {
  15583. return (fgui.UIPackage.createObject("game", "Component26"));
  15584. }
  15585. onConstruct() {
  15586. this.n11 = (this.getChild("n11"));
  15587. this.n30 = (this.getChild("n30"));
  15588. this.n34 = (this.getChild("n34"));
  15589. }
  15590. }
  15591. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15592. class ui_Component28 extends fgui.GButton {
  15593. static createInstance() {
  15594. return (fgui.UIPackage.createObject("game", "Component28"));
  15595. }
  15596. onConstruct() {
  15597. this.n12 = (this.getChild("n12"));
  15598. this.n31 = (this.getChild("n31"));
  15599. this.curTxt = (this.getChild("curTxt"));
  15600. this.n33 = (this.getChild("n33"));
  15601. }
  15602. }
  15603. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15604. class ui_Component1302 extends fgui.GComponent {
  15605. static createInstance() {
  15606. return (fgui.UIPackage.createObject("game", "Component1302"));
  15607. }
  15608. onConstruct() {
  15609. this.n2 = (this.getChild("n2"));
  15610. this.n3 = (this.getChild("n3"));
  15611. }
  15612. }
  15613. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15614. class ui_Component113 extends fgui.GComponent {
  15615. static createInstance() {
  15616. return (fgui.UIPackage.createObject("game", "Component113"));
  15617. }
  15618. onConstruct() {
  15619. this.n85 = (this.getChild("n85"));
  15620. this.n86 = (this.getChild("n86"));
  15621. this.n77 = (this.getChild("n77"));
  15622. this.n79 = (this.getChild("n79"));
  15623. this.n80 = (this.getChild("n80"));
  15624. this.n81 = (this.getChild("n81"));
  15625. this.n82 = (this.getChild("n82"));
  15626. this.n84 = (this.getChild("n84"));
  15627. this.n87 = (this.getChild("n87"));
  15628. this.t0 = this.getTransition("t0");
  15629. }
  15630. }
  15631. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15632. class ui_Component114 extends fgui.GComponent {
  15633. static createInstance() {
  15634. return (fgui.UIPackage.createObject("game", "Component114"));
  15635. }
  15636. onConstruct() {
  15637. this.n77 = (this.getChild("n77"));
  15638. this.t0 = this.getTransition("t0");
  15639. }
  15640. }
  15641. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15642. class ui_Component115 extends fgui.GComponent {
  15643. static createInstance() {
  15644. return (fgui.UIPackage.createObject("game", "Component115"));
  15645. }
  15646. onConstruct() {
  15647. this.n83 = (this.getChild("n83"));
  15648. this.fingerNode = (this.getChild("fingerNode"));
  15649. this.n84 = (this.getChild("n84"));
  15650. }
  15651. }
  15652. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15653. class ui_Component117 extends fgui.GComponent {
  15654. static createInstance() {
  15655. return (fgui.UIPackage.createObject("game", "Component117"));
  15656. }
  15657. onConstruct() {
  15658. this.n87 = (this.getChild("n87"));
  15659. this.n88 = (this.getChild("n88"));
  15660. this.n84 = (this.getChild("n84"));
  15661. this.n85 = (this.getChild("n85"));
  15662. this.n86 = (this.getChild("n86"));
  15663. this.t0 = this.getTransition("t0");
  15664. }
  15665. }
  15666. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15667. class ui_Component98_1 extends fgui.GButton {
  15668. static createInstance() {
  15669. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15670. }
  15671. onConstruct() {
  15672. this.c1 = this.getController("c1");
  15673. this.n8 = (this.getChild("n8"));
  15674. this.n41 = (this.getChild("n41"));
  15675. this.n40 = (this.getChild("n40"));
  15676. }
  15677. }
  15678. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15679. class ui_Component61 extends fgui.GComponent {
  15680. static createInstance() {
  15681. return (fgui.UIPackage.createObject("game", "Component61"));
  15682. }
  15683. onConstruct() {
  15684. this.n14 = (this.getChild("n14"));
  15685. this.n6 = (this.getChild("n6"));
  15686. this.t0 = this.getTransition("t0");
  15687. }
  15688. }
  15689. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15690. class ui_Component62 extends fgui.GComponent {
  15691. static createInstance() {
  15692. return (fgui.UIPackage.createObject("game", "Component62"));
  15693. }
  15694. onConstruct() {
  15695. this.n66 = (this.getChild("n66"));
  15696. this.n56 = (this.getChild("n56"));
  15697. this.n63 = (this.getChild("n63"));
  15698. this.n65 = (this.getChild("n65"));
  15699. this.t0 = this.getTransition("t0");
  15700. }
  15701. }
  15702. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15703. class ui_d3Root extends fgui.GComponent {
  15704. static createInstance() {
  15705. return (fgui.UIPackage.createObject("game", "d3Root"));
  15706. }
  15707. onConstruct() {
  15708. }
  15709. }
  15710. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15711. class ui_d2Root extends fgui.GComponent {
  15712. static createInstance() {
  15713. return (fgui.UIPackage.createObject("game", "d2Root"));
  15714. }
  15715. onConstruct() {
  15716. }
  15717. }
  15718. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15719. class ui_ballNode extends fgui.GComponent {
  15720. static createInstance() {
  15721. return (fgui.UIPackage.createObject("game", "ballNode"));
  15722. }
  15723. onConstruct() {
  15724. }
  15725. }
  15726. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15727. class ui_border extends fgui.GComponent {
  15728. static createInstance() {
  15729. return (fgui.UIPackage.createObject("game", "border"));
  15730. }
  15731. onConstruct() {
  15732. this.bar1 = (this.getChild("bar1"));
  15733. this.bar2 = (this.getChild("bar2"));
  15734. this.bar3 = (this.getChild("bar3"));
  15735. this.bar4 = (this.getChild("bar4"));
  15736. this.bar5 = (this.getChild("bar5"));
  15737. this.bar6 = (this.getChild("bar6"));
  15738. this.circle1 = (this.getChild("circle1"));
  15739. this.circle2 = (this.getChild("circle2"));
  15740. this.circle3 = (this.getChild("circle3"));
  15741. this.circle4 = (this.getChild("circle4"));
  15742. this.circle5 = (this.getChild("circle5"));
  15743. this.circle6 = (this.getChild("circle6"));
  15744. this.n28 = (this.getChild("n28"));
  15745. }
  15746. }
  15747. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15748. class ui_btn_buy extends fgui.GButton {
  15749. static createInstance() {
  15750. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15751. }
  15752. onConstruct() {
  15753. this.button = this.getController("button");
  15754. this.n0 = (this.getChild("n0"));
  15755. this.n1 = (this.getChild("n1"));
  15756. this.n2 = (this.getChild("n2"));
  15757. }
  15758. }
  15759. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15760. class ui_Component41_2 extends fgui.GComponent {
  15761. static createInstance() {
  15762. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15763. }
  15764. onConstruct() {
  15765. this.c1 = this.getController("c1");
  15766. this.n0 = (this.getChild("n0"));
  15767. this.n2 = (this.getChild("n2"));
  15768. this.n19 = (this.getChild("n19"));
  15769. this.cancelBtn = (this.getChild("cancelBtn"));
  15770. this.videoBtn = (this.getChild("videoBtn"));
  15771. this.n9 = (this.getChild("n9"));
  15772. this.n22 = (this.getChild("n22"));
  15773. this.tipsTxt = (this.getChild("tipsTxt"));
  15774. this.n23 = (this.getChild("n23"));
  15775. this.n24 = (this.getChild("n24"));
  15776. this.n26 = (this.getChild("n26"));
  15777. this.n27 = (this.getChild("n27"));
  15778. this.titleTxt = (this.getChild("titleTxt"));
  15779. }
  15780. }
  15781. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15782. class ui_Component41_1 extends fgui.GComponent {
  15783. static createInstance() {
  15784. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15785. }
  15786. onConstruct() {
  15787. this.c1 = this.getController("c1");
  15788. this.n0 = (this.getChild("n0"));
  15789. this.n2 = (this.getChild("n2"));
  15790. this.cancelBtn = (this.getChild("cancelBtn"));
  15791. this.videoBtn = (this.getChild("videoBtn"));
  15792. this.n27 = (this.getChild("n27"));
  15793. this.n30 = (this.getChild("n30"));
  15794. this.n31 = (this.getChild("n31"));
  15795. this.n32 = (this.getChild("n32"));
  15796. this.n33 = (this.getChild("n33"));
  15797. this.n34 = (this.getChild("n34"));
  15798. this.n35 = (this.getChild("n35"));
  15799. this.n36 = (this.getChild("n36"));
  15800. this.n1 = (this.getChild("n1"));
  15801. this.n37 = (this.getChild("n37"));
  15802. this.t0 = this.getTransition("t0");
  15803. this.t1 = this.getTransition("t1");
  15804. this.t2 = this.getTransition("t2");
  15805. this.t3 = this.getTransition("t3");
  15806. }
  15807. }
  15808. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15809. class ui_againBtn extends fgui.GButton {
  15810. static createInstance() {
  15811. return (fgui.UIPackage.createObject("game", "againBtn"));
  15812. }
  15813. onConstruct() {
  15814. this.n2 = (this.getChild("n2"));
  15815. this.n1 = (this.getChild("n1"));
  15816. this.n5 = (this.getChild("n5"));
  15817. }
  15818. }
  15819. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15820. class ui_Component118 extends fgui.GButton {
  15821. static createInstance() {
  15822. return (fgui.UIPackage.createObject("game", "Component118"));
  15823. }
  15824. onConstruct() {
  15825. this.c1 = this.getController("c1");
  15826. this.n14 = (this.getChild("n14"));
  15827. this.n9 = (this.getChild("n9"));
  15828. this.n10 = (this.getChild("n10"));
  15829. this.diamondTxt = (this.getChild("diamondTxt"));
  15830. this.n13 = (this.getChild("n13"));
  15831. this.n15 = (this.getChild("n15"));
  15832. }
  15833. }
  15834. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15835. class ui_Component119 extends fgui.GComponent {
  15836. static createInstance() {
  15837. return (fgui.UIPackage.createObject("game", "Component119"));
  15838. }
  15839. onConstruct() {
  15840. this.n1 = (this.getChild("n1"));
  15841. this.n2 = (this.getChild("n2"));
  15842. this.n13 = (this.getChild("n13"));
  15843. this.n6 = (this.getChild("n6"));
  15844. this.screenNode = (this.getChild("screenNode"));
  15845. this.n15 = (this.getChild("n15"));
  15846. this.closeBtn = (this.getChild("closeBtn"));
  15847. this.share2Btn = (this.getChild("share2Btn"));
  15848. this.shareBtn = (this.getChild("shareBtn"));
  15849. this.tipsNode = (this.getChild("tipsNode"));
  15850. this.awardNode = (this.getChild("awardNode"));
  15851. }
  15852. }
  15853. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15854. class ui_Component_yd1 extends fgui.GComponent {
  15855. static createInstance() {
  15856. return (fgui.UIPackage.createObject("game", "Component_yd1"));
  15857. }
  15858. onConstruct() {
  15859. this.n83 = (this.getChild("n83"));
  15860. this.fingerNode = (this.getChild("fingerNode"));
  15861. this.n84 = (this.getChild("n84"));
  15862. }
  15863. }
  15864. ui_Component_yd1.URL = "ui://isxx5ak7uc2qv5b3";
  15865. class ui_Component_yd2 extends fgui.GComponent {
  15866. static createInstance() {
  15867. return (fgui.UIPackage.createObject("game", "Component_yd2"));
  15868. }
  15869. onConstruct() {
  15870. this.n85 = (this.getChild("n85"));
  15871. this.n86 = (this.getChild("n86"));
  15872. this.n77 = (this.getChild("n77"));
  15873. this.n79 = (this.getChild("n79"));
  15874. this.n80 = (this.getChild("n80"));
  15875. this.n81 = (this.getChild("n81"));
  15876. this.n82 = (this.getChild("n82"));
  15877. this.n84 = (this.getChild("n84"));
  15878. this.n87 = (this.getChild("n87"));
  15879. this.t0 = this.getTransition("t0");
  15880. }
  15881. }
  15882. ui_Component_yd2.URL = "ui://isxx5ak7uc2qv5b5";
  15883. class ui_Component_yd3 extends fgui.GComponent {
  15884. static createInstance() {
  15885. return (fgui.UIPackage.createObject("game", "Component_yd3"));
  15886. }
  15887. onConstruct() {
  15888. this.n87 = (this.getChild("n87"));
  15889. this.n88 = (this.getChild("n88"));
  15890. this.n84 = (this.getChild("n84"));
  15891. this.n85 = (this.getChild("n85"));
  15892. this.n86 = (this.getChild("n86"));
  15893. this.t0 = this.getTransition("t0");
  15894. }
  15895. }
  15896. ui_Component_yd3.URL = "ui://isxx5ak7uc2qv5b6";
  15897. class ui_daoJuDisplay extends fgui.GComponent {
  15898. static createInstance() {
  15899. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15900. }
  15901. onConstruct() {
  15902. this.n6 = (this.getChild("n6"));
  15903. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15904. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15905. this.btn_buy = (this.getChild("btn_buy"));
  15906. this.nameTxt = (this.getChild("nameTxt"));
  15907. this.zsImg = (this.getChild("zsImg"));
  15908. }
  15909. }
  15910. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15911. class ui_Component132_1 extends fgui.GComponent {
  15912. static createInstance() {
  15913. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15914. }
  15915. onConstruct() {
  15916. this.n25 = (this.getChild("n25"));
  15917. this.n26 = (this.getChild("n26"));
  15918. this.n27 = (this.getChild("n27"));
  15919. this.t0 = this.getTransition("t0");
  15920. }
  15921. }
  15922. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15923. class ui_Component_lc_challenge1 extends fgui.GComponent {
  15924. static createInstance() {
  15925. return (fgui.UIPackage.createObject("game", "Component_lc_challenge1"));
  15926. }
  15927. onConstruct() {
  15928. this.n0 = (this.getChild("n0"));
  15929. this.n1_bai = (this.getChild("n1_bai"));
  15930. }
  15931. }
  15932. ui_Component_lc_challenge1.URL = "ui://isxx5ak7um3xv5as";
  15933. class ui_Component_shou extends fgui.GComponent {
  15934. static createInstance() {
  15935. return (fgui.UIPackage.createObject("game", "Component_shou"));
  15936. }
  15937. onConstruct() {
  15938. this.n57 = (this.getChild("n57"));
  15939. this.n54 = (this.getChild("n54"));
  15940. this.n55 = (this.getChild("n55"));
  15941. this.n56 = (this.getChild("n56"));
  15942. this.t1 = this.getTransition("t1");
  15943. }
  15944. }
  15945. ui_Component_shou.URL = "ui://isxx5ak7um3xv5aw";
  15946. class ui_SecretaryDisplay extends fgui.GComponent {
  15947. static createInstance() {
  15948. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15949. }
  15950. onConstruct() {
  15951. this.n2 = (this.getChild("n2"));
  15952. this.levelTxt = (this.getChild("levelTxt"));
  15953. this.n4 = (this.getChild("n4"));
  15954. this.secretary = (this.getChild("secretary"));
  15955. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15956. this.n16 = (this.getChild("n16"));
  15957. this.n37 = (this.getChild("n37"));
  15958. this.n41 = (this.getChild("n41"));
  15959. this.n14 = (this.getChild("n14"));
  15960. this.n17 = (this.getChild("n17"));
  15961. this.heightTxt = (this.getChild("heightTxt"));
  15962. this.n46 = (this.getChild("n46"));
  15963. this.n36 = (this.getChild("n36"));
  15964. this.n38 = (this.getChild("n38"));
  15965. this.foodTxt = (this.getChild("foodTxt"));
  15966. this.n47 = (this.getChild("n47"));
  15967. this.n40 = (this.getChild("n40"));
  15968. this.n42 = (this.getChild("n42"));
  15969. this.historyTxt = (this.getChild("historyTxt"));
  15970. this.n48 = (this.getChild("n48"));
  15971. this.nameImg = (this.getChild("nameImg"));
  15972. this.n12 = (this.getChild("n12"));
  15973. this.n49 = (this.getChild("n49"));
  15974. this.t0 = this.getTransition("t0");
  15975. }
  15976. }
  15977. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15978. class ui_BallRodDisplay extends fgui.GComponent {
  15979. static createInstance() {
  15980. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15981. }
  15982. onConstruct() {
  15983. this.c1 = this.getController("c1");
  15984. this.n31 = (this.getChild("n31"));
  15985. this.n6 = (this.getChild("n6"));
  15986. this.nameTxt = (this.getChild("nameTxt"));
  15987. this.rodImg = (this.getChild("rodImg"));
  15988. this.eftRod = (this.getChild("eftRod"));
  15989. this.levelNode = (this.getChild("levelNode"));
  15990. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15991. }
  15992. }
  15993. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15994. class ui_Component111_11 extends fgui.GComponent {
  15995. static createInstance() {
  15996. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15997. }
  15998. onConstruct() {
  15999. this.n68 = (this.getChild("n68"));
  16000. this.n69 = (this.getChild("n69"));
  16001. }
  16002. }
  16003. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  16004. class ui_Component112 extends fgui.GComponent {
  16005. static createInstance() {
  16006. return (fgui.UIPackage.createObject("game", "Component112"));
  16007. }
  16008. onConstruct() {
  16009. this.n68 = (this.getChild("n68"));
  16010. this.myMask = (this.getChild("myMask"));
  16011. }
  16012. }
  16013. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  16014. class ui_Component111 extends fgui.GComponent {
  16015. static createInstance() {
  16016. return (fgui.UIPackage.createObject("game", "Component111"));
  16017. }
  16018. onConstruct() {
  16019. this.n68 = (this.getChild("n68"));
  16020. this.myMask = (this.getChild("myMask"));
  16021. }
  16022. }
  16023. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  16024. class ui_Component144 extends fgui.GButton {
  16025. static createInstance() {
  16026. return (fgui.UIPackage.createObject("game", "Component144"));
  16027. }
  16028. onConstruct() {
  16029. this.n8 = (this.getChild("n8"));
  16030. }
  16031. }
  16032. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  16033. class ui_Sign_com2 extends fgui.GComponent {
  16034. static createInstance() {
  16035. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  16036. }
  16037. onConstruct() {
  16038. this.n0 = (this.getChild("n0"));
  16039. this.n1 = (this.getChild("n1"));
  16040. this.t0 = this.getTransition("t0");
  16041. }
  16042. }
  16043. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  16044. class ui_Sign_guang extends fgui.GComponent {
  16045. static createInstance() {
  16046. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  16047. }
  16048. onConstruct() {
  16049. this.n1 = (this.getChild("n1"));
  16050. this.n2 = (this.getChild("n2"));
  16051. this.n3 = (this.getChild("n3"));
  16052. this.n4 = (this.getChild("n4"));
  16053. this.n5 = (this.getChild("n5"));
  16054. this.n6 = (this.getChild("n6"));
  16055. this.n8 = (this.getChild("n8"));
  16056. }
  16057. }
  16058. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  16059. class ui_SignMax extends fgui.GComponent {
  16060. static createInstance() {
  16061. return (fgui.UIPackage.createObject("game", "SignMax"));
  16062. }
  16063. onConstruct() {
  16064. this.c1 = this.getController("c1");
  16065. this.n7 = (this.getChild("n7"));
  16066. this.n15 = (this.getChild("n15"));
  16067. this.n8 = (this.getChild("n8"));
  16068. this.titleTxt = (this.getChild("titleTxt"));
  16069. this.myIcon1 = (this.getChild("myIcon1"));
  16070. this.numTxt1 = (this.getChild("numTxt1"));
  16071. this.myIcon2 = (this.getChild("myIcon2"));
  16072. this.n20 = (this.getChild("n20"));
  16073. this.n17 = (this.getChild("n17"));
  16074. this.numTxt2 = (this.getChild("numTxt2"));
  16075. this.n12 = (this.getChild("n12"));
  16076. this.n13 = (this.getChild("n13"));
  16077. this.n21 = (this.getChild("n21"));
  16078. this.n14 = (this.getChild("n14"));
  16079. }
  16080. }
  16081. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  16082. class ui_Sign_com2_1 extends fgui.GComponent {
  16083. static createInstance() {
  16084. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  16085. }
  16086. onConstruct() {
  16087. this.n0 = (this.getChild("n0"));
  16088. this.n1 = (this.getChild("n1"));
  16089. this.t0 = this.getTransition("t0");
  16090. }
  16091. }
  16092. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  16093. class ui_Sign_com5 extends fgui.GComponent {
  16094. static createInstance() {
  16095. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  16096. }
  16097. onConstruct() {
  16098. this.n3 = (this.getChild("n3"));
  16099. this.n29 = (this.getChild("n29"));
  16100. this.n4 = (this.getChild("n4"));
  16101. this.day1 = (this.getChild("day1"));
  16102. this.day2 = (this.getChild("day2"));
  16103. this.day3 = (this.getChild("day3"));
  16104. this.day4 = (this.getChild("day4"));
  16105. this.day5 = (this.getChild("day5"));
  16106. this.day6 = (this.getChild("day6"));
  16107. this.day7 = (this.getChild("day7"));
  16108. this.t0 = this.getTransition("t0");
  16109. }
  16110. }
  16111. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  16112. class ui_Sign_com8 extends fgui.GComponent {
  16113. static createInstance() {
  16114. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  16115. }
  16116. onConstruct() {
  16117. this.n48 = (this.getChild("n48"));
  16118. this.womanTxt = (this.getChild("womanTxt"));
  16119. this.t0 = this.getTransition("t0");
  16120. }
  16121. }
  16122. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  16123. class ui_Sign_com6 extends fgui.GComponent {
  16124. static createInstance() {
  16125. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  16126. }
  16127. onConstruct() {
  16128. this.n2 = (this.getChild("n2"));
  16129. this.n3 = (this.getChild("n3"));
  16130. this.t0 = this.getTransition("t0");
  16131. }
  16132. }
  16133. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  16134. class ui_Sign_com7 extends fgui.GComponent {
  16135. static createInstance() {
  16136. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  16137. }
  16138. onConstruct() {
  16139. this.n29 = (this.getChild("n29"));
  16140. this.n2 = (this.getChild("n2"));
  16141. }
  16142. }
  16143. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  16144. class ui_UITurntable_com1_2 extends fgui.GComponent {
  16145. static createInstance() {
  16146. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  16147. }
  16148. onConstruct() {
  16149. this.n5 = (this.getChild("n5"));
  16150. this.n4 = (this.getChild("n4"));
  16151. this.t0 = this.getTransition("t0");
  16152. }
  16153. }
  16154. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  16155. class ui_UITurntable_com2 extends fgui.GComponent {
  16156. static createInstance() {
  16157. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  16158. }
  16159. onConstruct() {
  16160. this.c1 = this.getController("c1");
  16161. this.n4 = (this.getChild("n4"));
  16162. this.n6 = (this.getChild("n6"));
  16163. this.n10 = (this.getChild("n10"));
  16164. this.n11 = (this.getChild("n11"));
  16165. this.n12 = (this.getChild("n12"));
  16166. this.n13 = (this.getChild("n13"));
  16167. this.n14 = (this.getChild("n14"));
  16168. this.n15 = (this.getChild("n15"));
  16169. this.n16 = (this.getChild("n16"));
  16170. this.n17 = (this.getChild("n17"));
  16171. this.n18 = (this.getChild("n18"));
  16172. this.n19 = (this.getChild("n19"));
  16173. this.n20 = (this.getChild("n20"));
  16174. this.n21 = (this.getChild("n21"));
  16175. this.n22 = (this.getChild("n22"));
  16176. this.n23 = (this.getChild("n23"));
  16177. this.n24 = (this.getChild("n24"));
  16178. this.n25 = (this.getChild("n25"));
  16179. this.n26 = (this.getChild("n26"));
  16180. this.n27 = (this.getChild("n27"));
  16181. this.n28 = (this.getChild("n28"));
  16182. this.n29 = (this.getChild("n29"));
  16183. this.n30 = (this.getChild("n30"));
  16184. this.n31 = (this.getChild("n31"));
  16185. this.n32 = (this.getChild("n32"));
  16186. this.n33 = (this.getChild("n33"));
  16187. }
  16188. }
  16189. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  16190. class ui_UITurntable_com1_1 extends fgui.GComponent {
  16191. static createInstance() {
  16192. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  16193. }
  16194. onConstruct() {
  16195. this.n5 = (this.getChild("n5"));
  16196. this.n4 = (this.getChild("n4"));
  16197. this.t0 = this.getTransition("t0");
  16198. }
  16199. }
  16200. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  16201. class ui_UITurntable_com5 extends fgui.GComponent {
  16202. static createInstance() {
  16203. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  16204. }
  16205. onConstruct() {
  16206. this.flashNode = (this.getChild("flashNode"));
  16207. this.rotNode = (this.getChild("rotNode"));
  16208. this.n3 = (this.getChild("n3"));
  16209. this.n21 = (this.getChild("n21"));
  16210. this.t0 = this.getTransition("t0");
  16211. }
  16212. }
  16213. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  16214. class ui_UITurntable_com7 extends fgui.GComponent {
  16215. static createInstance() {
  16216. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  16217. }
  16218. onConstruct() {
  16219. this.n2 = (this.getChild("n2"));
  16220. this.n35 = (this.getChild("n35"));
  16221. this.img1 = (this.getChild("img1"));
  16222. this.img2 = (this.getChild("img2"));
  16223. this.img3 = (this.getChild("img3"));
  16224. this.img4 = (this.getChild("img4"));
  16225. this.img6 = (this.getChild("img6"));
  16226. this.img5 = (this.getChild("img5"));
  16227. this.txt1 = (this.getChild("txt1"));
  16228. this.txt2 = (this.getChild("txt2"));
  16229. this.txt3 = (this.getChild("txt3"));
  16230. this.txt4 = (this.getChild("txt4"));
  16231. this.txt5 = (this.getChild("txt5"));
  16232. this.txt6 = (this.getChild("txt6"));
  16233. }
  16234. }
  16235. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  16236. class ui_UITurntable_com9 extends fgui.GComponent {
  16237. static createInstance() {
  16238. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  16239. }
  16240. onConstruct() {
  16241. this.n38 = (this.getChild("n38"));
  16242. this.n39 = (this.getChild("n39"));
  16243. }
  16244. }
  16245. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  16246. class ui_UITurntable_com10 extends fgui.GComponent {
  16247. static createInstance() {
  16248. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  16249. }
  16250. onConstruct() {
  16251. this.n39 = (this.getChild("n39"));
  16252. this.n40 = (this.getChild("n40"));
  16253. this.t0 = this.getTransition("t0");
  16254. }
  16255. }
  16256. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  16257. class ui_UITurntable_com11 extends fgui.GComponent {
  16258. static createInstance() {
  16259. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  16260. }
  16261. onConstruct() {
  16262. this.n38 = (this.getChild("n38"));
  16263. this.n39 = (this.getChild("n39"));
  16264. this.n40 = (this.getChild("n40"));
  16265. this.t0 = this.getTransition("t0");
  16266. }
  16267. }
  16268. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  16269. class ui_UITurntable_com12 extends fgui.GComponent {
  16270. static createInstance() {
  16271. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16272. }
  16273. onConstruct() {
  16274. this.n43 = (this.getChild("n43"));
  16275. this.barNode = (this.getChild("barNode"));
  16276. this.tipsTxt = (this.getChild("tipsTxt"));
  16277. this.n45 = (this.getChild("n45"));
  16278. this.boxBtn = (this.getChild("boxBtn"));
  16279. }
  16280. }
  16281. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16282. class ui_UITurntable_com1 extends fgui.GButton {
  16283. static createInstance() {
  16284. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16285. }
  16286. onConstruct() {
  16287. this.n41 = (this.getChild("n41"));
  16288. this.n42 = (this.getChild("n42"));
  16289. this.t0 = this.getTransition("t0");
  16290. }
  16291. }
  16292. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16293. class ui_UITurntable_com3 extends fgui.GComponent {
  16294. static createInstance() {
  16295. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16296. }
  16297. onConstruct() {
  16298. this.n48 = (this.getChild("n48"));
  16299. this.womanTxt = (this.getChild("womanTxt"));
  16300. this.t0 = this.getTransition("t0");
  16301. }
  16302. }
  16303. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16304. class ui_cancelBtn2 extends fgui.GButton {
  16305. static createInstance() {
  16306. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16307. }
  16308. onConstruct() {
  16309. this.c1 = this.getController("c1");
  16310. this.n0 = (this.getChild("n0"));
  16311. this.n1 = (this.getChild("n1"));
  16312. this.n2 = (this.getChild("n2"));
  16313. this.n3 = (this.getChild("n3"));
  16314. this.n4 = (this.getChild("n4"));
  16315. this.n5 = (this.getChild("n5"));
  16316. this.n6 = (this.getChild("n6"));
  16317. this.n7 = (this.getChild("n7"));
  16318. this.n8 = (this.getChild("n8"));
  16319. this.powerEft = (this.getChild("powerEft"));
  16320. }
  16321. }
  16322. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16323. class ui_shareBtn2 extends fgui.GButton {
  16324. static createInstance() {
  16325. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16326. }
  16327. onConstruct() {
  16328. this.c1 = this.getController("c1");
  16329. this.n2 = (this.getChild("n2"));
  16330. this.n24 = (this.getChild("n24"));
  16331. this.n1 = (this.getChild("n1"));
  16332. this.n3 = (this.getChild("n3"));
  16333. this.n23 = (this.getChild("n23"));
  16334. this.n4 = (this.getChild("n4"));
  16335. this.n5 = (this.getChild("n5"));
  16336. this.n6 = (this.getChild("n6"));
  16337. this.n20 = (this.getChild("n20"));
  16338. this.n21 = (this.getChild("n21"));
  16339. this.n22 = (this.getChild("n22"));
  16340. this.powerEft = (this.getChild("powerEft"));
  16341. }
  16342. }
  16343. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16344. class ui_UIMoney extends fgui.GComponent {
  16345. static createInstance() {
  16346. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16347. }
  16348. onConstruct() {
  16349. this.c1 = this.getController("c1");
  16350. this.n4 = (this.getChild("n4"));
  16351. this.coinImg = (this.getChild("coinImg"));
  16352. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16353. this.coinTxt = (this.getChild("coinTxt"));
  16354. this.n7 = (this.getChild("n7"));
  16355. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16356. this.diamondTxt = (this.getChild("diamondTxt"));
  16357. this.diamondImg = (this.getChild("diamondImg"));
  16358. this.n12 = (this.getChild("n12"));
  16359. this.powerImg = (this.getChild("powerImg"));
  16360. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16361. this.powerTxt = (this.getChild("powerTxt"));
  16362. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16363. }
  16364. }
  16365. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16366. class ui_backBtn extends fgui.GButton {
  16367. static createInstance() {
  16368. return (fgui.UIPackage.createObject("game", "backBtn"));
  16369. }
  16370. onConstruct() {
  16371. this.n0 = (this.getChild("n0"));
  16372. this.t0 = this.getTransition("t0");
  16373. this.t1 = this.getTransition("t1");
  16374. }
  16375. }
  16376. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16377. class ui_MoneyBtn extends fgui.GButton {
  16378. static createInstance() {
  16379. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16380. }
  16381. onConstruct() {
  16382. this.button = this.getController("button");
  16383. this.n0 = (this.getChild("n0"));
  16384. }
  16385. }
  16386. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16387. class ui_UIMoneyBtn extends fgui.GComponent {
  16388. static createInstance() {
  16389. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16390. }
  16391. onConstruct() {
  16392. this.n1 = (this.getChild("n1"));
  16393. this.closeBtn = (this.getChild("closeBtn"));
  16394. }
  16395. }
  16396. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16397. class ui_Component64 extends fgui.GComponent {
  16398. static createInstance() {
  16399. return (fgui.UIPackage.createObject("game", "Component64"));
  16400. }
  16401. onConstruct() {
  16402. this.n57 = (this.getChild("n57"));
  16403. this.n54 = (this.getChild("n54"));
  16404. this.n55 = (this.getChild("n55"));
  16405. this.n56 = (this.getChild("n56"));
  16406. this.t1 = this.getTransition("t1");
  16407. }
  16408. }
  16409. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16410. class ui_Component41_3 extends fgui.GComponent {
  16411. static createInstance() {
  16412. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16413. }
  16414. onConstruct() {
  16415. this.c1 = this.getController("c1");
  16416. this.n0 = (this.getChild("n0"));
  16417. this.n2 = (this.getChild("n2"));
  16418. this.cancelBtn = (this.getChild("cancelBtn"));
  16419. this.videoBtn = (this.getChild("videoBtn"));
  16420. this.n9 = (this.getChild("n9"));
  16421. this.n24 = (this.getChild("n24"));
  16422. this.n27 = (this.getChild("n27"));
  16423. this.titleTxt = (this.getChild("titleTxt"));
  16424. this.n28 = (this.getChild("n28"));
  16425. this.t0 = this.getTransition("t0");
  16426. }
  16427. }
  16428. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16429. class ui_dh_zs_4 extends fgui.GComponent {
  16430. static createInstance() {
  16431. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16432. }
  16433. onConstruct() {
  16434. this.n1 = (this.getChild("n1"));
  16435. this.n2 = (this.getChild("n2"));
  16436. this.n3 = (this.getChild("n3"));
  16437. this.n4 = (this.getChild("n4"));
  16438. this.n5 = (this.getChild("n5"));
  16439. this.n6 = (this.getChild("n6"));
  16440. this.n8 = (this.getChild("n8"));
  16441. this.t0 = this.getTransition("t0");
  16442. }
  16443. }
  16444. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16445. class ui_Component71_1 extends fgui.GButton {
  16446. static createInstance() {
  16447. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16448. }
  16449. onConstruct() {
  16450. this.n17 = (this.getChild("n17"));
  16451. this.t0 = this.getTransition("t0");
  16452. }
  16453. }
  16454. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16455. class ui_Component83 extends fgui.GComponent {
  16456. static createInstance() {
  16457. return (fgui.UIPackage.createObject("game", "Component83"));
  16458. }
  16459. onConstruct() {
  16460. this.c1 = this.getController("c1");
  16461. this.n17 = (this.getChild("n17"));
  16462. this.n19 = (this.getChild("n19"));
  16463. this.n20 = (this.getChild("n20"));
  16464. }
  16465. }
  16466. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16467. class ui_Component84 extends fgui.GComponent {
  16468. static createInstance() {
  16469. return (fgui.UIPackage.createObject("game", "Component84"));
  16470. }
  16471. onConstruct() {
  16472. this.c1 = this.getController("c1");
  16473. this.n4 = (this.getChild("n4"));
  16474. this.n22 = (this.getChild("n22"));
  16475. this.n23 = (this.getChild("n23"));
  16476. this.numTxt = (this.getChild("numTxt"));
  16477. this.n25 = (this.getChild("n25"));
  16478. this.n26 = (this.getChild("n26"));
  16479. }
  16480. }
  16481. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16482. class ui_Component84_1 extends fgui.GComponent {
  16483. static createInstance() {
  16484. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16485. }
  16486. onConstruct() {
  16487. this.c1 = this.getController("c1");
  16488. this.n4 = (this.getChild("n4"));
  16489. this.n22 = (this.getChild("n22"));
  16490. this.n23 = (this.getChild("n23"));
  16491. this.numTxt = (this.getChild("numTxt"));
  16492. this.n25 = (this.getChild("n25"));
  16493. this.n26 = (this.getChild("n26"));
  16494. }
  16495. }
  16496. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16497. class ui_Component85 extends fgui.GComponent {
  16498. static createInstance() {
  16499. return (fgui.UIPackage.createObject("game", "Component85"));
  16500. }
  16501. onConstruct() {
  16502. this.n1 = (this.getChild("n1"));
  16503. this.n6 = (this.getChild("n6"));
  16504. this.n2 = (this.getChild("n2"));
  16505. this.n3 = (this.getChild("n3"));
  16506. this.levelTxt = (this.getChild("levelTxt"));
  16507. this.n10 = (this.getChild("n10"));
  16508. this.n11 = (this.getChild("n11"));
  16509. this.n12 = (this.getChild("n12"));
  16510. this.n13 = (this.getChild("n13"));
  16511. this.n14 = (this.getChild("n14"));
  16512. this.modeNode = (this.getChild("modeNode"));
  16513. this.n18 = (this.getChild("n18"));
  16514. this.conditionTxt = (this.getChild("conditionTxt"));
  16515. this.diamondNode = (this.getChild("diamondNode"));
  16516. this.coinNode = (this.getChild("coinNode"));
  16517. this.startBtn = (this.getChild("startBtn"));
  16518. this.n28 = (this.getChild("n28"));
  16519. this.displayRoot = (this.getChild("displayRoot"));
  16520. this.n32 = (this.getChild("n32"));
  16521. this.n33 = (this.getChild("n33"));
  16522. this.n_yd_zzq_btn3 = (this.getChild("n_yd_zzq_btn3"));
  16523. this.n_yd_3 = (this.getChild("n_yd_3"));
  16524. this.t0 = this.getTransition("t0");
  16525. }
  16526. }
  16527. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16528. class ui_Component86 extends fgui.GButton {
  16529. static createInstance() {
  16530. return (fgui.UIPackage.createObject("game", "Component86"));
  16531. }
  16532. onConstruct() {
  16533. this.n15 = (this.getChild("n15"));
  16534. this.t0 = this.getTransition("t0");
  16535. }
  16536. }
  16537. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16538. class ui_Component87 extends fgui.GComponent {
  16539. static createInstance() {
  16540. return (fgui.UIPackage.createObject("game", "Component87"));
  16541. }
  16542. onConstruct() {
  16543. this.n66 = (this.getChild("n66"));
  16544. this.myProgress = (this.getChild("myProgress"));
  16545. this.starAni = (this.getChild("starAni"));
  16546. this.hpTxt = (this.getChild("hpTxt"));
  16547. this.n74 = (this.getChild("n74"));
  16548. this.n73 = (this.getChild("n73"));
  16549. this.ballTxt = (this.getChild("ballTxt"));
  16550. this.n76 = (this.getChild("n76"));
  16551. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16552. this.levelTxt = (this.getChild("levelTxt"));
  16553. this.star1 = (this.getChild("star1"));
  16554. this.star2 = (this.getChild("star2"));
  16555. this.star3 = (this.getChild("star3"));
  16556. }
  16557. }
  16558. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16559. class ui_Component88 extends fgui.GProgressBar {
  16560. static createInstance() {
  16561. return (fgui.UIPackage.createObject("game", "Component88"));
  16562. }
  16563. onConstruct() {
  16564. this.n68 = (this.getChild("n68"));
  16565. this.bar = (this.getChild("bar"));
  16566. }
  16567. }
  16568. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16569. class ui_Component89 extends fgui.GComponent {
  16570. static createInstance() {
  16571. return (fgui.UIPackage.createObject("game", "Component89"));
  16572. }
  16573. onConstruct() {
  16574. this.c1 = this.getController("c1");
  16575. this.n71 = (this.getChild("n71"));
  16576. this.n72 = (this.getChild("n72"));
  16577. }
  16578. }
  16579. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16580. class ui_Component90 extends fgui.GComponent {
  16581. static createInstance() {
  16582. return (fgui.UIPackage.createObject("game", "Component90"));
  16583. }
  16584. onConstruct() {
  16585. this.c1 = this.getController("c1");
  16586. this.n64 = (this.getChild("n64"));
  16587. this.n65 = (this.getChild("n65"));
  16588. this.n66 = (this.getChild("n66"));
  16589. this.t0 = this.getTransition("t0");
  16590. }
  16591. }
  16592. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16593. class ui_Component127 extends fgui.GButton {
  16594. static createInstance() {
  16595. return (fgui.UIPackage.createObject("game", "Component127"));
  16596. }
  16597. onConstruct() {
  16598. this.n5 = (this.getChild("n5"));
  16599. }
  16600. }
  16601. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16602. class gameBinder {
  16603. static bindAll() {
  16604. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16605. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16606. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16607. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16608. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16609. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16610. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16611. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16612. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16613. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16614. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16615. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16616. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16617. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16618. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16619. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16620. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16621. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16622. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16623. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16624. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16625. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16626. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16627. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16628. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16629. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16630. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16631. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16632. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16633. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16634. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16635. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16636. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16637. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16638. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16639. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16640. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16641. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16642. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16643. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16644. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16645. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16646. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16647. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16648. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16649. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16650. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16651. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16652. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16653. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16654. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16655. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16656. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16657. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16658. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16659. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16660. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16661. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16662. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16663. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16664. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16665. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16666. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16667. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16668. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16669. fgui.UIObjectFactory.setExtension(ui_Component_lc2.URL, ui_Component_lc2);
  16670. fgui.UIObjectFactory.setExtension(ui_Component_shou2.URL, ui_Component_shou2);
  16671. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16672. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16673. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16674. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16675. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16676. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16677. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16678. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16679. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16680. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16681. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16682. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16683. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16684. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16685. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16686. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16687. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16688. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16689. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16690. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16691. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16692. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16693. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16694. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16695. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16696. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16697. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16698. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16699. fgui.UIObjectFactory.setExtension(ui_Component_denglu.URL, ui_Component_denglu);
  16700. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16701. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16702. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16703. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16704. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16705. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16706. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16707. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16708. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16709. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16710. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16711. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16712. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16713. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16714. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16715. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16716. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16717. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16718. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16719. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16720. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16721. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16722. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16723. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16724. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16725. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16726. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16727. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16728. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16729. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16730. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16731. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16732. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16733. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16734. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16735. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16736. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16737. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16738. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16739. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16740. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16741. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16742. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16743. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16744. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16745. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16746. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16747. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16748. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16749. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16750. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16751. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16752. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16753. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16754. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16755. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16756. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16757. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16758. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16759. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16760. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16761. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16762. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16763. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16764. fgui.UIObjectFactory.setExtension(ui_Component_lc3.URL, ui_Component_lc3);
  16765. fgui.UIObjectFactory.setExtension(ui_Component_shou3.URL, ui_Component_shou3);
  16766. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16767. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16768. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16769. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16770. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16771. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16772. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16773. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16774. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16775. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16776. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16777. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16778. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16779. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16780. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16781. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16782. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16783. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16784. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16785. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16786. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16787. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16788. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16789. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16790. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16791. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16792. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16793. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16794. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16795. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16796. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16797. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16798. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16799. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16800. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16801. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16802. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16803. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16804. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16805. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16806. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16807. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16808. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16809. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16810. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16811. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16812. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16813. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16814. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16815. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16816. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16817. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16818. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16819. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16820. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16821. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16822. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16823. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16824. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16825. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16826. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16827. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16828. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16829. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16830. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16831. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16832. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16833. fgui.UIObjectFactory.setExtension(ui_Component_yd1.URL, ui_Component_yd1);
  16834. fgui.UIObjectFactory.setExtension(ui_Component_yd2.URL, ui_Component_yd2);
  16835. fgui.UIObjectFactory.setExtension(ui_Component_yd3.URL, ui_Component_yd3);
  16836. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16837. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16838. fgui.UIObjectFactory.setExtension(ui_Component_lc_challenge1.URL, ui_Component_lc_challenge1);
  16839. fgui.UIObjectFactory.setExtension(ui_Component_shou.URL, ui_Component_shou);
  16840. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16841. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16842. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16843. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16844. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16845. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16846. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16847. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16848. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16849. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16850. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16851. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16852. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16853. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16854. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16855. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16856. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16857. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16858. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16859. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16860. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16861. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16862. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16863. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16864. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16865. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16866. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16867. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16868. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16869. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16870. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16871. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16872. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16873. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16874. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16875. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16876. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16877. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16878. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16879. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16880. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16881. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16882. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16883. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16884. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16885. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16886. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16887. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16888. }
  16889. }
  16890. class ui_btn6 extends fgui.GButton {
  16891. static createInstance() {
  16892. return (fgui.UIPackage.createObject("loading", "btn6"));
  16893. }
  16894. onConstruct() {
  16895. this.n6 = (this.getChild("n6"));
  16896. this.n1 = (this.getChild("n1"));
  16897. }
  16898. }
  16899. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16900. class ui_xyItem extends fgui.GComponent {
  16901. static createInstance() {
  16902. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16903. }
  16904. onConstruct() {
  16905. this.xyItem = (this.getChild("xyItem"));
  16906. }
  16907. }
  16908. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16909. class ui_loadinfo extends fgui.GProgressBar {
  16910. static createInstance() {
  16911. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16912. }
  16913. onConstruct() {
  16914. this.bg = (this.getChild("bg"));
  16915. this.bar = (this.getChild("bar"));
  16916. this.title = (this.getChild("title"));
  16917. this.ani = (this.getChild("ani"));
  16918. }
  16919. }
  16920. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16921. class ui_xyNode extends fgui.GComponent {
  16922. static createInstance() {
  16923. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16924. }
  16925. onConstruct() {
  16926. this.n0 = (this.getChild("n0"));
  16927. this.btnYes = (this.getChild("btnYes"));
  16928. this.btnNo = (this.getChild("btnNo"));
  16929. this.btnKnown = (this.getChild("btnKnown"));
  16930. this.btnSure = (this.getChild("btnSure"));
  16931. this.txtWelcom = (this.getChild("txtWelcom"));
  16932. this.txtXy = (this.getChild("txtXy"));
  16933. this.n75 = (this.getChild("n75"));
  16934. this.btnXy1 = (this.getChild("btnXy1"));
  16935. this.btnXy3 = (this.getChild("btnXy3"));
  16936. this.btnXy2 = (this.getChild("btnXy2"));
  16937. this.n74 = (this.getChild("n74"));
  16938. this.xy1 = (this.getChild("xy1"));
  16939. this.txtTitle = (this.getChild("txtTitle"));
  16940. this.btnBack = (this.getChild("btnBack"));
  16941. this.xyList = (this.getChild("xyList"));
  16942. this.xy2 = (this.getChild("xy2"));
  16943. this.xyNode = (this.getChild("xyNode"));
  16944. }
  16945. }
  16946. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16947. class ui_ageNode extends fgui.GComponent {
  16948. static createInstance() {
  16949. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16950. }
  16951. onConstruct() {
  16952. this.n3 = (this.getChild("n3"));
  16953. this.n7 = (this.getChild("n7"));
  16954. this.n4 = (this.getChild("n4"));
  16955. this.btnAge = (this.getChild("btnAge"));
  16956. this.ageNode = (this.getChild("ageNode"));
  16957. }
  16958. }
  16959. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16960. class ui_rnNode extends fgui.GComponent {
  16961. static createInstance() {
  16962. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16963. }
  16964. onConstruct() {
  16965. this.n28 = (this.getChild("n28"));
  16966. this.n30 = (this.getChild("n30"));
  16967. this.n33 = (this.getChild("n33"));
  16968. this.rn1 = (this.getChild("rn1"));
  16969. this.n40 = (this.getChild("n40"));
  16970. this.n41 = (this.getChild("n41"));
  16971. this.rn3 = (this.getChild("rn3"));
  16972. this.n37 = (this.getChild("n37"));
  16973. this.n39 = (this.getChild("n39"));
  16974. this.rn2 = (this.getChild("rn2"));
  16975. this.n47 = (this.getChild("n47"));
  16976. this.n49 = (this.getChild("n49"));
  16977. this.n44 = (this.getChild("n44"));
  16978. this.inputCode = (this.getChild("inputCode"));
  16979. this.inputName = (this.getChild("inputName"));
  16980. this.n48 = (this.getChild("n48"));
  16981. this.n50 = (this.getChild("n50"));
  16982. this.rn4 = (this.getChild("rn4"));
  16983. this.btnCheck = (this.getChild("btnCheck"));
  16984. this.btnExit = (this.getChild("btnExit"));
  16985. this.btnDone = (this.getChild("btnDone"));
  16986. this.rnNode = (this.getChild("rnNode"));
  16987. }
  16988. }
  16989. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16990. class ui_tipNode extends fgui.GComponent {
  16991. static createInstance() {
  16992. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16993. }
  16994. onConstruct() {
  16995. this.bg = (this.getChild("bg"));
  16996. this.n55 = (this.getChild("n55"));
  16997. this.n56 = (this.getChild("n56"));
  16998. this.tipNode = (this.getChild("tipNode"));
  16999. }
  17000. }
  17001. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  17002. class ui_fcmNode extends fgui.GComponent {
  17003. static createInstance() {
  17004. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  17005. }
  17006. onConstruct() {
  17007. this.n63 = (this.getChild("n63"));
  17008. this.n62 = (this.getChild("n62"));
  17009. this.btnRn = (this.getChild("btnRn"));
  17010. this.n61 = (this.getChild("n61"));
  17011. this.n58 = (this.getChild("n58"));
  17012. this.fcmNode = (this.getChild("fcmNode"));
  17013. }
  17014. }
  17015. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  17016. class ui_msgNode extends fgui.GComponent {
  17017. static createInstance() {
  17018. return (fgui.UIPackage.createObject("loading", "msgNode"));
  17019. }
  17020. onConstruct() {
  17021. this.n69 = (this.getChild("n69"));
  17022. this.txtMsg = (this.getChild("txtMsg"));
  17023. this.msgNode = (this.getChild("msgNode"));
  17024. }
  17025. }
  17026. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  17027. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  17028. static createInstance() {
  17029. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  17030. }
  17031. onConstruct() {
  17032. this.n1 = (this.getChild("n1"));
  17033. this.n13 = (this.getChild("n13"));
  17034. this.n14 = (this.getChild("n14"));
  17035. this.n15 = (this.getChild("n15"));
  17036. this.n3 = (this.getChild("n3"));
  17037. this.n4 = (this.getChild("n4"));
  17038. this.n5 = (this.getChild("n5"));
  17039. this.n6 = (this.getChild("n6"));
  17040. this.n7 = (this.getChild("n7"));
  17041. this.n8 = (this.getChild("n8"));
  17042. this.n9 = (this.getChild("n9"));
  17043. this.n10 = (this.getChild("n10"));
  17044. this.n12 = (this.getChild("n12"));
  17045. this.n11 = (this.getChild("n11"));
  17046. this.n16 = (this.getChild("n16"));
  17047. this.n17 = (this.getChild("n17"));
  17048. this.n18 = (this.getChild("n18"));
  17049. this.n20 = (this.getChild("n20"));
  17050. this.n21 = (this.getChild("n21"));
  17051. this.t0 = this.getTransition("t0");
  17052. }
  17053. }
  17054. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  17055. class ui_btn5 extends fgui.GButton {
  17056. static createInstance() {
  17057. return (fgui.UIPackage.createObject("loading", "btn5"));
  17058. }
  17059. onConstruct() {
  17060. this.n9 = (this.getChild("n9"));
  17061. this.n1 = (this.getChild("n1"));
  17062. }
  17063. }
  17064. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  17065. class ui_UILoading extends fgui.GComponent {
  17066. static createInstance() {
  17067. return (fgui.UIPackage.createObject("loading", "UILoading"));
  17068. }
  17069. onConstruct() {
  17070. this.n12 = (this.getChild("n12"));
  17071. this.loadinfo = (this.getChild("loadinfo"));
  17072. this.n13 = (this.getChild("n13"));
  17073. this.txtLoad = (this.getChild("txtLoad"));
  17074. this.n18 = (this.getChild("n18"));
  17075. }
  17076. }
  17077. ui_UILoading.URL = "ui://37nctnhwphc33";
  17078. class ui_AgeItem extends fgui.GComponent {
  17079. static createInstance() {
  17080. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  17081. }
  17082. onConstruct() {
  17083. this.txtAge = (this.getChild("txtAge"));
  17084. }
  17085. }
  17086. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  17087. class ui_btn1 extends fgui.GButton {
  17088. static createInstance() {
  17089. return (fgui.UIPackage.createObject("loading", "btn1"));
  17090. }
  17091. onConstruct() {
  17092. this.n6 = (this.getChild("n6"));
  17093. this.n1 = (this.getChild("n1"));
  17094. }
  17095. }
  17096. ui_btn1.URL = "ui://37nctnhwxe622p";
  17097. class ui_btn3 extends fgui.GButton {
  17098. static createInstance() {
  17099. return (fgui.UIPackage.createObject("loading", "btn3"));
  17100. }
  17101. onConstruct() {
  17102. this.n9 = (this.getChild("n9"));
  17103. this.n1 = (this.getChild("n1"));
  17104. }
  17105. }
  17106. ui_btn3.URL = "ui://37nctnhwxe622s";
  17107. class ui_btn2 extends fgui.GButton {
  17108. static createInstance() {
  17109. return (fgui.UIPackage.createObject("loading", "btn2"));
  17110. }
  17111. onConstruct() {
  17112. this.n6 = (this.getChild("n6"));
  17113. this.n1 = (this.getChild("n1"));
  17114. }
  17115. }
  17116. ui_btn2.URL = "ui://37nctnhwxe622t";
  17117. class ui_btnBack extends fgui.GButton {
  17118. static createInstance() {
  17119. return (fgui.UIPackage.createObject("loading", "btnBack"));
  17120. }
  17121. onConstruct() {
  17122. this.n6 = (this.getChild("n6"));
  17123. this.n7 = (this.getChild("n7"));
  17124. }
  17125. }
  17126. ui_btnBack.URL = "ui://37nctnhwxe622u";
  17127. class ui_btnXy1 extends fgui.GButton {
  17128. static createInstance() {
  17129. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  17130. }
  17131. onConstruct() {
  17132. this.n1 = (this.getChild("n1"));
  17133. }
  17134. }
  17135. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  17136. class ui_btnXy2 extends fgui.GButton {
  17137. static createInstance() {
  17138. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  17139. }
  17140. onConstruct() {
  17141. this.n1 = (this.getChild("n1"));
  17142. }
  17143. }
  17144. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  17145. class ui_btnXy3 extends fgui.GButton {
  17146. static createInstance() {
  17147. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  17148. }
  17149. onConstruct() {
  17150. this.n1 = (this.getChild("n1"));
  17151. }
  17152. }
  17153. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  17154. class ui_btn4 extends fgui.GButton {
  17155. static createInstance() {
  17156. return (fgui.UIPackage.createObject("loading", "btn4"));
  17157. }
  17158. onConstruct() {
  17159. this.n9 = (this.getChild("n9"));
  17160. this.n1 = (this.getChild("n1"));
  17161. }
  17162. }
  17163. ui_btn4.URL = "ui://37nctnhwxe622z";
  17164. class loadingBinder {
  17165. static bindAll() {
  17166. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  17167. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  17168. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  17169. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  17170. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  17171. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  17172. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  17173. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  17174. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  17175. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  17176. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  17177. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  17178. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  17179. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  17180. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  17181. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  17182. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  17183. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  17184. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  17185. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  17186. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  17187. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  17188. }
  17189. }
  17190. class UIMgr {
  17191. constructor() {
  17192. this._stage = null;
  17193. this._uiList = [];
  17194. this._showList = [];
  17195. this._bindPkgList = [];
  17196. this.uiIndex = 0;
  17197. }
  17198. static get inst() {
  17199. if (UIMgr._inst == null) {
  17200. UIMgr._inst = new UIMgr();
  17201. }
  17202. return UIMgr._inst;
  17203. }
  17204. setStage(s) {
  17205. if (this._stage) {
  17206. console.log("ViewMgr::Stage->舞台不可赋值两次");
  17207. return;
  17208. }
  17209. this._stage = s;
  17210. }
  17211. clearTempData() {
  17212. console.log('zh:clearTempData start');
  17213. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  17214. console.log('zh:clearTempData end');
  17215. }
  17216. init() {
  17217. this.setStage(Laya.stage);
  17218. fairygui.UIConfig.defaultFont = "arial";
  17219. fairygui.UIConfig.modalLayerColor = "rgba(29, 22, 22, 0.9)";
  17220. fairygui.UIConfig.packageFileExtension = "obj";
  17221. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  17222. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  17223. fairygui.GRoot.inst.width = Laya.stage.width;
  17224. fairygui.GRoot.inst.height = Laya.stage.height;
  17225. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  17226. }
  17227. addAllUpdate() {
  17228. this.uiIndex = 0;
  17229. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  17230. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  17231. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  17232. }
  17233. }
  17234. }
  17235. bindFUI(pkgname) {
  17236. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  17237. return;
  17238. }
  17239. switch (pkgname) {
  17240. case fguiRes.loading:
  17241. fairygui.UIPackage.addPackage(pkgname);
  17242. loadingBinder.bindAll();
  17243. this._bindPkgList.push(pkgname);
  17244. break;
  17245. case fguiRes.game:
  17246. fairygui.UIPackage.addPackage(pkgname);
  17247. gameBinder.bindAll();
  17248. this._bindPkgList.push(pkgname);
  17249. break;
  17250. default:
  17251. break;
  17252. }
  17253. }
  17254. Show(cls, ...param) {
  17255. let nameStr = cls.uiName;
  17256. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17257. let temp = this._uiList[i];
  17258. let str = temp.className;
  17259. if (str == nameStr) {
  17260. if (temp.isMuti) {
  17261. if (temp.isHide) {
  17262. temp.show(...param);
  17263. this._uiList.splice(i, 1);
  17264. this._uiList.push(temp);
  17265. return temp;
  17266. }
  17267. }
  17268. else {
  17269. temp.show(...param);
  17270. this._uiList.splice(i, 1);
  17271. this._uiList.push(temp);
  17272. return temp;
  17273. }
  17274. }
  17275. }
  17276. let ui = new cls();
  17277. ui.className = nameStr;
  17278. this._showUI(ui, param);
  17279. return ui;
  17280. }
  17281. destroyUI(ui) {
  17282. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17283. let temp = this._uiList[i].className;
  17284. if (temp == ui.className) {
  17285. this._uiList.splice(i, 1);
  17286. break;
  17287. }
  17288. }
  17289. this.checkUIState();
  17290. }
  17291. _showUI(ui, param) {
  17292. this._uiList.push(ui);
  17293. ui.show(...param);
  17294. }
  17295. Hide(uiClass) {
  17296. let ui = this.getUI(uiClass);
  17297. if (ui && !ui.isHide) {
  17298. ui.hide();
  17299. }
  17300. }
  17301. getUI(ui) {
  17302. let nameStr = ui.uiName;
  17303. for (let index = 0; index < this._uiList.length; index++) {
  17304. let temp = this._uiList[index];
  17305. if (temp.className == nameStr) {
  17306. return temp;
  17307. }
  17308. }
  17309. return null;
  17310. }
  17311. isShow(cls) {
  17312. for (var i of this._uiList) {
  17313. if (i instanceof cls) {
  17314. return i.isShowing;
  17315. }
  17316. }
  17317. return false;
  17318. }
  17319. showUINum() {
  17320. let num = 0;
  17321. for (var i of this._uiList) {
  17322. if (i.isShowing) {
  17323. num++;
  17324. }
  17325. }
  17326. return num;
  17327. }
  17328. checkUIState() {
  17329. Laya.timer.clear(this, this._uiCheck);
  17330. Laya.timer.once(400, this, this._uiCheck);
  17331. }
  17332. _uiCheck() {
  17333. let showList = [];
  17334. for (var i of this._uiList) {
  17335. if (!i.isHide) {
  17336. showList.push(i);
  17337. }
  17338. }
  17339. for (let index = 0; index < showList.length; index++) {
  17340. if (index == showList.length - 1) {
  17341. showList[index].checkActive(true);
  17342. }
  17343. else {
  17344. showList[index].checkActive(false);
  17345. }
  17346. }
  17347. }
  17348. showTip(msg, time = 600, size = 30) {
  17349. }
  17350. }
  17351. class UIShowList {
  17352. }
  17353. class SoundMgr {
  17354. constructor() {
  17355. this.soundMax = 4;
  17356. this.isLoad = false;
  17357. this.soundMap = {};
  17358. this.isSound = true;
  17359. this.openShake = true;
  17360. SoundMgr._instance = this;
  17361. }
  17362. static getInstance() {
  17363. if (!this._instance) {
  17364. this._instance = new SoundMgr();
  17365. }
  17366. return this._instance;
  17367. }
  17368. init() {
  17369. console.log('zh:sm init 1');
  17370. Laya.SoundManager.autoReleaseSound = true;
  17371. Laya.SoundManager.autoStopMusic = true;
  17372. Laya.SoundManager.musicVolume = 0.3;
  17373. Laya.SoundManager.soundVolume = 0.5;
  17374. this.musicPlayed = false;
  17375. this.audioUrl = "asset/sound/ogg/";
  17376. console.log('zh:sm init 2');
  17377. console.log('zh:dev type ');
  17378. if (Laya.Browser.onAndroid) {
  17379. console.log('zh:dev type android');
  17380. this.audioUrl = "asset/sound/ogg/";
  17381. this.isLoad = true;
  17382. }
  17383. else {
  17384. console.log('zh:dev type not android');
  17385. this.audioUrl = "asset/sound/mp3/";
  17386. this.isLoad = true;
  17387. }
  17388. }
  17389. onSetting(isS) {
  17390. this.isSound = isS;
  17391. this.mute(!this.isSound);
  17392. }
  17393. clearCount() {
  17394. for (var key in this.soundMap) {
  17395. delete this.soundMap[key];
  17396. }
  17397. }
  17398. playMusic(path, loop = 0) {
  17399. console.log('zh:playMusic 1 PATH=' + path);
  17400. this.musicPath = path;
  17401. if (!this.isLoad) {
  17402. return;
  17403. }
  17404. if (!path || path == "") {
  17405. return;
  17406. }
  17407. if (!this.isSound) {
  17408. return;
  17409. }
  17410. this.musicPlayed = true;
  17411. let url = this.getUrl(path);
  17412. if (!Laya.Browser.onAndroid) {
  17413. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17414. this.play(url, loop);
  17415. }));
  17416. }
  17417. else {
  17418. this.play(url, loop);
  17419. }
  17420. }
  17421. play(url, loop) {
  17422. Laya.SoundManager.playMusic(url, loop);
  17423. }
  17424. getUrl(path) {
  17425. let url = this.audioUrl + path;
  17426. if (Laya.Browser.onAndroid) {
  17427. url += ".ogg";
  17428. }
  17429. else {
  17430. url += ".mp3";
  17431. }
  17432. return url;
  17433. }
  17434. pauseMusic(pause) {
  17435. if (pause) {
  17436. this.mute(true);
  17437. }
  17438. else if (this.isSound)
  17439. this.mute(false);
  17440. }
  17441. stopMusic() {
  17442. Laya.SoundManager.stopMusic();
  17443. if (Moyu.isNeedPlatAudio) {
  17444. Moyu.stopMusic();
  17445. }
  17446. }
  17447. mute(mute) {
  17448. if (Moyu.isNeedPlatAudio) {
  17449. Moyu.pauseMusic(mute);
  17450. }
  17451. else {
  17452. Laya.SoundManager.musicMuted = mute;
  17453. if (!mute && !this.musicPlayed && this.musicPath) {
  17454. this.playMusic(this.musicPath);
  17455. }
  17456. }
  17457. }
  17458. stopSound(path) {
  17459. let url = this.getUrl(path);
  17460. Laya.SoundManager.stopSound(url);
  17461. }
  17462. playSound(path, loop = 1, soundMax = this.soundMax) {
  17463. if (!this.isLoad)
  17464. return;
  17465. if (!this.isSound)
  17466. return;
  17467. if (!path || path == "")
  17468. return;
  17469. let url = this.getUrl(path);
  17470. if (Moyu.isNeedPlatAudio) {
  17471. Moyu.playSound(path, loop == 0);
  17472. }
  17473. else {
  17474. let count = 1;
  17475. if (this.soundMap[path])
  17476. count = this.soundMap[path] + 1;
  17477. if (count > soundMax)
  17478. return;
  17479. this.soundMap[path] = count;
  17480. Laya.SoundManager.playSound(url, loop);
  17481. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17482. }
  17483. }
  17484. removePath(path) {
  17485. if (this.soundMap[path]) {
  17486. let count = this.soundMap[path];
  17487. count--;
  17488. if (count < 1)
  17489. delete this.soundMap[path];
  17490. else
  17491. this.soundMap[path] = count;
  17492. }
  17493. }
  17494. playBtnSound() {
  17495. this.playSound("btn");
  17496. }
  17497. playGetSound() {
  17498. }
  17499. playCloseUISound() {
  17500. }
  17501. }
  17502. SoundMgr._instance = null;
  17503. var Handler$1 = Laya.Handler;
  17504. var EResType;
  17505. (function (EResType) {
  17506. EResType[EResType["none"] = 0] = "none";
  17507. EResType[EResType["nromal"] = 1] = "nromal";
  17508. EResType[EResType["td"] = 2] = "td";
  17509. EResType[EResType["sk"] = 3] = "sk";
  17510. })(EResType || (EResType = {}));
  17511. class CResLoader {
  17512. constructor(doneCall, proCall) {
  17513. this.completrCall = doneCall;
  17514. this.progressCall = proCall;
  17515. this.progressHander = new Handler$1(this, this.onProgress);
  17516. this.tdResMap = {};
  17517. }
  17518. load(resList) {
  17519. this.resCount = 0;
  17520. this.loadCount = 0;
  17521. for (let i = 0; i < resList.length; i++) {
  17522. let path = resList[i];
  17523. if (!path)
  17524. continue;
  17525. this.resCount++;
  17526. let type = this.getResType(path);
  17527. if (type == EResType.nromal)
  17528. this.loadNromal(path);
  17529. else if (type == EResType.td)
  17530. this.loadTd(path);
  17531. }
  17532. }
  17533. getRes(path) {
  17534. let type = this.getResType(path);
  17535. if (type == EResType.nromal)
  17536. return Laya.loader.getRes(path);
  17537. else if (type == EResType.td) {
  17538. let res = this.tdResMap[path];
  17539. if (res)
  17540. return res.clone();
  17541. return null;
  17542. }
  17543. }
  17544. destroy() {
  17545. this.progressHander.clear();
  17546. this.progressHander = null;
  17547. }
  17548. clearRes(path) {
  17549. let type = this.getResType(path);
  17550. if (type == EResType.nromal)
  17551. Laya.loader.clearRes(path);
  17552. else if (type == EResType.td) {
  17553. let obj = this.tdResMap[path];
  17554. if (obj)
  17555. obj.destroy();
  17556. delete this.tdResMap[path];
  17557. }
  17558. }
  17559. getResType(path) {
  17560. let exs = this.getExtension(path);
  17561. if (exs == "sk")
  17562. return EResType.sk;
  17563. if (exs == "ls" || exs == "lh" || exs == "lm")
  17564. return EResType.td;
  17565. else
  17566. return EResType.nromal;
  17567. }
  17568. getExtension(res) {
  17569. var index = res.lastIndexOf(".");
  17570. return res.substr(index + 1);
  17571. }
  17572. loadNromal(path) {
  17573. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17574. if (res) {
  17575. this.onLoad();
  17576. }
  17577. else
  17578. console.log("load res fail:" + path);
  17579. }), this.progressHander);
  17580. }
  17581. loadSk() {
  17582. }
  17583. loadTd(path) {
  17584. if (this.tdResMap[path]) {
  17585. this.onLoad();
  17586. return;
  17587. }
  17588. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17589. if (res) {
  17590. this.tdResMap[path] = res;
  17591. this.onLoad();
  17592. }
  17593. else
  17594. console.log("load res fail:" + path);
  17595. }));
  17596. }
  17597. onLoad() {
  17598. this.loadCount++;
  17599. this.onProgress(1);
  17600. if (this.loadCount >= this.resCount) {
  17601. this.completrCall.run();
  17602. }
  17603. }
  17604. onProgress(pro) {
  17605. let progress = (this.loadCount + pro) / this.resCount;
  17606. this.progressCall.runWith(progress);
  17607. }
  17608. }
  17609. var Handler$2 = Laya.Handler;
  17610. class ResInfo {
  17611. constructor() {
  17612. this.index = 0;
  17613. }
  17614. }
  17615. class ResMgr {
  17616. constructor() {
  17617. this.resList = [];
  17618. this.doneList = [];
  17619. this.resMap = {};
  17620. this.currentLoad = null;
  17621. this.completeHandler = new Handler$2(this, this.onComplete);
  17622. this.progressHandler = new Handler$2(this, this.onProgress);
  17623. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17624. }
  17625. static getInstance() {
  17626. if (ResMgr._instance == null) {
  17627. ResMgr._instance = new ResMgr();
  17628. }
  17629. return ResMgr._instance;
  17630. }
  17631. loadList(list, completeHandler, progressHandler) {
  17632. if (list.length < 1) {
  17633. completeHandler.run();
  17634. return;
  17635. }
  17636. let info = this.getResInfo();
  17637. info.resList = list;
  17638. info.completeHandler = completeHandler;
  17639. info.progressHandler = progressHandler;
  17640. this.resList.push(info);
  17641. this.startLoad();
  17642. }
  17643. loadFguiRes(list, completeHandler, progressHandler) {
  17644. Laya.loader.load(list, completeHandler, progressHandler);
  17645. }
  17646. loadAny(list, completeHandler, progressHandler) {
  17647. Laya.loader.load(list, completeHandler, progressHandler);
  17648. }
  17649. load(path, completeHandler, progressHandler) {
  17650. let count = this.resMap[path];
  17651. if (count && count > 0) {
  17652. if (completeHandler)
  17653. completeHandler.run();
  17654. }
  17655. else
  17656. this.loadList([path], completeHandler, progressHandler);
  17657. }
  17658. getRes(path) {
  17659. let res = this.resMap[path];
  17660. if (!res)
  17661. this.showLog("资源不存在:" + path);
  17662. else
  17663. return this.loader.getRes(path);
  17664. }
  17665. clearList(list, force = false) {
  17666. if (!list || list.length < 1)
  17667. return;
  17668. let cr = () => {
  17669. for (const k in list) {
  17670. let v = list[k];
  17671. if (!v)
  17672. continue;
  17673. if (force) {
  17674. this.loader.clearRes(v);
  17675. delete this.resMap[v];
  17676. }
  17677. else {
  17678. let count = this.resMap[v];
  17679. if (count && count > 1) {
  17680. count--;
  17681. this.resMap[v] = count;
  17682. }
  17683. else {
  17684. this.loader.clearRes(v);
  17685. delete this.resMap[v];
  17686. }
  17687. }
  17688. }
  17689. if (!window.hasOwnProperty("ks"))
  17690. Laya.Resource.destroyUnusedResources();
  17691. };
  17692. Laya.timer.clearAll(this);
  17693. Laya.timer.once(2000, this, cr);
  17694. }
  17695. clear3D() {
  17696. for (const k in this.loader.tdResMap) {
  17697. this.loader.clearRes(k);
  17698. if (this.resMap[k])
  17699. delete this.resMap[k];
  17700. }
  17701. if (!window.hasOwnProperty("ks"))
  17702. Laya.Resource.destroyUnusedResources();
  17703. }
  17704. clear(path, force = false) {
  17705. this.clearList([path], force);
  17706. }
  17707. getResInfo() {
  17708. if (this.doneList.length > 0)
  17709. return this.doneList.pop();
  17710. else
  17711. return new ResInfo();
  17712. }
  17713. startLoad() {
  17714. if (this.currentLoad)
  17715. return;
  17716. this.currentLoad = this.resList.pop();
  17717. if (this.currentLoad) {
  17718. this.loader.load(this.currentLoad.resList);
  17719. }
  17720. }
  17721. onComplete() {
  17722. if (!this.currentLoad)
  17723. return;
  17724. for (const k in this.currentLoad.resList) {
  17725. let v = this.currentLoad.resList[k];
  17726. let count = this.resMap[v];
  17727. if (count)
  17728. count++;
  17729. else
  17730. count = 1;
  17731. this.resMap[v] = count;
  17732. }
  17733. if (this.currentLoad.completeHandler)
  17734. this.currentLoad.completeHandler.run();
  17735. this.doneList.push(this.currentLoad);
  17736. this.currentLoad = null;
  17737. this.startLoad();
  17738. }
  17739. onProgress(pro) {
  17740. if (!this.currentLoad)
  17741. return;
  17742. if (this.currentLoad.progressHandler)
  17743. this.currentLoad.progressHandler.runWith(pro);
  17744. }
  17745. showLog(str, ...args) {
  17746. console.log("[ResLoader] " + str);
  17747. }
  17748. }
  17749. ResMgr._instance = null;
  17750. class EventMgr extends Laya.EventDispatcher {
  17751. }
  17752. let eventMgr = new EventMgr();
  17753. /*! *****************************************************************************
  17754. Copyright (c) Microsoft Corporation. All rights reserved.
  17755. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17756. this file except in compliance with the License. You may obtain a copy of the
  17757. License at http://www.apache.org/licenses/LICENSE-2.0
  17758. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17759. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17760. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17761. MERCHANTABLITY OR NON-INFRINGEMENT.
  17762. See the Apache Version 2.0 License for specific language governing permissions
  17763. and limitations under the License.
  17764. ***************************************************************************** */
  17765. /* global Reflect, Promise */
  17766. var extendStatics = function(d, b) {
  17767. extendStatics = Object.setPrototypeOf ||
  17768. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17769. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17770. return extendStatics(d, b);
  17771. };
  17772. function __extends(d, b) {
  17773. extendStatics(d, b);
  17774. function __() { this.constructor = d; }
  17775. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17776. }
  17777. var __assign = function() {
  17778. __assign = Object.assign || function __assign(t) {
  17779. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17780. s = arguments[i];
  17781. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17782. }
  17783. return t;
  17784. };
  17785. return __assign.apply(this, arguments);
  17786. };
  17787. function __rest(s, e) {
  17788. var t = {};
  17789. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17790. t[p] = s[p];
  17791. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17792. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17793. t[p[i]] = s[p[i]];
  17794. return t;
  17795. }
  17796. function __decorate(decorators, target, key, desc) {
  17797. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17798. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17799. 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;
  17800. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17801. }
  17802. function __param(paramIndex, decorator) {
  17803. return function (target, key) { decorator(target, key, paramIndex); }
  17804. }
  17805. function __metadata(metadataKey, metadataValue) {
  17806. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17807. }
  17808. function __awaiter(thisArg, _arguments, P, generator) {
  17809. return new (P || (P = Promise))(function (resolve, reject) {
  17810. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17811. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17812. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17813. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17814. });
  17815. }
  17816. function __generator(thisArg, body) {
  17817. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17818. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17819. function verb(n) { return function (v) { return step([n, v]); }; }
  17820. function step(op) {
  17821. if (f) throw new TypeError("Generator is already executing.");
  17822. while (_) try {
  17823. 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;
  17824. if (y = 0, t) op = [op[0] & 2, t.value];
  17825. switch (op[0]) {
  17826. case 0: case 1: t = op; break;
  17827. case 4: _.label++; return { value: op[1], done: false };
  17828. case 5: _.label++; y = op[1]; op = [0]; continue;
  17829. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17830. default:
  17831. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17832. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17833. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17834. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17835. if (t[2]) _.ops.pop();
  17836. _.trys.pop(); continue;
  17837. }
  17838. op = body.call(thisArg, _);
  17839. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17840. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17841. }
  17842. }
  17843. function __exportStar(m, exports) {
  17844. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17845. }
  17846. function __values(o) {
  17847. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17848. if (m) return m.call(o);
  17849. return {
  17850. next: function () {
  17851. if (o && i >= o.length) o = void 0;
  17852. return { value: o && o[i++], done: !o };
  17853. }
  17854. };
  17855. }
  17856. function __read(o, n) {
  17857. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17858. if (!m) return o;
  17859. var i = m.call(o), r, ar = [], e;
  17860. try {
  17861. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17862. }
  17863. catch (error) { e = { error: error }; }
  17864. finally {
  17865. try {
  17866. if (r && !r.done && (m = i["return"])) m.call(i);
  17867. }
  17868. finally { if (e) throw e.error; }
  17869. }
  17870. return ar;
  17871. }
  17872. function __spread() {
  17873. for (var ar = [], i = 0; i < arguments.length; i++)
  17874. ar = ar.concat(__read(arguments[i]));
  17875. return ar;
  17876. }
  17877. function __await(v) {
  17878. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17879. }
  17880. function __asyncGenerator(thisArg, _arguments, generator) {
  17881. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17882. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17883. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17884. 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); }); }; }
  17885. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17886. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17887. function fulfill(value) { resume("next", value); }
  17888. function reject(value) { resume("throw", value); }
  17889. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17890. }
  17891. function __asyncDelegator(o) {
  17892. var i, p;
  17893. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17894. 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; }
  17895. }
  17896. function __asyncValues(o) {
  17897. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17898. var m = o[Symbol.asyncIterator], i;
  17899. 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);
  17900. 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); }); }; }
  17901. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17902. }
  17903. function __makeTemplateObject(cooked, raw) {
  17904. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17905. return cooked;
  17906. };
  17907. function __importStar(mod) {
  17908. if (mod && mod.__esModule) return mod;
  17909. var result = {};
  17910. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17911. result.default = mod;
  17912. return result;
  17913. }
  17914. function __importDefault(mod) {
  17915. return (mod && mod.__esModule) ? mod : { default: mod };
  17916. }
  17917. class CustomAlert {
  17918. static show(title, content, buttons) {
  17919. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17920. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17921. return;
  17922. }
  17923. const bg = new Laya.Box();
  17924. bg.alpha = 0;
  17925. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17926. Laya.stage.addChild(bg);
  17927. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17928. const panel = new Laya.Box();
  17929. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17930. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17931. bg.addChild(panel);
  17932. const titleText = new Laya.Text();
  17933. titleText.text = title;
  17934. titleText.fontSize = 32;
  17935. titleText.color = "#333333";
  17936. titleText.bold = true;
  17937. titleText.pos(20, 20);
  17938. titleText.width = 360;
  17939. titleText.align = "center";
  17940. panel.addChild(titleText);
  17941. const contentText = new Laya.Text();
  17942. contentText.text = content;
  17943. contentText.fontSize = 21;
  17944. contentText.color = "#555555";
  17945. contentText.pos(20, 70);
  17946. contentText.width = 360;
  17947. contentText.wordWrap = true;
  17948. contentText.align = "center";
  17949. panel.addChild(contentText);
  17950. const buttonContainer = new Laya.Box();
  17951. buttonContainer.pos(20, 160);
  17952. panel.addChild(buttonContainer);
  17953. const btnWidth = 120;
  17954. const spacing = 30;
  17955. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17956. buttons.forEach((btn, index) => {
  17957. const button = new Laya.Button();
  17958. button.label = btn.label;
  17959. button.size(btnWidth, 40);
  17960. button.labelSize = 22;
  17961. button.pos(index * (btnWidth + spacing), 0);
  17962. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17963. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17964. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17965. button.alpha = 0.9;
  17966. });
  17967. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17968. button.alpha = 1;
  17969. });
  17970. button.on(Laya.Event.CLICK, this, () => {
  17971. btn.handler();
  17972. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17973. bg.removeSelf();
  17974. }));
  17975. });
  17976. buttonContainer.addChild(button);
  17977. });
  17978. buttonContainer.x = (panel.width - totalWidth) / 2;
  17979. }
  17980. }
  17981. class ConfigMgr {
  17982. constructor() {
  17983. this.httpReqCount = 4;
  17984. this.httpReqOkCount = 0;
  17985. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17986. try {
  17987. this.httpReqOkCount = 0;
  17988. let reqData = xGame.httpMgr.getReqData();
  17989. console.log('zh:第1个请求getClassicCfg');
  17990. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17991. this.classicCfg = classicCfg;
  17992. this.httpReqOkCount++;
  17993. console.log('zh:第2个请求getLevelCfg');
  17994. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17995. this.levelCfg = levelCfg;
  17996. this.httpReqOkCount++;
  17997. console.log('zh:第3个请求 getPlaceBallCfg');
  17998. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17999. this.placeBallCfg = placeBallCfg;
  18000. this.httpReqOkCount++;
  18001. console.log('zh:第4个请求 npc');
  18002. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  18003. this.npcJson = npc.Data;
  18004. this.httpReqOkCount++;
  18005. console.log('zh:所有配置加载完成');
  18006. }
  18007. catch (error) {
  18008. console.error('zh:❌请求失败:', error);
  18009. Laya.timer.once(5000, this, () => {
  18010. let retryCount = 0;
  18011. const maxRetries = 3;
  18012. const tryFetchConfig = () => {
  18013. try {
  18014. xGame.cfgMgr.getConfigFromServer();
  18015. }
  18016. catch (error) {
  18017. if (retryCount < maxRetries) {
  18018. retryCount++;
  18019. console.log(`zh:🔄 第${retryCount}次重试获取配置...`);
  18020. Laya.timer.once(5000, this, tryFetchConfig);
  18021. }
  18022. else {
  18023. console.error("zh:❌ 达到最大重试次数,配置获取失败");
  18024. }
  18025. }
  18026. };
  18027. tryFetchConfig();
  18028. });
  18029. }
  18030. finally {
  18031. if (this.httpReqCount > this.httpReqOkCount) {
  18032. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [{
  18033. label: "Okay", handler: () => {
  18034. JSBridgeUtils.instance.exitAndCloseGame();
  18035. }
  18036. }]);
  18037. }
  18038. }
  18039. });
  18040. this.sendPostAsync = (action, reqData) => {
  18041. return new Promise((resolve, reject) => {
  18042. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  18043. try {
  18044. let code = res.code;
  18045. if (code == 200) {
  18046. const parsedData = JSON.parse(res.msg);
  18047. resolve(parsedData);
  18048. }
  18049. else {
  18050. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  18051. reject(new Error(`Request failed with code: ${code}`));
  18052. }
  18053. }
  18054. catch (error) {
  18055. console.error(`ERROR=${error}`);
  18056. alert("Please check your network connection.");
  18057. reject(error);
  18058. }
  18059. finally {
  18060. console.log(`zh:${action}的请求处理完毕`);
  18061. }
  18062. });
  18063. });
  18064. };
  18065. }
  18066. static getInstance() {
  18067. if (!this._instance) {
  18068. this._instance = new ConfigMgr();
  18069. }
  18070. return this._instance;
  18071. }
  18072. init() {
  18073. this.getConfigFromServer();
  18074. }
  18075. test() {
  18076. let reqData = xGame.httpMgr.getReqData();
  18077. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  18078. console.log('zh:1s');
  18079. try {
  18080. let code = res.code;
  18081. let data = res.data;
  18082. if (code == 200) {
  18083. const parsedData = JSON.parse(data);
  18084. this.classicCfg = parsedData;
  18085. }
  18086. else {
  18087. console.log('zh:res = ' + JSON.stringify(res));
  18088. }
  18089. }
  18090. catch (error) {
  18091. console.log('error=' + error);
  18092. alert("Please check your network connection.");
  18093. }
  18094. finally {
  18095. console.log('zh:1');
  18096. }
  18097. });
  18098. }
  18099. getUserInfoByIndex(index) {
  18100. return this.npcJson[index];
  18101. }
  18102. getRandomUserInfo() {
  18103. let index = xGame.tools.random(0, this.npcJson.length);
  18104. let rs = this.npcJson[index];
  18105. return rs;
  18106. }
  18107. getMaxBigMoveLength() {
  18108. return Object.keys(this.levelCfg).length;
  18109. }
  18110. getBigMoveLevelByIndex(index) {
  18111. let cfg = this.levelCfg;
  18112. cfg = cfg[index];
  18113. return cfg;
  18114. }
  18115. getRandomClassicLevel() {
  18116. let cfg = this.classicCfg;
  18117. let num = Object.keys(cfg).length;
  18118. let rand = xGame.common.randomNum(1, num);
  18119. return cfg[rand];
  18120. }
  18121. getPlaceBallByLevel(level) {
  18122. return this.placeBallCfg[level];
  18123. }
  18124. getMaxPlaceBall() {
  18125. return Object.keys(this.placeBallCfg).length;
  18126. }
  18127. }
  18128. class PoolD3Mgr {
  18129. constructor() {
  18130. this.pool = {};
  18131. }
  18132. static get ins() {
  18133. return this._ins || (this._ins = new PoolD3Mgr);
  18134. }
  18135. createList(key, prefab, parent) {
  18136. if (!this.pool[key]) {
  18137. this.pool[key] = {};
  18138. this.pool[key].prefab = prefab;
  18139. this.pool[key].list = [];
  18140. this.pool[key].parent = parent;
  18141. }
  18142. }
  18143. getItem(key) {
  18144. if (!this.pool[key]) {
  18145. return;
  18146. }
  18147. let temp;
  18148. if (this.pool[key].list.length > 0) {
  18149. temp = this.pool[key].list.pop();
  18150. }
  18151. else {
  18152. temp = this.pool[key].prefab.clone();
  18153. if (this.pool[key].parent) {
  18154. this.pool[key].parent.addChild(temp);
  18155. }
  18156. }
  18157. temp.active = true;
  18158. return temp;
  18159. }
  18160. putItem(key, obj) {
  18161. if (!this.pool[key]) {
  18162. return;
  18163. }
  18164. obj.active = false;
  18165. this.pool[key].list.push(obj);
  18166. }
  18167. }
  18168. let context$1 = context;
  18169. let uiMgr = UIMgr.inst;
  18170. let soundMgr = SoundMgr.getInstance();
  18171. let resMgr = ResMgr.getInstance();
  18172. let httpMgr = HttpMgr.getInstance();
  18173. let common = Common.getInstance();
  18174. let cfgMgr = ConfigMgr.getInstance();
  18175. let poolD3Mgr = PoolD3Mgr.ins;
  18176. let d3TexUrl = "res/d3Res/";
  18177. let d3ModeUrl = "res/unityRes/";
  18178. function setStageSize(view) {
  18179. if (view.width) {
  18180. view.width = Laya.stage.width;
  18181. view.height = Laya.stage.height;
  18182. }
  18183. }
  18184. function filledBg(view) {
  18185. let wh = Laya.stage.height / Laya.stage.width;
  18186. if (wh > 16 / 9) {
  18187. view.height = Laya.stage.height;
  18188. view.width = Laya.stage.height / 1334 * 750;
  18189. }
  18190. else {
  18191. view.width = Laya.stage.width;
  18192. view.height = Laya.stage.width / 750 * 1334;
  18193. }
  18194. }
  18195. function setNotch(view) {
  18196. if (view.height) {
  18197. view.y += context$1.notchHeight;
  18198. }
  18199. }
  18200. function showTip(str) {
  18201. uiMgr.Show(UIMsg, str);
  18202. }
  18203. function log(...args) {
  18204. console.log(args);
  18205. }
  18206. let xGame = {
  18207. context: context$1,
  18208. eventMgr,
  18209. resMgr,
  18210. uiMgr,
  18211. soundMgr,
  18212. define,
  18213. tools,
  18214. httpMgr,
  18215. d3TexUrl,
  18216. d3ModeUrl,
  18217. common,
  18218. cfgMgr,
  18219. poolD3Mgr,
  18220. setStageSize,
  18221. filledBg,
  18222. setNotch,
  18223. showTip,
  18224. log,
  18225. };
  18226. window["xGame"] = xGame;
  18227. let dataName = 'tBall_';
  18228. class UserData {
  18229. constructor() {
  18230. this.userId = "";
  18231. this.isAgree = false;
  18232. this.coinNum = 0;
  18233. this.gemNum = 0;
  18234. this.sound = true;
  18235. this.vibration = true;
  18236. this.currentDate = 0;
  18237. this.createTime = 0;
  18238. this.awardTime = 0;
  18239. this.roleId = 1;
  18240. this.roleList = [];
  18241. this.roleAds = [];
  18242. this.dressId = 101;
  18243. this.itemId = 201;
  18244. this.bigSkills = [1, 1, 1, 1, 1];
  18245. this.coin = 4000;
  18246. this.diamond = 0;
  18247. this.skillSuccessTimes = 0;
  18248. this.skillGuide = 0;
  18249. this.lianXiGuide = 0;
  18250. this.skillAccTimes = 0;
  18251. this.placeBallData = [];
  18252. this.shareDiamondTimes = 0;
  18253. this.dailyVideoShareTimes = 0;
  18254. this.secretary = [1, 0];
  18255. this.curSecretary = 0;
  18256. this.ballRod = [1, 0, 0, 0, 0, 1];
  18257. this.curBallRod = 5;
  18258. this.signData = 0;
  18259. this.signTime = 0;
  18260. this.drawTimes = 0;
  18261. this.drawAwardTimes = 0;
  18262. this.dailyfreeDrawTimes = 1;
  18263. this.power = 5;
  18264. this.powerTime = 0;
  18265. this.challengeTimes = 0;
  18266. this.extraSign = 0;
  18267. this.classicTimes = 0;
  18268. this.guideHelpLine = 0;
  18269. this.newUser = true;
  18270. this.rootBallFoul = 0;
  18271. this.timeoutFoul = 0;
  18272. this.roleList = [1];
  18273. }
  18274. saveData() {
  18275. let data = {};
  18276. for (let k in this) {
  18277. data[k.toString()] = this[k];
  18278. }
  18279. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  18280. }
  18281. getData() {
  18282. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18283. if (ld) {
  18284. let localData = JSON.parse(ld);
  18285. if (localData) {
  18286. for (let k in this) {
  18287. let key = k.toString();
  18288. let data = localData[key];
  18289. if (data != undefined) {
  18290. this[k] = data;
  18291. }
  18292. }
  18293. }
  18294. }
  18295. }
  18296. }
  18297. class ItemData {
  18298. constructor() {
  18299. this.itemList = {};
  18300. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18301. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18302. }
  18303. saveData() {
  18304. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18305. }
  18306. getData() {
  18307. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18308. if (ld) {
  18309. let localData = JSON.parse(ld);
  18310. if (localData) {
  18311. this.itemList = localData;
  18312. }
  18313. }
  18314. }
  18315. }
  18316. class GameData {
  18317. constructor() {
  18318. this.curLevel = 0;
  18319. this.gameType = 1;
  18320. this.signIdx = 0;
  18321. this.signMax = 0;
  18322. this.rotaryTime = 0;
  18323. this.rotaryCount = 0;
  18324. this.rotaryList = [];
  18325. this.diyCount = 3;
  18326. this.awardIdx = 0;
  18327. this.shareNum = 2;
  18328. this.rankWeek = 0;
  18329. this.rankScore = 0;
  18330. this.gameCount = 0;
  18331. this.trySkill = -1;
  18332. this.tryTime = 0;
  18333. }
  18334. saveData() {
  18335. let data = {};
  18336. for (let k in this) {
  18337. data[k.toString()] = this[k];
  18338. }
  18339. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18340. }
  18341. getData() {
  18342. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18343. if (ld) {
  18344. let localData = JSON.parse(ld);
  18345. if (localData) {
  18346. for (let k in this) {
  18347. let key = k.toString();
  18348. let data = localData[key];
  18349. if (data != undefined) {
  18350. this[k] = data;
  18351. }
  18352. }
  18353. }
  18354. }
  18355. }
  18356. }
  18357. class Diy2025GameData {
  18358. constructor() {
  18359. this.challengeMode_overLev = 0;
  18360. this.xszyForClassic = false;
  18361. this.xszyForChallenge = false;
  18362. }
  18363. saveData() {
  18364. let data = {};
  18365. for (let k in this) {
  18366. data[k.toString()] = this[k];
  18367. }
  18368. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18369. }
  18370. getData() {
  18371. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18372. if (ld) {
  18373. let localData = JSON.parse(ld);
  18374. if (localData) {
  18375. for (let k in this) {
  18376. let key = k.toString();
  18377. let data = localData[key];
  18378. if (data != undefined) {
  18379. this[k] = data;
  18380. }
  18381. }
  18382. }
  18383. }
  18384. }
  18385. }
  18386. class UIFuli1 extends UIBase {
  18387. constructor() {
  18388. super();
  18389. this.jiage = 4.99;
  18390. }
  18391. onConstructor() {
  18392. this.ui = ui_UIFuli1.createInstance();
  18393. this.contentPane = this.ui;
  18394. this.isEject = false;
  18395. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18396. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18397. }
  18398. show() {
  18399. super.show();
  18400. this.x = (Laya.stage.width - this.width) / 2;
  18401. this.y = (Laya.stage.height - this.height) / 2;
  18402. this.ui.n2.txt_price.text = "$" + this.jiage;
  18403. this.ui.n2.n_zzq_fl1.url = 'res/fuli1.png';
  18404. this.setGlobalFont(this.ui);
  18405. }
  18406. closeSelf() {
  18407. DataMgr.loadUserSpOrderForAd();
  18408. this.hide();
  18409. }
  18410. gotoBuy() {
  18411. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18412. if (userInfo != null) {
  18413. let token = userInfo.token;
  18414. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  18415. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  18416. DataMgr.loadUserSpOrderForAd();
  18417. return;
  18418. }
  18419. else {
  18420. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18421. }
  18422. }
  18423. gotoBuy2() {
  18424. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18425. if (userInfo == null) {
  18426. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18427. return;
  18428. }
  18429. let reqData = xGame.httpMgr.getReqData();
  18430. let pd = JSON.parse(reqData);
  18431. pd.productId = 1;
  18432. reqData = JSON.stringify(pd);
  18433. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18434. try {
  18435. console.log('zh:buySp res = ' + JSON.stringify(res));
  18436. let code = res.code;
  18437. let msg = res.msg;
  18438. if (code == 401) {
  18439. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18440. alert(TIP_MSG_key.loginTimeOut);
  18441. xGame.uiMgr.Show(UIMsg, msg);
  18442. return;
  18443. }
  18444. if (code == 200) {
  18445. xGame.uiMgr.Show(UIMsg, msg);
  18446. DataMgr.loadUserSpOrderForAd();
  18447. DataMgr.getUserZiChanInfo(false);
  18448. this.closeSelf();
  18449. }
  18450. else {
  18451. xGame.uiMgr.Show(UIMsg, msg);
  18452. }
  18453. }
  18454. catch (error) {
  18455. console.log('error=' + error);
  18456. alert(error);
  18457. }
  18458. finally {
  18459. }
  18460. });
  18461. }
  18462. }
  18463. UIFuli1.uiName = "UIFuli1";
  18464. class UIFuli2 extends UIBase {
  18465. constructor() {
  18466. super();
  18467. this.jiage = 14.99;
  18468. }
  18469. onConstructor() {
  18470. this.ui = ui_UIFuli2.createInstance();
  18471. this.contentPane = this.ui;
  18472. this.isEject = false;
  18473. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18474. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18475. }
  18476. show() {
  18477. super.show();
  18478. this.x = (Laya.stage.width - this.width) / 2;
  18479. this.y = (Laya.stage.height - this.height) / 2;
  18480. this.ui.n2.txt_price.text = "$" + this.jiage;
  18481. this.ui.n2.n_zzq_fl2.url = 'res/fuli2.png';
  18482. this.setGlobalFont(this.ui);
  18483. }
  18484. closeSelf() {
  18485. DataMgr.loadUserSpOrderForAd();
  18486. this.hide();
  18487. }
  18488. gotoBuy() {
  18489. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18490. if (userInfo != null) {
  18491. let token = userInfo.token;
  18492. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  18493. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  18494. DataMgr.loadUserSpOrderForAd();
  18495. return;
  18496. }
  18497. else {
  18498. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18499. }
  18500. }
  18501. gotoBuy1() {
  18502. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18503. if (userInfo == null) {
  18504. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18505. return;
  18506. }
  18507. let reqData = xGame.httpMgr.getReqData();
  18508. let pd = JSON.parse(reqData);
  18509. pd.productId = 2;
  18510. reqData = JSON.stringify(pd);
  18511. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18512. try {
  18513. console.log('zh:buySp res = ' + JSON.stringify(res));
  18514. let code = res.code;
  18515. let msg = res.msg;
  18516. if (code == 401) {
  18517. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18518. alert(TIP_MSG_key.loginTimeOut);
  18519. xGame.uiMgr.Show(UIMsg, msg);
  18520. return;
  18521. }
  18522. if (code == 200) {
  18523. xGame.uiMgr.Show(UIMsg, msg);
  18524. DataMgr.loadUserSpOrderForAd();
  18525. DataMgr.getUserZiChanInfo(false);
  18526. this.closeSelf();
  18527. }
  18528. else {
  18529. xGame.uiMgr.Show(UIMsg, msg);
  18530. }
  18531. }
  18532. catch (error) {
  18533. console.log('error=' + error);
  18534. alert(error);
  18535. }
  18536. finally {
  18537. }
  18538. });
  18539. }
  18540. }
  18541. UIFuli2.uiName = "UIFuli2";
  18542. class DataMgr {
  18543. static Init() {
  18544. this.userData = new UserData();
  18545. this.gameData = new GameData();
  18546. this.itemData = new ItemData();
  18547. this.diyGameData = new Diy2025GameData();
  18548. this.userData.getData();
  18549. this.gameData.getData();
  18550. this.itemData.getData();
  18551. this.diyGameData.getData();
  18552. this.roleId = this.userData.roleId;
  18553. this.resetUse();
  18554. }
  18555. static isNewDay() {
  18556. Moyu.isNewDay(this, (isnew) => {
  18557. xGame.common.isNewDay = isnew;
  18558. if (!isnew)
  18559. return;
  18560. DataMgr.setShareDiamondTimes(0, false);
  18561. DataMgr.setDailyVideoShareTimes(0, false);
  18562. DataMgr.setDailyfreeDrawTimes(1);
  18563. DataMgr.setExtraSign(0);
  18564. });
  18565. }
  18566. static deletData() {
  18567. Laya.LocalStorage.clear();
  18568. }
  18569. static upRankData() {
  18570. let num = xGame.common.getAllStarNum();
  18571. if (num > 0)
  18572. Moyu.upRankData(xGame.common.curRankID, num);
  18573. }
  18574. static addItem(id, count = 1) {
  18575. let v = this.itemData.itemList[id];
  18576. if (!v)
  18577. v = { id: id, count: count, adnum: 0, active: true };
  18578. else {
  18579. if (v.active) {
  18580. v.count += count;
  18581. }
  18582. else {
  18583. v.count = count;
  18584. v.active = true;
  18585. }
  18586. }
  18587. this.itemData.itemList[id] = v;
  18588. xGame.soundMgr.playGetSound();
  18589. this.saveItemData();
  18590. }
  18591. static hasItem(id) {
  18592. let v = this.itemData.itemList[id];
  18593. if (v && v.active)
  18594. return true;
  18595. return false;
  18596. }
  18597. static getItem(id) {
  18598. let v = this.itemData.itemList[id];
  18599. return v;
  18600. }
  18601. static getItemCount(id) {
  18602. let v = this.itemData.itemList[id];
  18603. if (v && v.active)
  18604. return v.count;
  18605. return 0;
  18606. }
  18607. static getItemAd(id) {
  18608. let v = this.itemData.itemList[id];
  18609. if (v) {
  18610. return v.adnum;
  18611. }
  18612. return 0;
  18613. }
  18614. static onItemAd(id, num = 1) {
  18615. let v = this.itemData.itemList[id];
  18616. if (!v)
  18617. v = { id: id, count: 1, adnum: num, active: false };
  18618. else
  18619. v.adnum += num;
  18620. this.itemData.itemList[id] = v;
  18621. this.saveItemData();
  18622. }
  18623. static costItem(id, count) {
  18624. let v = this.itemData.itemList[id];
  18625. if (v && v.active) {
  18626. if (v.count < count)
  18627. return false;
  18628. else {
  18629. v.count -= count;
  18630. this.itemData.itemList[id] = v;
  18631. return true;
  18632. }
  18633. }
  18634. return false;
  18635. }
  18636. static resetUse() {
  18637. this.dressId = this.userData.dressId;
  18638. this.itemId = this.userData.itemId;
  18639. }
  18640. static passLevel() {
  18641. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18642. this.gameData.curLevel++;
  18643. this.curLevel = this.gameData.curLevel;
  18644. this.saveGameData();
  18645. }
  18646. static useRole(id) {
  18647. this.roleId = id;
  18648. if (this.hasRole(id)) {
  18649. this.userData.roleId = id;
  18650. this.saveUserData();
  18651. }
  18652. }
  18653. static addRole(id) {
  18654. if (this.hasRole(id))
  18655. return;
  18656. this.userData.roleList.push(id);
  18657. this.saveUserData();
  18658. }
  18659. static hasRole(id) {
  18660. return this.userData.roleList.indexOf(id) >= 0;
  18661. }
  18662. static gemEnough(num) {
  18663. return this.userData.gemNum >= num;
  18664. }
  18665. static roleHasAd(id) {
  18666. let count = this.userData.roleAds[id];
  18667. if (count != undefined && count >= 0)
  18668. return true;
  18669. else
  18670. return false;
  18671. }
  18672. static saveUserData(time = 500, event, arg) {
  18673. if (this.userSaving)
  18674. return;
  18675. this.userSaving = true;
  18676. Laya.timer.once(time, this, () => {
  18677. this.userSaving = false;
  18678. this.userData.saveData();
  18679. if (event)
  18680. xGame.eventMgr.event(event, arg);
  18681. });
  18682. }
  18683. static updateUserNickName(loginUserName) {
  18684. let kyeStr = 'moyudata_180';
  18685. console.log('zh:################### kyeStr=' + kyeStr);
  18686. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18687. if (moyudata) {
  18688. const obj = JSON.parse(moyudata);
  18689. obj.nickName = loginUserName;
  18690. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18691. console.log('zh:################### updateUserNickName');
  18692. }
  18693. }
  18694. static saveGameData() {
  18695. if (this.gameSaving)
  18696. return;
  18697. this.gameSaving = true;
  18698. Laya.timer.once(1000, this, () => {
  18699. this.gameSaving = false;
  18700. this.gameData.saveData();
  18701. });
  18702. }
  18703. static saveItemData() {
  18704. let fun = () => {
  18705. this.itemData.saveData();
  18706. };
  18707. Laya.timer.clear(this, fun);
  18708. Laya.timer.once(500, this, fun);
  18709. }
  18710. static saveData() {
  18711. this.saveUserData();
  18712. this.saveGameData();
  18713. }
  18714. static getBigSkillList() {
  18715. return this.userData.bigSkills;
  18716. }
  18717. static getBigSkillByIndex(index) {
  18718. return this.userData.bigSkills[index];
  18719. }
  18720. static setBigSkill(index, val, addUp = true) {
  18721. if (addUp) {
  18722. this.userData.bigSkills[index] += val;
  18723. }
  18724. else {
  18725. this.userData.bigSkills[index] = val;
  18726. }
  18727. this.saveUserData();
  18728. console.log("zh:大技能更新");
  18729. this.updateUserInfo2Server("bigSkills");
  18730. }
  18731. static setBigSkillFormServer(jsonStr) {
  18732. console.log("zh:大技能 setBigSkillFormServer =" + jsonStr);
  18733. this.userData.bigSkills = JSON.parse(jsonStr);
  18734. this.saveUserData();
  18735. }
  18736. static coinEnough(need) {
  18737. if (typeof need != "number") {
  18738. console.error("金币格式错误");
  18739. return;
  18740. }
  18741. return this.userData.coin >= need;
  18742. }
  18743. static setCoin(val) {
  18744. if (typeof val != "number") {
  18745. return;
  18746. }
  18747. this.userData.coin += val;
  18748. this.saveUserData();
  18749. xGame.eventMgr.event(COIN_CHANGE);
  18750. this.updateUserInfo2Server("jb");
  18751. }
  18752. static setCoin2(val) {
  18753. if (typeof val != "number") {
  18754. return;
  18755. }
  18756. this.userData.coin = val;
  18757. this.saveUserData();
  18758. xGame.eventMgr.event(COIN_CHANGE);
  18759. }
  18760. static setCoinFormServer(val) {
  18761. if (typeof val != "number") {
  18762. return;
  18763. }
  18764. this.userData.coin = val;
  18765. this.saveUserData();
  18766. console.log('zh:通知更新金币变化' + val);
  18767. xGame.eventMgr.event(COIN_CHANGE);
  18768. }
  18769. static getCoin() {
  18770. return this.userData.coin;
  18771. }
  18772. static diamondEnough(need) {
  18773. if (typeof need != "number") {
  18774. console.error("金币格式错误");
  18775. return;
  18776. }
  18777. return this.userData.diamond >= need;
  18778. }
  18779. static setDiamond(val) {
  18780. if (typeof val != "number") {
  18781. return;
  18782. }
  18783. this.userData.diamond += val;
  18784. this.saveUserData();
  18785. xGame.eventMgr.event(DIAMOND_CHANGE);
  18786. this.updateUserInfo2Server("zs");
  18787. }
  18788. static setDiamond2(val) {
  18789. if (typeof val != "number") {
  18790. return;
  18791. }
  18792. this.userData.diamond = val;
  18793. this.saveUserData();
  18794. xGame.eventMgr.event(DIAMOND_CHANGE);
  18795. }
  18796. static setDiamondFormServer(val) {
  18797. if (typeof val != "number") {
  18798. return;
  18799. }
  18800. this.userData.diamond = val;
  18801. this.saveUserData();
  18802. console.log('zh:通知更新钻石变化' + val);
  18803. xGame.eventMgr.event(DIAMOND_CHANGE);
  18804. }
  18805. static getDiamond() {
  18806. return this.userData.diamond;
  18807. }
  18808. static getSkillSuccessTimes() {
  18809. return this.userData.skillSuccessTimes;
  18810. }
  18811. static setSkillSuccessTimes(val, addUp = true) {
  18812. if (addUp)
  18813. this.userData.skillSuccessTimes += val;
  18814. else
  18815. this.userData.skillSuccessTimes = val;
  18816. this.saveUserData();
  18817. }
  18818. static getSkillAccTimes() {
  18819. return this.userData.skillAccTimes;
  18820. }
  18821. static setSkillAccTimes(val) {
  18822. this.userData.skillAccTimes += val;
  18823. this.saveUserData();
  18824. }
  18825. static getSkillGuide() {
  18826. if (!xGame.common.openGuide) {
  18827. return 1;
  18828. }
  18829. return this.userData.skillGuide;
  18830. }
  18831. static setSkillGuide(val) {
  18832. this.userData.skillGuide = val;
  18833. this.saveUserData();
  18834. }
  18835. static setLianXiGuide(val) {
  18836. this.userData.lianXiGuide = val;
  18837. this.saveUserData();
  18838. }
  18839. static getLianXiGuide() {
  18840. return this.userData.lianXiGuide;
  18841. }
  18842. static getPlaceBallLevelList() {
  18843. return this.userData.placeBallData;
  18844. }
  18845. static setPlaceBallLevelList(objStr) {
  18846. if (objStr) {
  18847. let obj = JSON.parse(objStr);
  18848. this.userData.placeBallData = obj;
  18849. let cd = obj.length;
  18850. console.log('zh:setPlaceBallLevelList cd=' + cd);
  18851. xGame.common.placeBallCurLevel = cd;
  18852. DataMgr.setChallengeMode_overLev(cd);
  18853. this.saveUserData();
  18854. }
  18855. else {
  18856. this.userData.placeBallData = [];
  18857. this.saveUserData();
  18858. }
  18859. }
  18860. static getPlaceBallLevel(level) {
  18861. let arr = this.userData.placeBallData;
  18862. let index = level - 1;
  18863. let out;
  18864. if (arr[index]) {
  18865. out = arr[index];
  18866. }
  18867. else {
  18868. let max = arr.length;
  18869. if (max == index) {
  18870. out = {
  18871. star: 0,
  18872. play: true,
  18873. isCur: true,
  18874. getAward: false
  18875. };
  18876. }
  18877. else {
  18878. out = {
  18879. star: 0,
  18880. play: false,
  18881. getAward: false
  18882. };
  18883. }
  18884. }
  18885. return out;
  18886. }
  18887. static setPlaceBallLevel(level, star) {
  18888. let arr = this.userData.placeBallData;
  18889. let index = level - 1;
  18890. if (arr[index]) {
  18891. arr[index].star = Math.max(arr[index].star, star);
  18892. }
  18893. else {
  18894. let max = arr.length;
  18895. if (max == index) {
  18896. arr.push({
  18897. star: star,
  18898. play: true,
  18899. getAward: false
  18900. });
  18901. }
  18902. else {
  18903. console.error("关卡存储出错");
  18904. }
  18905. }
  18906. this.saveUserData();
  18907. }
  18908. static setPlaceBallAward(level) {
  18909. let arr = this.userData.placeBallData;
  18910. let index = level - 1;
  18911. if (arr[index]) {
  18912. arr[index].getAward = true;
  18913. }
  18914. this.saveUserData();
  18915. }
  18916. static getShareDiamondTimes() {
  18917. return this.userData.shareDiamondTimes;
  18918. }
  18919. static setShareDiamondTimes(val, addUp = true) {
  18920. if (addUp) {
  18921. this.userData.shareDiamondTimes += val;
  18922. }
  18923. else {
  18924. this.userData.shareDiamondTimes = val;
  18925. }
  18926. this.saveUserData();
  18927. }
  18928. static getDailyVideoShareTimes() {
  18929. return this.userData.dailyVideoShareTimes;
  18930. }
  18931. static setDailyVideoShareTimes(val, addUp = true) {
  18932. if (addUp) {
  18933. this.userData.dailyVideoShareTimes += val;
  18934. }
  18935. else {
  18936. this.userData.dailyVideoShareTimes = val;
  18937. }
  18938. this.saveUserData();
  18939. }
  18940. static getSecretary(index) {
  18941. return this.userData.secretary[index];
  18942. }
  18943. static setSecretary(index, val) {
  18944. this.userData.secretary[index] = val;
  18945. this.saveUserData();
  18946. }
  18947. static getCurSecretary() {
  18948. return this.userData.curSecretary;
  18949. }
  18950. static setCurSecretary(index) {
  18951. this.userData.curSecretary = index;
  18952. this.saveUserData();
  18953. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18954. }
  18955. static getBallRod(index) {
  18956. return this.userData.ballRod[index];
  18957. }
  18958. static setBallRod(index, val) {
  18959. this.userData.ballRod[index] = val;
  18960. this.saveUserData();
  18961. }
  18962. static setBallRodFormServer(haveQiuGanJsonStr) {
  18963. if (!haveQiuGanJsonStr) {
  18964. console.log("setBallRodFormServer数据为空或未定义");
  18965. return;
  18966. }
  18967. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18968. const keys = Object.keys(haveQiuGanJsonObj);
  18969. keys.forEach(key => {
  18970. let v = haveQiuGanJsonObj[key];
  18971. let k = parseInt(key);
  18972. let idx = k - 1;
  18973. this.userData.ballRod[idx] = v;
  18974. });
  18975. }
  18976. static getCurBallRod() {
  18977. return this.userData.curBallRod;
  18978. }
  18979. static setCurBallRod(index) {
  18980. this.userData.curBallRod = index;
  18981. this.saveUserData();
  18982. }
  18983. static setSignData(val) {
  18984. this.userData.signData = val;
  18985. this.saveUserData();
  18986. }
  18987. static getSignData() {
  18988. return this.userData.signData;
  18989. }
  18990. static setSignTime(val) {
  18991. this.userData.signTime = val;
  18992. this.saveUserData();
  18993. }
  18994. static getSignTime() {
  18995. return this.userData.signTime;
  18996. }
  18997. static getDrawTimes() {
  18998. return this.userData.drawTimes;
  18999. }
  19000. static setDrawTimes(val, addUp = true) {
  19001. if (addUp) {
  19002. this.userData.drawTimes += val;
  19003. }
  19004. else {
  19005. this.userData.drawTimes = val;
  19006. }
  19007. this.saveUserData();
  19008. }
  19009. static getDrawAwardTimes() {
  19010. return this.userData.drawAwardTimes;
  19011. }
  19012. static setDrawAwardTimes(val) {
  19013. this.userData.drawAwardTimes = val;
  19014. this.saveUserData();
  19015. }
  19016. static getDailyfreeDrawTimes() {
  19017. return this.userData.dailyfreeDrawTimes;
  19018. }
  19019. static setDailyfreeDrawTimes(val) {
  19020. this.userData.dailyfreeDrawTimes = val;
  19021. this.saveUserData();
  19022. }
  19023. static setPower(val, addUp = true) {
  19024. if (addUp)
  19025. this.userData.power += val;
  19026. else
  19027. this.userData.power = val;
  19028. if (this.userData.power >= xGame.common.maxPower) {
  19029. this.userData.power = xGame.common.maxPower;
  19030. }
  19031. xGame.eventMgr.event(POWER_CHANGE, val);
  19032. this.saveUserData();
  19033. this.updateUserInfo2Server("power");
  19034. }
  19035. static getPower() {
  19036. return this.userData.power;
  19037. }
  19038. static setPowerTime(val) {
  19039. this.userData.powerTime = val;
  19040. this.saveUserData();
  19041. }
  19042. static getPowerTime() {
  19043. return this.userData.powerTime;
  19044. }
  19045. static powerEnough() {
  19046. return this.getPower() > 0;
  19047. }
  19048. static getChallengeTimes() {
  19049. return this.userData.challengeTimes;
  19050. }
  19051. static setChallengeTimes(val) {
  19052. this.userData.challengeTimes += val;
  19053. this.saveUserData();
  19054. }
  19055. static getExtraSign() {
  19056. return this.userData.extraSign;
  19057. }
  19058. static setExtraSign(val) {
  19059. this.userData.extraSign = val;
  19060. this.saveUserData();
  19061. }
  19062. static getClassicTimes() {
  19063. return this.userData.classicTimes;
  19064. }
  19065. static setClassicTimes() {
  19066. this.userData.classicTimes += 1;
  19067. this.saveUserData();
  19068. }
  19069. static getGuideHelpLine() {
  19070. return this.userData.guideHelpLine;
  19071. }
  19072. static setGuideHelpLine() {
  19073. this.userData.guideHelpLine = 1;
  19074. this.saveUserData();
  19075. }
  19076. static getNewUser() {
  19077. return this.userData.newUser;
  19078. }
  19079. static setNewUser() {
  19080. this.userData.newUser = false;
  19081. this.saveUserData();
  19082. }
  19083. static getRootBallFoul() {
  19084. return this.userData.rootBallFoul;
  19085. }
  19086. static setRootBallFoul() {
  19087. this.userData.rootBallFoul = 1;
  19088. this.saveUserData();
  19089. }
  19090. static getTimeoutFoul() {
  19091. return this.userData.timeoutFoul;
  19092. }
  19093. static setTimeoutFoul() {
  19094. this.userData.timeoutFoul = 1;
  19095. this.saveUserData();
  19096. }
  19097. static saveDiyGameData() {
  19098. if (this.diyGameSaving)
  19099. return;
  19100. this.diyGameSaving = true;
  19101. Laya.timer.once(500, this, () => {
  19102. this.diyGameSaving = false;
  19103. this.diyGameData.saveData();
  19104. });
  19105. }
  19106. static getChallengeMode_overLev() {
  19107. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  19108. return this.challengeMode_overLev;
  19109. }
  19110. static setChallengeMode_overLev(levNum) {
  19111. this.diyGameData.challengeMode_overLev = levNum;
  19112. this.saveDiyGameData();
  19113. }
  19114. static updateUserInfo2Server(type, count = 0) {
  19115. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  19116. if (userInfoData == null) {
  19117. return;
  19118. }
  19119. let reqData = xGame.httpMgr.getReqData();
  19120. let rd = JSON.parse(reqData);
  19121. rd.dataType = type;
  19122. let dataValue = 0;
  19123. if (type == "zs") {
  19124. dataValue = this.getDiamond();
  19125. }
  19126. if (type == "jb") {
  19127. dataValue = this.getCoin();
  19128. }
  19129. if (type == "power") {
  19130. dataValue = this.getPower();
  19131. }
  19132. rd.dataValue = dataValue;
  19133. if (type == "bigSkills") {
  19134. let dataValueStr = this.userData.bigSkills;
  19135. let dvsJson = JSON.parse("[" + dataValueStr + "]");
  19136. rd.dataValueStr = JSON.stringify(dvsJson);
  19137. }
  19138. reqData = JSON.stringify(rd);
  19139. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  19140. try {
  19141. let code = res.code;
  19142. let data = res.data;
  19143. if (code == 401) {
  19144. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19145. console.log('zh:保存资产信息失败,请重新登录 ');
  19146. return;
  19147. }
  19148. if (code == 200) {
  19149. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  19150. }
  19151. else {
  19152. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  19153. }
  19154. }
  19155. catch (error) {
  19156. console.log('error=' + error);
  19157. alert("Please check your network connection.");
  19158. }
  19159. finally {
  19160. }
  19161. });
  19162. }
  19163. static getUserZiChanInfo(winTip = false) {
  19164. console.log('zh:getUserZCI');
  19165. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  19166. console.log('zh:userInfoData=' + userInfoData);
  19167. if (userInfoData == null || userInfoData == "" || userInfoData === "null") {
  19168. if (winTip) {
  19169. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19170. }
  19171. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19172. return;
  19173. }
  19174. let reqData = xGame.httpMgr.getReqData();
  19175. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  19176. try {
  19177. console.log('zh:buySp res = ' + JSON.stringify(res));
  19178. let code = res.code;
  19179. let msg = res.msg;
  19180. if (code == 401) {
  19181. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19182. if (winTip) {
  19183. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19184. }
  19185. return;
  19186. }
  19187. if (code == 200) {
  19188. let d = res.data;
  19189. let zuanShi = d.zuanShi;
  19190. let jinBi = d.jinBi;
  19191. let haveQiuGanJson = d.haveQiuGanJson;
  19192. let signData = d.signData;
  19193. let placeBallData = d.placeBallData;
  19194. let bigSkills = d.bigSkills;
  19195. DataMgr.setDiamondFormServer(zuanShi);
  19196. DataMgr.setCoinFormServer(jinBi);
  19197. DataMgr.setBallRodFormServer(haveQiuGanJson);
  19198. DataMgr.setPlaceBallLevelList(placeBallData);
  19199. if (signData && signData > 0) {
  19200. DataMgr.setSignData(signData);
  19201. }
  19202. DataMgr.setBigSkillFormServer(bigSkills);
  19203. }
  19204. else {
  19205. console.log("zh:更新用户资产信息error" + msg);
  19206. if (winTip) {
  19207. xGame.uiMgr.Show(UIMsg, msg);
  19208. }
  19209. }
  19210. }
  19211. catch (error) {
  19212. console.log('error=' + error);
  19213. if (winTip) {
  19214. alert(error);
  19215. }
  19216. }
  19217. finally {
  19218. console.log("zh:更新用户资产信息结束");
  19219. }
  19220. });
  19221. }
  19222. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  19223. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19224. console.log('zh:updateLocalUserData=' + userInfo);
  19225. if (userInfo != null) {
  19226. if (!userInfo.buySpids) {
  19227. userInfo.buySpids = { 1: false, 7: false };
  19228. }
  19229. else {
  19230. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  19231. }
  19232. userInfo.buySpids[spid] = isBuyOk;
  19233. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  19234. }
  19235. else {
  19236. }
  19237. }
  19238. static loadUserSpOrderForAd() {
  19239. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19240. if (userInfo == null) {
  19241. return;
  19242. }
  19243. console.log('zh:重新加载更新广告权利');
  19244. let reqData = xGame.httpMgr.getReqData();
  19245. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  19246. try {
  19247. console.log('zh:getOrderListForNoChongFuBuy res = ' + JSON.stringify(res));
  19248. let code = res.code;
  19249. let msg = res.msg;
  19250. if (code == 401) {
  19251. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19252. return;
  19253. }
  19254. if (code == 200) {
  19255. let data = res.data;
  19256. let buy_spid1 = false;
  19257. let buy_spid7 = false;
  19258. for (let index = 0; index < data.length; index++) {
  19259. let element = data[index];
  19260. console.log('zh:list element.spid = ' + element.spid);
  19261. if (element.spid == 1) {
  19262. buy_spid1 = true;
  19263. }
  19264. if (element.spid == 7) {
  19265. buy_spid7 = true;
  19266. }
  19267. }
  19268. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  19269. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  19270. }
  19271. else {
  19272. }
  19273. }
  19274. catch (error) {
  19275. console.log('error=' + error);
  19276. alert(error);
  19277. }
  19278. finally {
  19279. }
  19280. });
  19281. }
  19282. static checkForShowFuLi17AndAlert(alert_spid) {
  19283. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19284. if (userInfo == null) {
  19285. if (alert_spid === 1) {
  19286. xGame.uiMgr.Show(UIFuli1);
  19287. }
  19288. if (alert_spid === 7) {
  19289. xGame.uiMgr.Show(UIFuli2);
  19290. }
  19291. return;
  19292. }
  19293. console.log('zh:是否需要展示福利 ' + alert_spid + ' 的弹窗');
  19294. let reqData = xGame.httpMgr.getReqData();
  19295. let pd = JSON.parse(reqData);
  19296. pd.productId = alert_spid;
  19297. reqData = JSON.stringify(pd);
  19298. xGame.httpMgr.sendPost2025('order/getOrderForBuyFuLiSpid17', reqData, (res) => {
  19299. try {
  19300. let code = res.code;
  19301. let msg = res.msg;
  19302. if (code == 401) {
  19303. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19304. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19305. return;
  19306. }
  19307. if (code == 200) {
  19308. let data = res.data;
  19309. let buyOkSpid = [];
  19310. for (let i = 0; i < data.length; i++) {
  19311. let item = data[i];
  19312. let temp_spid = item.spid;
  19313. DataMgr.updateLocalUserDataForSpid17(temp_spid, true);
  19314. buyOkSpid.push(temp_spid);
  19315. }
  19316. let isBuyOk7 = buyOkSpid.indexOf(7) >= 0 ? true : false;
  19317. if (isBuyOk7) {
  19318. return;
  19319. }
  19320. let isBuyOk = buyOkSpid.indexOf(alert_spid) >= 0 ? true : false;
  19321. if (isBuyOk && alert_spid === 1) {
  19322. return;
  19323. }
  19324. else {
  19325. if (isBuyOk === false) {
  19326. if (alert_spid === 1) {
  19327. xGame.uiMgr.Show(UIFuli1);
  19328. }
  19329. if (alert_spid === 7) {
  19330. xGame.uiMgr.Show(UIFuli2);
  19331. }
  19332. }
  19333. else {
  19334. console.log('zh:已经购买了SPID=' + alert_spid + ',不需要再提示用户了');
  19335. }
  19336. }
  19337. }
  19338. else {
  19339. xGame.uiMgr.Show(UIMsg, msg);
  19340. }
  19341. }
  19342. catch (error) {
  19343. console.log('error=' + error);
  19344. alert(error);
  19345. }
  19346. finally {
  19347. }
  19348. });
  19349. }
  19350. }
  19351. DataMgr.isNewUser = false;
  19352. DataMgr.fristEnter = true;
  19353. DataMgr.levelType = 0;
  19354. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  19355. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  19356. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  19357. DataMgr.challengeMode_overLev = 0;
  19358. DataMgr.xszyForClassic = false;
  19359. DataMgr.xszyForChallenge = false;
  19360. DataMgr.awardId = 0;
  19361. DataMgr.awardCoin = 0;
  19362. DataMgr.sceneId = -1;
  19363. DataMgr.tryId = 0;
  19364. DataMgr.curLevel = 1;
  19365. DataMgr.vipLevel = 0;
  19366. DataMgr.maxLevel = 0;
  19367. DataMgr.awardRatio = 1;
  19368. DataMgr.gameList = [];
  19369. DataMgr.rankList = [];
  19370. DataMgr.recoverTime = 480000;
  19371. DataMgr.minScore = 0;
  19372. DataMgr.rankDis = 0;
  19373. DataMgr.userSaving = false;
  19374. DataMgr.gameSaving = false;
  19375. DataMgr.diyGameSaving = false;
  19376. class D3Tween extends Laya.Script3D {
  19377. constructor() {
  19378. super();
  19379. this.isInited = false;
  19380. }
  19381. ;
  19382. init() {
  19383. if (this.isInited)
  19384. return;
  19385. this.isInited = true;
  19386. this.gameObj = this.owner;
  19387. this.transform = this.gameObj.transform;
  19388. }
  19389. get rotX() {
  19390. return this.transform.localRotationEulerX;
  19391. }
  19392. set rotX(v) {
  19393. this.transform.localRotationEulerX = v;
  19394. }
  19395. get rotY() {
  19396. return this.transform.localRotationEulerY;
  19397. }
  19398. set rotY(v) {
  19399. this.transform.localRotationEulerY = v;
  19400. }
  19401. get rotZ() {
  19402. return this.transform.localRotationEulerZ;
  19403. }
  19404. set rotZ(v) {
  19405. this.transform.localRotationEulerZ = v;
  19406. }
  19407. get posX() {
  19408. return this.transform.localPositionX;
  19409. }
  19410. set posX(v) {
  19411. this.transform.localPositionX = v;
  19412. }
  19413. get posY() {
  19414. return this.transform.localPositionY;
  19415. }
  19416. set posY(v) {
  19417. this.transform.localPositionY = v;
  19418. }
  19419. get posZ() {
  19420. return this.transform.localPositionZ;
  19421. }
  19422. set posZ(v) {
  19423. this.transform.localPositionZ = v;
  19424. }
  19425. get rotation() {
  19426. return this.transform.localRotation;
  19427. }
  19428. set rotation(v) {
  19429. this.transform.localRotation = v;
  19430. }
  19431. }
  19432. class D2Hole extends Laya.Script {
  19433. constructor() { super(); }
  19434. onTriggerEnter(collider) {
  19435. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  19436. return;
  19437. }
  19438. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  19439. if (collider.owner["mySrc"].isRunSkillAni) {
  19440. return;
  19441. }
  19442. if (collider.owner["mySrc"].number != 0) {
  19443. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  19444. }
  19445. xGame.common.ballColliHole(collider);
  19446. xGame.common.recoverCameraView();
  19447. }
  19448. }
  19449. }
  19450. class Table extends Laya.Script3D {
  19451. constructor() {
  19452. super();
  19453. this.isSetBorder = false;
  19454. this.inited = false;
  19455. }
  19456. ;
  19457. onAwake() {
  19458. this.init();
  19459. }
  19460. init() {
  19461. if (this.inited)
  19462. return;
  19463. this.inited = true;
  19464. this.gameObj = this.owner;
  19465. this.border = this.gameObj.getChildByName("border");
  19466. }
  19467. setBorderPos() {
  19468. if (this.isSetBorder)
  19469. return;
  19470. this.isSetBorder = true;
  19471. let ui = xGame.common.gameUI.ui;
  19472. let bar1 = this.border.getChildByName("bar1");
  19473. let bar2 = this.border.getChildByName("bar2");
  19474. let bar3 = this.border.getChildByName("bar3");
  19475. let bar4 = this.border.getChildByName("bar4");
  19476. let bar5 = this.border.getChildByName("bar5");
  19477. let bar6 = this.border.getChildByName("bar6");
  19478. this.setInfo(bar1, ui.border.bar1, "box");
  19479. this.setInfo(bar2, ui.border.bar2, "box");
  19480. this.setInfo(bar3, ui.border.bar3, "box");
  19481. this.setInfo(bar4, ui.border.bar4, "box");
  19482. this.setInfo(bar5, ui.border.bar5, "box");
  19483. this.setInfo(bar6, ui.border.bar6, "box");
  19484. let circle1 = this.border.getChildByName("circle1");
  19485. let circle2 = this.border.getChildByName("circle2");
  19486. let circle3 = this.border.getChildByName("circle3");
  19487. let circle4 = this.border.getChildByName("circle4");
  19488. let circle5 = this.border.getChildByName("circle5");
  19489. let circle6 = this.border.getChildByName("circle6");
  19490. this.setInfo(circle1, ui.border.circle1, "circle");
  19491. this.setInfo(circle2, ui.border.circle2, "circle");
  19492. this.setInfo(circle3, ui.border.circle3, "circle");
  19493. this.setInfo(circle4, ui.border.circle4, "circle");
  19494. this.setInfo(circle5, ui.border.circle5, "circle");
  19495. this.setInfo(circle6, ui.border.circle6, "circle");
  19496. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  19497. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  19498. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  19499. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  19500. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  19501. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  19502. let arr = xGame.common.gameMgr.holePosList;
  19503. xGame.common.gameMgr.posObj = {
  19504. "1": arr[0],
  19505. "3": arr[2],
  19506. "4": arr[3],
  19507. "6": arr[5]
  19508. };
  19509. }
  19510. initHolePos(x, y) {
  19511. if (x < 300)
  19512. x += 25;
  19513. else if (x > 1000)
  19514. x -= 25;
  19515. else if (y > 200)
  19516. y -= 10;
  19517. else
  19518. y += 10;
  19519. if (y < 200)
  19520. y += 30;
  19521. else if (y > 500)
  19522. y -= 30;
  19523. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  19524. }
  19525. setInfo(d3Obj, d2Obj, type) {
  19526. let ui = xGame.common.gameUI.ui;
  19527. let sprite = new Laya.Sprite();
  19528. ui.border.displayObject.addChild(sprite);
  19529. let colli = xGame.common.getCollider(type);
  19530. sprite.addComponentIntance(colli);
  19531. let rigy = xGame.common.getRigbody();
  19532. rigy.type = "static";
  19533. sprite.addComponentIntance(rigy);
  19534. let d3Pos = d3Obj.transform.position;
  19535. xGame.common.pos3to2Convert(d3Pos);
  19536. let scaleX = d3Obj.transform.localScaleX;
  19537. let scaleZ = d3Obj.transform.localScaleZ;
  19538. let width = xGame.common.scale3to2Convert(scaleZ);
  19539. let height = xGame.common.scale3to2Convert(scaleX);
  19540. sprite.pivotX = width / 2;
  19541. sprite.pivotY = height / 2;
  19542. sprite.x = d3Pos.x;
  19543. sprite.y = d3Pos.y;
  19544. sprite.width = width;
  19545. sprite.height = height;
  19546. d2Obj.x = d3Pos.x;
  19547. d2Obj.y = d3Pos.y;
  19548. d2Obj.width = width;
  19549. d2Obj.height = height;
  19550. if (type == "box") {
  19551. colli.width = width;
  19552. colli.height = height;
  19553. colli.isSensor = false;
  19554. colli.label = "border";
  19555. }
  19556. else {
  19557. colli.radius = width / 2;
  19558. colli.isSensor = true;
  19559. colli.label = "hole";
  19560. sprite.addComponent(D2Hole);
  19561. }
  19562. }
  19563. }
  19564. class D3World extends Laya.Script3D {
  19565. constructor() {
  19566. super();
  19567. this.loadNum = 0;
  19568. this.setLoadNum = 7;
  19569. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  19570. }
  19571. onAwake() {
  19572. }
  19573. loadScene() {
  19574. this.scene = this.owner;
  19575. let url = `res/unityRes/root.lh`;
  19576. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  19577. this.scene.addChild(prefab);
  19578. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  19579. this.putCameraInfo();
  19580. this.camera.enableHDR = false;
  19581. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  19582. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  19583. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  19584. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  19585. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  19586. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  19587. this.knife.active = false;
  19588. this.loadD3Obj();
  19589. }));
  19590. }
  19591. putCameraInfo() {
  19592. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  19593. this.cameraObj = new cameraType();
  19594. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  19595. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  19596. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  19597. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  19598. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  19599. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  19600. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  19601. this.visitAngleChild.init();
  19602. this.visitRootObj.posX = this.visitAngleChild.posX;
  19603. this.visitRootObj.posY = this.visitAngleChild.posY;
  19604. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  19605. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  19606. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  19607. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  19608. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  19609. xGame.common.showOneCamera("mainCamera");
  19610. }
  19611. loadD3Obj() {
  19612. this.loadTable();
  19613. this.loadRoom();
  19614. this.loadInHoleParticial();
  19615. this.loadIceParticial();
  19616. this.loadHitParticial();
  19617. this.loadFireworksParticial();
  19618. this.loadBall();
  19619. }
  19620. loadInHoleParticial() {
  19621. this.loadD3Res("inHoleEft", "", (prefab) => {
  19622. prefab.addComponent(Partical);
  19623. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19624. });
  19625. }
  19626. loadIceParticial() {
  19627. this.loadD3Res("iceEft", "", (prefab) => {
  19628. prefab.addComponent(Partical);
  19629. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19630. });
  19631. }
  19632. loadHitParticial() {
  19633. this.loadD3Res("hitEft", "", (prefab) => {
  19634. prefab.addComponent(Partical);
  19635. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19636. });
  19637. }
  19638. loadFireworksParticial() {
  19639. this.loadD3Res("fireworksEft", "", (prefab) => {
  19640. prefab.addComponent(Partical);
  19641. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19642. });
  19643. }
  19644. loadBall(index = 1) {
  19645. this.loadD3Res("ball", index, (prefab) => {
  19646. this.ballPrefab = prefab;
  19647. this.ballPrefab.addComponent(Ball);
  19648. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19649. });
  19650. }
  19651. loadTable(index = 1) {
  19652. this.loadD3Res("table", index, (prefab) => {
  19653. this.tableSrc = prefab.addComponent(Table);
  19654. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19655. this.d3Hand.init();
  19656. this.tableRoot.addChild(prefab);
  19657. });
  19658. }
  19659. loadRoom(index = 1) {
  19660. this.loadD3Res("room", index, (prefab) => {
  19661. this.roomRoot.addChild(prefab);
  19662. });
  19663. }
  19664. loadD3Res(type, index, callback) {
  19665. let url = `res/unityRes/${type}${index}.lh`;
  19666. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19667. callback && callback(prefab);
  19668. this.checkResLoad();
  19669. }));
  19670. }
  19671. checkResLoad() {
  19672. this.loadNum++;
  19673. if (this.loadNum >= this.setLoadNum) {
  19674. xGame.eventMgr.event(D3RES_LOADED);
  19675. }
  19676. }
  19677. prePlayEft() {
  19678. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19679. eft.transform.localPositionX = 0;
  19680. eft.transform.localPositionY = -5;
  19681. eft.transform.localPositionZ = 0;
  19682. eft.active = true;
  19683. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19684. ice.transform.localPositionX = 0;
  19685. ice.transform.localPositionY = -5;
  19686. ice.transform.localPositionZ = 0;
  19687. ice.active = true;
  19688. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19689. hit.transform.localPositionX = 0;
  19690. hit.transform.localPositionY = -5;
  19691. hit.transform.localPositionZ = 0;
  19692. hit.active = true;
  19693. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19694. fireworks.transform.localPositionX = 0;
  19695. fireworks.transform.localPositionY = -5;
  19696. fireworks.transform.localPositionZ = 0;
  19697. fireworks.active = true;
  19698. }
  19699. }
  19700. class cameraType {
  19701. }
  19702. class MoyuMgr$1 {
  19703. static initMoyu() {
  19704. this.moyuView = new MoyuView$1();
  19705. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19706. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19707. this.moyuView.ui.displayObject.zOrder = 1000;
  19708. this.moyuView.init();
  19709. this.moyuView.showTip(true);
  19710. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19711. window['XApk'] = this;
  19712. }
  19713. static showAge(show) {
  19714. if (this.moyuView)
  19715. this.moyuView.showAge(show);
  19716. }
  19717. static onPlatMsg(idx) {
  19718. if (!MoyuMgr$1.moyuView)
  19719. return;
  19720. if (idx == '0') {
  19721. MoyuMgr$1.moyuView.showTip(false);
  19722. }
  19723. }
  19724. static showAgree(call) {
  19725. if (this.moyuView)
  19726. this.moyuView.showAgree(call);
  19727. else
  19728. call && call();
  19729. }
  19730. static showXy(type = 1) {
  19731. if (this.moyuView)
  19732. this.moyuView.showXy(type);
  19733. }
  19734. }
  19735. MoyuMgr$1.isAdvise = false;
  19736. class MoyuView$1 {
  19737. constructor() {
  19738. this.ysxyNum = 1;
  19739. this.ysJson = null;
  19740. this.ui = ui_UIMoyu.createInstance();
  19741. }
  19742. init() {
  19743. this.ui.mainBg.visible = false;
  19744. this.ui.xyNode.visible = false;
  19745. this.ui.ageNode.visible = false;
  19746. this.ui.tipNode.visible = false;
  19747. this.ui.rnNode.visible = false;
  19748. this.ui.fcmNode.visible = false;
  19749. this.ui.ageTip.visible = false;
  19750. this.ui.msgNode.visible = false;
  19751. this.ui.visible = false;
  19752. this.ui.xyNode.xyList.setVirtual();
  19753. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19754. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19755. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19756. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19757. this.ui.xyNode.btnKnown.visible = false;
  19758. this.ui.xyNode.xy1.visible = false;
  19759. this.ui.xyNode.xy2.visible = false;
  19760. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19761. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19762. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19763. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19764. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19765. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19766. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19767. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19768. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19769. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19770. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19771. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19772. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19773. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19774. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19775. this.ysxyNum = 2;
  19776. }
  19777. }
  19778. onClick(obj) {
  19779. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19780. switch (obj) {
  19781. case this.ui.ageTip:
  19782. if (Moyu.isTTApk) {
  19783. this.ui.ageNode.visible = true;
  19784. this.ui.mainBg.visible = true;
  19785. }
  19786. break;
  19787. case this.ui.tipNode:
  19788. this.showTip(false);
  19789. break;
  19790. case this.ui.ageNode.btnAge:
  19791. this.ui.ageNode.visible = false;
  19792. this.ui.mainBg.visible = false;
  19793. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19794. this.ui.visible = false;
  19795. break;
  19796. case this.ui.xyNode.btnXy3:
  19797. case this.ui.xyNode.btnXy1:
  19798. this.loadXy(1);
  19799. break;
  19800. case this.ui.xyNode.btnXy2:
  19801. this.loadXy(2);
  19802. break;
  19803. case this.ui.xyNode.btnBack:
  19804. this.ui.xyNode.xy1.visible = true;
  19805. this.ui.xyNode.xy2.visible = false;
  19806. break;
  19807. case this.ui.xyNode.btnKnown:
  19808. this.ui.xyNode.visible = false;
  19809. this.ui.mainBg.visible = false;
  19810. this.ui.visible = false;
  19811. break;
  19812. case this.ui.rnNode.btnCheck:
  19813. this.check();
  19814. break;
  19815. case this.ui.rnNode.btnExit:
  19816. case this.ui.xyNode.btnNo:
  19817. this.ysxyNum--;
  19818. if (this.ysxyNum > 0)
  19819. this.showMsg("Refuse to quit the game once again");
  19820. else {
  19821. Moyu.userAgree(false);
  19822. Moyu.exit();
  19823. }
  19824. break;
  19825. case this.ui.xyNode.btnSure:
  19826. case this.ui.xyNode.btnYes:
  19827. DataMgr.userData.isAgree = true;
  19828. DataMgr.saveUserData();
  19829. this.onAgree();
  19830. break;
  19831. case this.ui.rnNode.btnDone:
  19832. this.ui.rnNode.visible = false;
  19833. this.ui.visible = false;
  19834. break;
  19835. case this.ui.fcmNode.btnRn:
  19836. this.showRn();
  19837. break;
  19838. }
  19839. }
  19840. showTip(show) {
  19841. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19842. return;
  19843. if (show) {
  19844. MoyuMgr$1.isAdvise = true;
  19845. this.ui.visible = true;
  19846. this.ui.tipNode.visible = true;
  19847. this.ui.tipNode.alpha = 1;
  19848. Laya.timer.once(1000, this, this.showTip, [false]);
  19849. }
  19850. else {
  19851. this.ui.tipNode.alpha = 1;
  19852. this.ui.tipNode.visible = true;
  19853. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19854. this.ui.tipNode.visible = false;
  19855. MoyuMgr$1.isAdvise = false;
  19856. }), 1000);
  19857. }
  19858. }
  19859. showAge(show, px = 0, py = 0) {
  19860. if (Moyu.platType > 10 && !Moyu.isIos) {
  19861. this.ui.ageTip.x = px;
  19862. this.ui.ageTip.y = py;
  19863. this.ui.ageTip.visible = show;
  19864. if (show)
  19865. this.ui.visible = true;
  19866. }
  19867. }
  19868. showAgree(call) {
  19869. this.agreeCall = call;
  19870. this.onAgree();
  19871. return;
  19872. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19873. this.showXy(0);
  19874. }
  19875. else
  19876. this.onAgree();
  19877. }
  19878. onAgree() {
  19879. if (!this.ui.ageNode.visible)
  19880. this.ui.visible = false;
  19881. this.ui.xyNode.visible = false;
  19882. Moyu.userAgree(true);
  19883. this.showAge(false);
  19884. this.agreeCall && this.agreeCall();
  19885. this.showRn();
  19886. }
  19887. showMsg(txt) {
  19888. this.ui.msgNode.txtMsg.text = txt;
  19889. this.ui.msgNode.visible = true;
  19890. this.ui.msgNode.alpha = 1;
  19891. this.ui.visible = true;
  19892. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19893. this.ui.msgNode.visible = false;
  19894. }), 2500, true);
  19895. }
  19896. showRn() {
  19897. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19898. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19899. this.ui.rnNode.rn1.visible = true;
  19900. this.ui.rnNode.rn2.visible = false;
  19901. this.ui.rnNode.rn3.visible = false;
  19902. this.ui.rnNode.rn4.visible = false;
  19903. this.ui.rnNode.visible = true;
  19904. this.ui.mainBg.visible = true;
  19905. this.ui.rnNode.btnDone.visible = false;
  19906. this.ui.rnNode.btnExit.visible = true;
  19907. this.ui.rnNode.btnCheck.visible = true;
  19908. this.ui.fcmNode.visible = false;
  19909. this.ui.visible = true;
  19910. return;
  19911. }
  19912. }
  19913. this.showFcm();
  19914. }
  19915. showFcm() {
  19916. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19917. Moyu.initFCM(true);
  19918. if (Moyu.gameTime < 1)
  19919. this.fcmLoop();
  19920. else if (Moyu.gameTime < 999)
  19921. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19922. }
  19923. }
  19924. fcmLoop() {
  19925. if (Moyu.gameTime < 1) {
  19926. this.ui.rnNode.visible = false;
  19927. this.ui.fcmNode.visible = true;
  19928. this.ui.mainBg.visible = true;
  19929. this.ui.visible = true;
  19930. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19931. Laya.timer.clear(this.ui, this.fcmLoop);
  19932. }
  19933. }
  19934. check() {
  19935. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19936. this.ui.rnNode.rn1.visible = false;
  19937. this.ui.rnNode.rn2.visible = false;
  19938. this.ui.rnNode.rn4.visible = true;
  19939. }
  19940. else if (this.ui.rnNode.rn4.visible) {
  19941. let name = this.ui.rnNode.inputName.text;
  19942. let code = this.ui.rnNode.inputCode.text;
  19943. if (code && code.length == 18) {
  19944. this.ui.rnNode.rn1.visible = false;
  19945. this.ui.rnNode.rn4.visible = false;
  19946. Moyu.authenticate(name, code, (res) => {
  19947. this.ui.rnNode.rn2.visible = !res;
  19948. this.ui.rnNode.rn3.visible = res;
  19949. this.ui.rnNode.btnDone.visible = res;
  19950. this.ui.rnNode.btnExit.visible = !res;
  19951. this.ui.rnNode.btnCheck.visible = !res;
  19952. if (res)
  19953. this.showFcm();
  19954. });
  19955. }
  19956. else
  19957. this.showMsg("信息填写不完整");
  19958. }
  19959. }
  19960. loadXy(type = 0) {
  19961. this.ui.xyNode.xy1.visible = false;
  19962. this.ui.xyNode.xy2.visible = true;
  19963. this.ui.xyNode.xyList.scrollToView(0);
  19964. if (type == 1) {
  19965. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19966. }
  19967. else if (type == 2) {
  19968. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19969. }
  19970. }
  19971. showXy(type = 0) {
  19972. this.xyBtn();
  19973. if (type == 0) {
  19974. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19975. this.ui.xyNode.btnSure.visible = true;
  19976. }
  19977. else {
  19978. this.ui.xyNode.btnYes.visible = true;
  19979. this.ui.xyNode.btnNo.visible = true;
  19980. }
  19981. }
  19982. else {
  19983. this.ui.xyNode.btnKnown.visible = true;
  19984. this.ui.mainBg.visible = true;
  19985. }
  19986. this.ui.xyNode.xy1.visible = true;
  19987. this.ui.xyNode.xy2.visible = false;
  19988. this.ui.xyNode.visible = true;
  19989. this.ui.visible = true;
  19990. }
  19991. xyBtn() {
  19992. this.ui.xyNode.btnSure.visible = false;
  19993. this.ui.xyNode.btnYes.visible = false;
  19994. this.ui.xyNode.btnNo.visible = false;
  19995. this.ui.xyNode.btnKnown.visible = false;
  19996. {
  19997. this.ui.xyNode.btnXy3.visible = false;
  19998. this.ui.xyNode.btnXy2.visible = true;
  19999. this.ui.xyNode.btnXy1.visible = true;
  20000. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  20001. }
  20002. }
  20003. createXY(json) {
  20004. this.ysJson = json.content;
  20005. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  20006. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  20007. this.ui.xyNode.xy2.visible = true;
  20008. }
  20009. renderListItem(idx, cell) {
  20010. let xy = this.ysJson[idx];
  20011. cell.height = xy.line * 30;
  20012. cell.xyItem.text = xy.text;
  20013. }
  20014. onDestroy() {
  20015. this.agreeCall = null;
  20016. }
  20017. }
  20018. class UILoading extends UIBase {
  20019. constructor() {
  20020. super();
  20021. this.accTime = 0;
  20022. this.curNum = 0;
  20023. this.rate = 1;
  20024. this.loadSubOk = false;
  20025. this.loadResOK = false;
  20026. this.openLoading = true;
  20027. this.beginLoadRes = false;
  20028. this.finishD2 = false;
  20029. this.finishD3 = false;
  20030. }
  20031. onConstructor() {
  20032. this.ui = ui_UILoading.createInstance();
  20033. this.contentPane = this.ui;
  20034. this.isEject = false;
  20035. this._initUI();
  20036. this._addEvent();
  20037. }
  20038. _initUI() {
  20039. MoyuMgr$1.initMoyu();
  20040. }
  20041. _addEvent() {
  20042. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  20043. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  20044. }
  20045. show() {
  20046. super.show();
  20047. console.log('zh:加载分包资源');
  20048. loadSubRes(this.subResProgress.bind(this));
  20049. this.ui.txtLoad.text = "Loading...";
  20050. this.setGlobalFont(this.ui);
  20051. }
  20052. subResProgress(pro, finish) {
  20053. this.curNum = pro;
  20054. if (finish) {
  20055. this.curNum = 1;
  20056. this.loadSubOk = true;
  20057. }
  20058. }
  20059. laodD3Res() {
  20060. let scene3D = new Laya.Scene3D();
  20061. xGame.common.d3Scene = scene3D;
  20062. xGame.common.d3World = scene3D.addComponent(D3World);
  20063. xGame.common.d3World.loadScene();
  20064. }
  20065. loadD2Res() {
  20066. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  20067. this.finishD2 = true;
  20068. this.checkLoadAll();
  20069. this.curNum = 1;
  20070. }), Laya.Handler.create(this, (pro) => {
  20071. this.curNum = pro;
  20072. }, null, false));
  20073. }
  20074. d3ResFinish() {
  20075. this.finishD3 = true;
  20076. this.checkLoadAll();
  20077. }
  20078. checkLoadAll() {
  20079. if (this.finishD2 && this.finishD3) {
  20080. this.loadResOK = true;
  20081. }
  20082. }
  20083. loadRes() {
  20084. this.laodD3Res();
  20085. this.loadD2Res();
  20086. }
  20087. myUpdate(dt) {
  20088. if (!this.openLoading)
  20089. return;
  20090. this.accTime += dt * this.rate;
  20091. if (this.accTime >= this.curNum)
  20092. this.accTime = this.curNum;
  20093. this.ui.loadinfo.value = this.accTime * 100;
  20094. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  20095. if (!this.beginLoadRes) {
  20096. this.beginLoadRes = true;
  20097. this.ui.txtLoad.text = "Loading...";
  20098. this.curNum = 0;
  20099. this.accTime = 0;
  20100. this.loadRes();
  20101. }
  20102. if (this.loadResOK) {
  20103. this.openLoading = false;
  20104. Laya.timer.once(300, this, () => {
  20105. xGame.common.d3Scene.active = false;
  20106. MoyuMgr$1.showAgree(enterGame);
  20107. });
  20108. }
  20109. }
  20110. }
  20111. release() {
  20112. }
  20113. hide() {
  20114. super.hide();
  20115. this.release();
  20116. }
  20117. onClose() {
  20118. this.hide();
  20119. }
  20120. }
  20121. UILoading.uiName = "UILoading";
  20122. class UIRepentProp$1 extends UIBase {
  20123. constructor() {
  20124. super();
  20125. this.viewType = 0;
  20126. this.regretType = 0;
  20127. }
  20128. onConstructor() {
  20129. this.ui = ui_UIRepentProp.createInstance();
  20130. this.contentPane = this.ui;
  20131. this.isEject = false;
  20132. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  20133. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  20134. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  20135. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  20136. }
  20137. show(viewType, regretType, callback) {
  20138. PlatMgr.showInsert(true);
  20139. this.viewType = viewType;
  20140. this.regretType = regretType;
  20141. this.callback = callback;
  20142. super.show();
  20143. this.ui.t0.play();
  20144. this.ui.c1.selectedIndex = this.viewType;
  20145. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  20146. if (this.viewType == 0) {
  20147. let guide = DataMgr.getGuideHelpLine();
  20148. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  20149. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  20150. }
  20151. xGame.common.gameMgr.gamePause = true;
  20152. this.setGlobalFont(this.ui);
  20153. }
  20154. hideSelf() {
  20155. xGame.common.gameMgr.gamePause = false;
  20156. this.callback && this.callback(false);
  20157. this.hide();
  20158. }
  20159. videoRegret() {
  20160. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  20161. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  20162. }
  20163. else {
  20164. console.log('zh:AD 失败,直接发放奖励');
  20165. this.qjff_AD_for_UIrepentProp_videoRegret();
  20166. }
  20167. }
  20168. qjff_AD_for_UIrepentProp_videoRegret() {
  20169. this.callback && this.callback(true);
  20170. this.hideSelf();
  20171. }
  20172. videoAddHelpLine() {
  20173. let guide = DataMgr.getGuideHelpLine();
  20174. if (guide == 0) {
  20175. this.callback && this.callback(true);
  20176. this.hideSelf();
  20177. DataMgr.setGuideHelpLine();
  20178. xGame.common.gameUI.ui.guideNode.visible = false;
  20179. }
  20180. else {
  20181. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  20182. if (Laya.Browser.onAndroid) {
  20183. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20184. if (!boo) {
  20185. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20186. return;
  20187. }
  20188. }
  20189. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  20190. }
  20191. else {
  20192. console.log('zh:AD 失败,直接发放奖励');
  20193. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20194. }
  20195. }
  20196. }
  20197. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  20198. this.callback && this.callback(true);
  20199. this.hideSelf();
  20200. }
  20201. }
  20202. UIRepentProp$1.uiName = "UIRepentProp";
  20203. class UIRodMethod$1 extends UIBase {
  20204. constructor() {
  20205. super();
  20206. this.isPressd = false;
  20207. }
  20208. onConstructor() {
  20209. this.ui = ui_UIRodMethod.createInstance();
  20210. this.contentPane = this.ui;
  20211. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  20212. this.moveDir = new Laya.Vector2();
  20213. this.moveDest = new Laya.Vector2();
  20214. this.centerPos = new Laya.Vector2();
  20215. xGame.common.uiRodMethod = this;
  20216. }
  20217. show() {
  20218. super.show();
  20219. xGame.common.gameMgr.gamePause = true;
  20220. this.openPressDotEvent();
  20221. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  20222. this.centerPos.x = this.ui.white.x;
  20223. this.centerPos.y = this.ui.white.y;
  20224. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  20225. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  20226. this.setDot();
  20227. this.setGlobalFont(this.ui);
  20228. }
  20229. setDot() {
  20230. this.ui.dot.x = this.moveDest.x;
  20231. this.ui.dot.y = this.moveDest.y;
  20232. }
  20233. closeSelf() {
  20234. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  20235. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  20236. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  20237. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  20238. xGame.common.gameMgr.gamePause = false;
  20239. this.hide();
  20240. }
  20241. openPressDotEvent() {
  20242. this.closePressDotEvent();
  20243. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20244. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  20245. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20246. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20247. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20248. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20249. }
  20250. closePressDotEvent() {
  20251. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20252. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  20253. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20254. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20255. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20256. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20257. }
  20258. onDown(e) {
  20259. if (e.type == Laya.Event.MOUSE_DOWN)
  20260. this.isPressd = true;
  20261. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  20262. this.isPressd = false;
  20263. if (!this.isPressd)
  20264. return;
  20265. this.moveDest.x = e.stageX;
  20266. this.moveDest.y = e.stageY;
  20267. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  20268. if (dis > 6724) {
  20269. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  20270. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  20271. }
  20272. this.setDot();
  20273. }
  20274. resetRod() {
  20275. this.ui.dot.x = this.ui.white.x;
  20276. this.ui.dot.y = this.ui.white.y;
  20277. this.gameRod.dot.x = this.gameRod.bg.x;
  20278. this.gameRod.dot.y = this.gameRod.bg.y;
  20279. xGame.common.rodOffest.x = 0;
  20280. xGame.common.rodOffest.y = 0;
  20281. }
  20282. }
  20283. UIRodMethod$1.uiName = "UIRodMethod";
  20284. class UIMsg$1 extends UIBase {
  20285. constructor() {
  20286. super();
  20287. }
  20288. onConstructor() {
  20289. this.ui = ui_UIMsg.createInstance();
  20290. this.contentPane = this.ui;
  20291. this.isEject = false;
  20292. this.isMuti = true;
  20293. }
  20294. show(msg, callback) {
  20295. super.show();
  20296. this.ui.tipsNode.msgTxt.text = msg;
  20297. this.ui.alpha = 1;
  20298. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  20299. this.hide();
  20300. callback && callback();
  20301. }), 1000);
  20302. this.setGlobalFont(this.ui);
  20303. }
  20304. }
  20305. UIMsg$1.uiName = "UIMsg";
  20306. class UITips$1 extends UIBase {
  20307. constructor() {
  20308. super();
  20309. this.type = 0;
  20310. }
  20311. onConstructor() {
  20312. this.ui = ui_UITips.createInstance();
  20313. this.contentPane = this.ui;
  20314. this.isEject = false;
  20315. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  20316. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  20317. }
  20318. show(tipsTxt, womanTxt, type) {
  20319. super.show();
  20320. this.ui.t0.play();
  20321. this.ui.myNode.tipsTxt.text = tipsTxt;
  20322. this.ui.myNode.womanTxt.text = womanTxt;
  20323. PlatMgr.showInsert(true);
  20324. this.ui.myNode.c1.selectedIndex = type;
  20325. this.type = type;
  20326. switch (this.type) {
  20327. case TipsType.exitGame:
  20328. xGame.common.gameMgr.gamePause = true;
  20329. break;
  20330. case TipsType.foul:
  20331. Laya.timer.once(200, this, () => {
  20332. if (xGame.common.gameMgr) {
  20333. xGame.common.gameMgr.gamePause = true;
  20334. }
  20335. else {
  20336. console.log("zh:gameMgr is null");
  20337. }
  20338. });
  20339. break;
  20340. default:
  20341. break;
  20342. }
  20343. this.setGlobalFont(this.ui);
  20344. }
  20345. clickLeftBtn() {
  20346. this.hide();
  20347. xGame.common.gameMgr.gamePause = false;
  20348. switch (this.type) {
  20349. case TipsType.exitGame:
  20350. break;
  20351. case TipsType.foul:
  20352. break;
  20353. default:
  20354. break;
  20355. }
  20356. }
  20357. clickRightBtn() {
  20358. this.hide();
  20359. switch (this.type) {
  20360. case TipsType.exitGame:
  20361. xGame.eventMgr.event(RESET_GAME);
  20362. xGame.uiMgr.Show(UIMain$1);
  20363. Moyu.recordEnd(this, null);
  20364. xGame.common.longHelpLine = false;
  20365. break;
  20366. case TipsType.foul:
  20367. if (xGame.common.gameMgr) {
  20368. xGame.common.gameMgr.gamePause = false;
  20369. }
  20370. Laya.timer.clearAll(this);
  20371. break;
  20372. default:
  20373. break;
  20374. }
  20375. }
  20376. }
  20377. UITips$1.uiName = "UITips";
  20378. class UIGame$1 extends UIBase {
  20379. constructor() {
  20380. super();
  20381. this.powerNum = 0;
  20382. this.isD3Inited = false;
  20383. this.isPrePlay = false;
  20384. this.isMoveRod = false;
  20385. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  20386. this.rulerDis = 20;
  20387. this.rulerOffset = 0;
  20388. }
  20389. onConstructor() {
  20390. this.ui = ui_UIGame.createInstance();
  20391. this.contentPane = this.ui;
  20392. this.ui.x += xGame.common.sysOffestNum;
  20393. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  20394. this.isEject = false;
  20395. xGame.common.gameUI = this;
  20396. this.initSelf();
  20397. }
  20398. isTurnSelf() {
  20399. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  20400. return true;
  20401. }
  20402. }
  20403. initSelf() {
  20404. let topUI = this.ui.topNode;
  20405. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  20406. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  20407. this.barInfo = {};
  20408. this.barInfo.curY = 0;
  20409. this.barInfo.height = this.ui.powerNode.height;
  20410. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  20411. this.barInfo.powerStartY = this.ui.powerNode.y;
  20412. xGame.common.aiPlayer = new AIPlayer();
  20413. xGame.common.gameMgr = new GameMgr();
  20414. xGame.common.skillMgr = new SkillMgr();
  20415. xGame.common.wordsMgr = new WordsMgr();
  20416. xGame.common.talkMgr = new TalkMgr();
  20417. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  20418. });
  20419. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  20420. });
  20421. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  20422. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  20423. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  20424. this.addUIClick(this.ui.returnBtn, this.returnHome);
  20425. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  20426. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  20427. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  20428. }
  20429. getGanZiImg() {
  20430. let index = DataMgr.getCurBallRod();
  20431. let data = cfgTable.ballrodData[index + 1];
  20432. let gan_url = xGame.common.getGameIconUrl(data.img);
  20433. this.ui.powerNode.showImg.url = gan_url;
  20434. }
  20435. returnHome() {
  20436. let tips = "Are you sure to exit the game?";
  20437. let woman = "Boss, why don't you play for a while longer?";
  20438. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  20439. }
  20440. addRodMethodClick() {
  20441. if (this.isTurnSelf()) {
  20442. xGame.uiMgr.Show(UIRodMethod$1);
  20443. }
  20444. }
  20445. clickHelpLineBtn(force = false) {
  20446. if (!this.isTurnSelf())
  20447. return;
  20448. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  20449. if (success) {
  20450. xGame.common.longHelpLine = true;
  20451. xGame.common.d2World.getHelpLine();
  20452. Moyu.sendDataEvent("guideNum");
  20453. }
  20454. else {
  20455. }
  20456. });
  20457. }
  20458. renderSelfDisplayBalls(index, target) {
  20459. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  20460. target.myImg.url = xGame.common.getGameIconUrl(str);
  20461. }
  20462. renderAIDisplayBalls(index, target) {
  20463. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  20464. target.myImg.url = xGame.common.getGameIconUrl(str);
  20465. ;
  20466. }
  20467. updateMode() {
  20468. if (xGame.common.gameMode == GameMode.classic) {
  20469. this.ui.topNode.scoreNode.visible = false;
  20470. }
  20471. else if (xGame.common.gameMode == GameMode.bigMove) {
  20472. this.ui.topNode.scoreNode.visible = true;
  20473. }
  20474. }
  20475. show() {
  20476. super.show();
  20477. this.ui.alpha = 0;
  20478. this.updateSelf();
  20479. xGame.common.gameMgr.gamePause = false;
  20480. xGame.common.gameUI.ui.blackAni.visible = false;
  20481. xGame.common.gameUI.ui.whiteAni.visible = false;
  20482. this.ui.powerEft.visible = false;
  20483. this.ui.colorNode.visible = false;
  20484. this.updateHead();
  20485. let curUse = DataMgr.getCurBallRod();
  20486. this.getGanZiImg();
  20487. this.yinDaoForLianxi();
  20488. this.setGlobalFont(this.ui);
  20489. }
  20490. yinDaoForLianxi() {
  20491. let g = DataMgr.getSkillGuide();
  20492. if (g === 0) {
  20493. console.log('zh:默认的引导还没有完毕');
  20494. return;
  20495. }
  20496. let lianXiGuide = DataMgr.getLianXiGuide();
  20497. console.log('zh:lianXiGuide=', lianXiGuide);
  20498. if (lianXiGuide === 0) {
  20499. this.ui.n_lxms_yd1.visible = true;
  20500. console.log('zh:yinDaoForLianxi 111 set ok');
  20501. }
  20502. else {
  20503. this.ui.n_lxms_yd1.visible = false;
  20504. console.log('zh:无需引导11');
  20505. }
  20506. DataMgr.setLianXiGuide(0);
  20507. }
  20508. updateSelf() {
  20509. if (xGame.common.gameMode == GameMode.classic) {
  20510. this.ui.c1.selectedIndex = 0;
  20511. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  20512. this.ui.topNode.middleNode.visible = true;
  20513. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  20514. }
  20515. else if (xGame.common.gameMode == GameMode.bigMove) {
  20516. this.ui.c1.selectedIndex = 0;
  20517. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  20518. this.ui.topNode.middleNode.visible = false;
  20519. let max = xGame.cfgMgr.getMaxBigMoveLength();
  20520. let rand = xGame.common.randomNum(1, max);
  20521. let guide = DataMgr.getSkillGuide();
  20522. if (guide == 0)
  20523. rand = 1;
  20524. xGame.common.bigMoveLevelIndex = rand;
  20525. }
  20526. else if (xGame.common.gameMode == GameMode.placeBall) {
  20527. console.log('zh:练习模式...');
  20528. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20529. this.ui.c1.selectedIndex = 1 + data.type;
  20530. this.ui.alpha = 1;
  20531. this.startGame();
  20532. }
  20533. this.updateMode();
  20534. this.initD3world();
  20535. this.initD2world();
  20536. }
  20537. startGame() {
  20538. this.ui.snowNode.visible = Math.random() <= 0.1;
  20539. this.ui.d2Node.visible = false;
  20540. xGame.common.d3World.d3Hand.gameObj.active = false;
  20541. xGame.common.d3World.tableSrc.init();
  20542. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20543. this.cameraViewChange(() => {
  20544. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  20545. switch (xGame.common.gameMode) {
  20546. case GameMode.classic:
  20547. xGame.common.d3World.d3Hand.gameObj.active = true;
  20548. this.playPutBallD3Ani();
  20549. break;
  20550. case GameMode.bigMove:
  20551. this.enterGame();
  20552. Laya.timer.once(500, this, () => {
  20553. this.ui.topNode.middleNode.visible = true;
  20554. this.ui.topNode.middleNode.t0.play();
  20555. });
  20556. break;
  20557. case GameMode.placeBall:
  20558. this.enterGame();
  20559. break;
  20560. default:
  20561. break;
  20562. }
  20563. });
  20564. PlatMgr.showBanner(false);
  20565. }
  20566. enterGame() {
  20567. this.ui.d2Node.visible = true;
  20568. xGame.common.d3World.d3Hand.gameObj.active = false;
  20569. xGame.common.showOneCamera("mainCamera");
  20570. Moyu.recordGame(30, true);
  20571. if (!this.isPrePlay) {
  20572. this.isPrePlay = true;
  20573. xGame.common.d3World.prePlayEft();
  20574. }
  20575. xGame.common.gameMgr.gameReady();
  20576. this.openAllEvent();
  20577. this.ui.snowNode.visible = false;
  20578. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  20579. this.ui.helpBtn.visible = condition;
  20580. }
  20581. showHelpLineGuide() {
  20582. let longGuide = DataMgr.getGuideHelpLine();
  20583. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  20584. this.ui.helpBtn.visible = true;
  20585. this.ui.guideNode.visible = true;
  20586. }
  20587. }
  20588. setTurnAlpha(alpha) {
  20589. this.ui.keduNode.alpha = alpha;
  20590. this.ui.ganNode.alpha = alpha;
  20591. this.ui.rodMethodNode.alpha = alpha;
  20592. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  20593. }
  20594. cameraViewChange(callback) {
  20595. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20596. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  20597. xGame.common.showOneCamera("visitAngle");
  20598. cameraSrc.localRotationEulerY = 180;
  20599. cameraSrc.localRotationEulerZ = 0;
  20600. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  20601. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  20602. callback && callback();
  20603. }));
  20604. }));
  20605. }
  20606. playPutBallD3Ani() {
  20607. xGame.common.showOneCamera("mainCamera");
  20608. let handSrc = xGame.common.d3World.d3Hand;
  20609. handSrc.gameObj.active = true;
  20610. handSrc.transform.localPositionZ = 3;
  20611. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  20612. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  20613. handSrc.gameObj.active = false;
  20614. this.enterGame();
  20615. }), 400);
  20616. }));
  20617. }
  20618. updateHead() {
  20619. let user = Moyu.getUserInfo();
  20620. this.ui.topNode.selfNameTxt.text = user.nickName;
  20621. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  20622. let aiData = xGame.cfgMgr.getRandomUserInfo();
  20623. if (DataMgr.getSkillGuide() < 1) {
  20624. this.ui.topNode.aiNameTxt.text = 'billiards';
  20625. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  20626. }
  20627. else {
  20628. this.ui.topNode.aiNameTxt.text = aiData.name;
  20629. let randNo = Math.floor(Math.random() * 10) + 1;
  20630. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  20631. }
  20632. }
  20633. initD2world() {
  20634. let node = this.ui.d2Root.displayObject;
  20635. let src = node.getComponent(D2World);
  20636. if (!src) {
  20637. xGame.common.d2World = node.addComponent(D2World);
  20638. }
  20639. xGame.common.d2World.initSelf();
  20640. }
  20641. initD3world() {
  20642. if (this.isD3Inited)
  20643. return;
  20644. this.isD3Inited = true;
  20645. let scene3D = xGame.common.d3Scene;
  20646. this.ui.d3Root.displayObject.addChild(scene3D);
  20647. scene3D.active = true;
  20648. xGame.common.d3World.tableSrc.setBorderPos();
  20649. }
  20650. onRootMove(e) {
  20651. let rootBall = xGame.common.d2World.rootBall;
  20652. this.ui.moveNode.x = e.x;
  20653. this.ui.moveNode.y = e.y;
  20654. rootBall.gameObj.x = e.x;
  20655. rootBall.gameObj.y = e.y;
  20656. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20657. }
  20658. aiRootMove(move) {
  20659. if (move)
  20660. this.hideBallUI();
  20661. else {
  20662. this.showBallUI();
  20663. xGame.common.d2World.getHelpLine();
  20664. }
  20665. }
  20666. aiForce(type, force = 0) {
  20667. this.pressTarget = PressType.powerNode;
  20668. if (type == 1)
  20669. this.onEventUp({ force: true });
  20670. else if (type == 2)
  20671. this.onEventMove({ stageY: force, force: true });
  20672. }
  20673. onEventPress(e) {
  20674. if (e.stopPropagation)
  20675. e.stopPropagation();
  20676. if (!this.isTurnSelf())
  20677. return;
  20678. let target = e.target;
  20679. switch (target) {
  20680. case this.ui.myPowerNode.displayObject:
  20681. this.pressTarget = PressType.powerNode;
  20682. this.barInfo.curY = e.stageY;
  20683. this.updateBarInfo();
  20684. break;
  20685. case this.ui.moveNode.displayObject:
  20686. this.pressTarget = PressType.moveNode;
  20687. this.hideBallUI();
  20688. this.eventObj.curX = this.ui.moveNode.x;
  20689. this.eventObj.curY = this.ui.moveNode.y;
  20690. this.ui.moveNode.finger.visible = false;
  20691. this.eventObj.lastX = e.stageX;
  20692. this.eventObj.lastY = e.stageY;
  20693. break;
  20694. case this.ui.rulerClickNode.displayObject:
  20695. this.pressTarget = PressType.rulerNode;
  20696. this.eventObj.lastY = e.stageY;
  20697. break;
  20698. case this.ui.d2Root.displayObject:
  20699. this.pressTarget = PressType.d2Root;
  20700. this.eventObj.lastX = e.stageX;
  20701. this.eventObj.lastY = e.stageY;
  20702. this.eventObj.starX = e.stageX;
  20703. this.eventObj.starY = e.stageY;
  20704. this.eventObj.curX = 0;
  20705. this.eventObj.curY = 0;
  20706. xGame.common.d2World.d2Gan.setGanLastInfo();
  20707. this.rulerOffset = 0;
  20708. break;
  20709. default:
  20710. break;
  20711. }
  20712. }
  20713. onEventMove(e) {
  20714. if (e.stopPropagation)
  20715. e.stopPropagation();
  20716. if (e && e.force) {
  20717. }
  20718. else {
  20719. if (!this.isTurnSelf())
  20720. return;
  20721. }
  20722. switch (this.pressTarget) {
  20723. case PressType.powerNode:
  20724. this.barInfo.curY = e.stageY;
  20725. this.updateBarInfo();
  20726. this.isMoveRod = true;
  20727. break;
  20728. case PressType.moveNode:
  20729. let rootBall = xGame.common.d2World.rootBall;
  20730. let radius = rootBall.gameObj.width / 2;
  20731. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20732. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20733. let border = xGame.common.d2World.borderRect;
  20734. if (curX <= border.x + radius)
  20735. curX = border.x + radius;
  20736. else if (curX >= border.x + border.width - radius)
  20737. curX = border.x + border.width - radius;
  20738. if (curY <= border.y + radius)
  20739. curY = border.y + radius;
  20740. else if (curY >= border.y + border.height - radius)
  20741. curY = border.y + border.height - radius;
  20742. if (xGame.common.gameMgr.isOpenBall) {
  20743. if (curX >= border.x + border.openBallW - radius)
  20744. curX = border.x + border.openBallW - radius;
  20745. }
  20746. this.ui.moveNode.x = curX;
  20747. this.ui.moveNode.y = curY;
  20748. rootBall.gameObj.x = curX;
  20749. rootBall.gameObj.y = curY;
  20750. rootBall.d3BallSrc.setTransPos(curX, curY);
  20751. this.isMoveRod = true;
  20752. break;
  20753. case PressType.rulerNode:
  20754. let yy = e.stageY - this.eventObj.lastY;
  20755. this.eventObj.lastY = e.stageY;
  20756. let ruler1 = this.ui.rulerNode.img1;
  20757. let ruler2 = this.ui.rulerNode.img2;
  20758. ruler1.y += yy;
  20759. ruler2.y += yy;
  20760. this.rulerOffset += yy;
  20761. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20762. this.rulerOffset = 0;
  20763. xGame.soundMgr.playSound("inch", 1, 10);
  20764. }
  20765. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20766. let h = ruler1.height;
  20767. this.checkGuide();
  20768. this.checkGuideForLxms();
  20769. this.isMoveRod = true;
  20770. if (ruler1.y >= h) {
  20771. ruler1.y = -h;
  20772. ruler2.y = 0;
  20773. return;
  20774. }
  20775. else if (ruler1.y <= -h) {
  20776. ruler1.y = h;
  20777. ruler2.y = 0;
  20778. return;
  20779. }
  20780. if (ruler2.y >= h) {
  20781. ruler2.y = -h;
  20782. ruler1.y = 0;
  20783. return;
  20784. }
  20785. else if (ruler2.y <= -h) {
  20786. ruler2.y = h;
  20787. ruler1.y = 0;
  20788. return;
  20789. }
  20790. break;
  20791. case PressType.d2Root:
  20792. this.eventObj.curX = e.stageX;
  20793. this.eventObj.curY = e.stageY;
  20794. let offset = this.checkRodMoveDir();
  20795. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20796. this.eventObj.lastX = e.stageX;
  20797. this.eventObj.lastY = e.stageY;
  20798. break;
  20799. default:
  20800. break;
  20801. }
  20802. }
  20803. onEventUp(e) {
  20804. if (e.stopPropagation)
  20805. e.stopPropagation();
  20806. if (e && e.force) {
  20807. }
  20808. else {
  20809. if (!this.isTurnSelf())
  20810. return;
  20811. }
  20812. switch (this.pressTarget) {
  20813. case PressType.powerNode:
  20814. this.ui.powerNode.value = 0;
  20815. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20816. this.ui.powerTxt.text = "";
  20817. if (this.powerNum > 0) {
  20818. xGame.eventMgr.event(BALL_SHOOT);
  20819. xGame.common.d2World.shoot(this.powerNum);
  20820. xGame.common.d2World.d2Gan.shoot();
  20821. xGame.common.d2World.d2HelpLine.shoot();
  20822. this.finishGuide();
  20823. this.finishGuideForLxms();
  20824. this.ui.powerEft.visible = false;
  20825. this.ui.colorNode.visible = false;
  20826. let ganStr = "";
  20827. if (this.powerNum <= 30) {
  20828. ganStr = "gan_30";
  20829. }
  20830. else if (this.powerNum <= 60) {
  20831. ganStr = "gan_50";
  20832. }
  20833. else {
  20834. ganStr = "gan_80";
  20835. }
  20836. xGame.soundMgr.playSound(ganStr);
  20837. }
  20838. break;
  20839. case PressType.moveNode:
  20840. let rootBall = xGame.common.d2World.rootBall;
  20841. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20842. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20843. let isIntersect = this.judgeBallIntersect();
  20844. if (isIntersect) {
  20845. this.ui.moveNode.x = lastX;
  20846. this.ui.moveNode.y = lastY;
  20847. rootBall.gameObj.x = lastX;
  20848. rootBall.gameObj.y = lastY;
  20849. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20850. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20851. }
  20852. else {
  20853. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20854. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20855. }
  20856. this.showBallUI();
  20857. this.ui.moveNode.finger.visible = true;
  20858. xGame.common.d2World.getHelpLine();
  20859. break;
  20860. case PressType.rulerNode:
  20861. break;
  20862. case PressType.d2Root:
  20863. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20864. if (dis <= 25) {
  20865. this.moveToClickDot(e);
  20866. }
  20867. break;
  20868. default:
  20869. break;
  20870. }
  20871. this.pressTarget = -1;
  20872. }
  20873. checkGuide() {
  20874. let guide = DataMgr.getSkillGuide();
  20875. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20876. xGame.common.guideStep++;
  20877. xGame.common.gameUI.ui.guide2.visible = false;
  20878. xGame.common.gameUI.ui.guide3.visible = true;
  20879. }
  20880. }
  20881. checkGuideForLxms() {
  20882. let guide = DataMgr.getLianXiGuide();
  20883. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 2) {
  20884. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  20885. xGame.common.gameUI.ui.n_lxms_yd3.visible = true;
  20886. xGame.common.guideStepForLianXi = 3;
  20887. }
  20888. }
  20889. finishGuide() {
  20890. let guide = DataMgr.getSkillGuide();
  20891. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20892. xGame.common.guideStep = 10;
  20893. this.closeAllGuide();
  20894. console.log('zh: 新手引导完毕');
  20895. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20896. }
  20897. }
  20898. finishGuideForLxms() {
  20899. let guide = DataMgr.getLianXiGuide();
  20900. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  20901. xGame.common.guideStepForLianXi = 3;
  20902. DataMgr.setLianXiGuide(1);
  20903. this.closeAllGuideForLxms();
  20904. console.log('zh: lxms新手引导完毕');
  20905. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20906. }
  20907. }
  20908. closeAllGuide() {
  20909. xGame.common.gameUI.ui.guide1.visible = false;
  20910. xGame.common.gameUI.ui.guide2.visible = false;
  20911. xGame.common.gameUI.ui.guide3.visible = false;
  20912. }
  20913. closeAllGuideForLxms() {
  20914. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  20915. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  20916. xGame.common.gameUI.ui.n_lxms_yd3.visible = false;
  20917. }
  20918. updateBarInfo() {
  20919. let star = this.ui.powerNode.y;
  20920. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20921. if (rate >= 1)
  20922. rate = 1;
  20923. if (rate <= 0)
  20924. rate = 0;
  20925. this.powerNum = Math.ceil(rate * 100);
  20926. this.ui.powerNode.value = this.powerNum;
  20927. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20928. this.ui.colorNode.value = this.powerNum;
  20929. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20930. this.ui.powerEft.visible = this.powerNum != 0;
  20931. this.ui.colorNode.visible = this.powerNum != 0;
  20932. this.ui.powerTxt.text = this.powerNum + "";
  20933. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20934. }
  20935. forceCancel() {
  20936. this.ui.powerNode.value = 0;
  20937. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20938. this.ui.powerTxt.text = "";
  20939. }
  20940. checkRodMoveDir() {
  20941. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20942. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20943. if (tempX >= 0 && tempY <= 0) {
  20944. return this.checkDir();
  20945. }
  20946. else if (tempX < 0 && tempY < 0) {
  20947. return this.checkDir(1, -1);
  20948. }
  20949. else if (tempX < 0 && tempY > 0) {
  20950. return this.checkDir(-1, -1);
  20951. }
  20952. else {
  20953. return this.checkDir(-1, 1);
  20954. }
  20955. }
  20956. checkDir(flagX = 1, flagY = 1) {
  20957. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20958. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20959. if (offsetY == 0) {
  20960. return offsetX * flagX;
  20961. }
  20962. if (offsetX == 0) {
  20963. return offsetY * flagY;
  20964. }
  20965. let angle = offsetY / offsetX;
  20966. if (Math.abs(angle) >= 1) {
  20967. return offsetY * flagY;
  20968. }
  20969. else {
  20970. return offsetX * flagX;
  20971. }
  20972. }
  20973. judgeBallIntersect() {
  20974. let rootBall = xGame.common.d2World.rootBall;
  20975. let ballArr = xGame.common.d2World.ballArr;
  20976. let radius = rootBall.gameObj.width / 2;
  20977. let temp;
  20978. let isIntersect = false;
  20979. for (let index = 0; index < ballArr.length; index++) {
  20980. temp = ballArr[index];
  20981. if (temp.number == rootBall.number)
  20982. continue;
  20983. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20984. if (isIntersect) {
  20985. break;
  20986. }
  20987. }
  20988. return isIntersect;
  20989. }
  20990. hideBallUI() {
  20991. let d2Gan = xGame.common.d2World.d2Gan;
  20992. if (!d2Gan.ui.isDisposed)
  20993. d2Gan.ui.visible = false;
  20994. let d2Help = xGame.common.d2World.d2HelpLine;
  20995. if (!d2Help.ui.isDisposed)
  20996. d2Help.ui.visible = false;
  20997. let rootBall = xGame.common.d2World.rootBall;
  20998. if (!rootBall.destroyed) {
  20999. rootBall.gameObj.active = false;
  21000. }
  21001. }
  21002. showBallUI() {
  21003. let d2Gan = xGame.common.d2World.d2Gan;
  21004. if (!d2Gan.ui.isDisposed)
  21005. d2Gan.ui.visible = true;
  21006. let d2Help = xGame.common.d2World.d2HelpLine;
  21007. if (!d2Help.ui.isDisposed)
  21008. d2Help.ui.visible = true;
  21009. let rootBall = xGame.common.d2World.rootBall;
  21010. if (!rootBall.destroyed) {
  21011. rootBall.gameObj.active = true;
  21012. }
  21013. }
  21014. moveToClickDot(e) {
  21015. if (!this.isMoveRod && !xGame.common.clickedBall) {
  21016. let root = xGame.common.d2World.rootBall.gameObj;
  21017. let xx = e.stageX - xGame.common.sysOffestNum;
  21018. let yy = e.stageY;
  21019. let x = xx - root.x;
  21020. let y = yy - root.y;
  21021. let angle = xGame.common.getfguiRotation(x, y);
  21022. xGame.common.d2World.d2Gan.ui.rotation = angle;
  21023. xGame.common.d2World.getHelpLine();
  21024. }
  21025. this.isMoveRod = false;
  21026. xGame.common.clickedBall = false;
  21027. }
  21028. openAllEvent() {
  21029. this.closeAllEvent();
  21030. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21031. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21032. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21033. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21034. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  21035. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  21036. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  21037. }
  21038. closeAllEvent() {
  21039. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21040. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21041. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21042. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21043. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  21044. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  21045. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  21046. }
  21047. resetGame() {
  21048. this.closeAllEvent();
  21049. this.hideBallUI();
  21050. xGame.common.gameMgr.gamePause = true;
  21051. }
  21052. }
  21053. UIGame$1.uiName = "UIGame";
  21054. class UIAddCoin$1 extends UIBase {
  21055. constructor() {
  21056. super();
  21057. this.coinNum = 2000;
  21058. }
  21059. onConstructor() {
  21060. this.ui = ui_UIAddCoin.createInstance();
  21061. this.contentPane = this.ui;
  21062. this.isEject = false;
  21063. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  21064. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  21065. }
  21066. show() {
  21067. super.show();
  21068. this.ui.t0.play();
  21069. this.setGlobalFont(this.ui);
  21070. }
  21071. videoAddCoin() {
  21072. console.log('zh:qjff_AD_for_UIAddCoin');
  21073. if (Laya.Browser.onAndroid) {
  21074. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21075. if (!boo) {
  21076. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21077. return;
  21078. }
  21079. }
  21080. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  21081. }
  21082. else {
  21083. console.log('zh:AD 失败,直接发放奖励');
  21084. this.qjff_AD_for_UIAddCoin();
  21085. }
  21086. }
  21087. qjff_AD_for_UIAddCoin() {
  21088. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  21089. this.hide();
  21090. }
  21091. }
  21092. UIAddCoin$1.uiName = "UIAddCoin";
  21093. class UIInvitation$1 extends UIBase {
  21094. constructor() {
  21095. super();
  21096. }
  21097. onConstructor() {
  21098. this.ui = ui_UIInvitation.createInstance();
  21099. this.contentPane = this.ui;
  21100. this.isEject = false;
  21101. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  21102. }
  21103. show() {
  21104. super.show();
  21105. this.setGlobalFont(this.ui);
  21106. }
  21107. enterGame() {
  21108. xGame.common.gameMode = GameMode.classic;
  21109. DataMgr.setChallengeTimes(1);
  21110. xGame.common.passAwardCoin = 2000;
  21111. let need = xGame.common.classicNiceNeddCoin;
  21112. if (DataMgr.coinEnough(need)) {
  21113. DataMgr.setCoin(-need);
  21114. xGame.eventMgr.event(RESTART_GAME, true);
  21115. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  21116. }
  21117. else {
  21118. xGame.eventMgr.event(RESTART_GAME, true);
  21119. }
  21120. this.hide();
  21121. }
  21122. hide() {
  21123. super.hide();
  21124. }
  21125. }
  21126. UIInvitation$1.uiName = "UIInvitation";
  21127. class UIPower$1 extends UIBase {
  21128. constructor() {
  21129. super();
  21130. }
  21131. onConstructor() {
  21132. this.ui = ui_UIPower.createInstance();
  21133. this.contentPane = this.ui;
  21134. this.isEject = false;
  21135. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  21136. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  21137. }
  21138. show() {
  21139. super.show();
  21140. this.ui.t0.play();
  21141. this.setGlobalFont(this.ui);
  21142. }
  21143. videoGetPower() {
  21144. console.log('zh:qjff_AD_for_uipower');
  21145. if (Laya.Browser.onAndroid) {
  21146. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21147. if (!boo) {
  21148. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21149. return;
  21150. }
  21151. }
  21152. if (Laya.Browser.onAndroid) {
  21153. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  21154. }
  21155. else {
  21156. console.log('zh:AD 失败,直接发放奖励');
  21157. this.qjff_AD_for_uipower();
  21158. }
  21159. }
  21160. else {
  21161. this.qjff_AD_for_uipower();
  21162. }
  21163. }
  21164. qjff_AD_for_uipower() {
  21165. DataMgr.setPower(xGame.common.videoPower, true);
  21166. xGame.eventMgr.event(POWER_TIME);
  21167. this.hide();
  21168. }
  21169. }
  21170. UIPower$1.uiName = "UIPower";
  21171. class UIGameEnd$1 extends UIBase {
  21172. constructor() {
  21173. super();
  21174. this.success = false;
  21175. this.awardCoinNum = 1000;
  21176. this.awardDiamondNum = 10;
  21177. }
  21178. onConstructor() {
  21179. this.ui = ui_UIGameEnd.createInstance();
  21180. this.contentPane = this.ui;
  21181. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  21182. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  21183. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  21184. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21185. this.ui.talkNode.visible = false;
  21186. if (Moyu.isKs)
  21187. this.ui.closeNode.closeBtn.x += 100;
  21188. }
  21189. updateType() {
  21190. switch (xGame.common.gameMode) {
  21191. case GameMode.classic:
  21192. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  21193. this.ui.coinNode.visible = this.success;
  21194. if (!this.success) {
  21195. Laya.timer.once(500, this, () => {
  21196. xGame.uiMgr.Show(UIAddCoin$1);
  21197. });
  21198. }
  21199. else {
  21200. this.logEventForClassic_win();
  21201. }
  21202. this.logEventForClassic_complete();
  21203. this.ui.isGetAward.visible = false;
  21204. this.ui.leftBtn.c1.selectedIndex = 3;
  21205. this.ui.rightBtn.c1.selectedIndex = 0;
  21206. this.moneyNode.ui.c1.selectedIndex = 1;
  21207. break;
  21208. case GameMode.bigMove:
  21209. console.log('zh:招法模式 aaaaaa bigMove');
  21210. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  21211. this.ui.coinNode.visible = this.success;
  21212. if (xGame.common.gameMode == GameMode.bigMove) {
  21213. if (this.success) {
  21214. DataMgr.setSkillSuccessTimes(1, true);
  21215. DataMgr.setSkillAccTimes(1);
  21216. }
  21217. else {
  21218. DataMgr.setSkillSuccessTimes(0, false);
  21219. }
  21220. }
  21221. this.logEventForRod_complete_N();
  21222. if (!this.success) {
  21223. Laya.timer.once(500, this, () => {
  21224. xGame.uiMgr.Show(UIAddCoin$1);
  21225. });
  21226. }
  21227. else {
  21228. this.logEventForRod_win();
  21229. }
  21230. this.ui.isGetAward.visible = false;
  21231. this.ui.leftBtn.c1.selectedIndex = 3;
  21232. this.ui.rightBtn.c1.selectedIndex = 0;
  21233. this.moneyNode.ui.c1.selectedIndex = 1;
  21234. break;
  21235. case GameMode.placeBall:
  21236. this.ui.coinNode.visible = false;
  21237. if (this.success) {
  21238. if (xGame.common.placeBallStarNum == 3) {
  21239. this.ui.c1.selectedIndex = 2;
  21240. }
  21241. else {
  21242. this.ui.c1.selectedIndex = 3;
  21243. }
  21244. let level = xGame.common.placeBallCurLevel;
  21245. if (level > 59) {
  21246. this.logEventForChallenge_level_complete(level);
  21247. }
  21248. else {
  21249. this.logEventForChallenge_level_N(level);
  21250. }
  21251. }
  21252. else {
  21253. this.ui.c1.selectedIndex = 4;
  21254. }
  21255. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  21256. if (cfg.type == PlaceBallType.challenge) {
  21257. this.ui.c1.selectedIndex = 2;
  21258. }
  21259. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  21260. this.updatePlaceBallBtn();
  21261. this.updatePlaceBallStarNum();
  21262. this.updatePlaceBallAwardState();
  21263. this.moneyNode.ui.c1.selectedIndex = 2;
  21264. this.moneyNode.checkPowerTime();
  21265. this.moneyNode.powerChange();
  21266. DataMgr.upRankData();
  21267. break;
  21268. default:
  21269. break;
  21270. }
  21271. }
  21272. logEventForRod_complete_N() {
  21273. let gfmsIdx = xGame.common.curPlayerSkillType;
  21274. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  21275. let gfmc = 'Skyfall Shot';
  21276. if (gfmsIdx == 0) {
  21277. gfmc = 'Skyfall Shot';
  21278. }
  21279. if (gfmsIdx == 1) {
  21280. gfmc = 'Surging break';
  21281. }
  21282. if (gfmsIdx == 2) {
  21283. gfmc = 'Frost Lock';
  21284. }
  21285. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  21286. console.log('zh:logEventForRod_complete_N level = ' + level);
  21287. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21288. let jsonStr = {
  21289. "count": 0,
  21290. "name": gfmc
  21291. };
  21292. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21293. const d = LocalStorageManager.getItem(keyStr);
  21294. jsonStr.count = d.count + 1;
  21295. LocalStorageManager.setItem(keyStr, jsonStr);
  21296. }
  21297. else {
  21298. LocalStorageManager.setItem(keyStr, jsonStr);
  21299. }
  21300. const d2 = LocalStorageManager.getItem(keyStr);
  21301. let count = d2.count;
  21302. console.log('zh:logEventForRod_complete_N count = ' + count);
  21303. if (count % 5 == 0) {
  21304. const reqStr = JSON.stringify(jsonStr);
  21305. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  21306. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  21307. }
  21308. }
  21309. logEventForRod_win() {
  21310. console.log('zh:logEventForRod_win,胜利');
  21311. let gfmsIdx = xGame.common.curPlayerSkillType;
  21312. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  21313. let gfmc = 'Skyfall Shot';
  21314. if (gfmsIdx == 0) {
  21315. gfmc = 'Skyfall Shot';
  21316. }
  21317. if (gfmsIdx == 1) {
  21318. gfmc = 'Surging break';
  21319. }
  21320. if (gfmsIdx == 2) {
  21321. gfmc = 'Frost Lock';
  21322. }
  21323. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  21324. console.log('zh:logEventForRod_win level = ' + level);
  21325. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  21326. let jsonStr = {
  21327. "count": 1,
  21328. "name": gfmc + ' Lev' + level
  21329. };
  21330. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21331. const d = LocalStorageManager.getItem(keyStr);
  21332. jsonStr.count = d.count + 1;
  21333. LocalStorageManager.setItem(keyStr, jsonStr);
  21334. }
  21335. else {
  21336. LocalStorageManager.setItem(keyStr, jsonStr);
  21337. }
  21338. const reqStr = JSON.stringify(jsonStr);
  21339. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  21340. }
  21341. logEventForClassic_win() {
  21342. console.log('zh:logEventForClassic_win,胜利');
  21343. let rtype = xGame.common.classicRoomType;
  21344. let msmc = '';
  21345. if (rtype == 1) {
  21346. msmc = 'beginner';
  21347. }
  21348. if (rtype == 2) {
  21349. msmc = 'expert';
  21350. }
  21351. if (rtype == 3) {
  21352. msmc = 'master';
  21353. }
  21354. let keyStr = 'sjmd_classic_win_' + rtype;
  21355. let jsonStr = {
  21356. "difficulty": msmc,
  21357. "classic_count": 1,
  21358. "difficulty_count": 1
  21359. };
  21360. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21361. const d = LocalStorageManager.getItem(keyStr);
  21362. jsonStr.classic_count = d.classic_count + 1;
  21363. jsonStr.difficulty_count = d.difficulty_count + 1;
  21364. LocalStorageManager.setItem(keyStr, jsonStr);
  21365. }
  21366. else {
  21367. LocalStorageManager.setItem(keyStr, jsonStr);
  21368. }
  21369. const reqStr = JSON.stringify(jsonStr);
  21370. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  21371. }
  21372. logEventForClassic_complete() {
  21373. console.log('zh:logEventForClassic_complete,胜利');
  21374. let rtype = xGame.common.classicRoomType;
  21375. let msmc = '';
  21376. if (rtype == 1) {
  21377. msmc = 'beginner';
  21378. }
  21379. if (rtype == 2) {
  21380. msmc = 'expert';
  21381. }
  21382. if (rtype == 3) {
  21383. msmc = 'master';
  21384. }
  21385. let keyStr = 'sjmd_classic_complete_' + rtype;
  21386. let jsonStr = {
  21387. "msmc": msmc,
  21388. "count": 0
  21389. };
  21390. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21391. const d = LocalStorageManager.getItem(keyStr);
  21392. jsonStr.count = d.count + 1;
  21393. LocalStorageManager.setItem(keyStr, jsonStr);
  21394. }
  21395. else {
  21396. LocalStorageManager.setItem(keyStr, jsonStr);
  21397. }
  21398. if (jsonStr.count % 5 == 0) {
  21399. const reqStr = JSON.stringify(jsonStr);
  21400. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  21401. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  21402. }
  21403. }
  21404. updatePlaceBallBtn() {
  21405. this.ui.leftBtn.c1.selectedIndex = 5;
  21406. if (this.success) {
  21407. this.ui.rightBtn.c1.selectedIndex = 14;
  21408. }
  21409. else {
  21410. if (xGame.common.placeBallStarNum == 3) {
  21411. this.ui.rightBtn.c1.selectedIndex = 14;
  21412. }
  21413. else {
  21414. this.ui.rightBtn.c1.selectedIndex = 1;
  21415. }
  21416. }
  21417. }
  21418. updatePlaceBallStarNum() {
  21419. let starNum = xGame.common.placeBallStarNum;
  21420. if (starNum == 0)
  21421. this.ui.starNumNode.c1.selectedIndex = 3;
  21422. else {
  21423. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  21424. }
  21425. }
  21426. updatePlaceBallAwardState() {
  21427. let level = xGame.common.placeBallCurLevel;
  21428. let starNum = xGame.common.placeBallStarNum;
  21429. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21430. let data = cfgTable.placeballData[level].award;
  21431. let cfg = cfgTable.placeballData[level];
  21432. this.awardDiamondNum = data[1];
  21433. this.awardCoinNum = data[0];
  21434. if (cfg.type == PlaceBallType.challenge) {
  21435. this.awardDiamondNum = 0;
  21436. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21437. }
  21438. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  21439. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  21440. if (cfg.type == PlaceBallType.challenge) {
  21441. this.ui.awardNode.coinNode.visible = true;
  21442. }
  21443. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  21444. this.ui.awardNode.diamondNode.x = 265;
  21445. this.ui.awardNode.coinNode.x = 354;
  21446. }
  21447. else {
  21448. this.ui.awardNode.diamondNode.x = 291;
  21449. this.ui.awardNode.coinNode.x = 291;
  21450. }
  21451. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  21452. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  21453. if (this.awardCoinNum == 0) {
  21454. this.ui.awardNode.coinNode.numTxt.text = "";
  21455. }
  21456. if (getAward) {
  21457. this.ui.isGetAward.visible = true;
  21458. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  21459. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  21460. }
  21461. else {
  21462. this.ui.isGetAward.visible = false;
  21463. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  21464. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  21465. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  21466. }
  21467. else {
  21468. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  21469. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  21470. }
  21471. }
  21472. }
  21473. show(success) {
  21474. super.show();
  21475. xGame.eventMgr.event(RESET_GAME);
  21476. this.success = success;
  21477. Laya.timer.clearAll(this);
  21478. this.playSecretaryAni();
  21479. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  21480. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  21481. offsetTime = Math.floor(offsetTime / 1000);
  21482. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  21483. this.updateType();
  21484. Laya.timer.once(200, this, () => {
  21485. this.addAward(() => {
  21486. this.updateType();
  21487. Laya.timer.once(500, this, () => {
  21488. this.showChallengeLevel();
  21489. });
  21490. });
  21491. });
  21492. if (this.success) {
  21493. JSBridgeUtils.instance.showInternAd('gameend_success');
  21494. console.log('zh:game end 成功');
  21495. xGame.soundMgr.playSound('slots_roll01');
  21496. xGame.soundMgr.playSound("s_win");
  21497. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21498. this.diyGameDataUtilForGameWin();
  21499. this.updateGamePlaceBallData2Server();
  21500. }
  21501. else {
  21502. JSBridgeUtils.instance.showInternAd('gameend_faill');
  21503. console.log('zh:game end失败');
  21504. xGame.soundMgr.playSound('matchwin01');
  21505. xGame.soundMgr.playSound("s_lose");
  21506. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21507. }
  21508. console.log('zh:开始弹出福利框2个');
  21509. Laya.timer.once(1000, this, () => {
  21510. console.log('zh: 1秒后 showFuLiSp1');
  21511. DataMgr.checkForShowFuLi17AndAlert(1);
  21512. });
  21513. let challengeNum = DataMgr.getChallengeTimes();
  21514. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  21515. DataMgr.setChallengeTimes(1);
  21516. }
  21517. if (this.success && xGame.common.gameMode == GameMode.classic) {
  21518. DataMgr.setClassicTimes();
  21519. }
  21520. this.setGlobalFont(this.ui);
  21521. }
  21522. diyGameDataUtilForGameWin() {
  21523. console.log('zh: DiyGameDataUtilForGameWin diy ');
  21524. switch (xGame.common.gameMode) {
  21525. case GameMode.classic:
  21526. console.log('zh:DiyGameDataUtilForGameWin 111');
  21527. case GameMode.bigMove:
  21528. console.log('zh:DiyGameDataUtilForGameWin 222');
  21529. this.restartGame();
  21530. break;
  21531. case GameMode.placeBall:
  21532. console.log('zh:DiyGameDataUtilForGameWin 333');
  21533. var level = xGame.common.placeBallCurLevel;
  21534. console.log('zh:练习模式 联系了多少LEV=' + level);
  21535. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21536. if (level > db_over_lev) {
  21537. DataMgr.setChallengeMode_overLev(level);
  21538. }
  21539. break;
  21540. default:
  21541. console.log('zh:DiyGameDataUtilForGameWin 444');
  21542. break;
  21543. }
  21544. }
  21545. updateGamePlaceBallData2Server() {
  21546. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  21547. if (userInfo == null) {
  21548. return;
  21549. }
  21550. let pbdObj = DataMgr.getPlaceBallLevelList();
  21551. let reqData = xGame.httpMgr.getReqData();
  21552. let pd = JSON.parse(reqData);
  21553. pd.placeBallData = JSON.stringify(pbdObj);
  21554. reqData = JSON.stringify(pd);
  21555. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  21556. try {
  21557. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  21558. let code = res.code;
  21559. let msg = res.msg;
  21560. if (code == 401) {
  21561. Laya.LocalStorage.removeItem(keyForLoginInfo);
  21562. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  21563. return;
  21564. }
  21565. if (code == 200) {
  21566. let data = res.data;
  21567. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  21568. }
  21569. else {
  21570. xGame.uiMgr.Show(UIMsg$1, msg);
  21571. }
  21572. }
  21573. catch (error) {
  21574. console.log('error=' + error);
  21575. alert(error);
  21576. }
  21577. finally {
  21578. }
  21579. });
  21580. }
  21581. showChallengeLevel() {
  21582. if (DataMgr.getChallengeTimes() != 0)
  21583. return;
  21584. let skill = DataMgr.getSkillAccTimes();
  21585. let put = DataMgr.getPlaceBallLevelList().length;
  21586. if (skill >= 3 || put >= 5) {
  21587. xGame.uiMgr.Show(UIInvitation$1);
  21588. this.hide();
  21589. }
  21590. }
  21591. addAward(callback) {
  21592. if (!this.success) {
  21593. callback && callback();
  21594. return;
  21595. }
  21596. switch (xGame.common.gameMode) {
  21597. case GameMode.classic:
  21598. this.awardCoinNum = xGame.common.passAwardCoin;
  21599. this.awardDiamondNum = 0;
  21600. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21601. break;
  21602. case GameMode.bigMove:
  21603. this.awardCoinNum = xGame.common.passAwardCoin;
  21604. this.awardDiamondNum = 0;
  21605. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21606. callback && callback();
  21607. break;
  21608. case GameMode.placeBall:
  21609. let level = xGame.common.placeBallCurLevel;
  21610. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  21611. if (xGame.common.placeBallStarNum != 3) {
  21612. callback && callback();
  21613. return;
  21614. }
  21615. else {
  21616. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21617. if (getAward) {
  21618. callback && callback();
  21619. return;
  21620. }
  21621. }
  21622. let cfg = cfgTable.placeballData[level];
  21623. let data = cfgTable.placeballData[level].award;
  21624. this.awardCoinNum = data[0];
  21625. this.awardDiamondNum = data[1];
  21626. if (cfg.type == PlaceBallType.challenge) {
  21627. this.awardDiamondNum = 0;
  21628. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21629. }
  21630. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  21631. let diamondAward;
  21632. if (this.awardDiamondNum > 0) {
  21633. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  21634. xGame.common.getAward([diamondAward, coinAward], callback);
  21635. }
  21636. else {
  21637. xGame.common.getAward([coinAward], callback);
  21638. }
  21639. if (cfg.type == PlaceBallType.normal) {
  21640. DataMgr.setPlaceBallAward(level);
  21641. }
  21642. break;
  21643. default:
  21644. break;
  21645. }
  21646. }
  21647. playSecretaryAni_old() {
  21648. let parent = this.ui.secretary.displayObject;
  21649. parent.destroyChildren();
  21650. let xx = this.ui.secretary.width / 2;
  21651. let yy = this.ui.secretary.height;
  21652. let scale = xGame.common.getSecretaryScale();
  21653. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21654. if (this.success) {
  21655. let rand = Math.random() <= 0.5 ? 2 : 3;
  21656. xGame.common.secretary.play(data, rand, false, parent, () => {
  21657. xGame.common.secretary.play(data, 1, true, parent);
  21658. });
  21659. }
  21660. else {
  21661. xGame.common.secretary.play(data, 0, true, parent);
  21662. }
  21663. }
  21664. playSecretaryAni() {
  21665. let parent = this.ui.secretary.displayObject;
  21666. parent.destroyChildren();
  21667. let xx = this.ui.secretary.width / 2;
  21668. let yy = this.ui.secretary.height;
  21669. let scale = xGame.common.getSecretaryScale();
  21670. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21671. if (this.success) {
  21672. let rand = 0;
  21673. xGame.common.secretary.play(data, 0, true, parent);
  21674. }
  21675. else {
  21676. xGame.common.secretary.play(data, 0, true, parent);
  21677. }
  21678. }
  21679. restartGame() {
  21680. switch (xGame.common.gameMode) {
  21681. case GameMode.classic:
  21682. xGame.eventMgr.event(RESTART_GAME);
  21683. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21684. break;
  21685. case GameMode.bigMove:
  21686. this.hide();
  21687. xGame.eventMgr.event(RESTART_GAME);
  21688. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21689. break;
  21690. default:
  21691. break;
  21692. }
  21693. }
  21694. hide() {
  21695. super.hide();
  21696. xGame.common.stopGirlPop(this.ui.talkNode);
  21697. PlatMgr.showBanner(false);
  21698. }
  21699. returnHome() {
  21700. this.hide();
  21701. let showFailWords = !this.success;
  21702. xGame.uiMgr.Show(UIMain$1, showFailWords);
  21703. }
  21704. clickLeftBtn() {
  21705. switch (xGame.common.gameMode) {
  21706. case GameMode.classic:
  21707. case GameMode.bigMove:
  21708. this.returnHome();
  21709. break;
  21710. case GameMode.placeBall:
  21711. let level = xGame.common.placeBallCurLevel;
  21712. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  21713. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21714. break;
  21715. default:
  21716. break;
  21717. }
  21718. }
  21719. powerStartPlaceBallLevel(level, btn) {
  21720. if (DataMgr.powerEnough()) {
  21721. btn.touchable = false;
  21722. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21723. btn.touchable = true;
  21724. DataMgr.setPower(-1);
  21725. xGame.eventMgr.event(POWER_TIME);
  21726. this.startPlaceBallLevel(level);
  21727. this.logEventForChallenge_level_start(level);
  21728. }));
  21729. }
  21730. else {
  21731. xGame.uiMgr.Show(UIPower$1, 0);
  21732. }
  21733. }
  21734. clickRightBtn() {
  21735. switch (xGame.common.gameMode) {
  21736. case GameMode.classic:
  21737. console.log('zh:clickRightBtn 111');
  21738. case GameMode.bigMove:
  21739. console.log('zh:clickRightBtn 222');
  21740. this.restartGame();
  21741. break;
  21742. case GameMode.placeBall:
  21743. console.log('zh:clickRightBtn 333');
  21744. let level = xGame.common.placeBallCurLevel;
  21745. let data = DataMgr.getPlaceBallLevel(level);
  21746. let curPss = data.play && !data.isCur;
  21747. if (curPss) {
  21748. console.log('zh:clickRightBtn 333-111');
  21749. console.log('zh:当前LV=' + level);
  21750. if (level == 60) {
  21751. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21752. Laya.timer.once(3000, this, () => {
  21753. this.returnHome();
  21754. });
  21755. }
  21756. else {
  21757. let lev = level + 1;
  21758. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21759. }
  21760. }
  21761. else {
  21762. console.log('zh:clickRightBtn 333-000');
  21763. Moyu.sendDataEvent("placeBallNextLevel");
  21764. console.log('zh:qjff_AD_for_uiGameEnd');
  21765. if (Laya.Browser.onAndroid) {
  21766. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21767. if (!boo) {
  21768. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21769. return;
  21770. }
  21771. }
  21772. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21773. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21774. }
  21775. else {
  21776. console.log('zh:AD 失败,直接发放奖励');
  21777. this.qjff_AD_for_uiGameEnd(level);
  21778. }
  21779. }
  21780. break;
  21781. default:
  21782. console.log('zh:clickRightBtn 444');
  21783. break;
  21784. }
  21785. }
  21786. logEventForChallenge_level_start(level) {
  21787. let keyStr = 'sjmd_challenge_level_start';
  21788. let jsonStr = {
  21789. "count": 0,
  21790. "gold_balance ": DataMgr.getCoin(),
  21791. "level": level,
  21792. "diamond_balance ": DataMgr.getDiamond()
  21793. };
  21794. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21795. const d = LocalStorageManager.getItem(keyStr);
  21796. if (level > d.level) {
  21797. jsonStr.count = d.count + 1;
  21798. LocalStorageManager.setItem(keyStr, jsonStr);
  21799. }
  21800. else {
  21801. }
  21802. }
  21803. else {
  21804. LocalStorageManager.setItem(keyStr, jsonStr);
  21805. }
  21806. const reqStr = JSON.stringify(jsonStr);
  21807. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21808. }
  21809. qjff_AD_for_uiGameEnd(level) {
  21810. DataMgr.setPlaceBallLevel(level, 1);
  21811. this.startPlaceBallLevel(level + 1);
  21812. }
  21813. startPlaceBallLevel(level) {
  21814. xGame.common.gameMode = GameMode.placeBall;
  21815. xGame.common.placeBallCurLevel = level;
  21816. xGame.uiMgr.Show(UIGame$1);
  21817. this.hide();
  21818. }
  21819. logEventForChallenge_level_complete(level) {
  21820. let keyStr = 'sjmd_challenge_level_complete';
  21821. let jsonStr = {
  21822. "count": 1,
  21823. "gold_balance ": DataMgr.getCoin(),
  21824. "level": level,
  21825. "diamond_balance ": DataMgr.getDiamond()
  21826. };
  21827. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21828. const d = LocalStorageManager.getItem(keyStr);
  21829. jsonStr.count = d.count + 1;
  21830. LocalStorageManager.setItem(keyStr, jsonStr);
  21831. }
  21832. else {
  21833. LocalStorageManager.setItem(keyStr, jsonStr);
  21834. }
  21835. const reqStr = JSON.stringify(jsonStr);
  21836. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21837. }
  21838. logEventForChallenge_level_N(level) {
  21839. console.log('zh:logEventForChallenge_level_N ' + level);
  21840. let keyStr = 'sjmd_challenge_level_N';
  21841. if (LocalStorageManager.hasKey(keyStr)) {
  21842. let lev = LocalStorageManager.getItem(keyStr);
  21843. if (level > lev) {
  21844. LocalStorageManager.setItem(keyStr, level);
  21845. }
  21846. if ((level) % 5 == 0) {
  21847. console.log('zh:每5关上报1次');
  21848. let sjmc = 'challenge_level_' + level;
  21849. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21850. let sjmcForFirebase = 'challenge_level_' + level;
  21851. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21852. }
  21853. else {
  21854. console.log('zh:5 no 上报');
  21855. }
  21856. }
  21857. else {
  21858. LocalStorageManager.setItem(keyStr, level);
  21859. }
  21860. }
  21861. }
  21862. UIGameEnd$1.uiName = "UIGameEnd";
  21863. class ShowItem$1 {
  21864. constructor() {
  21865. this.ui = ui_ShowItem.createInstance();
  21866. }
  21867. destroySelf() {
  21868. if (!this.ui.isDisposed) {
  21869. this.ui.removeFromParent();
  21870. this.ui.dispose();
  21871. }
  21872. }
  21873. setParent(parent) {
  21874. parent.addChild(this.ui);
  21875. }
  21876. setPos(x, y) {
  21877. this.ui.x = x;
  21878. this.ui.y = y;
  21879. }
  21880. setUrl(index) {
  21881. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21882. }
  21883. }
  21884. class UILevelProp$1 extends UIBase {
  21885. constructor() {
  21886. super();
  21887. this.firstPos = 385;
  21888. this.secondPos = 467;
  21889. this.showItemArr = [];
  21890. }
  21891. onConstructor() {
  21892. this.ui = ui_UILevelProp.createInstance();
  21893. this.contentPane = this.ui;
  21894. this.isEject = false;
  21895. this.addUIClick(this.ui.closeBtn, this.hideWin);
  21896. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21897. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21898. this.addUIClick(this.ui.myNode.n_yd_zzq_btn3, this.startGame);
  21899. }
  21900. show(level) {
  21901. console.log('zh:show.');
  21902. super.show();
  21903. this.ui.t1.play();
  21904. this.level = level;
  21905. this.data = cfgTable.placeballData[this.level];
  21906. this.updateSelf();
  21907. this.showPreView();
  21908. this.moneyNode.ui.c1.selectedIndex = 2;
  21909. this.moneyNode.checkPowerTime();
  21910. this.moneyNode.powerChange();
  21911. this.yinDaoForLianxi();
  21912. this.setGlobalFont(this.ui);
  21913. }
  21914. yinDaoForLianxi() {
  21915. let lianXiGuide = DataMgr.getLianXiGuide();
  21916. console.log('zh:lianXiGuide=', lianXiGuide);
  21917. if (lianXiGuide === 0) {
  21918. this.ui.myNode.n_yd_3.visible = true;
  21919. console.log('zh:yinDaoForLianxi 333 set ok');
  21920. }
  21921. else {
  21922. this.ui.myNode.n_yd_3.visible = false;
  21923. console.log('zh:无需引导33');
  21924. }
  21925. }
  21926. showPreView() {
  21927. let item;
  21928. let data;
  21929. for (let index = 0; index < this.showItemArr.length; index++) {
  21930. item = this.showItemArr[index];
  21931. item.destroySelf();
  21932. }
  21933. this.showItemArr = [];
  21934. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21935. for (const key in cfgData) {
  21936. data = cfgData[key];
  21937. item = new ShowItem$1();
  21938. item.setParent(this.ui.myNode.displayRoot);
  21939. item.setPos(data.x, data.y);
  21940. item.setUrl(data.value);
  21941. this.showItemArr.push(item);
  21942. }
  21943. }
  21944. updateSelf() {
  21945. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21946. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21947. if (this.data.ball == -1) {
  21948. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21949. }
  21950. else {
  21951. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21952. }
  21953. let localData = DataMgr.getPlaceBallLevel(this.level);
  21954. let getAward = localData.getAward;
  21955. let cfg = cfgTable.placeballData[this.level];
  21956. let coin = this.data.award[0];
  21957. let diamond = this.data.award[1];
  21958. if (cfg.type == PlaceBallType.challenge) {
  21959. diamond = 0;
  21960. coin = 100;
  21961. }
  21962. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21963. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21964. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21965. if (cfg.type == PlaceBallType.challenge) {
  21966. this.ui.myNode.coinNode.numTxt.text = "";
  21967. }
  21968. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21969. if (coin > 0 && diamond > 0) {
  21970. this.ui.myNode.diamondNode.x = 385;
  21971. this.ui.myNode.coinNode.x = 467;
  21972. }
  21973. else {
  21974. this.ui.myNode.diamondNode.x = 385;
  21975. this.ui.myNode.coinNode.x = 385;
  21976. }
  21977. if (!getAward) {
  21978. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21979. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21980. }
  21981. else {
  21982. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21983. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21984. }
  21985. }
  21986. startGame() {
  21987. console.log("zh:startGame");
  21988. if (DataMgr.powerEnough()) {
  21989. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21990. this.ui.myNode.startBtn.touchable = false;
  21991. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21992. console.log('zh:startGame dh ');
  21993. this.ui.myNode.startBtn.touchable = true;
  21994. DataMgr.setPower(-1);
  21995. xGame.eventMgr.event(POWER_TIME);
  21996. xGame.common.gameMode = GameMode.placeBall;
  21997. xGame.common.placeBallCurLevel = this.level;
  21998. xGame.uiMgr.Show(UIGame$1);
  21999. xGame.uiMgr.Hide(UILevelDisplay$1);
  22000. xGame.uiMgr.Hide(UIMain$1);
  22001. this.logEventForChallenge_level_start(this.level);
  22002. this.hideWin();
  22003. }));
  22004. console.log('zh:eeeee');
  22005. }
  22006. else {
  22007. let guide = DataMgr.getLianXiGuide();
  22008. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  22009. console.log('zh:自动添加2点体力,以便于完成练习引导模式');
  22010. DataMgr.setPower(2);
  22011. }
  22012. console.log('zh:guide = ' + guide);
  22013. console.log('zh:xGame.common.gameMode = ' + xGame.common.gameMode);
  22014. console.log('zh:powerEnough不足=' + DataMgr.powerEnough());
  22015. xGame.uiMgr.Show(UIPower$1);
  22016. }
  22017. }
  22018. logEventForChallenge_level_start(level) {
  22019. let keyStr = 'sjmd_challenge_level_start';
  22020. let jsonStr = {
  22021. "count": 1,
  22022. "gold_balance ": DataMgr.getCoin(),
  22023. "level": level,
  22024. "diamond_balance ": DataMgr.getDiamond()
  22025. };
  22026. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22027. const d = LocalStorageManager.getItem(keyStr);
  22028. if (level > d.level) {
  22029. jsonStr.count = d.count + 1;
  22030. LocalStorageManager.setItem(keyStr, jsonStr);
  22031. }
  22032. else {
  22033. }
  22034. }
  22035. else {
  22036. LocalStorageManager.setItem(keyStr, jsonStr);
  22037. }
  22038. const reqStr = JSON.stringify(jsonStr);
  22039. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  22040. }
  22041. hideWin() {
  22042. super.hide();
  22043. if (this.ui.myNode.startBtn) {
  22044. this.ui.myNode.startBtn.touchable = true;
  22045. if (this.ui.myNode.startBtn.powerEft.t0) {
  22046. this.ui.myNode.startBtn.powerEft.t0.stop();
  22047. }
  22048. }
  22049. }
  22050. }
  22051. UILevelProp$1.uiName = "UILevelProp";
  22052. class PutBallLevelDisplay$1 {
  22053. constructor(ui, index) {
  22054. this.index = 0;
  22055. this.ui = ui;
  22056. this.index = index;
  22057. this.ui.onClick(this, this.clickSelf);
  22058. this.updateSelf();
  22059. this.ui.levelTxt.text = (this.index + 1) + "";
  22060. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  22061. this.ui.special.levelTxt.text = (this.index + 1) + "";
  22062. }
  22063. updateSelf() {
  22064. let level = this.index + 1;
  22065. this.data = DataMgr.getPlaceBallLevel(level);
  22066. this.ui.starNode.c1.selectedIndex = this.data.star;
  22067. let isChallenge = cfgTable.placeballData[level].type;
  22068. if (this.data.isCur) {
  22069. if (isChallenge) {
  22070. this.ui.c1.selectedIndex = 5;
  22071. }
  22072. else {
  22073. this.ui.c1.selectedIndex = 2;
  22074. }
  22075. }
  22076. else {
  22077. if (this.data.play) {
  22078. if (this.data.star == 3) {
  22079. this.ui.c1.selectedIndex = 0;
  22080. }
  22081. else {
  22082. this.ui.c1.selectedIndex = 1;
  22083. }
  22084. }
  22085. else {
  22086. if (isChallenge) {
  22087. this.ui.c1.selectedIndex = 4;
  22088. }
  22089. else {
  22090. this.ui.c1.selectedIndex = 3;
  22091. }
  22092. }
  22093. }
  22094. }
  22095. clickSelf() {
  22096. console.log("zh:lev clickSelf");
  22097. if (!this.data.play)
  22098. return;
  22099. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22100. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  22101. }
  22102. }
  22103. class UILevelDisplay$1 extends UIBase {
  22104. constructor() {
  22105. super();
  22106. }
  22107. onConstructor() {
  22108. this.ui = ui_UILevelDisplay.createInstance();
  22109. this.contentPane = this.ui;
  22110. this.isEject = false;
  22111. this.myList = this.ui.myNode.myList;
  22112. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  22113. this.addUIClick(this.ui.myNode.yd_zzq_btn, this.showLevelTipWindows);
  22114. this.levelItemArr = [];
  22115. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  22116. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  22117. this.myList.numItems = levelNum;
  22118. }
  22119. levelItemRender(index, target) {
  22120. let item = new PutBallLevelDisplay$1(target, index);
  22121. this.levelItemArr.push(item);
  22122. }
  22123. show() {
  22124. super.show();
  22125. this.updateLevel();
  22126. this.scrollToPlace();
  22127. this.yinDaoForLianxi();
  22128. this.setGlobalFont(this.ui);
  22129. }
  22130. yinDaoForLianxi() {
  22131. let lianXiGuide = DataMgr.getLianXiGuide();
  22132. console.log('zh:lianXiGuide=', lianXiGuide);
  22133. if (lianXiGuide === 0) {
  22134. this.ui.myNode.n_yd.visible = true;
  22135. console.log('zh:yinDaoForLianxi 222 set ok');
  22136. }
  22137. else {
  22138. this.ui.myNode.n_yd.visible = false;
  22139. console.log('zh:无需引导');
  22140. }
  22141. }
  22142. showLevelTipWindows() {
  22143. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22144. xGame.uiMgr.Show(UILevelProp$1, 1);
  22145. }
  22146. updateLevel() {
  22147. let temp;
  22148. for (let index = 0; index < this.levelItemArr.length; index++) {
  22149. temp = this.levelItemArr[index];
  22150. temp.updateSelf();
  22151. }
  22152. }
  22153. scrollToPlace() {
  22154. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  22155. let passArr = DataMgr.getPlaceBallLevelList();
  22156. let offest = passArr.length;
  22157. if (offest >= maxNum - 1)
  22158. offest = maxNum - 1;
  22159. this.myList.scrollToView(offest, true, true);
  22160. }
  22161. hide() {
  22162. super.hide();
  22163. }
  22164. }
  22165. UILevelDisplay$1.uiName = "UILevelDisplay";
  22166. class UIMatching$1 extends UIBase {
  22167. constructor() {
  22168. super();
  22169. }
  22170. onConstructor() {
  22171. this.ui = ui_UIMatching.createInstance();
  22172. this.contentPane = this.ui;
  22173. this.isEject = false;
  22174. }
  22175. show(callback) {
  22176. super.show();
  22177. PlatMgr.showBanner(true);
  22178. this.callback = callback;
  22179. let user = Moyu.getUserInfo();
  22180. if (!this.selfPot) {
  22181. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  22182. }
  22183. if (!this.aiPot) {
  22184. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  22185. }
  22186. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  22187. this.ui.selfHead.nameTxt.text = user.nickName;
  22188. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  22189. this.ui.aiHead.nameTxt.text = "???";
  22190. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  22191. this.ui.selfHead.c1.selectedIndex = 0;
  22192. this.ui.aiHead.c1.selectedIndex = 0;
  22193. this.ui.selfHead.x = this.selfPot.x;
  22194. this.ui.selfHead.y = this.selfPot.y;
  22195. this.ui.aiHead.x = this.aiPot.x;
  22196. this.ui.aiHead.y = this.aiPot.y;
  22197. switch (xGame.common.gameMode) {
  22198. case GameMode.classic:
  22199. break;
  22200. case GameMode.bigMove:
  22201. this.initSkillData();
  22202. break;
  22203. default:
  22204. break;
  22205. }
  22206. this.ui.t1.play(Laya.Handler.create(this, () => {
  22207. this.ui.t2.play(Laya.Handler.create(this, () => {
  22208. switch (xGame.common.gameMode) {
  22209. case GameMode.classic:
  22210. this.waitingPeople();
  22211. break;
  22212. case GameMode.bigMove:
  22213. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  22214. break;
  22215. default:
  22216. break;
  22217. }
  22218. }));
  22219. }));
  22220. this.setGlobalFont(this.ui);
  22221. }
  22222. initSkillData() {
  22223. this.skillSelectData = [];
  22224. let skillUrl = xGame.common.skillIconList;
  22225. let skillName = xGame.common.skillNameList;
  22226. let skillLevel = DataMgr.getBigSkillList();
  22227. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  22228. for (let index = 0; index < 5; index++) {
  22229. let obj = {};
  22230. obj.skillImg = skillUrl[index];
  22231. obj.skillName = skillName[index];
  22232. obj.skillType = skillType[index];
  22233. obj.skillLevel = skillLevel[index];
  22234. this.skillSelectData.push(obj);
  22235. }
  22236. }
  22237. getAISkillLevel(myLevel) {
  22238. let video = xGame.common.upSkillLevel;
  22239. let aiLevel;
  22240. let temp;
  22241. if (video) {
  22242. temp = xGame.common.randomNum(-2, -1);
  22243. }
  22244. else {
  22245. if (myLevel <= 5) {
  22246. temp = xGame.common.randomNum(1, 3);
  22247. }
  22248. else if (myLevel <= 9) {
  22249. temp = xGame.common.randomNum(-2, 1);
  22250. }
  22251. else {
  22252. temp = xGame.common.randomNum(-4, 0);
  22253. }
  22254. }
  22255. aiLevel = temp + myLevel;
  22256. if (aiLevel <= 1)
  22257. aiLevel = 1;
  22258. if (aiLevel >= 10)
  22259. aiLevel = 10;
  22260. return aiLevel;
  22261. }
  22262. getAISkillType() {
  22263. return xGame.common.randomNum(1, 4);
  22264. let successTimes = DataMgr.getSkillSuccessTimes();
  22265. let info = cfgTable.aiskillData[successTimes];
  22266. if (!info) {
  22267. let max = Object.keys(cfgTable.aiskillData).length - 1;
  22268. info = cfgTable.aiskillData[max];
  22269. }
  22270. let dataArr = info.skillselect;
  22271. let myCfg = {};
  22272. for (let index = 0; index < dataArr.length; index++) {
  22273. let temp = dataArr[index].split('-');
  22274. myCfg[temp[0]] = {};
  22275. myCfg[temp[0]].id = parseInt(temp[0]);
  22276. myCfg[temp[0]].weight = parseInt(temp[1]);
  22277. }
  22278. let aiCfg = xGame.common.initWeight(myCfg);
  22279. let curData = xGame.common.getRandomWeightData(aiCfg);
  22280. return parseInt(curData.id);
  22281. }
  22282. getAISkillData(index) {
  22283. let myLevel = this.skillSelectData[index].skillLevel;
  22284. let aiLevel = this.getAISkillLevel(myLevel);
  22285. let aiType = this.getAISkillType() - 1;
  22286. return { aiLevel, aiType } = { aiLevel, aiType };
  22287. }
  22288. skillSelectFinish(index) {
  22289. let aiInfo = this.getAISkillData(index);
  22290. xGame.common.gameMgr.selfCurSkill = index;
  22291. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  22292. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  22293. this.ui.selfHead.c1.selectedIndex = 1;
  22294. this.ui.aiHead.c1.selectedIndex = 1;
  22295. let myData = this.skillSelectData[index];
  22296. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  22297. let guide = DataMgr.getSkillGuide();
  22298. if (guide == 0) {
  22299. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  22300. }
  22301. else {
  22302. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  22303. }
  22304. let aiData = this.skillSelectData[aiInfo.aiType];
  22305. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  22306. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  22307. this.waitingPeople();
  22308. }
  22309. waitingPeople() {
  22310. let time = xGame.common.randomNum(1000, 3000);
  22311. time += 1000;
  22312. Laya.timer.once(time, this, () => {
  22313. this.matchingSuccess();
  22314. });
  22315. }
  22316. matchingSuccess() {
  22317. let gameUI = xGame.common.gameUI;
  22318. let name = gameUI.ui.topNode.aiNameTxt.text;
  22319. let url = gameUI.ui.topNode.aiHeadLoader.url;
  22320. this.ui.aiHead.nameTxt.text = name;
  22321. this.ui.aiHead.headImg.url = url;
  22322. name = gameUI.ui.topNode.selfNameTxt.text;
  22323. url = gameUI.ui.topNode.selfHeadLoader.url;
  22324. this.ui.selfHead.nameTxt.text = name;
  22325. this.ui.selfHead.headImg.url = url;
  22326. this.ui.t3.play(Laya.Handler.create(this, () => {
  22327. this.callback && this.callback();
  22328. this.ui.t4.play(Laya.Handler.create(this, () => {
  22329. this.destroySelf();
  22330. }));
  22331. }));
  22332. }
  22333. destroySelf() {
  22334. this.callback = null;
  22335. this.skillSelectData = null;
  22336. this.selfPot = null;
  22337. this.aiPot = null;
  22338. if (!this.ui.isDisposed) {
  22339. this.ui.removeFromParent();
  22340. this.ui.dispose();
  22341. }
  22342. xGame.uiMgr.destroyUI(this);
  22343. }
  22344. }
  22345. UIMatching$1.uiName = "UIMatching";
  22346. class SkillDisplay$1 {
  22347. constructor(ui, data, uiIndex) {
  22348. this.starX = 0;
  22349. this.starY = 0;
  22350. this.index = 0;
  22351. this.ui = ui;
  22352. this.data = data;
  22353. this.index = uiIndex;
  22354. this.initSelf();
  22355. console.log('zh:SkillDisplay constructor this.skillData=', data);
  22356. }
  22357. initSelf() {
  22358. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  22359. this.ui.nameTxt.text = this.data.name;
  22360. this.ui.describeTxt.text = this.data.describe;
  22361. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  22362. this.ui.startBtn.onClick(this, this.startGame);
  22363. this.updateSelf();
  22364. }
  22365. updateSelf() {
  22366. this.checkTry();
  22367. let level = DataMgr.getBigSkillByIndex(this.index);
  22368. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  22369. }
  22370. checkTry() {
  22371. let index = this.index;
  22372. let level = DataMgr.getBigSkillByIndex(index);
  22373. if (level == null) {
  22374. DataMgr.setBigSkill(index, 1, false);
  22375. level = 1;
  22376. }
  22377. this.ui.levelTxt.text = "LV." + level;
  22378. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  22379. this.ui.tryNode.visible = true;
  22380. else
  22381. this.ui.tryNode.visible = false;
  22382. }
  22383. clickAddLevel() {
  22384. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22385. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  22386. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  22387. if (Laya.Browser.onAndroid) {
  22388. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  22389. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22390. }
  22391. else {
  22392. console.log('zh:AD 失败,直接发放奖励');
  22393. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22394. }
  22395. }
  22396. else {
  22397. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22398. }
  22399. }
  22400. qjff_AD_for_skilldisplay_clickAddLevel() {
  22401. DataMgr.setBigSkill(this.data.index, 1);
  22402. this.updateSelf();
  22403. xGame.common.upSkillLevel = true;
  22404. }
  22405. startGame() {
  22406. console.log('zh:rod skill startgame');
  22407. if (this.data.index == 3) {
  22408. alert('Coming soon!');
  22409. return;
  22410. }
  22411. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22412. let needCoin = xGame.common.bigMoveNeedCoin;
  22413. xGame.common.passAwardCoin = 2000;
  22414. let guide = DataMgr.getSkillGuide();
  22415. console.log('zh:startGame guide=' + guide);
  22416. xGame.common.temSelfLevel = 0;
  22417. if (guide == 0) {
  22418. needCoin = 0;
  22419. xGame.common.temSelfLevel = 100;
  22420. }
  22421. if (DataMgr.coinEnough(needCoin)) {
  22422. DataMgr.setCoin(-needCoin);
  22423. xGame.common.curPlayerSkillType = this.index;
  22424. if (guide == 0)
  22425. xGame.common.curPlayerSkillType = 0;
  22426. console.log('zh: skilldisplay 1');
  22427. xGame.uiMgr.Show(UIGame$1);
  22428. xGame.uiMgr.Hide(UIMain$1);
  22429. xGame.uiMgr.Show(UIMatching$1, () => {
  22430. xGame.common.gameUI.ui.alpha = 1;
  22431. xGame.common.gameUI.startGame();
  22432. xGame.uiMgr.Hide(UISkill$1);
  22433. });
  22434. this.logEventForRod_start();
  22435. }
  22436. else {
  22437. console.log('zh: skilldisplay 2');
  22438. xGame.uiMgr.Show(UIAddProp$1, 0);
  22439. Moyu.sendDataEvent("AddCoinVideo");
  22440. }
  22441. }
  22442. logEventForRod_start() {
  22443. let gfmsIdx = xGame.common.curPlayerSkillType;
  22444. console.log('zh:选择的技能=' + gfmsIdx);
  22445. let gfmc = 'Skyfall Shot';
  22446. if (gfmsIdx == 0) {
  22447. gfmc = 'Skyfall Shot';
  22448. }
  22449. if (gfmsIdx == 1) {
  22450. gfmc = 'Surging break';
  22451. }
  22452. if (gfmsIdx == 2) {
  22453. gfmc = 'Frost Lock';
  22454. }
  22455. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  22456. let jsonStr = {
  22457. "count": 0,
  22458. "name": gfmc
  22459. };
  22460. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22461. const d = LocalStorageManager.getItem(keyStr);
  22462. jsonStr.count = d.count + 1;
  22463. LocalStorageManager.setItem(keyStr, jsonStr);
  22464. }
  22465. else {
  22466. LocalStorageManager.setItem(keyStr, jsonStr);
  22467. }
  22468. const reqStr = JSON.stringify(jsonStr);
  22469. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  22470. }
  22471. }
  22472. class UISkill$1 extends UIBase {
  22473. constructor() {
  22474. super();
  22475. this.skillData = [];
  22476. }
  22477. onConstructor() {
  22478. this.ui = ui_UISkill.createInstance();
  22479. this.contentPane = this.ui;
  22480. this.isEject = false;
  22481. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22482. this.initSkillData();
  22483. console.log('zh:aaaaaa1111111111');
  22484. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  22485. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  22486. console.log('zh:aaaaaa22222222');
  22487. this.displayList = [];
  22488. this.ui.skillNode.skillList.numItems = 3;
  22489. this.addUIClick(this.ui, this.interuptSecretary);
  22490. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  22491. this.ui.talkNode.visible = false;
  22492. if (Moyu.isKs)
  22493. this.ui.closeNode.closeBtn.x += 100;
  22494. }
  22495. show() {
  22496. super.show();
  22497. this.playSecretaryIdle();
  22498. this.moneyNode.ui.c1.selectedIndex = 1;
  22499. Laya.timer.clearAll(this);
  22500. xGame.soundMgr.playSound("s_start");
  22501. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22502. let guide = DataMgr.getSkillGuide();
  22503. this.ui.guideNode.visible = guide == 0;
  22504. let item = this.getSkillItemByUIIndex(0);
  22505. if (guide == 0) {
  22506. item.ui.c1.selectedIndex = 1;
  22507. }
  22508. else {
  22509. item.ui.c1.selectedIndex = 0;
  22510. }
  22511. this.ui.guideNode.guideBtn.visible = guide == 0;
  22512. for (let index = 0; index < this.displayList.length; index++) {
  22513. this.displayList[index].checkTry();
  22514. }
  22515. this.setGlobalFont(this.ui);
  22516. }
  22517. getSkillItemByUIIndex(cur) {
  22518. for (let index = 0; index < this.displayList.length; index++) {
  22519. if (this.displayList[index].index == cur) {
  22520. return this.displayList[index];
  22521. }
  22522. }
  22523. }
  22524. enterGuideLevel() {
  22525. let item = this.getSkillItemByUIIndex(0);
  22526. item.startGame();
  22527. if (DataMgr.getNewUser())
  22528. Moyu.sendDataEvent("gameStart1");
  22529. }
  22530. initSkillData() {
  22531. this.skillData = [];
  22532. let nameList = xGame.common.skillNameList;
  22533. let iconList = xGame.common.skillIconList;
  22534. let describeList = [
  22535. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  22536. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  22537. "The power of frost descends—freezing the flow and taking full control of the game!"
  22538. ];
  22539. console.log('zh:initSkillData 111111111');
  22540. let data;
  22541. for (let index = 0; index < nameList.length; index++) {
  22542. data = {};
  22543. data.name = nameList[index];
  22544. data.icon = iconList[index];
  22545. data.describe = describeList[index];
  22546. data.index = index;
  22547. this.skillData.push(data);
  22548. }
  22549. }
  22550. updateSkillItem(index, target) {
  22551. if (this.displayList[index] == null) {
  22552. let uiIndex;
  22553. switch (index) {
  22554. case 0:
  22555. uiIndex = 1;
  22556. break;
  22557. case 1:
  22558. uiIndex = 0;
  22559. break;
  22560. case 2:
  22561. uiIndex = 2;
  22562. break;
  22563. case 3:
  22564. uiIndex = 3;
  22565. break;
  22566. default:
  22567. break;
  22568. }
  22569. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  22570. this.displayList.push(temp);
  22571. }
  22572. }
  22573. playSecretaryIdle() {
  22574. let parent = this.ui.secretary.displayObject;
  22575. parent.destroyChildren();
  22576. let xx = this.ui.secretary.width / 2;
  22577. let yy = this.ui.secretary.height;
  22578. let scale = xGame.common.getSecretaryScale();
  22579. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22580. xGame.common.secretary.play(data, 0, true, parent);
  22581. }
  22582. returnUIMain() {
  22583. this.hide();
  22584. xGame.common.stopGirlPop(this.ui.talkNode);
  22585. xGame.uiMgr.Show(UIMain$1);
  22586. }
  22587. interuptSecretary() {
  22588. Laya.timer.clearAll(this);
  22589. this.playSecretaryRandomSound();
  22590. }
  22591. playSecretaryRandomSound() {
  22592. if (this.isHide)
  22593. return;
  22594. let time = xGame.common.randomNum(45000, 60000);
  22595. Laya.timer.once(time, this, () => {
  22596. if (this.isHide)
  22597. return;
  22598. let index = xGame.common.randomNum(4, 7);
  22599. xGame.soundMgr.playSound("s_main0" + index);
  22600. let words = 1;
  22601. switch (index) {
  22602. case 4:
  22603. words = 5;
  22604. break;
  22605. case 5:
  22606. words = 3;
  22607. break;
  22608. case 6:
  22609. words = 6;
  22610. break;
  22611. case 7:
  22612. words = 7;
  22613. break;
  22614. default:
  22615. break;
  22616. }
  22617. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22618. this.playSecretaryRandomSound();
  22619. });
  22620. }
  22621. }
  22622. UISkill$1.uiName = "UISkill";
  22623. class UIAddProp$1 extends UIBase {
  22624. constructor() {
  22625. super();
  22626. this.curType = "";
  22627. }
  22628. onConstructor() {
  22629. this.ui = ui_UIAddProp.createInstance();
  22630. this.contentPane = this.ui;
  22631. this.isEject = false;
  22632. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22633. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  22634. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  22635. this.updateUI();
  22636. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  22637. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  22638. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  22639. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  22640. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  22641. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  22642. }
  22643. show(type) {
  22644. super.show();
  22645. this.curType = type == 0 ? "coin" : "diamond";
  22646. this.switchBtn("");
  22647. this.ui.t0.play();
  22648. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  22649. PlatMgr.showInsert(true);
  22650. this.setGlobalFont(this.ui);
  22651. }
  22652. closeSelf() {
  22653. this.hide();
  22654. }
  22655. updateUI() {
  22656. let data = cfgTable.moneyData;
  22657. let temp;
  22658. let obj;
  22659. for (const key in data) {
  22660. temp = data[key];
  22661. obj = this.ui.myNode["node" + key];
  22662. if (parseInt(key) <= 2) {
  22663. obj.diamondTxt.text = "+" + temp.num;
  22664. }
  22665. else {
  22666. obj.coinTxt.text = temp.num;
  22667. obj.diamondTxt.text = temp.get.split('_')[1];
  22668. }
  22669. }
  22670. this.updateDiamondShare();
  22671. }
  22672. updateDiamondShare() {
  22673. let data = DataMgr.getShareDiamondTimes();
  22674. if (data >= xGame.common.maxShareDiamondTimes) {
  22675. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  22676. this.ui.myNode.node1.touchable = false;
  22677. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22678. }
  22679. else {
  22680. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  22681. this.ui.myNode.node1.touchable = true;
  22682. }
  22683. }
  22684. switchBtn(type) {
  22685. if (type == "")
  22686. type = this.curType;
  22687. else {
  22688. if (this.curType == type) {
  22689. return;
  22690. }
  22691. else {
  22692. this.curType = type;
  22693. }
  22694. }
  22695. if (type == "coin") {
  22696. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  22697. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  22698. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  22699. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  22700. this.ui.myNode.c1.selectedIndex = 0;
  22701. }
  22702. else {
  22703. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  22704. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  22705. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  22706. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  22707. this.ui.myNode.c1.selectedIndex = 1;
  22708. }
  22709. }
  22710. convertCoin(index) {
  22711. let data = cfgTable.moneyData[index];
  22712. let coinNum = data.num;
  22713. let str = data.get.split('_')[1];
  22714. let needDiamond = parseInt(str);
  22715. if (DataMgr.diamondEnough(needDiamond)) {
  22716. DataMgr.setDiamond(-needDiamond);
  22717. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  22718. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  22719. }
  22720. else {
  22721. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  22722. this.switchBtn("diamond");
  22723. }
  22724. }
  22725. videoGetDiamond() {
  22726. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  22727. if (Laya.Browser.onAndroid) {
  22728. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22729. if (!boo) {
  22730. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22731. return;
  22732. }
  22733. }
  22734. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  22735. }
  22736. else {
  22737. console.log('zh:AD 失败,直接发放奖励');
  22738. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  22739. }
  22740. }
  22741. qjff_AD_for_uiAddProp_videoGetDiamond() {
  22742. let num = cfgTable.moneyData[2].num;
  22743. xGame.common.playObjFlyAnim(num, Prop.diamond);
  22744. this.closeSelf();
  22745. }
  22746. videoGetCoin() {
  22747. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  22748. if (Laya.Browser.onAndroid) {
  22749. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22750. if (!boo) {
  22751. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22752. return;
  22753. }
  22754. }
  22755. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  22756. }
  22757. else {
  22758. console.log('zh:AD 失败,直接发放奖励');
  22759. this.qjff_AD_for_uiAddProp_videoGetCoin();
  22760. }
  22761. }
  22762. qjff_AD_for_uiAddProp_videoGetCoin() {
  22763. xGame.common.playObjFlyAnim(2000, Prop.coin);
  22764. this.closeSelf();
  22765. }
  22766. shareGetDiamond() {
  22767. let times = DataMgr.getShareDiamondTimes();
  22768. if (times >= xGame.common.maxShareDiamondTimes) {
  22769. console.log('zh: 233333333333 maxShareDiamondTimes');
  22770. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22771. }
  22772. else {
  22773. console.log('zh:33333333333333ad');
  22774. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22775. if (Laya.Browser.onAndroid) {
  22776. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22777. if (!boo) {
  22778. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22779. return;
  22780. }
  22781. }
  22782. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22783. }
  22784. else {
  22785. console.log('zh:AD 失败,直接发放奖励');
  22786. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22787. }
  22788. }
  22789. }
  22790. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22791. let diamond = xGame.common.randomNum(50, 100);
  22792. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22793. DataMgr.setShareDiamondTimes(1);
  22794. this.updateDiamondShare();
  22795. }
  22796. openPutBallView() {
  22797. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22798. let skill = xGame.uiMgr.getUI(UISkill$1);
  22799. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22800. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22801. if (end && !end.isHide) {
  22802. xGame.uiMgr.Hide(UIGameEnd$1);
  22803. xGame.uiMgr.Show(UIMain$1);
  22804. }
  22805. if (skill && !skill.isHide)
  22806. xGame.uiMgr.Hide(UISkill$1);
  22807. if (uigame && !uigame.isHide)
  22808. xGame.uiMgr.Hide(UIGame$1);
  22809. if (level && !level.isHide) {
  22810. }
  22811. else {
  22812. xGame.uiMgr.Show(UILevelDisplay$1);
  22813. }
  22814. this.closeSelf();
  22815. }
  22816. }
  22817. UIAddProp$1.uiName = "UIAddProp";
  22818. class MoneyNode$1 {
  22819. constructor(ui) {
  22820. this.leftTime = 0;
  22821. this.ui = ui;
  22822. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22823. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22824. this.ui.addPowerBtn.onClick(this, this.addPower);
  22825. this.ui.c1.selectedIndex = 1;
  22826. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22827. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22828. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22829. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22830. this.coinChange();
  22831. this.diamondChange();
  22832. this.powerChange();
  22833. }
  22834. addPower() {
  22835. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22836. xGame.uiMgr.Show(UIPower$1);
  22837. }
  22838. powerChange() {
  22839. let powerNum = DataMgr.getPower();
  22840. this.ui.powerTxt.text = powerNum + "";
  22841. }
  22842. checkPowerTime() {
  22843. let cur = new Date().getTime();
  22844. let last = DataMgr.getPowerTime();
  22845. if (last == 0) {
  22846. last = cur;
  22847. DataMgr.setPowerTime(cur);
  22848. }
  22849. let power = DataMgr.getPower();
  22850. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22851. Laya.timer.clearAll(this);
  22852. if (power >= xGame.common.natureMaxPower) {
  22853. this.ui.powerTimeTxt.text = "";
  22854. DataMgr.setPowerTime(cur);
  22855. return;
  22856. }
  22857. if (power + offset >= xGame.common.natureMaxPower) {
  22858. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22859. this.ui.powerTimeTxt.text = "";
  22860. DataMgr.setPowerTime(cur);
  22861. }
  22862. else {
  22863. if (offset > 0) {
  22864. DataMgr.setPower(offset);
  22865. DataMgr.setPowerTime(cur);
  22866. }
  22867. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22868. this.leftTime = xGame.common.powerRecoverNum - time;
  22869. if (this.leftTime <= 0)
  22870. this.leftTime = 0;
  22871. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22872. Laya.timer.loop(1000, this, this.updatePowerTime);
  22873. }
  22874. }
  22875. updatePowerTime() {
  22876. this.leftTime -= 1;
  22877. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22878. if (this.leftTime <= 0) {
  22879. this.checkPowerTime();
  22880. }
  22881. }
  22882. coinChange() {
  22883. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22884. }
  22885. diamondChange() {
  22886. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22887. }
  22888. addCoin() {
  22889. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22890. Moyu.sendDataEvent("AddCoinBtn");
  22891. xGame.uiMgr.Show(UIAddProp$1, 0);
  22892. }
  22893. addDiamond() {
  22894. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22895. Moyu.sendDataEvent("AddDiamondBtn");
  22896. xGame.uiMgr.Show(UIAddProp$1, 1);
  22897. }
  22898. }
  22899. class SettingNode$1 {
  22900. constructor(ui) {
  22901. this.showSetting = false;
  22902. this.openSound = true;
  22903. this.openShake = true;
  22904. this.ui = ui;
  22905. this.ui.soundBtn.onClick(this, this.switchSound);
  22906. this.ui.shakeBtn.onClick(this, this.switchShake);
  22907. this.ui.xyBtn.onClick(this, this.onXy);
  22908. this.ui.clickNode.onClick(this, this.changeSetting);
  22909. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22910. this.ui.xyBtn.visible = false;
  22911. this.ui.shakeBtn.visible = false;
  22912. }
  22913. changeSetting() {
  22914. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22915. this.showSetting = !this.showSetting;
  22916. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22917. }
  22918. switchSound() {
  22919. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22920. this.openSound = !this.openSound;
  22921. Moyu.onSetting(this.openSound, this.openShake);
  22922. xGame.soundMgr.onSetting(this.openSound);
  22923. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22924. }
  22925. switchShake() {
  22926. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22927. this.openShake = !this.openShake;
  22928. Moyu.onSetting(this.openSound, this.openShake);
  22929. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22930. }
  22931. onXy() {
  22932. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22933. MoyuMgr$1.showXy(1);
  22934. }
  22935. }
  22936. class UIDraw$1 extends UIBase {
  22937. constructor() {
  22938. super();
  22939. this.curKey = 0;
  22940. }
  22941. onConstructor() {
  22942. this.ui = ui_UIDraw.createInstance();
  22943. this.contentPane = this.ui;
  22944. this.isEject = false;
  22945. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22946. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22947. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22948. this.initDraw();
  22949. this.initUI();
  22950. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22951. }
  22952. show() {
  22953. super.show();
  22954. this.ui.t0.play();
  22955. this.playSecretaryIdle();
  22956. this.updateDraw();
  22957. this.checkFree();
  22958. if (PlatMgr.bannerDelay > 0) {
  22959. this.ui.closeNode.closeBtn.visible = false;
  22960. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22961. this.ui.closeNode.closeBtn.visible = true;
  22962. });
  22963. }
  22964. PlatMgr.showRateBanner();
  22965. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  22966. this.setGlobalFont(this.ui);
  22967. }
  22968. hide() {
  22969. Laya.timer.clearAll(this);
  22970. super.hide();
  22971. }
  22972. checkFree() {
  22973. let isFree = DataMgr.getDailyfreeDrawTimes();
  22974. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22975. }
  22976. initDraw() {
  22977. this.drawObj = [];
  22978. let data = cfgTable.drawData;
  22979. let temp;
  22980. let weight = 0;
  22981. for (const key in data) {
  22982. temp = data[key];
  22983. weight += temp.weight;
  22984. this.drawObj.push(weight);
  22985. }
  22986. this.allWeight = weight;
  22987. }
  22988. initUI() {
  22989. let data = cfgTable.drawData;
  22990. let temp;
  22991. let img;
  22992. let txt;
  22993. for (const key in data) {
  22994. temp = data[key];
  22995. img = this.ui.myNode.rotNode["img" + key];
  22996. txt = this.ui.myNode.rotNode["txt" + key];
  22997. img.url = xGame.common.getGameIconUrl(temp.icon);
  22998. txt.visible = true;
  22999. if (temp.award > 2) {
  23000. img.rotation = 0;
  23001. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  23002. }
  23003. else {
  23004. img.rotation = temp.rotation;
  23005. txt.text = temp.num;
  23006. }
  23007. }
  23008. }
  23009. getCurkey() {
  23010. let rand = Math.random() * this.allWeight;
  23011. let temp;
  23012. for (let index = 0; index < this.drawObj.length - 1; index++) {
  23013. temp = this.drawObj[index];
  23014. if (index == 0) {
  23015. if (rand < temp) {
  23016. return index + 1;
  23017. }
  23018. }
  23019. else {
  23020. if (rand >= temp && rand < this.drawObj[index + 1]) {
  23021. return index + 1;
  23022. }
  23023. }
  23024. }
  23025. return 2;
  23026. }
  23027. startDraw() {
  23028. console.log('zh:开始抽奖');
  23029. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  23030. if (freeTimes > 0) {
  23031. console.log('zh:freeTimes=' + freeTimes);
  23032. this.beginDraw();
  23033. DataMgr.setDailyfreeDrawTimes(0);
  23034. this.checkFree();
  23035. }
  23036. else {
  23037. if (Laya.Browser.onAndroid) {
  23038. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23039. if (!boo) {
  23040. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23041. return;
  23042. }
  23043. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  23044. }
  23045. else {
  23046. console.log('zh:AD 失败,直接发放奖励');
  23047. this.qjff_chouJiang();
  23048. }
  23049. }
  23050. else {
  23051. this.qjff_chouJiang();
  23052. }
  23053. }
  23054. }
  23055. qjff_chouJiang() {
  23056. this.beginDraw();
  23057. }
  23058. beginDraw() {
  23059. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  23060. this.ui.drawBtn.touchable = false;
  23061. this.curKey = this.getCurkey();
  23062. console.log("zh:当前key", this.curKey);
  23063. let cell = 60;
  23064. let lap = 3;
  23065. let angle = cell * (this.curKey - 1) + lap * 360;
  23066. let target = this.ui.myNode.rotNode;
  23067. target.rotation = 0;
  23068. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  23069. console.log("zh:旋转完成");
  23070. this.ui.drawBtn.touchable = true;
  23071. this.getAward();
  23072. }));
  23073. }
  23074. getAward() {
  23075. let data = cfgTable.drawData[this.curKey];
  23076. let temp = new AwardType();
  23077. temp.type = data.award;
  23078. temp.num = data.num;
  23079. xGame.common.getAward([temp], () => {
  23080. DataMgr.setDrawTimes(1);
  23081. this.updateDraw();
  23082. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  23083. });
  23084. }
  23085. updateDraw() {
  23086. let drawTimes = DataMgr.getDrawTimes();
  23087. let awardTimes = DataMgr.getDrawAwardTimes();
  23088. if (Math.floor(drawTimes / 3) > awardTimes) {
  23089. this.ui.extraNode.boxBtn.t0.play(null, -1);
  23090. this.ui.extraNode.boxBtn.touchable = true;
  23091. this.ui.extraNode.tipsTxt.text = "3/3";
  23092. this.ui.extraNode.barNode.width = 265;
  23093. this.getExtraAward();
  23094. }
  23095. else {
  23096. this.ui.extraNode.boxBtn.t0.stop();
  23097. this.ui.extraNode.boxBtn.touchable = false;
  23098. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  23099. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  23100. }
  23101. let data = cfgTable.drawData[1];
  23102. if (awardTimes == 0) {
  23103. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  23104. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  23105. this.ui.myNode.rotNode.img1.rotation = 0;
  23106. }
  23107. else {
  23108. let award = data.nextid;
  23109. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  23110. this.ui.myNode.rotNode.txt1.text = award[1];
  23111. this.ui.myNode.rotNode.img1.rotation = 0;
  23112. }
  23113. }
  23114. getExtraAward() {
  23115. let drawTimes = DataMgr.getDrawTimes();
  23116. let awardTimes = DataMgr.getDrawAwardTimes();
  23117. let data = cfgTable.drawData[1];
  23118. let award = new AwardType();
  23119. if (awardTimes == 0) {
  23120. award.num = data.num;
  23121. award.type = data.award;
  23122. xGame.common.getAward([award], () => {
  23123. let all = Math.floor(drawTimes / 3);
  23124. DataMgr.setDrawAwardTimes(all);
  23125. this.updateDraw();
  23126. });
  23127. }
  23128. else {
  23129. award.num = parseInt(data.nextid[1]);
  23130. award.type = parseInt(data.nextid[0]);
  23131. xGame.common.getAward([award], () => {
  23132. let all = Math.floor(drawTimes / 3);
  23133. DataMgr.setDrawAwardTimes(all);
  23134. this.updateDraw();
  23135. });
  23136. }
  23137. }
  23138. closeSelf() {
  23139. this.hide();
  23140. }
  23141. playSecretaryIdle() {
  23142. let parent = this.ui.secretary.displayObject;
  23143. parent.destroyChildren();
  23144. let xx = this.ui.secretary.width / 2;
  23145. let yy = this.ui.secretary.height;
  23146. let scale = xGame.common.getSecretaryScale();
  23147. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23148. xGame.common.secretary.play(data, 0, true, parent);
  23149. }
  23150. }
  23151. UIDraw$1.uiName = "UIDraw";
  23152. class UIRanking$1 extends UIBase {
  23153. constructor() {
  23154. super();
  23155. this.showSelf = true;
  23156. this.rankType = 1;
  23157. this.rankList = [];
  23158. this.topX = 10;
  23159. this.myIndex = this.topX + 1;
  23160. this.myStar = 0;
  23161. }
  23162. onConstructor() {
  23163. this.ui = ui_UIRanking.createInstance();
  23164. this.contentPane = this.ui;
  23165. this.isEject = false;
  23166. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  23167. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  23168. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  23169. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  23170. this.ui.myNode.myList.setVirtual();
  23171. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  23172. }
  23173. show() {
  23174. super.show();
  23175. this.getPaiHangBangDataFormJosnFile();
  23176. this.updateSelf();
  23177. let self = Moyu.getUserInfo();
  23178. if (!self.isAuth) {
  23179. Moyu.initUser(this, () => {
  23180. DataMgr.upRankData();
  23181. });
  23182. }
  23183. this.setGlobalFont(this.ui);
  23184. }
  23185. getPaiHangBangDataFormJosnFile() {
  23186. const rankingList = cfgTable.paiHangBangData.list;
  23187. this.updateItemData(rankingList);
  23188. }
  23189. updateSelfItem() {
  23190. console.log('zh:Moyu.platType =' + Moyu.platType);
  23191. let self = Moyu.getUserInfo();
  23192. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  23193. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  23194. if (this.myIndex > this.topX) {
  23195. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  23196. }
  23197. else {
  23198. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  23199. }
  23200. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  23201. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  23202. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  23203. }
  23204. updateItemData(data) {
  23205. this.myStar = xGame.common.getAllStarNum();
  23206. if (this.rankList.length < 2) {
  23207. this.rankList = data;
  23208. let self = Moyu.getUserInfo();
  23209. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  23210. self.headIcon = self.headIcon;
  23211. for (let i = 0; i < data.length; i++) {
  23212. let data = this.rankList[i];
  23213. if (data.userId == self.userId) {
  23214. this.rankList.splice(i, 1);
  23215. break;
  23216. }
  23217. }
  23218. for (let i = 0; i < data.length; i++) {
  23219. let data = this.rankList[i];
  23220. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  23221. this.myIndex = i + 1;
  23222. let user = { headIcon: self.headIcon, nickName: "myself" };
  23223. let ud = { user: user, data: {} };
  23224. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  23225. console.log('zh:Moyu.platType = ' + Moyu.platType);
  23226. if (Moyu.platType < 11) {
  23227. user.headIcon = self.headIcon;
  23228. user.nickName = self.nickName;
  23229. }
  23230. this.rankList.splice(i, 0, md);
  23231. break;
  23232. }
  23233. }
  23234. }
  23235. this.updateSelfItem();
  23236. this.ui.myNode.myList.numItems = this.rankList.length;
  23237. }
  23238. updateItemUI(index, obj) {
  23239. let data = this.rankList[index];
  23240. let userData = JSON.parse(data.userData).user;
  23241. obj.nameTxt.text = userData.nickName.toString();
  23242. obj.valueTxt.text = data.rankScore;
  23243. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  23244. obj.rankTxt.text = index + 1;
  23245. switch (index) {
  23246. case 0:
  23247. this.setImg(obj, 1, 0, 0);
  23248. obj.rankTxt.color = "#FFC047";
  23249. break;
  23250. case 1:
  23251. this.setImg(obj, 0, 1, 0);
  23252. obj.rankTxt.color = "#ACACAC";
  23253. break;
  23254. case 2:
  23255. this.setImg(obj, 0, 0, 1);
  23256. obj.rankTxt.color = "#D09672";
  23257. break;
  23258. default:
  23259. this.setImg(obj, 0, 0, 0);
  23260. obj.rankTxt.color = "#496FAB";
  23261. break;
  23262. }
  23263. }
  23264. setImg(obj, a, b, c) {
  23265. obj.img1.visible = a ? true : false;
  23266. obj.img2.visible = b ? true : false;
  23267. obj.img3.visible = c ? true : false;
  23268. }
  23269. changeList(type) {
  23270. this.rankType = type;
  23271. this.updateSelf();
  23272. }
  23273. changeSelfNode() {
  23274. this.showSelf = !this.showSelf;
  23275. this.updateSelf();
  23276. }
  23277. updateSelf() {
  23278. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  23279. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  23280. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  23281. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  23282. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  23283. }
  23284. }
  23285. UIRanking$1.uiName = "UIRanking";
  23286. class UISecretary$1 extends UIBase {
  23287. constructor() {
  23288. super();
  23289. this.curIndex = 1;
  23290. }
  23291. onConstructor() {
  23292. this.ui = ui_UISecretary.createInstance();
  23293. this.contentPane = this.ui;
  23294. this.isEject = false;
  23295. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23296. this.nodeObj = { left: null, right: null, cur: null };
  23297. this.nodeObj.cur = this.ui.myNode.gameNode3;
  23298. }
  23299. show() {
  23300. super.show();
  23301. this.ui.t0.play();
  23302. this.updateData();
  23303. this.setGlobalFont(this.ui);
  23304. }
  23305. addSecretarySpine(node, spineName) {
  23306. if (spineName == "mishu") {
  23307. if (this.secretarySpine1) {
  23308. node.displayObject.destroyChildren();
  23309. this.playWoman(this.secretarySpine1, node.displayObject);
  23310. }
  23311. else {
  23312. let spine1 = new SpineMgr("mishu", () => {
  23313. this.secretarySpine1 = spine1;
  23314. this.playWoman(this.secretarySpine1, node.displayObject);
  23315. });
  23316. }
  23317. }
  23318. else {
  23319. if (this.secretarySpine2) {
  23320. node.displayObject.destroyChildren();
  23321. this.playWoman(this.secretarySpine2, node.displayObject);
  23322. }
  23323. else {
  23324. let spine2 = new SpineMgr("xiaomishu2", () => {
  23325. this.secretarySpine2 = spine2;
  23326. this.playWoman(this.secretarySpine2, node.displayObject);
  23327. });
  23328. }
  23329. }
  23330. }
  23331. playWoman(node, parent) {
  23332. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  23333. let yy = this.ui.myNode.gameNode3.secretary.height;
  23334. let scale = 1.5;
  23335. if (node == this.secretarySpine2) {
  23336. scale = 1.2;
  23337. }
  23338. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23339. node.play(data, 0, true, parent);
  23340. }
  23341. turnLeft() {
  23342. this.curIndex--;
  23343. if (this.curIndex < 1) {
  23344. this.curIndex = 2;
  23345. }
  23346. let left = this.nodeObj.left;
  23347. let right = this.nodeObj.right;
  23348. let cur = this.nodeObj.cur;
  23349. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  23350. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  23351. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  23352. this.updateData();
  23353. }));
  23354. this.ui.myNode.setChildIndex(right, 2);
  23355. this.nodeObj.left = cur;
  23356. this.nodeObj.right = left;
  23357. this.nodeObj.cur = right;
  23358. }
  23359. turnRight() {
  23360. this.curIndex++;
  23361. if (this.curIndex > 2) {
  23362. this.curIndex = 1;
  23363. }
  23364. let left = this.nodeObj.left;
  23365. let right = this.nodeObj.right;
  23366. let cur = this.nodeObj.cur;
  23367. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  23368. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  23369. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  23370. this.updateData();
  23371. }));
  23372. this.ui.myNode.setChildIndex(left, 2);
  23373. this.nodeObj.left = right;
  23374. this.nodeObj.right = cur;
  23375. this.nodeObj.cur = left;
  23376. }
  23377. updateData() {
  23378. console.log('zh: updateData FFFFFFFFFF');
  23379. let data = cfgTable.secretaryshopData;
  23380. let children = this.ui.myNode._children;
  23381. let temp;
  23382. let curData;
  23383. for (let index = 0; index < children.length; index++) {
  23384. temp = children[index];
  23385. curData = data[1];
  23386. temp.heightTxt.text = curData.height;
  23387. temp.foodTxt.text = curData.food;
  23388. temp.historyTxt.text = curData.history;
  23389. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  23390. this.addSecretarySpine(temp.secretary, curData.spine);
  23391. let womanIndex = curData.id - 1;
  23392. let getWoman = DataMgr.getSecretary(womanIndex);
  23393. let curUse = DataMgr.getCurSecretary();
  23394. if (getWoman) {
  23395. if (curUse == womanIndex) {
  23396. temp.purchaseBtn.c1.selectedIndex = 1;
  23397. }
  23398. else {
  23399. temp.purchaseBtn.c1.selectedIndex = 2;
  23400. }
  23401. }
  23402. else {
  23403. temp.purchaseBtn.c1.selectedIndex = 0;
  23404. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  23405. }
  23406. temp.purchaseBtn.visible = false;
  23407. }
  23408. }
  23409. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  23410. console.log('zh: 点击了clickSecretary ');
  23411. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23412. if (getWoman) {
  23413. if (curUse != womanIndex) {
  23414. console.log();
  23415. DataMgr.setCurSecretary(womanIndex);
  23416. this.updateData();
  23417. }
  23418. }
  23419. else {
  23420. console.log('zh:点击购买了');
  23421. let need = needDiamond;
  23422. if (DataMgr.diamondEnough(need)) {
  23423. DataMgr.setDiamond(-need);
  23424. DataMgr.setSecretary(womanIndex, 1);
  23425. DataMgr.setCurSecretary(womanIndex);
  23426. this.updateData();
  23427. }
  23428. else {
  23429. xGame.uiMgr.Show(UIAddProp$1, 1);
  23430. }
  23431. }
  23432. }
  23433. closeSelf() {
  23434. this.hide();
  23435. }
  23436. }
  23437. UISecretary$1.uiName = "UISecretary";
  23438. class BallRodDisplay$1 {
  23439. constructor(ui, index) {
  23440. this.index = 0;
  23441. this.uiIndex = 0;
  23442. this.ui = ui;
  23443. this.index = index;
  23444. this.initData();
  23445. }
  23446. initData() {
  23447. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  23448. let data = cfgTable.ballrodData[this.index + 1];
  23449. this.ui.nameTxt.text = data.name;
  23450. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  23451. this.ui.levelNode.c1.selectedIndex = data.quality;
  23452. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  23453. if (data.spine) {
  23454. this.mySpine = new SpineMgr(data.spine, () => {
  23455. let xx = 150;
  23456. let yy = 70;
  23457. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  23458. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  23459. });
  23460. }
  23461. }
  23462. updateSelf() {
  23463. let get = DataMgr.getBallRod(this.index);
  23464. if (get == null)
  23465. get = 1;
  23466. let curUse = DataMgr.getCurBallRod();
  23467. if (get) {
  23468. if (curUse == this.index) {
  23469. this.ui.purchaseBtn.c1.selectedIndex = 0;
  23470. }
  23471. else {
  23472. this.ui.purchaseBtn.c1.selectedIndex = 1;
  23473. }
  23474. }
  23475. else {
  23476. this.ui.purchaseBtn.c1.selectedIndex = 2;
  23477. }
  23478. }
  23479. buyBallRod() {
  23480. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23481. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  23482. switch (selectedIndex) {
  23483. case 0:
  23484. break;
  23485. case 1:
  23486. console.log('zh:点击了 USE THIS');
  23487. DataMgr.setCurBallRod(this.index);
  23488. let curUse = DataMgr.getCurBallRod();
  23489. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  23490. let ui = xGame.uiMgr.getUI(UIShop$1);
  23491. ui.updateBallRod();
  23492. break;
  23493. case 2:
  23494. let data = cfgTable.ballrodData[this.index + 1];
  23495. let need = data.price;
  23496. if (DataMgr.diamondEnough(need)) {
  23497. this.buyQiuGan(data);
  23498. DataMgr.setDiamond(-need);
  23499. DataMgr.setBallRod(this.index, 1);
  23500. DataMgr.setCurBallRod(this.index);
  23501. let ui = xGame.uiMgr.getUI(UIShop$1);
  23502. ui.updateBallRod();
  23503. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  23504. }
  23505. else {
  23506. xGame.uiMgr.Show(UIAddProp$1, 1);
  23507. }
  23508. break;
  23509. default:
  23510. break;
  23511. }
  23512. }
  23513. buyQiuGan(qgItem) {
  23514. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  23515. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23516. if (userInfo == null) {
  23517. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23518. return;
  23519. }
  23520. let reqData = xGame.httpMgr.getReqData();
  23521. let pd = JSON.parse(reqData);
  23522. pd.qiuGanData = qgItem;
  23523. reqData = JSON.stringify(pd);
  23524. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  23525. try {
  23526. console.log('zh:buySp res = ' + JSON.stringify(res));
  23527. let code = res.code;
  23528. let msg = res.msg;
  23529. if (code == 401) {
  23530. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23531. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.loginTimeOut);
  23532. return;
  23533. }
  23534. if (code == 200) {
  23535. xGame.uiMgr.Show(UIMsg$1, msg);
  23536. DataMgr.getUserZiChanInfo(false);
  23537. }
  23538. else {
  23539. xGame.uiMgr.Show(UIMsg$1, msg);
  23540. }
  23541. }
  23542. catch (error) {
  23543. console.log('error=' + error);
  23544. alert(error);
  23545. }
  23546. finally {
  23547. }
  23548. });
  23549. }
  23550. logEventForGouMaiGan(qiuGanName) {
  23551. const ev = {
  23552. value: qiuGanName
  23553. };
  23554. const jsonStr = JSON.stringify(ev);
  23555. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  23556. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  23557. }
  23558. }
  23559. class DaoJuDisplay$1 {
  23560. constructor(ui, index) {
  23561. this.index = 0;
  23562. this.uiIndex = 0;
  23563. this.ggSpid = "";
  23564. this.spid = 0;
  23565. this.ui = ui;
  23566. this.index = index;
  23567. this.initData();
  23568. }
  23569. initData() {
  23570. this.ui.btn_buy.onClick(this, this.gotoBuy);
  23571. let data = cfgTable.daoJuData[this.index + 1];
  23572. this.ui.nameTxt.text = data.spbt;
  23573. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  23574. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  23575. this.ggSpid = data.ggSpid;
  23576. this.spid = data.spid;
  23577. let baseUrl = "asset/sound/ogg/";
  23578. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  23579. }
  23580. gotoBuy() {
  23581. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23582. if (userInfo != null) {
  23583. let token = userInfo.token;
  23584. let ggSpid = this.ggSpid;
  23585. let spid = this.spid;
  23586. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  23587. console.log('zh:gotoBuy1 spid =' + spid);
  23588. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  23589. return;
  23590. }
  23591. else {
  23592. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23593. }
  23594. }
  23595. gotoBuy1() {
  23596. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23597. let djItem = cfgTable.daoJuData[this.index + 1];
  23598. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  23599. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23600. if (userInfo == null) {
  23601. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23602. return;
  23603. }
  23604. let reqData = xGame.httpMgr.getReqData();
  23605. let pd = JSON.parse(reqData);
  23606. pd.spItem = djItem;
  23607. reqData = JSON.stringify(pd);
  23608. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  23609. try {
  23610. console.log('zh:buySp res = ' + JSON.stringify(res));
  23611. let code = res.code;
  23612. let msg = res.msg;
  23613. if (code == 401) {
  23614. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23615. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23616. return;
  23617. }
  23618. if (code == 200) {
  23619. xGame.uiMgr.Show(UIMsg$1, msg);
  23620. DataMgr.getUserZiChanInfo(false);
  23621. }
  23622. else {
  23623. xGame.uiMgr.Show(UIMsg$1, msg);
  23624. }
  23625. }
  23626. catch (error) {
  23627. console.log('error=' + error);
  23628. alert(error);
  23629. }
  23630. finally {
  23631. }
  23632. });
  23633. }
  23634. }
  23635. class UIShop$1 extends UIBase {
  23636. constructor() {
  23637. super();
  23638. this.itemNums = 0;
  23639. this.itemNumsForDj = 0;
  23640. this.curType = "";
  23641. }
  23642. onConstructor() {
  23643. this.ui = ui_UIShop.createInstance();
  23644. this.contentPane = this.ui;
  23645. this.isEject = false;
  23646. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23647. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23648. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  23649. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  23650. this.addUIClick(this.ui, this.interuptSecretary);
  23651. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  23652. this.ballRodArr = [];
  23653. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  23654. this.ui.myNode.myList.numItems = this.itemNums;
  23655. this.loadDjdata_old();
  23656. }
  23657. loadDjdata_old() {
  23658. let fff = cfgTable.daoJuData;
  23659. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  23660. this.daoJuArr = [];
  23661. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  23662. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  23663. }
  23664. getProductList() {
  23665. let reqData = xGame.httpMgr.getReqData();
  23666. let pd = JSON.parse(reqData);
  23667. pd.splx = "Consumable";
  23668. reqData = JSON.stringify(pd);
  23669. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  23670. try {
  23671. let code = res.code;
  23672. let msg = res.msg;
  23673. if (code == 401) {
  23674. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23675. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  23676. return;
  23677. }
  23678. if (code == 200) {
  23679. let data = res.data;
  23680. for (let index = 0; index < data.length; index++) {
  23681. let element = data[index];
  23682. cfgTable.daoJuData[element.spid] = element;
  23683. }
  23684. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  23685. }
  23686. else {
  23687. xGame.uiMgr.Show(UIMsg, msg);
  23688. }
  23689. }
  23690. catch (error) {
  23691. console.log('error=' + error);
  23692. alert(error);
  23693. }
  23694. finally {
  23695. }
  23696. });
  23697. }
  23698. show(type) {
  23699. super.show();
  23700. this.curType = type == 0 ? "qiugan" : "daoju";
  23701. this.switchBtn("");
  23702. this.playSecretaryIdle();
  23703. this.updateBallRod();
  23704. this.setGlobalFont(this.ui);
  23705. }
  23706. test123() {
  23707. console.log('zh:test123 ');
  23708. }
  23709. switchBtn(type) {
  23710. console.log('zh:1111切換 sel type=' + type);
  23711. if (type == "") {
  23712. type = this.curType;
  23713. }
  23714. else {
  23715. if (this.curType == type) {
  23716. return;
  23717. }
  23718. else {
  23719. this.curType = type;
  23720. }
  23721. }
  23722. if (type == "qiugan") {
  23723. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  23724. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  23725. this.ui.myNode.c1.selectedIndex = 0;
  23726. this.ui.myNode.myList.visible = true;
  23727. this.ui.myNode.djList.visible = false;
  23728. }
  23729. else {
  23730. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  23731. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  23732. this.ui.myNode.c1.selectedIndex = 1;
  23733. this.ui.myNode.myList.visible = false;
  23734. this.ui.myNode.djList.visible = true;
  23735. }
  23736. }
  23737. updateBallRod() {
  23738. for (let index = 0; index < this.ballRodArr.length; index++) {
  23739. this.ballRodArr[index].updateSelf();
  23740. }
  23741. }
  23742. renderBallRod(sort, obj) {
  23743. let index = this.getIndexBySort(sort + 1) - 1;
  23744. let ballRod = new BallRodDisplay$1(obj, index);
  23745. this.ballRodArr.push(ballRod);
  23746. }
  23747. renderDaoJu(idx, obj) {
  23748. let index = this.getIndexBySortForDj(idx + 1) - 1;
  23749. let b = new DaoJuDisplay$1(obj, index);
  23750. this.daoJuArr.push(b);
  23751. }
  23752. getIndexBySort(sort) {
  23753. let object = cfgTable.ballrodData;
  23754. for (const key in object) {
  23755. if (object[key].sort == sort) {
  23756. return parseInt(key);
  23757. }
  23758. }
  23759. }
  23760. getIndexBySortForDj(idx) {
  23761. let object = cfgTable.daoJuData;
  23762. for (const key in object) {
  23763. if (object[key].idx == idx) {
  23764. return parseInt(key);
  23765. }
  23766. }
  23767. }
  23768. playSecretaryIdle() {
  23769. let parent = this.ui.secretary.displayObject;
  23770. parent.destroyChildren();
  23771. let xx = this.ui.secretary.width / 2;
  23772. let yy = this.ui.secretary.height;
  23773. let scale = xGame.common.getSecretaryScale();
  23774. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23775. xGame.common.secretary.play(data, 0, true, parent);
  23776. }
  23777. interuptSecretary() {
  23778. Laya.timer.clearAll(this);
  23779. this.playSecretaryRandomSound();
  23780. }
  23781. playSecretaryRandomSound() {
  23782. if (this.isHide)
  23783. return;
  23784. let time = xGame.common.randomNum(45000, 60000);
  23785. Laya.timer.once(time, this, () => {
  23786. if (this.isHide)
  23787. return;
  23788. let index = xGame.common.randomNum(4, 7);
  23789. xGame.soundMgr.playSound("s_main0" + index);
  23790. let words = 1;
  23791. switch (index) {
  23792. case 4:
  23793. words = 5;
  23794. break;
  23795. case 5:
  23796. words = 3;
  23797. break;
  23798. case 6:
  23799. words = 6;
  23800. break;
  23801. case 7:
  23802. words = 7;
  23803. break;
  23804. default:
  23805. break;
  23806. }
  23807. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23808. this.playSecretaryRandomSound();
  23809. });
  23810. }
  23811. closeSelf() {
  23812. this.hide();
  23813. }
  23814. }
  23815. UIShop$1.uiName = "UIShop";
  23816. class SignMax$1 {
  23817. constructor(ui) {
  23818. this.ui = ui;
  23819. }
  23820. updateSelf(index, sameDay, curDayIndex) {
  23821. let data = cfgTable.signData[index + 1];
  23822. this.ui.titleTxt.text = data.title;
  23823. let arr1 = data.award[0].split('-');
  23824. let arr2 = data.award[1].split('-');
  23825. let num1 = parseInt(arr1[1]);
  23826. let num2 = parseInt(arr2[1]);
  23827. this.ui.numTxt1.text = num1 + "";
  23828. this.ui.numTxt2.text = num2 + "";
  23829. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23830. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23831. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23832. this.ui.numTxt1.visible = false;
  23833. }
  23834. else {
  23835. this.ui.numTxt1.visible = true;
  23836. }
  23837. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23838. this.ui.numTxt2.visible = false;
  23839. }
  23840. else {
  23841. this.ui.numTxt2.visible = true;
  23842. }
  23843. if (index < curDayIndex) {
  23844. this.ui.c1.selectedIndex = 1;
  23845. }
  23846. else if (index == curDayIndex) {
  23847. if (sameDay) {
  23848. this.ui.c1.selectedIndex = 2;
  23849. }
  23850. else {
  23851. this.ui.c1.selectedIndex = 2;
  23852. }
  23853. }
  23854. else {
  23855. this.ui.c1.selectedIndex = 0;
  23856. }
  23857. }
  23858. }
  23859. class SignNormal$1 {
  23860. constructor(ui) {
  23861. this.ui = ui;
  23862. }
  23863. updateSelf(index, sameDay, curDayIndex) {
  23864. let data = cfgTable.signData[index + 1];
  23865. this.ui.titleTxt.text = data.title;
  23866. let arr = data.award[0].split('-');
  23867. let type = parseInt(arr[0]);
  23868. let num = parseInt(arr[1]);
  23869. this.ui.numTxt.text = num + "";
  23870. if (type > 2) {
  23871. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23872. this.ui.myIcon.rotation = 0;
  23873. }
  23874. else {
  23875. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23876. this.ui.myIcon.rotation = 0;
  23877. }
  23878. if (xGame.common.signAwardContainsRod(data.award)) {
  23879. this.ui.numTxt.visible = false;
  23880. }
  23881. else {
  23882. this.ui.numTxt.visible = true;
  23883. }
  23884. if (index < curDayIndex) {
  23885. this.ui.c1.selectedIndex = 1;
  23886. }
  23887. else if (index == curDayIndex) {
  23888. if (sameDay) {
  23889. this.ui.c1.selectedIndex = 2;
  23890. }
  23891. else {
  23892. this.ui.c1.selectedIndex = 2;
  23893. }
  23894. }
  23895. else {
  23896. this.ui.c1.selectedIndex = 0;
  23897. }
  23898. }
  23899. }
  23900. class UISign$1 extends UIBase {
  23901. constructor() {
  23902. super();
  23903. this.curDayIndex = 0;
  23904. this.starX = 0;
  23905. }
  23906. onConstructor() {
  23907. this.ui = ui_UISign.createInstance();
  23908. this.contentPane = this.ui;
  23909. this.isEject = false;
  23910. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23911. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23912. this.initSignItem();
  23913. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23914. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23915. }
  23916. show() {
  23917. super.show();
  23918. this.ui.t0.play();
  23919. this.playSecretaryIdle();
  23920. this.updateSign();
  23921. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23922. this.setGlobalFont(this.ui);
  23923. }
  23924. initSignItem() {
  23925. this.signArr = [];
  23926. for (let index = 0; index < 6; index++) {
  23927. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23928. this.signArr.push(temp);
  23929. }
  23930. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23931. if (Moyu.isKs)
  23932. this.ui.closeNode.closeBtn.x += 100;
  23933. }
  23934. updateSign() {
  23935. let sameDay = xGame.common.judgeSameDay();
  23936. let max = 7;
  23937. this.curDayIndex = DataMgr.getSignData();
  23938. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23939. this.curDayIndex = 0;
  23940. if (!sameDay) {
  23941. this.ui.normalBtn.visible = true;
  23942. this.ui.tipsNode.visible = false;
  23943. this.ui.againBtn.visible = false;
  23944. }
  23945. else {
  23946. this.ui.normalBtn.visible = false;
  23947. let again = DataMgr.getExtraSign();
  23948. let isCurrency = false;
  23949. let index = this.curDayIndex;
  23950. if (index == 0)
  23951. index = 7;
  23952. let award = cfgTable.signData[index].award;
  23953. let num = award[0].split("-")[0];
  23954. if (num == "1" || num == "2")
  23955. isCurrency = true;
  23956. let showAgain = again == 0 && isCurrency;
  23957. this.ui.againBtn.visible = showAgain;
  23958. this.ui.tipsNode.visible = !showAgain;
  23959. }
  23960. for (let index = 0; index < this.signArr.length; index++) {
  23961. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23962. }
  23963. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23964. }
  23965. playSecretaryIdle() {
  23966. let parent = this.ui.secretary.displayObject;
  23967. parent.destroyChildren();
  23968. let xx = this.ui.secretary.width / 2;
  23969. let yy = this.ui.secretary.height;
  23970. let scale = xGame.common.getSecretaryScale();
  23971. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23972. xGame.common.secretary.play(data, 0, true, parent);
  23973. }
  23974. closeSelf() {
  23975. this.hide();
  23976. }
  23977. normalGetAward() {
  23978. let sameDay = xGame.common.judgeSameDay();
  23979. if (!sameDay) {
  23980. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23981. let temp;
  23982. let type;
  23983. let num;
  23984. let arr = [];
  23985. for (let index = 0; index < award.length; index++) {
  23986. temp = award[index].split("-");
  23987. type = parseInt(temp[0]);
  23988. num = parseInt(temp[1]);
  23989. let awardType = new AwardType();
  23990. awardType.num = num;
  23991. awardType.type = type;
  23992. arr.push(awardType);
  23993. }
  23994. xGame.common.getAward(arr, (watchVideo) => {
  23995. this.curDayIndex++;
  23996. if (this.curDayIndex > 7)
  23997. this.curDayIndex = 0;
  23998. DataMgr.setSignData(this.curDayIndex);
  23999. this.updateSignData2Server(this.curDayIndex);
  24000. DataMgr.setSignTime(new Date().getTime());
  24001. if (watchVideo) {
  24002. DataMgr.setExtraSign(1);
  24003. Moyu.sendDataEvent("signIn1");
  24004. }
  24005. this.updateSign();
  24006. });
  24007. }
  24008. }
  24009. againGetAward() {
  24010. Moyu.sendDataEvent("signIn2");
  24011. console.log('zh:qjff_AD_for_uisign');
  24012. if (Laya.Browser.onAndroid) {
  24013. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24014. if (!boo) {
  24015. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24016. return;
  24017. }
  24018. }
  24019. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  24020. }
  24021. else {
  24022. console.log('zh:AD 失败,直接发放奖励');
  24023. this.qjff_AD_for_uisign();
  24024. }
  24025. }
  24026. qjff_AD_for_uisign() {
  24027. let index = this.curDayIndex;
  24028. if (index == 0)
  24029. index = 7;
  24030. let award = cfgTable.signData[index].award;
  24031. let temp;
  24032. let type;
  24033. let num;
  24034. for (let index = 0; index < award.length; index++) {
  24035. temp = award[index].split("-");
  24036. type = parseInt(temp[0]);
  24037. num = parseInt(temp[1]) * 3;
  24038. xGame.common.playObjFlyAnim(num, type);
  24039. }
  24040. DataMgr.setExtraSign(1);
  24041. this.updateSign();
  24042. }
  24043. updateSignData2Server(day) {
  24044. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24045. if (userInfo == null) {
  24046. return;
  24047. }
  24048. let reqData = xGame.httpMgr.getReqData();
  24049. let pd = JSON.parse(reqData);
  24050. pd.signData = day;
  24051. reqData = JSON.stringify(pd);
  24052. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  24053. try {
  24054. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  24055. let code = res.code;
  24056. let msg = res.msg;
  24057. if (code == 401) {
  24058. Laya.LocalStorage.removeItem(keyForLoginInfo);
  24059. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24060. return;
  24061. }
  24062. if (code == 200) {
  24063. let data = res.data;
  24064. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  24065. }
  24066. else {
  24067. xGame.uiMgr.Show(UIMsg$1, msg);
  24068. }
  24069. }
  24070. catch (error) {
  24071. console.log('error=' + error);
  24072. alert(error);
  24073. }
  24074. finally {
  24075. }
  24076. });
  24077. }
  24078. }
  24079. UISign$1.uiName = "UISign";
  24080. class UIModeSelection$1 extends UIBase {
  24081. constructor() {
  24082. super();
  24083. }
  24084. onConstructor() {
  24085. this.ui = ui_UIModeSelection.createInstance();
  24086. this.contentPane = this.ui;
  24087. this.isEject = false;
  24088. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  24089. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  24090. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  24091. this.addUIClick(this.ui.closeBtn, this.hide);
  24092. this.peopleArr = [65, 990, 580];
  24093. this.peopleOffest = [5, 10, 10];
  24094. }
  24095. show(callback) {
  24096. this.updateSelf();
  24097. super.show();
  24098. this.ui.t0.play();
  24099. this.callback = callback;
  24100. this.setGlobalFont(this.ui);
  24101. }
  24102. updateSelf() {
  24103. let cfg = cfgTable.modeselectData;
  24104. for (let index = 1; index <= 3; index++) {
  24105. let node = this.ui.myNode["type" + index];
  24106. node.need.text = cfg[index].need;
  24107. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  24108. node.peopleTxt.text = this.getRandPeople(index - 1);
  24109. }
  24110. }
  24111. enterGame(type) {
  24112. console.log('zh: 进入经典模式 type: ' + type);
  24113. xGame.common.classicRoomType = type;
  24114. let cfg = cfgTable.modeselectData[type];
  24115. let need = cfg.need;
  24116. xGame.common.passAwardCoin = cfg.award;
  24117. if (DataMgr.coinEnough(need)) {
  24118. DataMgr.setCoin(-need);
  24119. this.ui.myNode["type" + type].t0.play();
  24120. Laya.timer.once(200, this, () => {
  24121. this.callback && this.callback();
  24122. });
  24123. this.logEventForClassic_start();
  24124. }
  24125. else {
  24126. Moyu.sendDataEvent("AddCoinVideo");
  24127. xGame.uiMgr.Show(UIAddProp$1, 0);
  24128. }
  24129. }
  24130. getRandPeople(index) {
  24131. let rand = this.peopleOffest[index];
  24132. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  24133. }
  24134. logEventForClassic_start() {
  24135. let rtype = xGame.common.classicRoomType;
  24136. let msmc = '';
  24137. if (rtype == 1) {
  24138. msmc = 'beginner';
  24139. }
  24140. if (rtype == 2) {
  24141. msmc = 'expert';
  24142. }
  24143. if (rtype == 3) {
  24144. msmc = 'master';
  24145. }
  24146. let keyStr = 'sjmd_classic_start_' + rtype;
  24147. let jsonStr = {
  24148. "difficulty": msmc,
  24149. "classic_count": 1,
  24150. "difficulty_count": 1
  24151. };
  24152. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24153. const d = LocalStorageManager.getItem(keyStr);
  24154. jsonStr.classic_count = d.classic_count + 1;
  24155. jsonStr.difficulty_count = d.difficulty_count + 1;
  24156. LocalStorageManager.setItem(keyStr, jsonStr);
  24157. }
  24158. else {
  24159. LocalStorageManager.setItem(keyStr, jsonStr);
  24160. }
  24161. const reqStr = JSON.stringify(jsonStr);
  24162. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  24163. }
  24164. }
  24165. UIModeSelection$1.uiName = "UIModeSelection";
  24166. class UILogin$1 extends UIBase {
  24167. constructor() {
  24168. super();
  24169. this.fontStr = 'big-john-woff2-2';
  24170. try {
  24171. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  24172. console.log("zh: constructor加载arial字体成功");
  24173. }
  24174. catch (error) {
  24175. console.log("zh: constructor加载arial字体失败");
  24176. }
  24177. }
  24178. onFontLoaded() {
  24179. try {
  24180. Laya.Text.defaultFont = this.fontStr;
  24181. this.ui.txt_ua.font = this.fontStr;
  24182. this.ui.txt_up.font = this.fontStr;
  24183. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  24184. }
  24185. catch (error) {
  24186. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  24187. }
  24188. }
  24189. onConstructor() {
  24190. this.ui = ui_UILogin.createInstance();
  24191. this.contentPane = this.ui;
  24192. this.isEject = false;
  24193. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  24194. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  24195. this.addUIClick(this.ui.btn_login, this.userLogin);
  24196. }
  24197. show() {
  24198. super.show();
  24199. this.x = (Laya.stage.width - this.width) / 2;
  24200. this.y = (Laya.stage.height - this.height) / 2;
  24201. this.onFontLoaded();
  24202. }
  24203. closeSelf() {
  24204. this.hide();
  24205. }
  24206. userLogin() {
  24207. let ua = this.ui.txt_ua.text;
  24208. let up = this.ui.txt_up.text;
  24209. console.log('zh:ua font' + this.ui.txt_ua.font);
  24210. if (ua && up) {
  24211. let reqData = JSON.stringify({
  24212. username: ua.trim(),
  24213. password: up.trim(),
  24214. fromMark: 'app_game'
  24215. });
  24216. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  24217. try {
  24218. console.log('zh:res = ' + JSON.stringify(res));
  24219. let code = res.code;
  24220. let msg = res.msg;
  24221. if (code == 200) {
  24222. let keyStr = keyForLoginInfo;
  24223. let jsonStr = {
  24224. "username": res.username,
  24225. "token": res.token,
  24226. "buySpids": { 1: false, 7: false }
  24227. };
  24228. LocalStorageManager.setItem(keyStr, jsonStr);
  24229. let myu = Moyu.getUserInfo();
  24230. console.log('zh:myu = ' + JSON.stringify(myu));
  24231. DataMgr.updateUserNickName(res.username);
  24232. Moyu.updateUserInfo(res.username);
  24233. xGame.uiMgr.Show(UIMsg$1, msg);
  24234. DataMgr.loadUserSpOrderForAd();
  24235. DataMgr.getUserZiChanInfo(false);
  24236. xGame.eventMgr.event(LOGIN_IN);
  24237. this.closeSelf();
  24238. }
  24239. else {
  24240. xGame.uiMgr.Show(UIMsg$1, msg);
  24241. }
  24242. }
  24243. catch (error) {
  24244. console.log('error=' + error);
  24245. alert(error);
  24246. }
  24247. finally {
  24248. }
  24249. });
  24250. }
  24251. else {
  24252. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  24253. }
  24254. }
  24255. gotoRegPage() {
  24256. this.closeSelf();
  24257. xGame.uiMgr.Show(UIReg$1);
  24258. }
  24259. }
  24260. UILogin$1.uiName = "UILogin";
  24261. class UIReg$1 extends UIBase {
  24262. constructor() {
  24263. super();
  24264. this.fontStr = 'big-john-woff2-2';
  24265. try {
  24266. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  24267. console.log("zh: constructor加载arial字体成功");
  24268. }
  24269. catch (error) {
  24270. console.log("zh: constructor加载arial字体失败");
  24271. }
  24272. }
  24273. onFontLoaded() {
  24274. try {
  24275. Laya.Text.defaultFont = this.fontStr;
  24276. this.ui.txt_ua.font = this.fontStr;
  24277. this.ui.txt_up1.font = this.fontStr;
  24278. this.ui.txt_up2.font = this.fontStr;
  24279. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  24280. }
  24281. catch (error) {
  24282. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  24283. }
  24284. }
  24285. onConstructor() {
  24286. this.ui = ui_UIReg.createInstance();
  24287. this.contentPane = this.ui;
  24288. this.isEject = false;
  24289. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  24290. this.addUIClick(this.ui.btn_reg, this.regUser);
  24291. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  24292. }
  24293. show() {
  24294. super.show();
  24295. this.x = (Laya.stage.width - this.width) / 2;
  24296. this.y = (Laya.stage.height - this.height) / 2;
  24297. this.onFontLoaded();
  24298. }
  24299. closeSelf() {
  24300. this.hide();
  24301. }
  24302. regUser() {
  24303. this.ui.lab_tip.visible = false;
  24304. let ua = this.ui.txt_ua.text;
  24305. let up1 = this.ui.txt_up1.text;
  24306. let up2 = this.ui.txt_up2.text;
  24307. if (ua && up1 && up2 && up1 == up2) {
  24308. let reqData = JSON.stringify({
  24309. username: ua.trim(),
  24310. password: up1.trim(),
  24311. fromMark: 'app_game'
  24312. });
  24313. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  24314. try {
  24315. console.log('zh:res = ' + JSON.stringify(res));
  24316. let code = res.code;
  24317. let msg = res.msg;
  24318. xGame.uiMgr.Show(UIMsg$1, msg);
  24319. if (code == 200) {
  24320. this.ui.lab_tip.color = "#FFFFFF";
  24321. xGame.uiMgr.Show(UIMsg$1, msg);
  24322. this.closeSelf();
  24323. }
  24324. else {
  24325. this.ui.lab_tip.color = "#FF0000";
  24326. xGame.uiMgr.Show(UIMsg$1, msg);
  24327. }
  24328. }
  24329. catch (error) {
  24330. console.log('error=' + error);
  24331. alert(error);
  24332. }
  24333. finally {
  24334. }
  24335. });
  24336. }
  24337. else {
  24338. if (up1 != up2) {
  24339. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  24340. }
  24341. else {
  24342. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  24343. }
  24344. }
  24345. }
  24346. gotoLogin() {
  24347. this.closeSelf();
  24348. xGame.uiMgr.Show(UILogin$1);
  24349. }
  24350. }
  24351. UIReg$1.uiName = "UIReg";
  24352. class UITry$1 extends UIBase {
  24353. constructor() {
  24354. super();
  24355. this.closeTime = 0;
  24356. this.closeNum = 0;
  24357. this.skillUrl = xGame.common.skillIconList;
  24358. }
  24359. onConstructor() {
  24360. this.ui = ui_UITry.createInstance();
  24361. this.contentPane = this.ui;
  24362. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  24363. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  24364. }
  24365. show() {
  24366. super.show();
  24367. this.closeNum = 0;
  24368. this.closeTime = 15;
  24369. this.ui.t0.play();
  24370. PlatMgr.showRateBanner();
  24371. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24372. Laya.timer.loop(1000, this, this.updateTime);
  24373. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  24374. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  24375. xGame.common.gameMgr.gamePause = true;
  24376. this.setGlobalFont(this.ui);
  24377. }
  24378. updateTime() {
  24379. if (this.closeTime > 1) {
  24380. this.closeTime--;
  24381. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24382. }
  24383. else
  24384. this.hide();
  24385. }
  24386. hide() {
  24387. Laya.timer.clearAll(this);
  24388. Moyu.showBannerAd(false);
  24389. super.hide();
  24390. xGame.common.gameMgr.gamePause = false;
  24391. }
  24392. onTry() {
  24393. console.log('zh:qjff_AD_for_uitry');
  24394. if (Laya.Browser.onAndroid) {
  24395. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24396. if (!boo) {
  24397. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24398. return;
  24399. }
  24400. }
  24401. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  24402. }
  24403. else {
  24404. console.log('zh:AD 失败,直接发放奖励');
  24405. this.qjff_AD_for_uitry();
  24406. }
  24407. }
  24408. qjff_AD_for_uitry() {
  24409. let select = xGame.common.curPlayerSkillType;
  24410. DataMgr.gameData.trySkill = select;
  24411. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  24412. DataMgr.saveGameData();
  24413. DataMgr.setBigSkill(select, 1);
  24414. xGame.showTip("Trial Successful");
  24415. this.hide();
  24416. }
  24417. onCancel() {
  24418. if (this.closeNum > 0) {
  24419. this.closeNum--;
  24420. if (this.closeNum < 2)
  24421. this.hide();
  24422. return;
  24423. }
  24424. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  24425. this.onTry();
  24426. }
  24427. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  24428. this.closeNum = 3;
  24429. }
  24430. else
  24431. this.hide();
  24432. }
  24433. }
  24434. UITry$1.uiName = "UITry";
  24435. class UIGetAward$1 extends UIBase {
  24436. constructor() {
  24437. super();
  24438. this.showTriple = true;
  24439. }
  24440. onConstructor() {
  24441. this.ui = ui_UIGetAward.createInstance();
  24442. this.contentPane = this.ui;
  24443. this.isEject = false;
  24444. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  24445. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  24446. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  24447. }
  24448. show(arr, showTriple, callback) {
  24449. super.show();
  24450. this.ui.t0.play();
  24451. this.ui.eftNode.visible = true;
  24452. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  24453. this.ui.eftNode.visible = false;
  24454. }), 1, 0, 0, 0.9);
  24455. this.awardArr = arr;
  24456. this.showTriple = showTriple;
  24457. this.callback = callback;
  24458. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  24459. this.ui.myList.numItems = arr.length;
  24460. xGame.soundMgr.playSound("getaward");
  24461. this.setGlobalFont(this.ui);
  24462. }
  24463. updateSelf(index, obj) {
  24464. let temp = this.awardArr[index];
  24465. let icon = this.getIcon(temp.type);
  24466. let str = icon;
  24467. if (temp.type > 2) {
  24468. str = "s" + icon;
  24469. }
  24470. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  24471. obj.myIcon.rotation = 0;
  24472. obj.numTxt.text = temp.num + "";
  24473. obj.numTxt.visible = temp.type > 2 ? false : true;
  24474. obj.nameTxt.text = this.getNameStr(temp.type);
  24475. }
  24476. renderItem(index, obj) {
  24477. this.updateSelf(index, obj);
  24478. }
  24479. tripleGetAward() {
  24480. console.log('zh:qjff_AD_for_uigetAward');
  24481. if (Laya.Browser.onAndroid) {
  24482. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24483. if (!boo) {
  24484. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24485. return;
  24486. }
  24487. }
  24488. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  24489. }
  24490. else {
  24491. console.log('zh:AD 失败,直接发放奖励');
  24492. this.qjff_AD_for_uigetAward();
  24493. }
  24494. }
  24495. qjff_AD_for_uigetAward() {
  24496. this.getAward(3);
  24497. }
  24498. normalGetAward() {
  24499. if (PlatMgr.isMisVideo())
  24500. this.tripleGetAward();
  24501. else
  24502. this.getAward();
  24503. }
  24504. getAward(times = 1) {
  24505. this.hide();
  24506. for (let index = 0; index < this.awardArr.length; index++) {
  24507. this.awardArr[index].num *= times;
  24508. }
  24509. this.callback && this.callback(times != 1);
  24510. }
  24511. getIcon(type) {
  24512. switch (type) {
  24513. case Prop.diamond:
  24514. return "ty_zs";
  24515. case Prop.coin:
  24516. return "ty_jb";
  24517. case Prop.gan1:
  24518. return "qg1";
  24519. case Prop.gan2:
  24520. return "qg2";
  24521. case Prop.gan3:
  24522. return "qg3";
  24523. case Prop.gan4:
  24524. return "qg4";
  24525. default:
  24526. break;
  24527. }
  24528. }
  24529. getNameStr(type) {
  24530. switch (type) {
  24531. case Prop.diamond:
  24532. return "Diamond";
  24533. case Prop.coin:
  24534. return "Coins";
  24535. case Prop.gan1:
  24536. case Prop.gan2:
  24537. case Prop.gan3:
  24538. case Prop.gan4:
  24539. return cfgTable.ballrodData[type - 1].name;
  24540. default:
  24541. break;
  24542. }
  24543. }
  24544. }
  24545. UIGetAward$1.uiName = "UIGetAward";
  24546. class UIBox$1 extends UIBase {
  24547. constructor() {
  24548. super();
  24549. this.boxNum = 0;
  24550. this.boxMax = 10;
  24551. this.inAd = false;
  24552. this.isClose = false;
  24553. }
  24554. onConstructor() {
  24555. this.ui = ui_UIBox.createInstance();
  24556. this.contentPane = this.ui;
  24557. this.isEject = false;
  24558. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  24559. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  24560. Laya.timer.loop(1000, this, this.update);
  24561. }
  24562. update() {
  24563. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  24564. this.boxNum -= 1;
  24565. this.upBar();
  24566. }
  24567. }
  24568. upBar() {
  24569. if (this.boxNum > this.boxMax)
  24570. this.boxNum = this.boxMax;
  24571. this.ui.bar.value = this.boxNum * 10;
  24572. }
  24573. show() {
  24574. super.show();
  24575. this.isClose = false;
  24576. this.boxNum = 0;
  24577. this.inAd = false;
  24578. this.upBar();
  24579. this.ui.t0.play();
  24580. this.ui.closeBtn.visible = false;
  24581. Laya.timer.once(3000, this, () => {
  24582. this.ui.closeBtn.visible = true;
  24583. this.ui.bar.alpha = 1;
  24584. });
  24585. Laya.timer.once(500, this, () => {
  24586. this.ui.t1.play();
  24587. });
  24588. this.setGlobalFont(this.ui);
  24589. }
  24590. hide() {
  24591. Laya.timer.clearAll(this);
  24592. Moyu.showBannerAd(false);
  24593. super.hide();
  24594. }
  24595. onOpenBox() {
  24596. this.boxNum++;
  24597. if (this.boxNum < this.boxMax) {
  24598. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  24599. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  24600. }
  24601. }
  24602. else if (this.boxNum == this.boxMax) {
  24603. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  24604. this.ui.openBtn.c1.selectedIndex = 13;
  24605. this.inAd = true;
  24606. }
  24607. else
  24608. this.getAward();
  24609. }
  24610. else if (this.inAd) {
  24611. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  24612. if (Laya.Browser.onAndroid) {
  24613. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24614. if (!boo) {
  24615. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24616. return;
  24617. }
  24618. }
  24619. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  24620. }
  24621. else {
  24622. console.log('zh:AD 失败,直接发放奖励');
  24623. this.qjff_AD_for_UIBOX_onOpenBox();
  24624. }
  24625. }
  24626. this.upBar();
  24627. }
  24628. qjff_AD_for_UIBOX_onOpenBox() {
  24629. this.getAward();
  24630. }
  24631. onCloseBox() {
  24632. if (this.isClose)
  24633. this.hide();
  24634. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  24635. this.isClose = true;
  24636. PlatMgr.showBanner(true, 0, 3000);
  24637. }
  24638. else
  24639. this.hide();
  24640. }
  24641. getAward() {
  24642. let str = "";
  24643. if (Math.random() < 0.5) {
  24644. let max = Moyu.isLegal ? 500 : 2500;
  24645. let num = xGame.tools.random(max, 500 + max);
  24646. DataMgr.setCoin(num);
  24647. str = "金币x" + num;
  24648. }
  24649. else {
  24650. let max = Moyu.isLegal ? 10 : 30;
  24651. let num = xGame.tools.random(max, 30 + max);
  24652. DataMgr.setDiamond(num);
  24653. str = "钻石x" + num;
  24654. }
  24655. xGame.showTip("恭喜获得-" + str);
  24656. this.hide();
  24657. }
  24658. }
  24659. UIBox$1.uiName = "UIBox";
  24660. class UIMain$1 extends UIBase {
  24661. constructor() {
  24662. super();
  24663. this.firstEnter = true;
  24664. this.moni_click_count = 0;
  24665. }
  24666. nativeCallJs(msg) {
  24667. let t = msg;
  24668. console.log("zh: nativeCallJs 奖励开始发放:", t);
  24669. switch (t) {
  24670. case 'qjff_chouJiang':
  24671. let dui = xGame.uiMgr.getUI(UIDraw$1);
  24672. dui.qjff_chouJiang();
  24673. break;
  24674. case 'qjff_AD_for_uisign':
  24675. let dui2 = xGame.uiMgr.getUI(UISign$1);
  24676. dui2.qjff_AD_for_uisign();
  24677. break;
  24678. case 'qjff_AD_for_uitry':
  24679. let dui3 = xGame.uiMgr.getUI(UITry$1);
  24680. dui3.qjff_AD_for_uitry();
  24681. break;
  24682. case 'qjff_AD_for_uipower':
  24683. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  24684. dui4.qjff_AD_for_uipower();
  24685. break;
  24686. case 'qjff_AD_for_uigetAward':
  24687. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  24688. dui5.qjff_AD_for_uigetAward();
  24689. break;
  24690. case 'qjff_AD_for_uiGameEnd':
  24691. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  24692. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  24693. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  24694. break;
  24695. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  24696. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  24697. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  24698. break;
  24699. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  24700. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  24701. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  24702. break;
  24703. case 'qjff_AD_for_UIrepentProp_videoRegret':
  24704. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  24705. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  24706. break;
  24707. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  24708. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  24709. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  24710. break;
  24711. case 'qjff_AD_for_UIBOX_onOpenBox':
  24712. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  24713. dui11.qjff_AD_for_UIBOX_onOpenBox();
  24714. break;
  24715. case 'qjff_AD_for_UIAddCoin':
  24716. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24717. dui12.qjff_AD_for_UIAddCoin();
  24718. break;
  24719. case 'app_sign_for_buyProduct_onSuccess':
  24720. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  24721. DataMgr.getUserZiChanInfo(false);
  24722. break;
  24723. case '222axxxxxx':
  24724. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24725. dui15.qjff_AD_for_uisign();
  24726. break;
  24727. case '333axsxxxxxx':
  24728. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24729. dui16.qjff_AD_for_uisign();
  24730. break;
  24731. default:
  24732. console.log('zh:未知的方法名字' + t);
  24733. break;
  24734. }
  24735. }
  24736. onConstructor() {
  24737. console.log('zh: UIMain onConstructor');
  24738. this.ui = ui_UIMain.createInstance();
  24739. this.contentPane = this.ui;
  24740. this.isEject = false;
  24741. this.addEvent();
  24742. this.addClickSpine();
  24743. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24744. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24745. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24746. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24747. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24748. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24749. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24750. let curUse = DataMgr.getCurSecretary();
  24751. this.changeSecretary(curUse);
  24752. this.ui.talkNode.visible = false;
  24753. let guide = DataMgr.getSkillGuide();
  24754. if (xGame.common.isNewDay && guide == 1) {
  24755. xGame.common.isNewDay = false;
  24756. xGame.soundMgr.playSound("s_main01");
  24757. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24758. console.log("zh:播放小秘书每天语音");
  24759. }
  24760. this.onGetUserInfo();
  24761. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24762. DataMgr.getUserZiChanInfo(false);
  24763. }
  24764. this.ui.n83.visible = false;
  24765. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24766. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24767. let ua = d.username;
  24768. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24769. }
  24770. this.c_btn_for_user();
  24771. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24772. }
  24773. Logout() {
  24774. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24775. LocalStorageManager.removeItem(keyForLoginInfo);
  24776. this.freshUser();
  24777. }
  24778. JSBridgeUtils.instance.loginOutForApp();
  24779. this.setUserDefaultNickname();
  24780. DataMgr.setCoin2(4000);
  24781. DataMgr.setDiamond2(0);
  24782. this.setDefaultQiuGanInfo();
  24783. DataMgr.setPlaceBallLevelList("");
  24784. DataMgr.setChallengeMode_overLev(1);
  24785. this.setDefaultSignData();
  24786. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  24787. }
  24788. setDefaultSignData() {
  24789. DataMgr.setSignData(1);
  24790. DataMgr.setSignTime(new Date().getTime());
  24791. }
  24792. setDefaultQiuGanInfo() {
  24793. DataMgr.setBallRod(0, 1);
  24794. DataMgr.setBallRod(1, 0);
  24795. DataMgr.setBallRod(2, 0);
  24796. DataMgr.setBallRod(3, 0);
  24797. DataMgr.setBallRod(4, 0);
  24798. DataMgr.setBallRod(5, 1);
  24799. }
  24800. setUserDefaultNickname() {
  24801. let defUsername = "player";
  24802. this.ui.headNode.nameTxt.text = defUsername;
  24803. DataMgr.updateUserNickName(defUsername);
  24804. Moyu.updateUserInfo(defUsername);
  24805. }
  24806. gotoLogin() {
  24807. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  24808. xGame.uiMgr.Show(UILogin$1);
  24809. }
  24810. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  24811. this.Logout();
  24812. }
  24813. }
  24814. gotoRegUser() {
  24815. xGame.uiMgr.Show(UIReg$1);
  24816. }
  24817. showFuLiSp1() {
  24818. console.log('zh:福利1');
  24819. DataMgr.checkForShowFuLi17AndAlert(1);
  24820. }
  24821. showFuLiSp7() {
  24822. console.log('zh:福利7');
  24823. DataMgr.checkForShowFuLi17AndAlert(7);
  24824. }
  24825. c_btn_for_user() {
  24826. this.ui.n_dengLu.c1.selectedIndex = 0;
  24827. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24828. this.ui.n_dengLu.c1.selectedIndex = 1;
  24829. }
  24830. else {
  24831. this.ui.n_dengLu.c1.selectedIndex = 0;
  24832. }
  24833. }
  24834. changeSecretary(curUse) {
  24835. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24836. xGame.common.secretary && xGame.common.secretary.dispose();
  24837. this.addSecretarySpine(name);
  24838. }
  24839. addSecretarySpine(name) {
  24840. let spine = new SpineMgr(name, () => {
  24841. this.playSecretaryIdle();
  24842. });
  24843. xGame.common.secretary = spine;
  24844. }
  24845. addClickSpine() {
  24846. let clickSpine = new SpineMgr("dianji", () => {
  24847. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24848. let parent = Laya.stage;
  24849. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24850. clickSpine.play(data, 0, false, parent, (spine) => {
  24851. spine.destroy(true);
  24852. });
  24853. });
  24854. });
  24855. }
  24856. addEvent() {
  24857. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24858. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24859. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  24860. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24861. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24862. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24863. this.addUIClick(this.ui, this.interuptSecretary);
  24864. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24865. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24866. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24867. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24868. this.addUIClick(this.ui.signBtn, this.openSignView);
  24869. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24870. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24871. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  24872. this.addUIClick(this.ui.n_yd_challenge_1_btn, this.startPlaceBall);
  24873. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24874. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24875. }
  24876. show(showFailWords) {
  24877. super.show();
  24878. DataMgr.loadUserSpOrderForAd();
  24879. this.moneyNode.ui.c1.selectedIndex = 1;
  24880. this.playSecretaryIdle();
  24881. xGame.soundMgr.playMusic("caromhall01", 0);
  24882. Laya.timer.clearAll(this);
  24883. this.playSecretaryRandomSound();
  24884. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24885. if (showFailWords) {
  24886. console.log('zh:uimain.ts ');
  24887. setTimeout(() => {
  24888. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24889. let words = -1;
  24890. if (str == "s_main02") {
  24891. words = 2;
  24892. }
  24893. else {
  24894. words = 3;
  24895. }
  24896. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24897. xGame.soundMgr.playSound(str);
  24898. }, 300);
  24899. }
  24900. this.showGuide();
  24901. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24902. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24903. let guide = DataMgr.getSkillGuide();
  24904. if (guide == 1) {
  24905. let randTime = xGame.common.randomNum(300, 800);
  24906. if (this.firstEnter) {
  24907. console.log("zh: firstEnter");
  24908. this.firstEnter = false;
  24909. randTime += 900;
  24910. }
  24911. else {
  24912. console.log("zh: no firstEnter");
  24913. }
  24914. Laya.timer.once(randTime, this, () => {
  24915. });
  24916. Laya.timer.once(1000, this, () => {
  24917. console.log('zh: 1秒后 showFuLiSp7');
  24918. this.showFuLiSp7();
  24919. });
  24920. this.showTipForGuest();
  24921. }
  24922. this.setGlobalFont(this.ui);
  24923. this.yinDaoForLianxi();
  24924. }
  24925. yinDaoForLianxi() {
  24926. let g = DataMgr.getSkillGuide();
  24927. if (g === 0) {
  24928. console.log('zh:默认的引导还没有完毕');
  24929. return;
  24930. }
  24931. let lianXiGuide = DataMgr.getLianXiGuide();
  24932. if (lianXiGuide == 0) {
  24933. let x = this.ui.placeBallBtn.x;
  24934. let y = this.ui.placeBallBtn.y;
  24935. this.ui.n_yd_lxms_1.visible = true;
  24936. this.ui.n_yd_challenge_1_hand.x = x + 150;
  24937. this.ui.n_yd_challenge_1_hand.y = y;
  24938. this.ui.n_yd_challenge_1_btn.x = x;
  24939. this.ui.n_yd_challenge_1_btn.y = y;
  24940. console.log('zh:yinDaoForLianxi set ok');
  24941. }
  24942. else {
  24943. this.ui.n_yd_lxms_1.visible = false;
  24944. }
  24945. }
  24946. showTipForGuest() {
  24947. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24948. if (userInfo == null) {
  24949. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  24950. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  24951. let woman = "this is an important notice.";
  24952. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  24953. return;
  24954. }
  24955. }
  24956. checkActive(show) {
  24957. }
  24958. showGuide() {
  24959. let guide = DataMgr.getSkillGuide();
  24960. this.ui.guideBtn.visible = guide == 0;
  24961. this.ui.enterGuide.visible = false;
  24962. this.ui.secretaryGuide.visible = guide == 0;
  24963. if (guide == 0) {
  24964. console.log("zh:显示引导");
  24965. xGame.soundMgr.playSound("s_guide");
  24966. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24967. }
  24968. else {
  24969. console.log("zh:不需要显示引导");
  24970. }
  24971. }
  24972. ensureSecretary() {
  24973. console.log('zh: ensureSecretary ');
  24974. this.ui.secretaryGuide.visible = false;
  24975. this.ui.enterGuide.visible = true;
  24976. this.ui.wordsNode.t0.play();
  24977. if (DataMgr.getNewUser())
  24978. Moyu.sendDataEvent("gameReady");
  24979. }
  24980. playSecretaryIdle() {
  24981. let parent = this.ui.secretary.displayObject;
  24982. parent.destroyChildren();
  24983. let xx = this.ui.secretary.width / 2;
  24984. let yy = this.ui.secretary.height;
  24985. let scale = xGame.common.getSecretaryScale();
  24986. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24987. xGame.common.secretary.play(data, 0, true, parent);
  24988. }
  24989. startGame(type) {
  24990. if (!this.isReadyForLoadNetSource()) {
  24991. return;
  24992. }
  24993. xGame.common.gameMode = type;
  24994. Moyu.sendDataEvent("PlayGame", { type: type });
  24995. let gm = xGame.common.gameMode;
  24996. console.log('zh:进入游戏gameMode =' + gm);
  24997. switch (gm) {
  24998. case GameMode.classic:
  24999. console.log('zh:进入经典模式111111111');
  25000. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  25001. let db_over_lev = DataMgr.getChallengeMode_overLev();
  25002. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  25003. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  25004. console.log('zh:判断是否可以玩该模式classic =NO');
  25005. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  25006. xGame.uiMgr.Show(UIMsg$1, tipStr);
  25007. return;
  25008. }
  25009. else {
  25010. console.log('zh:可以玩该模式classic');
  25011. this.beginGame();
  25012. }
  25013. }
  25014. else {
  25015. console.log('zh:不需要判断是否可以玩该classic');
  25016. let challengeTimes = DataMgr.getChallengeTimes();
  25017. if (challengeTimes == 0) {
  25018. xGame.uiMgr.Show(UIInvitation$1);
  25019. }
  25020. else {
  25021. this.beginGame();
  25022. }
  25023. }
  25024. break;
  25025. case GameMode.bigMove:
  25026. console.info('zh:bigMove check 大招');
  25027. let guide = DataMgr.getSkillGuide();
  25028. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  25029. let db_over_lev = DataMgr.getChallengeMode_overLev();
  25030. console.log('zh:bigMove db_over_lev=', db_over_lev);
  25031. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  25032. console.log('zh:提示不可以玩');
  25033. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  25034. xGame.uiMgr.Show(UIMsg$1, tipStr);
  25035. return;
  25036. }
  25037. else {
  25038. console.log('zh:可以玩该模式 bigMove');
  25039. this.beginGame();
  25040. if (DataMgr.getNewUser())
  25041. Moyu.sendDataEvent("gameStart0");
  25042. }
  25043. }
  25044. else {
  25045. this.beginGame();
  25046. if (DataMgr.getNewUser())
  25047. Moyu.sendDataEvent("gameStart0");
  25048. }
  25049. break;
  25050. default:
  25051. console.error('zh:未知错误!!!!');
  25052. break;
  25053. }
  25054. }
  25055. beginGame(isNice = false) {
  25056. console.log('zh:beginGame ');
  25057. let guide = DataMgr.getSkillGuide();
  25058. if (guide == 1) {
  25059. console.log('zh:非新手引导,showInternAd ');
  25060. JSBridgeUtils.instance.showInternAd('beginGame');
  25061. }
  25062. else {
  25063. console.log('zh:新手引导,不显示AD ');
  25064. }
  25065. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  25066. console.log('zh:beginGame 1');
  25067. if (xGame.common.gameMode == GameMode.classic) {
  25068. console.log('zh:beginGame 2');
  25069. if (isNice) {
  25070. console.log('zh:进入巅峰赛');
  25071. this.enterClassic();
  25072. }
  25073. else {
  25074. console.log('zh:beginGame 3-1');
  25075. xGame.uiMgr.Show(UIModeSelection$1, () => {
  25076. console.log('zh:beginGame 3-2');
  25077. this.enterClassic();
  25078. });
  25079. }
  25080. }
  25081. else if (xGame.common.gameMode == GameMode.bigMove) {
  25082. console.log('zh:beginGame 5');
  25083. this.ui.enterGuide.visible = false;
  25084. xGame.uiMgr.Show(UISkill$1);
  25085. }
  25086. }
  25087. enterClassic() {
  25088. console.log('zh:beginGame 7');
  25089. xGame.uiMgr.Show(UIGame$1);
  25090. xGame.uiMgr.Show(UIMatching$1, () => {
  25091. if (!this.isHide)
  25092. this.hide();
  25093. xGame.common.gameUI.ui.alpha = 1;
  25094. console.log('zh:beginGame 8');
  25095. xGame.common.gameUI.startGame();
  25096. xGame.uiMgr.Hide(UIGameEnd$1);
  25097. });
  25098. }
  25099. start_debug_for_moni_payOk() {
  25100. let ccc = this.moni_click_count + 1;
  25101. this.moni_click_count = ccc;
  25102. if (ccc % 5 == 0) {
  25103. console.log('zh:start_debug_for_moni_payOk');
  25104. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  25105. if (userInfo != null) {
  25106. let token = userInfo.token;
  25107. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  25108. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  25109. alert('模拟支付OK');
  25110. return;
  25111. }
  25112. else {
  25113. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  25114. }
  25115. }
  25116. }
  25117. startGlobal() {
  25118. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  25119. }
  25120. startWeekly() {
  25121. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  25122. }
  25123. zhouSaiMonth() {
  25124. console.log('zh: zhouSaiMonth 被调用');
  25125. }
  25126. isReadyForLoadNetSource() {
  25127. let reqCount = xGame.cfgMgr.httpReqCount;
  25128. let ok = xGame.cfgMgr.httpReqOkCount;
  25129. if (reqCount > ok) {
  25130. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  25131. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  25132. Laya.timer.once(5000, this, () => {
  25133. let retryCount = 0;
  25134. const maxRetries = 3;
  25135. const tryFetchConfig = () => {
  25136. try {
  25137. xGame.cfgMgr.getConfigFromServer();
  25138. }
  25139. catch (error) {
  25140. if (retryCount < maxRetries) {
  25141. retryCount++;
  25142. console.log(`🔄 第${retryCount}次重试获取配置...`);
  25143. Laya.timer.once(5000, this, tryFetchConfig);
  25144. }
  25145. else {
  25146. console.error("❌ 达到最大重试次数,配置获取失败");
  25147. }
  25148. }
  25149. };
  25150. tryFetchConfig();
  25151. });
  25152. return false;
  25153. }
  25154. return true;
  25155. }
  25156. startPlaceBall() {
  25157. if (!this.isReadyForLoadNetSource()) {
  25158. return;
  25159. }
  25160. xGame.uiMgr.Show(UILevelDisplay$1);
  25161. }
  25162. hide() {
  25163. console.log('zh:uimain hide ...');
  25164. super.hide();
  25165. xGame.common.stopGirlPop(this.ui.talkNode);
  25166. }
  25167. onGetUserInfo(force = false) {
  25168. if (Moyu.isWx) {
  25169. let info = Moyu.getSystemInfo();
  25170. if (info)
  25171. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  25172. }
  25173. else {
  25174. Moyu.initUser(this, this.freshUser, force);
  25175. }
  25176. this.freshUser();
  25177. console.log('zh:5秒后更新用户信息');
  25178. setTimeout(() => {
  25179. DataMgr.getUserZiChanInfo(true);
  25180. }, 5000);
  25181. }
  25182. event_login_in() {
  25183. console.log("zh:event_login_in被触发");
  25184. this.freshUser();
  25185. }
  25186. freshUser() {
  25187. let user = Moyu.getUserInfo();
  25188. if (!user.isAuth) {
  25189. user.headIcon = 'res/ty_touxiang.png';
  25190. }
  25191. else {
  25192. DataMgr.upRankData();
  25193. }
  25194. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  25195. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  25196. let keyStr = keyForLoginInfo;
  25197. if (LocalStorageManager.hasJosnKey(keyStr)) {
  25198. const d = LocalStorageManager.getItem(keyStr);
  25199. let ua = d.username;
  25200. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  25201. }
  25202. else {
  25203. }
  25204. this.c_btn_for_user();
  25205. }
  25206. interuptSecretary() {
  25207. Laya.timer.clearAll(this);
  25208. this.playSecretaryRandomSound();
  25209. }
  25210. playSecretaryRandomSound() {
  25211. if (this.isHide)
  25212. return;
  25213. let time = xGame.common.randomNum(45000, 60000);
  25214. Laya.timer.once(time, this, () => {
  25215. if (this.isHide)
  25216. return;
  25217. let index = xGame.common.randomNum(4, 7);
  25218. xGame.soundMgr.playSound("s_main0" + index);
  25219. let words = 1;
  25220. switch (index) {
  25221. case 4:
  25222. words = 5;
  25223. break;
  25224. case 5:
  25225. words = 3;
  25226. break;
  25227. case 6:
  25228. words = 6;
  25229. break;
  25230. case 7:
  25231. words = 7;
  25232. break;
  25233. default:
  25234. break;
  25235. }
  25236. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  25237. this.playSecretaryRandomSound();
  25238. });
  25239. }
  25240. openSecretaryView() {
  25241. xGame.uiMgr.Show(UISecretary$1);
  25242. Moyu.sendDataEvent("secretary");
  25243. }
  25244. openShopView() {
  25245. xGame.uiMgr.Show(UIShop$1, 1);
  25246. }
  25247. openShopView0() {
  25248. xGame.uiMgr.Show(UIShop$1, 0);
  25249. }
  25250. openSignView() {
  25251. xGame.uiMgr.Show(UISign$1);
  25252. }
  25253. openDrawView() {
  25254. xGame.uiMgr.Show(UIDraw$1);
  25255. }
  25256. openRanking() {
  25257. console.log('zh:phb openRanking');
  25258. xGame.uiMgr.Show(UIRanking$1);
  25259. Moyu.sendDataEvent("rankingList");
  25260. }
  25261. }
  25262. UIMain$1.uiName = "UIMain";
  25263. function InitShader() {
  25264. }
  25265. function appInit() {
  25266. xGame.context.init(getLoadingResList(), initCallback);
  25267. }
  25268. function getLoadingResList() {
  25269. return [
  25270. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  25271. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  25272. ];
  25273. }
  25274. function getGameResList() {
  25275. return [
  25276. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  25277. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  25278. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  25279. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  25280. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  25281. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  25282. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  25283. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  25284. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  25285. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  25286. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  25287. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  25288. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  25289. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  25290. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  25291. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  25292. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  25293. ];
  25294. }
  25295. function initCallback() {
  25296. window["DataMgr"] = DataMgr;
  25297. DataMgr.Init();
  25298. Moyu.init(getPlat(), this, () => {
  25299. DataMgr.isNewDay();
  25300. PlatMgr.initConfig();
  25301. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  25302. }, true);
  25303. console.log('zh:开始sm init1 start');
  25304. xGame.soundMgr.init();
  25305. console.log('zh:开始sm init1 end');
  25306. xGame.uiMgr.init();
  25307. xGame.uiMgr.clearTempData();
  25308. xGame.uiMgr.bindFUI(fguiRes.loading);
  25309. xGame.uiMgr.Show(UILoading);
  25310. }
  25311. function onFontLoaded() {
  25312. try {
  25313. Laya.Text.defaultFont = "arial";
  25314. console.log("zh: onFontLoaded 设置arial字体成功");
  25315. }
  25316. catch (error) {
  25317. console.log("zh: constructor onFontLoaded加载arial字体失败");
  25318. }
  25319. }
  25320. function loadSubRes(callback) {
  25321. var tab = ["asset", "res", "spine"];
  25322. let subDone = 0;
  25323. for (var i = 0; i < tab.length; i++) {
  25324. let sub = tab[i];
  25325. Moyu.loadSubRes(sub, (pro) => {
  25326. callback && callback(pro, false);
  25327. }).then(() => {
  25328. subDone++;
  25329. if (subDone >= tab.length)
  25330. callback && callback(1, true);
  25331. });
  25332. }
  25333. }
  25334. function enterGame() {
  25335. xGame.cfgMgr.init();
  25336. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  25337. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  25338. xGame.uiMgr.Hide(UILoading);
  25339. fgui.UIPackage.removePackage(fguiRes.loading);
  25340. xGame.uiMgr.bindFUI(fguiRes.game);
  25341. xGame.uiMgr.Show(UIMain$1);
  25342. if (DataMgr.getNewUser())
  25343. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  25344. }
  25345. function getPlat() {
  25346. let cfg = new MoyuCfg();
  25347. cfg.plat = MoyuPlat.web;
  25348. cfg.myId = 180;
  25349. cfg.myKey = '8848a885774230a4';
  25350. cfg.version = 0;
  25351. if (window.hasOwnProperty("gamebox")) {
  25352. cfg.plat = MoyuPlat.f399;
  25353. cfg.version = 0;
  25354. }
  25355. else if (window.hasOwnProperty("ks")) {
  25356. cfg.plat = MoyuPlat.ks;
  25357. cfg.version = 0;
  25358. cfg.ads.ksVideoId = '2300002254_01';
  25359. cfg.ads.ksInsertId = '2300002254_02';
  25360. }
  25361. else if (Laya.Browser.onTTMiniGame) {
  25362. cfg.plat = MoyuPlat.tt;
  25363. cfg.version = 0;
  25364. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  25365. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  25366. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  25367. }
  25368. else if (Laya.Browser.onMiniGame) {
  25369. cfg.plat = MoyuPlat.wx;
  25370. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  25371. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  25372. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  25373. }
  25374. else if (Laya.Browser.onQQMiniGame) {
  25375. cfg.plat = MoyuPlat.qq;
  25376. }
  25377. else if (Laya.Browser.onQGMiniGame) {
  25378. cfg.plat = MoyuPlat.op;
  25379. cfg.ads.opVideoId = '455502';
  25380. cfg.ads.opBannerId = '455507';
  25381. }
  25382. else if (Laya.Browser.onVVMiniGame) {
  25383. cfg.plat = MoyuPlat.vv;
  25384. cfg.version = 0;
  25385. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  25386. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  25387. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  25388. }
  25389. else if (Laya.Browser.onHWMiniGame) {
  25390. cfg.plat = MoyuPlat.hw;
  25391. }
  25392. else if (window["mz"]) {
  25393. cfg.plat = MoyuPlat.mz;
  25394. }
  25395. else {
  25396. let cfg = window['conchConfig'];
  25397. if (cfg) {
  25398. var os = cfg.getOS();
  25399. if (os == "Conch-ios") {
  25400. cfg.plat = MoyuPlat.ios;
  25401. }
  25402. else if (os == "Conch-android") {
  25403. }
  25404. }
  25405. }
  25406. return cfg;
  25407. }
  25408. class Main {
  25409. constructor() {
  25410. if (window["Laya3D"])
  25411. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  25412. else {
  25413. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  25414. this.initMain();
  25415. }
  25416. }
  25417. initMain() {
  25418. Laya["Physics"] && Laya["Physics"].enable();
  25419. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  25420. Laya.stage.scaleMode = GameConfig.scaleMode;
  25421. Laya.stage.screenMode = GameConfig.screenMode;
  25422. Laya.stage.alignV = GameConfig.alignV;
  25423. Laya.stage.alignH = GameConfig.alignH;
  25424. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  25425. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  25426. Laya.enableDebugPanel();
  25427. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  25428. Laya["PhysicsDebugDraw"].enable();
  25429. if (GameConfig.stat)
  25430. Laya.Stat.show();
  25431. Laya.alertGlobalError(true);
  25432. this.loadFont();
  25433. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  25434. }
  25435. loadFont() {
  25436. try {
  25437. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoaded));
  25438. console.log("zh: constructor加载arial字体成功1");
  25439. }
  25440. catch (error) {
  25441. console.log("zh: constructor加载arial字体失败1");
  25442. }
  25443. }
  25444. onFontLoaded() {
  25445. try {
  25446. Laya.Text.defaultFont = "Arial";
  25447. console.log("zh: onFontLoaded 设置arial字体成功1");
  25448. }
  25449. catch (error) {
  25450. console.log("zh: constructor onFontLoaded加载arial字体失败1");
  25451. }
  25452. }
  25453. onVersionLoaded() {
  25454. appInit();
  25455. }
  25456. }
  25457. new Main();
  25458. }());
  25459. //# sourceMappingURL=bundle.js.map