1
0

bundle.js 905 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608
  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 keyForLoginInfo = "userInfo";
  52. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  53. let poolKey = {
  54. inHoleEft: "inHoleEft",
  55. d3ball: "d3ball",
  56. iceEft: "iceEft",
  57. hitEft: "hitEft",
  58. fireworksEft: "fireworksEft",
  59. };
  60. var GameMode;
  61. (function (GameMode) {
  62. GameMode[GameMode["classic"] = 0] = "classic";
  63. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  64. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  65. })(GameMode || (GameMode = {}));
  66. var SkillType;
  67. (function (SkillType) {
  68. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  69. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  70. SkillType[SkillType["ice"] = 2] = "ice";
  71. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  72. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  73. })(SkillType || (SkillType = {}));
  74. var ClassicWordsType;
  75. (function (ClassicWordsType) {
  76. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  77. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  78. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  79. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  80. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  81. })(ClassicWordsType || (ClassicWordsType = {}));
  82. var PressType;
  83. (function (PressType) {
  84. PressType[PressType["powerNode"] = 0] = "powerNode";
  85. PressType[PressType["d2Root"] = 1] = "d2Root";
  86. PressType[PressType["moveNode"] = 2] = "moveNode";
  87. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  88. })(PressType || (PressType = {}));
  89. var PlaceBallType;
  90. (function (PlaceBallType) {
  91. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  92. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  93. })(PlaceBallType || (PlaceBallType = {}));
  94. var EAdType;
  95. (function (EAdType) {
  96. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  97. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  98. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  99. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  100. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  101. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  102. EAdType[EAdType["sign"] = 6] = "sign";
  103. EAdType[EAdType["draw"] = 7] = "draw";
  104. EAdType[EAdType["triple"] = 8] = "triple";
  105. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  106. EAdType[EAdType["getPower"] = 10] = "getPower";
  107. EAdType[EAdType["box"] = 11] = "box";
  108. EAdType[EAdType["try"] = 12] = "try";
  109. EAdType[EAdType["againSign"] = 13] = "againSign";
  110. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  111. })(EAdType || (EAdType = {}));
  112. var Prop;
  113. (function (Prop) {
  114. Prop[Prop["diamond"] = 1] = "diamond";
  115. Prop[Prop["coin"] = 2] = "coin";
  116. Prop[Prop["gan1"] = 3] = "gan1";
  117. Prop[Prop["gan2"] = 4] = "gan2";
  118. Prop[Prop["gan3"] = 5] = "gan3";
  119. Prop[Prop["gan4"] = 6] = "gan4";
  120. })(Prop || (Prop = {}));
  121. var TipsType;
  122. (function (TipsType) {
  123. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  124. TipsType[TipsType["foul"] = 1] = "foul";
  125. })(TipsType || (TipsType = {}));
  126. class AwardType {
  127. constructor(type, num) {
  128. this.type = type;
  129. this.num = num;
  130. }
  131. }
  132. var define = /*#__PURE__*/Object.freeze({
  133. fguiRes: fguiRes,
  134. ballCamp: ballCamp,
  135. FoulType: FoulType,
  136. ALL_BALL_STOP: ALL_BALL_STOP,
  137. WAIT_SHOOT: WAIT_SHOOT,
  138. D3RES_LOADED: D3RES_LOADED,
  139. BALL_SHOOT: BALL_SHOOT,
  140. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  141. RESET_GAME: RESET_GAME,
  142. COIN_CHANGE: COIN_CHANGE,
  143. DIAMOND_CHANGE: DIAMOND_CHANGE,
  144. RESTART_GAME: RESTART_GAME,
  145. GET_USER_INFO: GET_USER_INFO,
  146. CHANGE_SECRETARY: CHANGE_SECRETARY,
  147. POWER_CHANGE: POWER_CHANGE,
  148. POWER_TIME: POWER_TIME,
  149. keyForLoginInfo: keyForLoginInfo,
  150. baseHeadUrl: baseHeadUrl,
  151. poolKey: poolKey,
  152. get GameMode () { return GameMode; },
  153. get SkillType () { return SkillType; },
  154. get ClassicWordsType () { return ClassicWordsType; },
  155. get PressType () { return PressType; },
  156. get PlaceBallType () { return PlaceBallType; },
  157. get EAdType () { return EAdType; },
  158. get Prop () { return Prop; },
  159. get TipsType () { return TipsType; },
  160. AwardType: AwardType
  161. });
  162. class CContext {
  163. constructor() {
  164. this.winSize = { width: 0, height: 0 };
  165. this.notchHeight = 0;
  166. this.bannerHeight = 0;
  167. }
  168. init(resList, callback) {
  169. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  170. this.notchHeight = this.getNotchHeight();
  171. this.bannerHeight = this.getBannerHeight();
  172. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  173. callback && callback();
  174. }));
  175. }
  176. getNotchHeight() {
  177. let notchHeight = 50;
  178. if (Laya.Browser.onMiniGame) {
  179. let deviceInfo = wx.getSystemInfoSync();
  180. if (Laya.Browser.onIOS) {
  181. if (deviceInfo.model.search('iPhone X') != -1) {
  182. notchHeight = deviceInfo.statusBarHeight - 10;
  183. }
  184. else {
  185. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  186. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  187. notchHeight = deviceInfo.statusBarHeight - 10;
  188. }
  189. }
  190. }
  191. else if (Laya.Browser.onAndroid) {
  192. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  193. notchHeight = deviceInfo.statusBarHeight;
  194. }
  195. }
  196. }
  197. return notchHeight;
  198. }
  199. getBannerHeight() {
  200. return 0;
  201. }
  202. }
  203. let context = new CContext();
  204. var Handler = Laya.Handler;
  205. var Tween = Laya.Tween;
  206. function playClickEffect(btn) {
  207. if (!btn)
  208. return;
  209. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  210. if (!btn)
  211. return;
  212. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  213. if (!btn)
  214. return;
  215. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  216. }), 0, true);
  217. }), 0, true);
  218. }
  219. function getNumList(strList) {
  220. let dataList = [];
  221. if (strList) {
  222. let list = strList;
  223. let array = list.split(',');
  224. for (var v in array) {
  225. dataList.push(Number(array[v]));
  226. }
  227. }
  228. return dataList;
  229. }
  230. function getStrList(strList) {
  231. let dataList = [];
  232. if (strList) {
  233. let list = strList;
  234. let array = list.split('|');
  235. for (var v in array) {
  236. dataList.push(String(array[v]));
  237. }
  238. }
  239. return dataList;
  240. }
  241. function getRandStr(len) {
  242. 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'];
  243. let str = "";
  244. for (let i = 0; i < len; i++) {
  245. let rand = random(0, list.length);
  246. str += list[rand];
  247. }
  248. return str;
  249. }
  250. function getUserId() {
  251. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  252. return str;
  253. }
  254. function formatPos(pos, len = 2) {
  255. let v = Math.pow(10, len);
  256. pos.x = Math.floor(pos.x * v) / v;
  257. pos.y = Math.floor(pos.y * v) / v;
  258. if (pos.z)
  259. pos.z = Math.floor(pos.z * v) / v;
  260. return pos;
  261. }
  262. function setPosInt(pos) {
  263. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  264. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  265. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  266. return pos;
  267. }
  268. function random(min, max) {
  269. var rang = max - min;
  270. var rand = Math.random() * rang;
  271. return Math.floor(rand) + min;
  272. }
  273. function randomList(list, num) {
  274. if (list.length <= num)
  275. return list;
  276. let arry = [];
  277. list.forEach(item => {
  278. arry.push(item);
  279. });
  280. let nums = [];
  281. for (let i = 0; i < num; i++) {
  282. let rand = random(0, arry.length);
  283. let v = arry[rand];
  284. nums.push(v);
  285. arry.splice(rand, 1);
  286. }
  287. return nums;
  288. }
  289. function worldToScreen(camera, point, pos) {
  290. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  291. pos.x = pos.x / Laya.stage.clientScaleX;
  292. pos.y = pos.y / Laya.stage.clientScaleY;
  293. }
  294. function getStringLenght(str) {
  295. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  296. }
  297. function reviseString(str, len) {
  298. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  299. if (ld > len) {
  300. let sl = Math.floor(len / 2);
  301. let rs = str.substring(0, sl);
  302. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  303. while (d + 2 < len) {
  304. sl++;
  305. rs = str.substring(0, sl);
  306. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  307. }
  308. return rs + "...";
  309. }
  310. return str;
  311. }
  312. function getCoinString(coin) {
  313. if (coin < 10000)
  314. return coin.toString();
  315. else if (coin < 1000000) {
  316. let vh = Math.ceil(coin / 100);
  317. return (vh / 10) + "k";
  318. }
  319. else if (coin < 1000000000) {
  320. var vh = Math.ceil(coin / 100000);
  321. return (vh / 10) + "m";
  322. }
  323. else if (coin < 1000000000000) {
  324. var vh = Math.ceil(coin / 100000000);
  325. return (vh / 10) + "b";
  326. }
  327. else if (coin < 1000000000000000) {
  328. var vh = Math.ceil(coin / 100000000000);
  329. return (vh / 10) + "t";
  330. }
  331. }
  332. function getV3Dest(pos, dir, dis, dest) {
  333. dir.x *= dis;
  334. dir.y *= dis;
  335. dir.z *= dis;
  336. Laya.Vector3.add(pos, dir, dest);
  337. return dest;
  338. }
  339. function getV2Dest(x1, y1, dir, dis, dest) {
  340. dest.x = x1 + dir.x * dis;
  341. dest.y = y1 + dir.y * dis;
  342. return dest;
  343. }
  344. function getV2Dir(x1, y1, x2, y2, dir) {
  345. dir.x = x2 - x1;
  346. dir.y = y2 - y1;
  347. Laya.Vector2.normalize(dir, dir);
  348. return dir;
  349. }
  350. function getV3Dir(p1, p2, dir) {
  351. Laya.Vector3.subtract(p1, p2, dir);
  352. Laya.Vector3.normalize(dir, dir);
  353. return dir;
  354. }
  355. function copyPos(ip, op) {
  356. op.x = ip.x;
  357. op.y = ip.y;
  358. if (ip.z)
  359. op.z = ip.z;
  360. return op;
  361. }
  362. function getScreenImg() {
  363. let gl = Laya.WebGLContext.mainContext;
  364. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  365. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  366. let w = gl.drawingBufferWidth;
  367. let h = gl.drawingBufferHeight;
  368. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  369. texture2d.setPixels(pixels);
  370. return new Laya.Texture(texture2d);
  371. }
  372. function playMoveByPositions(sp, positions, v, completeCallback) {
  373. let p;
  374. let play = () => {
  375. if (positions.length == 0) {
  376. completeCallback();
  377. return;
  378. }
  379. p = positions[0];
  380. positions.splice(0, 1);
  381. 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, () => {
  382. play();
  383. }));
  384. };
  385. play();
  386. }
  387. function setStarPos(node, num, max) {
  388. for (let i = 1; i <= 5; i++) {
  389. let img = node.getChildAt(i - 1);
  390. img.width = img.height = 30;
  391. img.pivotX = img.pivotY = 0.5;
  392. img.gray = i > num;
  393. img.visible = i <= max;
  394. if (max == 3) {
  395. img.x = node.width / 2 + (i - 2) * 30 - 15;
  396. img.y = node.height - 40;
  397. if (i == 2)
  398. img.y = node.height - 30;
  399. }
  400. else if (max == 5) {
  401. let ly = Math.abs(i - 3);
  402. img.x = node.width / 2 + (i - 3) * 20 - 15;
  403. img.y = node.height - ly * 8 - 30;
  404. }
  405. }
  406. }
  407. function playLoopAnimRotate(sp, time, clockwise = true) {
  408. let rotation;
  409. sp.rotation = sp.rotation % 360;
  410. if (clockwise) {
  411. rotation = -360;
  412. }
  413. else {
  414. rotation = 360;
  415. }
  416. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  417. this.playLoopAnimRotate(sp, time, clockwise);
  418. }));
  419. }
  420. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  421. let x, y;
  422. if (isBig) {
  423. x = valueXMin;
  424. y = valueYMin;
  425. }
  426. else {
  427. x = valueXMax;
  428. y = valueYMax;
  429. }
  430. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  431. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  432. }));
  433. }
  434. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  435. let scale;
  436. if (isBig) {
  437. scale = valueMin;
  438. }
  439. else {
  440. scale = valueMax;
  441. }
  442. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  443. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  444. }));
  445. }
  446. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  447. let value;
  448. if (isBig) {
  449. value = valueMin;
  450. }
  451. else {
  452. value = valueMax;
  453. }
  454. if (count) {
  455. count--;
  456. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  457. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  458. }));
  459. }
  460. else {
  461. sp.rotation = 0;
  462. }
  463. }
  464. function inRect(rect, p) {
  465. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  466. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  467. return true;
  468. }
  469. }
  470. return false;
  471. }
  472. function getNumberK(number) {
  473. if (number < 1000) {
  474. return number.toString();
  475. }
  476. else {
  477. return (number / 1000).toFixed(1) + "k";
  478. }
  479. }
  480. function pointInsideCircle(point, circle, r) {
  481. if (r === 0)
  482. return false;
  483. var dx = circle.x - point.x;
  484. var dy = circle.y - point.y;
  485. return dx * dx + dy * dy <= r * r;
  486. }
  487. function formatString(str, data) {
  488. if (!str || data == undefined) {
  489. return str;
  490. }
  491. if (typeof data === "object") {
  492. for (var key in data) {
  493. if (data.hasOwnProperty(key)) {
  494. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  495. }
  496. }
  497. }
  498. else {
  499. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  500. return str.replace(reg, function (match, index) {
  501. return args[index - (-1)];
  502. });
  503. }
  504. return str;
  505. }
  506. function getIntersection(a, b) {
  507. let t = [];
  508. for (var i = 0; i < a.length; i++) {
  509. for (var j = 0; j < b.length; j++) {
  510. if (a[i] == b[j]) {
  511. t.push(a[i]);
  512. }
  513. }
  514. }
  515. return t;
  516. }
  517. function getComplement(a, b) {
  518. let t = [];
  519. let count = false;
  520. for (var i = 0; i < a.length; i++) {
  521. count = false;
  522. for (var j = 0; j < b.length; j++) {
  523. if (a[i] == b[j]) {
  524. count = true;
  525. break;
  526. }
  527. }
  528. if (!count) {
  529. t.push(a[i]);
  530. }
  531. }
  532. return t;
  533. }
  534. function geSpriteStageRect(sp) {
  535. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  536. let rect = {
  537. x: point.x,
  538. y: point.y,
  539. width: sp.width * sp.globalScaleX,
  540. height: sp.height * sp.globalScaleY
  541. };
  542. return rect;
  543. }
  544. function touchButton(button) {
  545. let event = new Laya.Event();
  546. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  547. }
  548. function setColor(sprite, r, g, b) {
  549. var redMat = [
  550. r / 255, 0, 0, 0, 0,
  551. g / 255, 0, 0, 0, 0,
  552. b / 255, 0, 0, 0, 0,
  553. 0, 0, 0, 1, 0,
  554. ];
  555. var filter = new Laya.ColorFilter(redMat);
  556. sprite.filters = [filter];
  557. }
  558. function clone(obj, newobj = {}) {
  559. for (var attr in obj) {
  560. if (typeof obj[attr] == "object") {
  561. newobj[attr] = clone(obj[attr], newobj[attr]);
  562. }
  563. else {
  564. newobj[attr] = obj[attr];
  565. }
  566. }
  567. return newobj;
  568. }
  569. function _ms(arr, compare, begin, end) {
  570. const size = end - begin;
  571. if (size <= 1) {
  572. return;
  573. }
  574. const middle = (end + begin) >> 1;
  575. _ms(arr, compare, begin, middle);
  576. _ms(arr, compare, middle, end);
  577. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  578. return;
  579. }
  580. const merged = [];
  581. let leftIndex = begin, rightIndex = middle;
  582. while (merged.length < size) {
  583. if (leftIndex === middle) {
  584. merged.push(arr[rightIndex++]);
  585. }
  586. else if (rightIndex === end) {
  587. merged.push(arr[leftIndex++]);
  588. }
  589. else {
  590. const c = compare(arr[leftIndex], arr[rightIndex]);
  591. if (c <= 0) {
  592. merged.push(arr[leftIndex++]);
  593. }
  594. else {
  595. merged.push(arr[rightIndex++]);
  596. }
  597. }
  598. }
  599. arr.splice(begin, size, ...merged);
  600. }
  601. function sort(arr, compare) {
  602. if (!Array.isArray(arr)) {
  603. throw new Error('sort的参数必须为数组');
  604. }
  605. _ms(arr, compare, 0, arr.length);
  606. return arr;
  607. }
  608. function getLanguage(id) {
  609. }
  610. function getLanguageByTip(id) {
  611. }
  612. function toWeights(array) {
  613. let max = 0;
  614. for (var i = 0; i < array.length; i++) {
  615. max = max + array[i];
  616. if (array[i] == 0) {
  617. array[i] = 0;
  618. }
  619. else {
  620. array[i] = max;
  621. }
  622. }
  623. return array;
  624. }
  625. function unique(array) {
  626. var n = {}, r = [], len = array.length, val, type;
  627. for (var i = 0; i < array.length; i++) {
  628. val = array[i];
  629. type = typeof val;
  630. if (!n[val]) {
  631. n[val] = [type];
  632. r.push(val);
  633. }
  634. else if (n[val].indexOf(type) < 0) {
  635. n[val].push(type);
  636. r.push(val);
  637. }
  638. }
  639. return r;
  640. }
  641. function unique1(array) {
  642. var r = [];
  643. for (var i = 0, l = array.length; i < l; i++) {
  644. for (var j = i + 1; j < l; j++)
  645. if (array[i] == array[j])
  646. j == ++i;
  647. r.push(array[i]);
  648. }
  649. return r;
  650. }
  651. function getDistance(x1, y1, x2, y2) {
  652. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  653. }
  654. function getV2Dis(pos1, pos2) {
  655. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  656. }
  657. function getV2SqDis(pos1, pos2) {
  658. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  659. }
  660. function getDis(x1, y1, x2, y2) {
  661. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  662. }
  663. function getDeltaxy(x1, y1, x2, y2) {
  664. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  665. }
  666. function getSymbolNumber(num) {
  667. if (num > 0) {
  668. return "+" + num;
  669. }
  670. else if (num < 0) {
  671. return num.toString();
  672. }
  673. return num.toString();
  674. }
  675. function fixNumber(num, length) {
  676. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  677. }
  678. function toThousands(num) {
  679. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  680. }
  681. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  682. function fmtMoney(money) {
  683. money = toThousands(money.replace(/^0+/, ''));
  684. if (money.length == 0) {
  685. money = "0";
  686. }
  687. let unit = 0;
  688. for (var i = 0; i < money.length; i++) {
  689. if (money.charAt(i) == ",") {
  690. unit++;
  691. }
  692. }
  693. if (unit == 0) {
  694. return money;
  695. }
  696. else {
  697. let idx = money.indexOf(",");
  698. if (idx) {
  699. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  700. }
  701. return money.replace(",", ".");
  702. }
  703. }
  704. function flatten(arr) {
  705. while (arr.some(item => Array.isArray(item))) {
  706. arr = [].concat(...arr);
  707. }
  708. return arr;
  709. }
  710. function getDistanceByPoint(p1, p2) {
  711. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  712. }
  713. function getAngleByPoint(p1, p2) {
  714. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  715. }
  716. function toIntByArray(array) {
  717. for (var index = 0; index < array.length; index++) {
  718. array[index] = parseInt(array[index]);
  719. }
  720. return array;
  721. }
  722. function getAngle0To360(angle) {
  723. while (angle < 0) {
  724. angle += 360;
  725. }
  726. while (angle >= 360) {
  727. angle -= 360;
  728. }
  729. return angle;
  730. }
  731. function toAngle(radian) {
  732. return radian * 180 / Math.PI;
  733. }
  734. function toRadian(angle) {
  735. return angle * Math.PI / 180;
  736. }
  737. function getArrayValueRandom(array) {
  738. return array[random(0, array.length - 1)];
  739. }
  740. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  743. }
  744. function fmtTimeMMSS(time) {
  745. if (time < 0) {
  746. time = 0;
  747. }
  748. else
  749. time = Math.floor(time);
  750. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  751. }
  752. function fmtTimeMS(time) {
  753. if (time < 0) {
  754. time = 0;
  755. }
  756. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  757. }
  758. function fmtTimeHHMM(time) {
  759. if (time < 0) {
  760. time = 0;
  761. }
  762. time = Math.floor(time / 1000);
  763. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  764. }
  765. let severTime = 0;
  766. function getServerTime() {
  767. return new Date(new Date().getTime() - severTime);
  768. }
  769. function setServerTime(data) {
  770. severTime = (new Date().getTime() - data);
  771. }
  772. var tools = /*#__PURE__*/Object.freeze({
  773. playClickEffect: playClickEffect,
  774. getNumList: getNumList,
  775. getStrList: getStrList,
  776. getRandStr: getRandStr,
  777. getUserId: getUserId,
  778. formatPos: formatPos,
  779. setPosInt: setPosInt,
  780. random: random,
  781. randomList: randomList,
  782. worldToScreen: worldToScreen,
  783. getStringLenght: getStringLenght,
  784. reviseString: reviseString,
  785. getCoinString: getCoinString,
  786. getV3Dest: getV3Dest,
  787. getV2Dest: getV2Dest,
  788. getV2Dir: getV2Dir,
  789. getV3Dir: getV3Dir,
  790. copyPos: copyPos,
  791. getScreenImg: getScreenImg,
  792. playMoveByPositions: playMoveByPositions,
  793. setStarPos: setStarPos,
  794. playLoopAnimRotate: playLoopAnimRotate,
  795. playLoopAnimPosition: playLoopAnimPosition,
  796. playLoopAnimScale: playLoopAnimScale,
  797. playLoopAnimRotation: playLoopAnimRotation,
  798. inRect: inRect,
  799. getNumberK: getNumberK,
  800. pointInsideCircle: pointInsideCircle,
  801. formatString: formatString,
  802. getIntersection: getIntersection,
  803. getComplement: getComplement,
  804. geSpriteStageRect: geSpriteStageRect,
  805. touchButton: touchButton,
  806. setColor: setColor,
  807. clone: clone,
  808. sort: sort,
  809. getLanguage: getLanguage,
  810. getLanguageByTip: getLanguageByTip,
  811. toWeights: toWeights,
  812. unique: unique,
  813. unique1: unique1,
  814. getDistance: getDistance,
  815. getV2Dis: getV2Dis,
  816. getV2SqDis: getV2SqDis,
  817. getDis: getDis,
  818. getDeltaxy: getDeltaxy,
  819. getSymbolNumber: getSymbolNumber,
  820. fixNumber: fixNumber,
  821. toThousands: toThousands,
  822. fmtMoney: fmtMoney,
  823. flatten: flatten,
  824. getDistanceByPoint: getDistanceByPoint,
  825. getAngleByPoint: getAngleByPoint,
  826. toIntByArray: toIntByArray,
  827. getAngle0To360: getAngle0To360,
  828. toAngle: toAngle,
  829. toRadian: toRadian,
  830. getArrayValueRandom: getArrayValueRandom,
  831. promptByTip: promptByTip,
  832. promptByErrorCode: promptByErrorCode,
  833. fmtTimeMMSS: fmtTimeMMSS,
  834. fmtTimeMS: fmtTimeMS,
  835. fmtTimeHHMM: fmtTimeHHMM,
  836. getServerTime: getServerTime,
  837. setServerTime: setServerTime
  838. });
  839. class HttpMgr {
  840. constructor() {
  841. HttpMgr._instance = this;
  842. }
  843. static getInstance() {
  844. if (!this._instance) {
  845. this._instance = new HttpMgr();
  846. }
  847. return this._instance;
  848. }
  849. sendPost(url, data, call) {
  850. let httpObj = new Laya.HttpRequest();
  851. httpObj.http.timeout = 5000;
  852. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  853. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  854. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  855. function errorHandler(error) {
  856. console.log("errorHandler:" + error);
  857. alert("Please check your network connection.");
  858. }
  859. function completeHandler(data) {
  860. if (data && data.length > 0) {
  861. let jsonData = JSON.parse(data);
  862. if (call)
  863. call(jsonData);
  864. }
  865. }
  866. }
  867. sendPost2025(reqUrl, data, call) {
  868. let isDev = false;
  869. let urlTop = "https://api.kessongame.site/";
  870. let urlMid = urlTop + "prod-api/api/game/";
  871. if (isDev) {
  872. urlTop = "http://192.168.1.13:8090/";
  873. urlMid = urlTop + "api/game/";
  874. }
  875. let url = urlMid + reqUrl;
  876. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  877. if (isDev) {
  878. url = urlTop + reqUrl;
  879. }
  880. else {
  881. url = urlTop + "prod-api/" + reqUrl;
  882. }
  883. }
  884. let httpObj = new Laya.HttpRequest();
  885. httpObj.http.timeout = 5000;
  886. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  887. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  888. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  889. function errorHandler(error) {
  890. if (call) {
  891. call("{'msg':'Network exception','code':500}");
  892. }
  893. else {
  894. alert("Tip:Please check your network connection.");
  895. }
  896. }
  897. function completeHandler(data) {
  898. if (data && data.length > 0) {
  899. let jsonData = JSON.parse(data);
  900. if (call)
  901. call(jsonData);
  902. }
  903. }
  904. }
  905. sendGet(url, call) {
  906. let httpObj = new Laya.HttpRequest();
  907. httpObj.http.timeout = 5000;
  908. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  909. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  910. httpObj.send(url, '', 'get');
  911. function errorHandler(error) {
  912. console.log("errorHandler:" + error);
  913. }
  914. function completeHandler(data) {
  915. if (data && data.length > 0) {
  916. if (call)
  917. call(data);
  918. }
  919. }
  920. }
  921. }
  922. HttpMgr._instance = null;
  923. class LightShader extends Laya.Sprite {
  924. constructor() {
  925. super();
  926. this._time = 0;
  927. this._sin = 0;
  928. this.initShader();
  929. }
  930. initShader() {
  931. var vs = `
  932. #define FSHIGHPRECISION
  933. attribute vec4 posuv;
  934. uniform vec2 size;
  935. varying vec4 v_texcoord;
  936. void main() {
  937. vec4 pos = vec4(posuv.xy,0.,1.);
  938. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  939. gl_Position=pos1;
  940. v_texcoord.xy = posuv.xy;
  941. }
  942. `;
  943. var ps = `
  944. #define FSHIGHPRECISION
  945. precision highp float;
  946. varying vec4 v_texcoord;
  947. uniform vec2 size;
  948. uniform sampler2D texture;
  949. uniform float u_Time;
  950. void main() {
  951. vec4 color= texture2D(texture, v_texcoord.xy);
  952. float width = 0.2;
  953. float start = u_Time;
  954. float offset = 1.0;
  955. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  956. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  957. {
  958. color.r=1.1;
  959. color.g=1.1;
  960. color.b=1.1;
  961. gl_FragColor = color;
  962. } else {
  963. gl_FragColor = color;
  964. }
  965. }
  966. `;
  967. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  968. this.customRenderEnable = true;
  969. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  970. }
  971. customRender(context, x, y) {
  972. this.onUpdate();
  973. if (!this.texture)
  974. return;
  975. let xx = x - this.pivotX;
  976. let yy = y - this.pivotY;
  977. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  978. }
  979. onUpdate() {
  980. this._time += 2 * Laya.timer.delta * 0.001;
  981. this._sin = Math.sin(this._time);
  982. if (this._sin > 0.99) {
  983. this._sin = 0;
  984. this._time = 0;
  985. }
  986. this.shaderValue['u_Time'] = this._sin;
  987. }
  988. }
  989. LightShader.DissolveSurfaceSaveName = 9997;
  990. class UIBase extends fairygui.Window {
  991. constructor() {
  992. super();
  993. this.isEject = true;
  994. this.isHide = true;
  995. this.showbanner = true;
  996. this.className = "";
  997. this.isMuti = false;
  998. this.showbanner = false;
  999. this.onConstructor();
  1000. }
  1001. checkActive(show) {
  1002. }
  1003. getUIName() {
  1004. return UIBase.uiName;
  1005. }
  1006. onConstructor() {
  1007. }
  1008. onInit() {
  1009. if (!!this.contentPane) {
  1010. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1011. }
  1012. this.setPivot(0.5, 0.5, false);
  1013. }
  1014. doShowAnimation() {
  1015. if (!this.isEject)
  1016. return;
  1017. super.doShowAnimation();
  1018. Laya.Tween.clearTween(this);
  1019. this.scaleX = this.scaleY = 0.8;
  1020. let tweenFunc1 = (func) => {
  1021. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1022. };
  1023. let tweenFunc2 = (func) => {
  1024. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1025. };
  1026. tweenFunc1(tweenFunc2);
  1027. }
  1028. show(...args) {
  1029. super.show();
  1030. this._openParam = args;
  1031. this.isHide = false;
  1032. xGame.uiMgr.checkUIState();
  1033. }
  1034. moveBannerButton() {
  1035. }
  1036. showBannerButton() {
  1037. this.bannerButton.visible = true;
  1038. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1039. this.bannerButton.touchable = true;
  1040. }));
  1041. }
  1042. hide() {
  1043. super.hide();
  1044. this.isHide = true;
  1045. xGame.uiMgr.checkUIState();
  1046. }
  1047. Dispose() {
  1048. super.dispose();
  1049. }
  1050. myUpdate(delay) {
  1051. }
  1052. refresh() { }
  1053. addUIClick(obj, func, arr = null) {
  1054. obj.onClick(this, func, arr);
  1055. obj.onClick(this, this.playBtnSound);
  1056. }
  1057. offUIClick(obj, func) {
  1058. obj.offClick(this, func);
  1059. }
  1060. playBtnSound() {
  1061. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1062. }
  1063. }
  1064. UIBase.lastShowBanner = 0;
  1065. UIBase.showBannerNum = 0;
  1066. UIBase.uiName = "";
  1067. class ui_UIDraw extends fgui.GComponent {
  1068. static createInstance() {
  1069. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1070. }
  1071. onConstruct() {
  1072. this.n1 = (this.getChild("n1"));
  1073. this.extraNode = (this.getChild("extraNode"));
  1074. this.myNode = (this.getChild("myNode"));
  1075. this.closeNode = (this.getChild("closeNode"));
  1076. this.moneyNode = (this.getChild("moneyNode"));
  1077. this.n38 = (this.getChild("n38"));
  1078. this.secretary = (this.getChild("secretary"));
  1079. this.drawBtn = (this.getChild("drawBtn"));
  1080. this.talkNode = (this.getChild("talkNode"));
  1081. this.t0 = this.getTransition("t0");
  1082. }
  1083. }
  1084. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1085. class ui_UIBox extends fgui.GComponent {
  1086. static createInstance() {
  1087. return (fgui.UIPackage.createObject("game", "UIBox"));
  1088. }
  1089. onConstruct() {
  1090. this.n0 = (this.getChild("n0"));
  1091. this.n12 = (this.getChild("n12"));
  1092. this.n1 = (this.getChild("n1"));
  1093. this.n2 = (this.getChild("n2"));
  1094. this.bar = (this.getChild("bar"));
  1095. this.closeBtn = (this.getChild("closeBtn"));
  1096. this.openBtn = (this.getChild("openBtn"));
  1097. this.t0 = this.getTransition("t0");
  1098. this.t1 = this.getTransition("t1");
  1099. }
  1100. }
  1101. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1102. class GlobalManager {
  1103. constructor() {
  1104. }
  1105. registerMethod(name, method) {
  1106. console.log('zh: 注册全局方法', name);
  1107. this[name] = method;
  1108. }
  1109. callMethod(name, ...args) {
  1110. console.log('zh: 调用全局方法', name);
  1111. if (this[name]) {
  1112. return this[name](...args);
  1113. }
  1114. else {
  1115. console.error(`zh: 全局方法 Method ${name} not found`);
  1116. }
  1117. }
  1118. }
  1119. GlobalManager.instance = new GlobalManager();
  1120. class JSBridgeUtils {
  1121. constructor() { }
  1122. static get instance() {
  1123. if (!this._instance) {
  1124. this._instance = new JSBridgeUtils();
  1125. }
  1126. return this._instance;
  1127. }
  1128. initBridge() {
  1129. if (!Laya.Browser.onAndroid) {
  1130. console.log('zh:非android dev');
  1131. return;
  1132. }
  1133. let cfg = window['conchConfig'];
  1134. if (cfg) {
  1135. var os = cfg.getOS();
  1136. if (os == "Conch-android") {
  1137. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1138. if (this.bridge) {
  1139. return true;
  1140. }
  1141. else {
  1142. return false;
  1143. }
  1144. }
  1145. else {
  1146. return false;
  1147. }
  1148. }
  1149. else {
  1150. return false;
  1151. }
  1152. }
  1153. testAd1() {
  1154. if (!Laya.Browser.onAndroid) {
  1155. console.log('zh:非android dev');
  1156. return;
  1157. }
  1158. if (!this.initBridge()) {
  1159. return;
  1160. }
  1161. let rs = this.bridge.call("testString", "hello");
  1162. console.log('zh:testString rs=' + rs);
  1163. }
  1164. testAdCallBack() {
  1165. if (!this.initBridge()) {
  1166. return;
  1167. }
  1168. console.log("zh:testAdCallBack start");
  1169. const defaultObj = { code: 200, msg: "req update Ui" };
  1170. const reqObj = { code: 300, msg: "hello java ui" };
  1171. this.bridge.callWithBack((rsStr) => {
  1172. const rsObj = JSON.parse(rsStr);
  1173. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1174. }, "testAsyncCallback", JSON.stringify(reqObj));
  1175. }
  1176. showInternAd(mark) {
  1177. console.log('zh:showInternAd start');
  1178. if (!Laya.Browser.onAndroid) {
  1179. console.log('zh:showInternAd 非android dev');
  1180. return false;
  1181. }
  1182. if (!this.initBridge()) {
  1183. return false;
  1184. }
  1185. let rs = this.bridge.call("showInternAd", mark);
  1186. try {
  1187. const result = JSON.parse(rs);
  1188. if (result.code === 200) {
  1189. console.log("zh:showInternAd OK");
  1190. return true;
  1191. }
  1192. else {
  1193. console.warn("zh:showInternAd FAILL:", result.msg);
  1194. return false;
  1195. }
  1196. }
  1197. catch (e) {
  1198. console.error("zh:解析桥接返回值失败:", e);
  1199. return false;
  1200. }
  1201. }
  1202. exitAndCloseGame() {
  1203. if (!Laya.Browser.onAndroid) {
  1204. console.log('zh:非android dev');
  1205. return;
  1206. }
  1207. if (!this.initBridge()) {
  1208. return;
  1209. }
  1210. console.log('zh:开始关闭游戏-');
  1211. this.bridge.call("exitAndCloseGame");
  1212. }
  1213. showRewardAd(mark) {
  1214. if (!Laya.Browser.onAndroid) {
  1215. console.log('zh:非android dev');
  1216. return false;
  1217. }
  1218. if (!this.initBridge()) {
  1219. return false;
  1220. }
  1221. let rs = this.bridge.call("showRewardAd", mark);
  1222. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1223. try {
  1224. const result = JSON.parse(rs);
  1225. if (result.code === 200) {
  1226. console.log("zh:广告显示成功");
  1227. return true;
  1228. }
  1229. else {
  1230. console.warn("zh:广告显示失败:", result.msg);
  1231. return false;
  1232. }
  1233. }
  1234. catch (e) {
  1235. console.error("zh:解析桥接返回值失败:", e);
  1236. return false;
  1237. }
  1238. }
  1239. logEventForAdNoParams(eventName) {
  1240. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1241. if (!Laya.Browser.onAndroid) {
  1242. console.log('zh:非android dev');
  1243. return;
  1244. }
  1245. if (!this.initBridge()) {
  1246. return;
  1247. }
  1248. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1249. this.bridge.call("logEventForAdNoParams", eventName);
  1250. }
  1251. logEventForAdHaveParams(eventName, jsonStr) {
  1252. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1253. if (!Laya.Browser.onAndroid) {
  1254. console.log('zh:非android dev');
  1255. return;
  1256. }
  1257. if (!this.initBridge()) {
  1258. return;
  1259. }
  1260. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1261. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1262. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1263. }
  1264. logEventForFirebase(eventName, jsonStr) {
  1265. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1266. if (!Laya.Browser.onAndroid) {
  1267. console.log('zh:非android dev');
  1268. return;
  1269. }
  1270. if (!this.initBridge()) {
  1271. return;
  1272. }
  1273. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1274. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1275. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1276. }
  1277. nativeCallJs(msg) {
  1278. console.log("zh:nativeCallJs received data: 1111", msg);
  1279. if (msg === 'Ad1') {
  1280. GlobalManager.instance.callMethod('Ad1');
  1281. console.log("zh: Ad1 奖励发送成功");
  1282. }
  1283. else if (msg === 'Ad2') {
  1284. GlobalManager.instance.callMethod('Ad2');
  1285. console.log("zh: Ad2 奖励发送成功");
  1286. }
  1287. else if (msg === 'Ad3') {
  1288. GlobalManager.instance.callMethod('Ad3');
  1289. console.log("zh: Ad3 奖励发送成功");
  1290. }
  1291. else if (msg === 'Ad4') {
  1292. GlobalManager.instance.callMethod('Ad4');
  1293. console.log("zh: Ad4 奖励发送成功");
  1294. }
  1295. else if (msg === 'Ad5') {
  1296. console.log("zh: Ad5 奖励发送成功");
  1297. GlobalManager.instance.callMethod('Ad5');
  1298. }
  1299. }
  1300. }
  1301. class UIBox extends UIBase {
  1302. constructor() {
  1303. super();
  1304. this.boxNum = 0;
  1305. this.boxMax = 10;
  1306. this.inAd = false;
  1307. this.isClose = false;
  1308. }
  1309. onConstructor() {
  1310. this.ui = ui_UIBox.createInstance();
  1311. this.contentPane = this.ui;
  1312. this.isEject = false;
  1313. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1314. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1315. Laya.timer.loop(1000, this, this.update);
  1316. }
  1317. update() {
  1318. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1319. this.boxNum -= 1;
  1320. this.upBar();
  1321. }
  1322. }
  1323. upBar() {
  1324. if (this.boxNum > this.boxMax)
  1325. this.boxNum = this.boxMax;
  1326. this.ui.bar.value = this.boxNum * 10;
  1327. }
  1328. show() {
  1329. super.show();
  1330. this.isClose = false;
  1331. this.boxNum = 0;
  1332. this.inAd = false;
  1333. this.upBar();
  1334. this.ui.t0.play();
  1335. this.ui.closeBtn.visible = false;
  1336. Laya.timer.once(3000, this, () => {
  1337. this.ui.closeBtn.visible = true;
  1338. this.ui.bar.alpha = 1;
  1339. });
  1340. Laya.timer.once(500, this, () => {
  1341. this.ui.t1.play();
  1342. });
  1343. }
  1344. hide() {
  1345. Laya.timer.clearAll(this);
  1346. Moyu.showBannerAd(false);
  1347. super.hide();
  1348. }
  1349. onOpenBox() {
  1350. this.boxNum++;
  1351. if (this.boxNum < this.boxMax) {
  1352. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1353. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1354. }
  1355. }
  1356. else if (this.boxNum == this.boxMax) {
  1357. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1358. this.ui.openBtn.c1.selectedIndex = 13;
  1359. this.inAd = true;
  1360. }
  1361. else
  1362. this.getAward();
  1363. }
  1364. else if (this.inAd) {
  1365. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1366. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1367. }
  1368. else {
  1369. console.log('zh:AD 失败,直接发放奖励');
  1370. this.qjff_AD_for_UIBOX_onOpenBox();
  1371. }
  1372. }
  1373. this.upBar();
  1374. }
  1375. qjff_AD_for_UIBOX_onOpenBox() {
  1376. this.getAward();
  1377. }
  1378. onCloseBox() {
  1379. if (this.isClose)
  1380. this.hide();
  1381. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1382. this.isClose = true;
  1383. PlatMgr.showBanner(true, 0, 3000);
  1384. }
  1385. else
  1386. this.hide();
  1387. }
  1388. getAward() {
  1389. let str = "";
  1390. if (Math.random() < 0.5) {
  1391. let max = Moyu.isLegal ? 500 : 2500;
  1392. let num = xGame.tools.random(max, 500 + max);
  1393. DataMgr.setCoin(num);
  1394. str = "金币x" + num;
  1395. }
  1396. else {
  1397. let max = Moyu.isLegal ? 10 : 30;
  1398. let num = xGame.tools.random(max, 30 + max);
  1399. DataMgr.setDiamond(num);
  1400. str = "钻石x" + num;
  1401. }
  1402. xGame.showTip("恭喜获得-" + str);
  1403. this.hide();
  1404. }
  1405. }
  1406. UIBox.uiName = "UIBox";
  1407. class ui_UITry extends fgui.GComponent {
  1408. static createInstance() {
  1409. return (fgui.UIPackage.createObject("game", "UITry"));
  1410. }
  1411. onConstruct() {
  1412. this.n11 = (this.getChild("n11"));
  1413. this.myNode = (this.getChild("myNode"));
  1414. this.t0 = this.getTransition("t0");
  1415. }
  1416. }
  1417. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1418. class UITry extends UIBase {
  1419. constructor() {
  1420. super();
  1421. this.closeTime = 0;
  1422. this.closeNum = 0;
  1423. this.skillUrl = xGame.common.skillIconList;
  1424. }
  1425. onConstructor() {
  1426. this.ui = ui_UITry.createInstance();
  1427. this.contentPane = this.ui;
  1428. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1429. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1430. }
  1431. show() {
  1432. super.show();
  1433. this.closeNum = 0;
  1434. this.closeTime = 15;
  1435. this.ui.t0.play();
  1436. PlatMgr.showRateBanner();
  1437. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1438. Laya.timer.loop(1000, this, this.updateTime);
  1439. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1440. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1441. xGame.common.gameMgr.gamePause = true;
  1442. }
  1443. updateTime() {
  1444. if (this.closeTime > 1) {
  1445. this.closeTime--;
  1446. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1447. }
  1448. else
  1449. this.hide();
  1450. }
  1451. hide() {
  1452. Laya.timer.clearAll(this);
  1453. Moyu.showBannerAd(false);
  1454. super.hide();
  1455. xGame.common.gameMgr.gamePause = false;
  1456. }
  1457. onTry() {
  1458. console.log('zh:qjff_AD_for_uitry');
  1459. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1460. }
  1461. else {
  1462. console.log('zh:AD 失败,直接发放奖励');
  1463. this.qjff_AD_for_uitry();
  1464. }
  1465. }
  1466. qjff_AD_for_uitry() {
  1467. let select = xGame.common.curPlayerSkillType;
  1468. DataMgr.gameData.trySkill = select;
  1469. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1470. DataMgr.saveGameData();
  1471. DataMgr.setBigSkill(select, 1);
  1472. xGame.showTip("Trial Successful");
  1473. this.hide();
  1474. }
  1475. onCancel() {
  1476. if (this.closeNum > 0) {
  1477. this.closeNum--;
  1478. if (this.closeNum < 2)
  1479. this.hide();
  1480. return;
  1481. }
  1482. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1483. this.onTry();
  1484. }
  1485. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1486. this.closeNum = 3;
  1487. }
  1488. else
  1489. this.hide();
  1490. }
  1491. }
  1492. UITry.uiName = "UITry";
  1493. class PlatMgr {
  1494. static initConfig() {
  1495. this.lastVt = 0;
  1496. if (!Moyu.platConfig)
  1497. return;
  1498. for (let k in Moyu.platConfig) {
  1499. let pd = this[k];
  1500. let pc = Moyu.platConfig[k];
  1501. if (pd != undefined && pc != undefined)
  1502. this[k] = pc;
  1503. }
  1504. Moyu.setBannerPos(0.5, 1);
  1505. }
  1506. static rand100(num) {
  1507. return xGame.tools.random(0, 100) < num;
  1508. }
  1509. static isMisVideo() {
  1510. let dt = Laya.timer.currTimer - this.lastVt;
  1511. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1512. this.lastVt = Laya.timer.currTimer;
  1513. return true;
  1514. }
  1515. else {
  1516. if (this.rand100(this.fullVideoRate)) {
  1517. console.log('zh:插屏 ad start');
  1518. JSBridgeUtils.instance.showInternAd('platMgr');
  1519. }
  1520. return false;
  1521. }
  1522. }
  1523. static showVideo(call, type) {
  1524. Moyu.showVideoAd(() => {
  1525. this.lastVt = Laya.timer.currTimer;
  1526. call && call();
  1527. }, type);
  1528. }
  1529. static showInsert(delay = false) {
  1530. if (this.getRand() < this.insertRate) {
  1531. let dt = delay ? this.insertDelay : 0;
  1532. console.log('zh:插屏 ad start');
  1533. JSBridgeUtils.instance.showInternAd('gameInsert');
  1534. }
  1535. }
  1536. static gameInsert() {
  1537. let t = this.getRand();
  1538. let r = this.gameInsertRate;
  1539. if (t < r) {
  1540. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1541. }
  1542. }
  1543. static showRateBanner() {
  1544. if (this.getRand() < this.bannerRate)
  1545. this.showBanner(true, this.bannerDelay, 3000);
  1546. }
  1547. static showBanner(show, delay = 0, hide = 0) {
  1548. if (2 > 1) {
  1549. console.log('zh:显示showBanner广告 直接返回');
  1550. return;
  1551. }
  1552. if (!show)
  1553. Moyu.showBannerAd(false);
  1554. else {
  1555. Laya.timer.clear(this, this.bannerShow);
  1556. if (delay > 0)
  1557. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1558. else
  1559. this.bannerShow(true);
  1560. if (hide > 0)
  1561. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1562. }
  1563. }
  1564. static bannerShow(show) {
  1565. if (2 > 1) {
  1566. console.log('zh:显示showBanner广告 直接返回');
  1567. return;
  1568. }
  1569. Moyu.showBannerAd(show);
  1570. console.log("showBanner" + show);
  1571. }
  1572. static getRand() {
  1573. return xGame.tools.random(0, 100);
  1574. }
  1575. static openBox() {
  1576. if (this.getRand() < this.boxRate)
  1577. xGame.uiMgr.Show(UIBox);
  1578. }
  1579. static openTry() {
  1580. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1581. return;
  1582. if (this.getRand() < this.tryRate)
  1583. xGame.uiMgr.Show(UITry);
  1584. else if (DataMgr.gameData.gameCount == 1)
  1585. xGame.uiMgr.Show(UITry);
  1586. }
  1587. }
  1588. PlatMgr.forceShare = 0;
  1589. PlatMgr.signAdRate = 0;
  1590. PlatMgr.forceVideoRate = 0;
  1591. PlatMgr.forceVideoGap = 0;
  1592. PlatMgr.fullVideoRate = 0;
  1593. PlatMgr.gameInsertRate = 0;
  1594. PlatMgr.insertGap = 0;
  1595. PlatMgr.insertDelay = 0;
  1596. PlatMgr.insertRate = 0;
  1597. PlatMgr.boxRate = 0;
  1598. PlatMgr.boxVideoRate = 0;
  1599. PlatMgr.boxInsertRate = 0;
  1600. PlatMgr.boxBannerRate = 0;
  1601. PlatMgr.tryRate = 0;
  1602. PlatMgr.tryClose3Rate = 0;
  1603. PlatMgr.tryVideoRate = 0;
  1604. PlatMgr.bannerRate = 0;
  1605. PlatMgr.lastVt = 0;
  1606. class ui_UIAddProp extends fgui.GComponent {
  1607. static createInstance() {
  1608. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1609. }
  1610. onConstruct() {
  1611. this.n11 = (this.getChild("n11"));
  1612. this.myNode = (this.getChild("myNode"));
  1613. this.closeBtn = (this.getChild("closeBtn"));
  1614. this.t0 = this.getTransition("t0");
  1615. }
  1616. }
  1617. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1618. class SpineMgr {
  1619. constructor(name, loadCb = null) {
  1620. this.loaded = false;
  1621. this.spineName = '';
  1622. this.loadedCallback = loadCb;
  1623. this.templet = new Laya.Templet();
  1624. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1625. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1626. if (name === 'mishu') {
  1627. this.templet.loadAni('spine/nvmishu.sk');
  1628. }
  1629. else {
  1630. this.templet.loadAni(`spine/${name}.sk`);
  1631. }
  1632. this.templet.lock = true;
  1633. this.spineName = name;
  1634. }
  1635. onError() {
  1636. console.log("zh:spine加载出错");
  1637. }
  1638. parseComplete() {
  1639. this.loaded = true;
  1640. this.loadedCallback && this.loadedCallback();
  1641. }
  1642. dispose() {
  1643. if (this.templet && !this.templet.destroyed) {
  1644. this.templet.destroy();
  1645. }
  1646. this.templet = null;
  1647. }
  1648. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1649. if (!this.loaded) {
  1650. return;
  1651. }
  1652. let spine;
  1653. if (mySpine) {
  1654. spine = mySpine;
  1655. }
  1656. else {
  1657. spine = this.createSpine(data, parent);
  1658. }
  1659. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1660. if (!isLoop) {
  1661. spine.on(Laya.Event.STOPPED, this, () => {
  1662. spine.offAll(Laya.Event.STOPPED);
  1663. callback && callback(spine);
  1664. });
  1665. }
  1666. return spine;
  1667. }
  1668. createSpine(data, parent, type = 1) {
  1669. let spine;
  1670. spine = this.templet.buildArmature(type);
  1671. spine.showSkinByIndex(0);
  1672. parent.addChild(spine);
  1673. spine.pos(data.x, data.y);
  1674. spine.scale(data.scaleX, data.scaleY, true);
  1675. return spine;
  1676. }
  1677. }
  1678. var AIState;
  1679. (function (AIState) {
  1680. AIState[AIState["none"] = 0] = "none";
  1681. AIState[AIState["idle"] = 1] = "idle";
  1682. AIState[AIState["reset"] = 2] = "reset";
  1683. AIState[AIState["move"] = 3] = "move";
  1684. AIState[AIState["wait"] = 4] = "wait";
  1685. AIState[AIState["select"] = 5] = "select";
  1686. AIState[AIState["turn"] = 6] = "turn";
  1687. AIState[AIState["shoot"] = 7] = "shoot";
  1688. AIState[AIState["leave"] = 8] = "leave";
  1689. })(AIState || (AIState = {}));
  1690. class AIPlayer {
  1691. constructor() {
  1692. this.dtime = 30;
  1693. this.awayTime = 0;
  1694. this.awayNum = 0;
  1695. this.hideTime = 0;
  1696. this.rootMoveTime = 0;
  1697. this.isGuide = false;
  1698. this.state = AIState.none;
  1699. this.waitTime = 0;
  1700. this.forceNum = 0;
  1701. this.forceMax = 0;
  1702. this.ballSize = 33;
  1703. this.selectNum = 0;
  1704. this.destRot = 0;
  1705. this.aiLv = 10;
  1706. this.kickBall = [];
  1707. this.lineBall = [];
  1708. this.scoreBall = [];
  1709. this.holeBall = [];
  1710. this.turnNum = 0;
  1711. this.setNum = 0;
  1712. this.setMax = 0;
  1713. this.setRate = 0;
  1714. this.rectL = 0;
  1715. this.rectR = 0;
  1716. this.rectT = 0;
  1717. this.rectB = 0;
  1718. this.rootPos = { x: 0, y: 0 };
  1719. this.bestForce = 0;
  1720. this.bestAngle = 180;
  1721. this.bestPos = { x: 0, y: 0 };
  1722. this.bestKick = { x: 0, y: 0 };
  1723. this.posList = [];
  1724. this.posIdx = 0;
  1725. this.chatTime = 3000;
  1726. this.tempDir1 = new Laya.Vector2();
  1727. this.tempDir2 = new Laya.Vector2();
  1728. this.tempDir3 = new Laya.Vector2();
  1729. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1730. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1731. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1732. this.gameSrc = xGame.common.gameUI;
  1733. this.hideTime = Laya.timer.currTimer;
  1734. Moyu.setOnTipCall((id) => {
  1735. if (id == 20012)
  1736. this.hideTime = Laya.timer.currTimer;
  1737. else
  1738. (id == 20011);
  1739. {
  1740. let dt = Laya.timer.currTimer - this.hideTime;
  1741. console.log("onshow" + dt);
  1742. if (dt > 30000 && this.state > AIState.none)
  1743. xGame.common.gameMgr.aiGameEnd(false);
  1744. }
  1745. }, this);
  1746. }
  1747. init() {
  1748. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1749. this.awayTime = xGame.tools.random(5000, 10000);
  1750. this.awayNum = 0;
  1751. this.hideTime = Laya.timer.currTimer;
  1752. let rect = xGame.common.d2World.borderRect;
  1753. this.rectL = Math.ceil(rect.x) + 17;
  1754. this.rectT = Math.ceil(rect.y) + 17;
  1755. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1756. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1757. this.wBall = xGame.common.d2World.rootBall;
  1758. this.ballSize = this.wBall.gameObj.width - 1;
  1759. if (this.posList.length < 1) {
  1760. let dp = 40;
  1761. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1762. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1763. let dx = i < this.rectR ? i : this.rectR;
  1764. let dy = j < this.rectB ? j : this.rectB;
  1765. let order = xGame.tools.random(0, 1000);
  1766. this.posList.push({ x: dx, y: dy, order: order });
  1767. }
  1768. }
  1769. this.posList.sort(function (a, b) {
  1770. return a.order - b.order;
  1771. });
  1772. this.setMax = this.posList.length;
  1773. }
  1774. this.state = AIState.idle;
  1775. }
  1776. setAiLevel(num) {
  1777. this.aiLv = num;
  1778. }
  1779. initBall() {
  1780. this.rootPos.x = this.wBall.gameObj.x;
  1781. this.rootPos.y = this.wBall.gameObj.y;
  1782. this.initHoleBall();
  1783. }
  1784. initHoleBall() {
  1785. this.kickBall = [];
  1786. this.lineBall = [];
  1787. this.scoreBall = [];
  1788. this.holeBall = [];
  1789. this.selectNum = 0;
  1790. this.forceNum = 0;
  1791. this.forceMax = 0;
  1792. this.turnNum = 0;
  1793. let list = xGame.common.d2World.ballArr;
  1794. if (list.length < 20 && !this.isGuide) {
  1795. let holes = xGame.common.gameMgr.holePosList;
  1796. for (let i = 0; i < list.length; i++) {
  1797. let obj = list[i];
  1798. if (!obj)
  1799. continue;
  1800. obj.kickPos.x = 0;
  1801. obj.kickPos.y = 0;
  1802. obj.poleAngle = 0;
  1803. obj.hard = 0;
  1804. obj.borderDis = 0;
  1805. obj.kickAngle = 180;
  1806. if (obj.number == 0)
  1807. continue;
  1808. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1809. continue;
  1810. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1811. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1812. continue;
  1813. }
  1814. let b = obj.gameObj;
  1815. let wbp = this.rootPos;
  1816. let bx = wbp.x - b.x;
  1817. let by = wbp.y - b.y;
  1818. obj.borderDis = xGame.tools.random(0, 100);
  1819. this.kickBall.push(obj);
  1820. if (!this.isLine(wbp, obj))
  1821. continue;
  1822. obj.kickAngle = xGame.tools.random(90, 180);
  1823. obj.kickPos.x = b.x;
  1824. obj.kickPos.y = b.y;
  1825. this.lineBall.push(obj);
  1826. let minDis = 999999;
  1827. let hole = false;
  1828. for (let j = 0; j < holes.length; j++) {
  1829. let hp = holes[j];
  1830. if (bx >= 0 && hp.x > b.x + 100)
  1831. continue;
  1832. if (bx <= 0 && hp.x < b.x - 100)
  1833. continue;
  1834. if (by < -10 && hp.y < wbp.y)
  1835. continue;
  1836. if (by > 10 && hp.y > wbp.y)
  1837. continue;
  1838. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1839. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1840. if (dis < minDis) {
  1841. let dx = b.x - this.tempDir1.x * this.ballSize;
  1842. let dy = b.y - this.tempDir1.y * this.ballSize;
  1843. this.tempDir3.x = this.tempDir1.x;
  1844. this.tempDir3.y = this.tempDir1.y;
  1845. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1846. obj.kickPos.x = dx;
  1847. obj.kickPos.y = dy;
  1848. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1849. if (num > 1)
  1850. num = 1;
  1851. obj.kickAngle = Math.acos(num) * 57.3;
  1852. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1853. dis = dis * 2;
  1854. if (Math.abs(hp.x - 600) < 100)
  1855. dis += 50;
  1856. obj.hard = dis + obj.kickAngle * 3;
  1857. hole = true;
  1858. }
  1859. }
  1860. }
  1861. }
  1862. if (hole) {
  1863. this.scoreBall.push(obj);
  1864. this.holeBall.push(obj);
  1865. }
  1866. }
  1867. this.scoreBall.sort(function (a, b) {
  1868. return a.hard - b.hard;
  1869. });
  1870. this.holeBall.sort(function (a, b) {
  1871. return a.kickAngle - b.kickAngle;
  1872. });
  1873. this.kickBall.sort(function (a, b) {
  1874. return a.borderDis - b.borderDis;
  1875. });
  1876. }
  1877. else {
  1878. let max = list.length - 1;
  1879. let i = xGame.tools.random(0, max);
  1880. for (i; i <= max; i++) {
  1881. let idx = i >= max ? i -= max : i;
  1882. let obj = list[idx];
  1883. if (obj && obj.number != 0) {
  1884. obj.kickAngle = xGame.tools.random(90, 180);
  1885. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1886. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1887. this.lineBall.push(obj);
  1888. break;
  1889. }
  1890. }
  1891. }
  1892. }
  1893. selectBall() {
  1894. let ball = null;
  1895. this.destRot = 0;
  1896. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1897. let ai = 110 - this.aiLv * 10;
  1898. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1899. let score = false;
  1900. if (this.scoreBall.length < 1) {
  1901. if (this.lineBall.length < 1) {
  1902. for (let i = 0; i < this.kickBall.length; i++) {
  1903. let list = [];
  1904. let bo = this.kickBall[i];
  1905. let bobj = bo.gameObj;
  1906. let rect = xGame.common.d2World.borderRect;
  1907. let mobj = this.wBall.gameObj;
  1908. let minb = bobj.y - rect.y - 20;
  1909. let minw = mobj.y - rect.y - 50;
  1910. if (minb > 0 && minw > 0) {
  1911. let dlenx = 0;
  1912. let dleny = mobj.y - rect.y;
  1913. let spx = mobj.x;
  1914. let spy = rect.y - dleny;
  1915. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1916. }
  1917. minb = rect.y + rect.height - bobj.y - 20;
  1918. minw = rect.y + rect.height - mobj.y - 50;
  1919. if (minb > 0 && minw > 0) {
  1920. let dlenx = 0;
  1921. let dleny = rect.y + rect.height - mobj.y;
  1922. let spx = mobj.x;
  1923. let spy = rect.y + rect.height + dleny;
  1924. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1925. }
  1926. minb = bobj.x - rect.x - 20;
  1927. minw = mobj.x - rect.x - 50;
  1928. if (minb > 0 && minw > 0) {
  1929. let dlenx = mobj.x - rect.x;
  1930. let dleny = 0;
  1931. let spx = rect.x - dlenx;
  1932. let spy = mobj.y;
  1933. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1934. }
  1935. minb = rect.x + rect.width - bobj.x - 20;
  1936. minw = rect.x + rect.width - mobj.x - 50;
  1937. if (minb > 0 && minw > 0) {
  1938. let dlenx = rect.x + rect.width - mobj.x;
  1939. let dleny = 0;
  1940. let spx = rect.x + rect.width + dlenx;
  1941. let spy = mobj.y;
  1942. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1943. }
  1944. list.sort(function (a, b) {
  1945. return a.order - b.order;
  1946. });
  1947. for (let i = 0; i < list.length; i++) {
  1948. let data = list[i];
  1949. let mx = mobj.x - bobj.x;
  1950. let my = mobj.y - bobj.y;
  1951. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1952. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1953. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1954. if (num > 1)
  1955. num = 1;
  1956. let cos = Math.acos(num);
  1957. if (cos > 1.57)
  1958. cos = 1.57;
  1959. else if (cos < 0.01)
  1960. cos = 0.01;
  1961. let tan = Math.tan(cos);
  1962. let dx = tan * data.dleny;
  1963. let dy = tan * data.dlenx;
  1964. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1965. if (Math.abs(bx - 667) < 40)
  1966. continue;
  1967. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1968. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1969. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1970. this.forceMax = dis * 0.08;
  1971. this.destRot += mis * 0.1;
  1972. this.setKick(bx, by);
  1973. return true;
  1974. }
  1975. }
  1976. }
  1977. }
  1978. else {
  1979. ball = xGame.common.getRandArrEle(this.lineBall);
  1980. }
  1981. }
  1982. else {
  1983. for (let i = 0; i < this.scoreBall.length; i++) {
  1984. if (i < this.scoreBall.length - 1) {
  1985. let rand = 70 + this.aiLv * 10 + i * 10;
  1986. if (xGame.tools.random(0, 100) < rand) {
  1987. ball = this.scoreBall[i];
  1988. break;
  1989. }
  1990. }
  1991. else {
  1992. ball = this.scoreBall[i];
  1993. break;
  1994. }
  1995. }
  1996. score = true;
  1997. this.selectNum++;
  1998. }
  1999. if (!ball)
  2000. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2001. if (this.selectNum >= max) {
  2002. let dx = ball.gameObj.x;
  2003. let dy = ball.gameObj.y;
  2004. let kickAngle = 0;
  2005. if (score) {
  2006. dx = ball.kickPos.x;
  2007. dy = ball.kickPos.y;
  2008. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2009. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2010. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2011. if (adot > 1)
  2012. adot = 1;
  2013. kickAngle = Math.acos(adot) * 57.3;
  2014. if (kickAngle > 45) {
  2015. let kdx = ball.kickPos.x - ball.gameObj.x;
  2016. let kdy = ball.kickPos.y - ball.gameObj.y;
  2017. dx = ball.kickPos.x - kdx * mis * 0.3;
  2018. dy = ball.kickPos.y - kdy * mis * 0.3;
  2019. }
  2020. else
  2021. this.destRot += mis;
  2022. }
  2023. else if (ball.poleAngle != 0) {
  2024. this.destRot += ball.poleAngle;
  2025. }
  2026. if (xGame.common.gameMode == 0) {
  2027. let af = kickAngle * 0.08;
  2028. this.forceMax = ball.hard * 0.1 + af * af;
  2029. }
  2030. this.setKick(dx, dy);
  2031. }
  2032. else {
  2033. let rand = this.aiLv * 5 + 40;
  2034. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2035. ball = xGame.common.getRandArrEle(this.scoreBall);
  2036. else
  2037. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2038. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2039. if (xGame.tools.random(0, 100) > rand) {
  2040. this.selectNum = max;
  2041. }
  2042. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2043. this.selectNum++;
  2044. }
  2045. ball.onClick(0, true);
  2046. }
  2047. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2048. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2049. let balls = xGame.common.d2World.ballArr;
  2050. let max = xGame.tools.getDis(hx, hy, bx, by);
  2051. for (let index = 0; index < balls.length; index++) {
  2052. let obj = balls[index];
  2053. if (obj.number == 0)
  2054. continue;
  2055. if (obj.number == bn || obj.number == dn)
  2056. continue;
  2057. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2058. if (dis * dis > max)
  2059. continue;
  2060. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2061. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2062. if (num > 1)
  2063. num = 1;
  2064. if (num < 0)
  2065. continue;
  2066. let gap = Math.sin(Math.acos(num)) * dis;
  2067. if (gap < this.ballSize)
  2068. return true;
  2069. }
  2070. return false;
  2071. }
  2072. isLine(xy, ball) {
  2073. let bx = xy.x;
  2074. let by = xy.y;
  2075. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2076. let dis = ball.getDestDis(xy);
  2077. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2078. let sin = Math.sin(angle);
  2079. let cos = Math.cos(angle);
  2080. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2081. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2082. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2083. let dx = bx + this.tempDir2.x * dis;
  2084. let dy = by + this.tempDir2.y * dis;
  2085. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2086. sin = Math.sin(-angle);
  2087. cos = Math.cos(-angle);
  2088. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2089. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2090. dx = bx + this.tempDir2.x * dis;
  2091. dy = by + this.tempDir2.y * dis;
  2092. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2093. if (isr && isl)
  2094. return false;
  2095. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2096. }
  2097. return true;
  2098. }
  2099. turnPole() {
  2100. this.turnNum++;
  2101. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2102. let dr = rot - this.destRot;
  2103. let abs = Math.abs(dr) % 360;
  2104. if (abs > 180) {
  2105. if (rot > 180)
  2106. rot -= 360;
  2107. if (this.destRot > 180)
  2108. this.destRot -= 360;
  2109. }
  2110. let max = this.turnNum * 5 + this.aiLv * 5;
  2111. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2112. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2113. let at = xGame.tools.random(1000, 2000);
  2114. if (!this.onAway(3))
  2115. at += xGame.tools.random(10000, 15000);
  2116. this.setState(AIState.shoot, at);
  2117. }
  2118. else {
  2119. let mr = 0;
  2120. if (abs > 3)
  2121. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2122. else if (Math.random() > 0.6)
  2123. mr = xGame.tools.random(1, 10) * 0.1;
  2124. mr = dr > 0 ? -mr : mr;
  2125. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2126. }
  2127. }
  2128. setKick(dx, dy) {
  2129. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2130. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2131. this.tempDir1.x = 0;
  2132. this.tempDir1.y = 1;
  2133. this.tempDir2.y = -this.tempDir2.y;
  2134. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2135. if (num > 1)
  2136. num = 1;
  2137. let rot = Math.acos(num) * 57.3;
  2138. if (this.tempDir2.x < 0)
  2139. rot = 360 - rot;
  2140. this.destRot += rot;
  2141. if (!xGame.common.gameMgr.finishOneShoot) {
  2142. this.forceMax += xGame.tools.random(10, 50);
  2143. this.forceMax -= this.aiLv * 2;
  2144. if (this.forceMax < 20)
  2145. this.forceMax = 20;
  2146. }
  2147. if (this.forceMax > 100)
  2148. this.forceMax = 101;
  2149. else if (this.forceMax < 10)
  2150. this.forceMax += xGame.tools.random(0, 10);
  2151. if (xGame.common.gameMode == 1)
  2152. this.forceMax = xGame.tools.random(80, 100);
  2153. else
  2154. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2155. let max = 2000 - this.aiLv * 100;
  2156. if (Math.random() > 0.8)
  2157. max += xGame.tools.random(100, 2000);
  2158. this.setState(AIState.turn, xGame.tools.random(500, max));
  2159. }
  2160. shoot() {
  2161. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2162. if (Math.random() > 0.8) {
  2163. this.gameSrc.aiForce(1);
  2164. this.setState(AIState.wait);
  2165. }
  2166. }
  2167. else {
  2168. let df = xGame.tools.random(3, 8);
  2169. if (this.forceNum < this.forceMax)
  2170. this.forceNum += df;
  2171. else
  2172. this.forceNum -= df;
  2173. let startY = this.gameSrc.ui.powerNode.y;
  2174. let height = this.gameSrc.ui.powerNode.height;
  2175. let force = startY + height * this.forceNum * 0.01;
  2176. this.gameSrc.aiForce(2, force);
  2177. }
  2178. }
  2179. reset() {
  2180. for (let i = 0; i < 4; i++) {
  2181. this.setRate--;
  2182. this.setNum++;
  2183. let pos = this.posList[this.posIdx];
  2184. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2185. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2186. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2187. this.rootPos.x = 387;
  2188. if (this.rootPos.x < this.rectL)
  2189. this.rootPos.x = this.rectL;
  2190. else if (this.rootPos.x > this.rectR)
  2191. this.rootPos.x = this.rectR;
  2192. if (this.rootPos.y < this.rectT)
  2193. this.rootPos.y = this.rectT;
  2194. else if (this.rootPos.y > this.rectB)
  2195. this.rootPos.y = this.rectB;
  2196. this.posIdx++;
  2197. let max = this.posList.length;
  2198. if (this.posIdx >= max)
  2199. this.posIdx -= max;
  2200. this.initHoleBall();
  2201. let ball = null;
  2202. if (this.scoreBall.length > 0)
  2203. ball = this.scoreBall[0];
  2204. else if (this.lineBall.length > 0)
  2205. ball = xGame.common.getRandArrEle(this.lineBall);
  2206. if (ball && ball.kickAngle < this.bestAngle) {
  2207. this.bestAngle = ball.kickAngle;
  2208. this.bestKick.x = ball.kickPos.x;
  2209. this.bestKick.y = ball.kickPos.y;
  2210. this.bestPos.x = this.rootPos.x;
  2211. this.bestPos.y = this.rootPos.y;
  2212. this.bestForce = ball.hard * 0.08;
  2213. }
  2214. }
  2215. if (this.setNum >= this.setMax)
  2216. this.setMax = 0;
  2217. if (this.setRate < 1) {
  2218. this.setState(AIState.move, 0);
  2219. this.rootMoveTime = Laya.timer.currTimer;
  2220. this.gameSrc.aiRootMove(true);
  2221. }
  2222. }
  2223. delayLine() {
  2224. this.gameSrc.aiRootMove(false);
  2225. }
  2226. move() {
  2227. if (this.bestPos.x < 1)
  2228. this.bestPos = this.rootPos;
  2229. let wObj = this.wBall.gameObj;
  2230. let destx = wObj.x;
  2231. let desty = wObj.y;
  2232. let dx = Math.abs(destx - this.bestPos.x);
  2233. let dy = Math.abs(desty - this.bestPos.y);
  2234. let mx = 3 + dx * 0.03;
  2235. let my = 3 + dy * 0.03;
  2236. if (dx < 4 && dy < 4) {
  2237. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2238. dt = dt < 1000 ? 1000 - dt : 0;
  2239. if (this.setMax > 0) {
  2240. let min = this.setMax * 0.3 + this.aiLv * 5;
  2241. this.setRate = xGame.tools.random(min, this.setMax);
  2242. this.setState(AIState.reset, 0);
  2243. }
  2244. else {
  2245. this.destRot = 0;
  2246. this.forceMax = this.bestForce;
  2247. this.setKick(this.bestKick.x, this.bestKick.y);
  2248. }
  2249. if (dt > 100) {
  2250. Laya.timer.clear(this, this.delayLine);
  2251. Laya.timer.once(dt, this, this.delayLine);
  2252. }
  2253. else
  2254. this.gameSrc.aiRootMove(false);
  2255. }
  2256. else {
  2257. if (dx > 4)
  2258. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2259. if (dy > 4)
  2260. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2261. this.gameSrc.onRootMove({ x: destx, y: desty });
  2262. }
  2263. }
  2264. resetRoot() {
  2265. this.bestAngle = 180;
  2266. this.bestForce = 0;
  2267. this.setMax = this.posList.length;
  2268. this.posIdx = xGame.tools.random(0, this.setMax);
  2269. let min = this.setMax * 0.3 + this.aiLv * 5;
  2270. this.setRate = xGame.tools.random(min, this.setMax);
  2271. let max = 2000 - this.aiLv * 100;
  2272. if (Math.random() > 0.8)
  2273. max += xGame.tools.random(100, 1000);
  2274. if (this.isGuide)
  2275. this.setState(AIState.select, 500);
  2276. else if (this.onAway(2))
  2277. this.setState(AIState.reset, xGame.tools.random(400, max));
  2278. else
  2279. this.setState(AIState.none);
  2280. if (xGame.common.gameMgr.finishOneShoot)
  2281. this.chat();
  2282. }
  2283. runAI() {
  2284. if (this.state > AIState.idle)
  2285. return;
  2286. this.initBall();
  2287. this.onGame(2500);
  2288. if (Math.random() > 0.6)
  2289. this.chat();
  2290. }
  2291. stopRun() {
  2292. this.setState(AIState.idle);
  2293. }
  2294. onGame(base) {
  2295. let max = base - this.aiLv * 100;
  2296. if (Math.random() > 0.8)
  2297. max += xGame.tools.random(100, 1000);
  2298. if (this.onAway(2))
  2299. this.setState(AIState.select, xGame.tools.random(500, max));
  2300. else
  2301. this.setState(AIState.none);
  2302. }
  2303. setState(sta, wt = 0) {
  2304. if (this.state == AIState.none)
  2305. return;
  2306. this.state = sta;
  2307. this.waitTime = wt;
  2308. }
  2309. onUpdate() {
  2310. if (this.state == AIState.none)
  2311. return;
  2312. this.awayTime -= this.dtime;
  2313. if (this.awayTime < 1) {
  2314. this.awayTime = xGame.tools.random(6000, 10000);
  2315. this.awayNum += (11 - this.aiLv);
  2316. this.onAway(1);
  2317. }
  2318. if (this.waitTime >= 0) {
  2319. this.waitTime -= this.dtime;
  2320. return;
  2321. }
  2322. switch (this.state) {
  2323. case AIState.idle:
  2324. this.chat();
  2325. break;
  2326. case AIState.reset:
  2327. this.reset();
  2328. break;
  2329. case AIState.move:
  2330. this.move();
  2331. break;
  2332. case AIState.leave:
  2333. this.state = AIState.none;
  2334. xGame.common.gameMgr.aiGameEnd(true);
  2335. break;
  2336. case AIState.select:
  2337. this.selectBall();
  2338. break;
  2339. case AIState.turn:
  2340. this.turnPole();
  2341. break;
  2342. case AIState.shoot:
  2343. this.shoot();
  2344. break;
  2345. }
  2346. }
  2347. onAway(type) {
  2348. if (type == 1) {
  2349. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2350. let num = this.awayNum + db * 20;
  2351. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2352. xGame.common.gameMgr.aiLeave();
  2353. this.setState(AIState.leave, 6666);
  2354. }
  2355. }
  2356. else if (type == 2) {
  2357. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2358. let num = this.awayNum + db * 30;
  2359. if (xGame.tools.random(0, 10000) < num)
  2360. return false;
  2361. }
  2362. else if (type == 3) {
  2363. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2364. let num = this.awayNum + db * 10;
  2365. if (xGame.tools.random(0, 4000) < num)
  2366. return false;
  2367. }
  2368. return true;
  2369. }
  2370. chat() {
  2371. if (this.chatTime > 0) {
  2372. this.chatTime -= this.dtime;
  2373. return;
  2374. }
  2375. this.chatTime = xGame.tools.random(2000, 10000);
  2376. let rand = xGame.tools.random(0, 100);
  2377. if (rand < 15)
  2378. this.talk();
  2379. else if (rand < 35)
  2380. this.emotion();
  2381. }
  2382. talk() {
  2383. xGame.common.talkMgr.showAITalk(0);
  2384. }
  2385. emotion() {
  2386. xGame.common.talkMgr.showAIEmotion(0);
  2387. }
  2388. resetAI() {
  2389. this.stopRun();
  2390. this.state = AIState.none;
  2391. }
  2392. }
  2393. class Partical extends Laya.Script3D {
  2394. constructor() {
  2395. super();
  2396. this.duration = 2000;
  2397. }
  2398. ;
  2399. onAwake() {
  2400. this.gameObj = this.owner;
  2401. }
  2402. onEnable() {
  2403. this.openTimer();
  2404. }
  2405. openTimer() {
  2406. Laya.timer.once(this.duration, this, this.disappear);
  2407. }
  2408. setCallback(obj, callback) {
  2409. this.obj = obj;
  2410. this.callback = callback;
  2411. Laya.timer.clearAll(this);
  2412. Laya.timer.once(this.duration, this, this.disappear);
  2413. }
  2414. disappear() {
  2415. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2416. this.callback && this.callback(this.obj);
  2417. }
  2418. }
  2419. class Ball extends Laya.Script3D {
  2420. constructor() {
  2421. super();
  2422. this.posV3 = new Laya.Vector3();
  2423. this.rotRate = 2.1;
  2424. this.rotSpeed = new Laya.Vector3();
  2425. this.myIndex = 0;
  2426. }
  2427. onAwake() {
  2428. this.gameObj = this.owner;
  2429. this.transform = this.gameObj.transform;
  2430. this.ballNode = this.gameObj.getChildByName("Ball");
  2431. this.shadowNode = this.gameObj.getChildByName("shadow");
  2432. }
  2433. initSelf(index, x, y, owner) {
  2434. this.d2BallSrc = owner;
  2435. this.myIndex = index;
  2436. this.setAlbedoTexture();
  2437. this.setTransPos(x, y);
  2438. this.setScale();
  2439. this.ballNode.transform.localRotationEulerX = 90;
  2440. if (index == 0) {
  2441. }
  2442. }
  2443. setAlbedoTexture(isIce = false) {
  2444. let url;
  2445. if (isIce) {
  2446. url = `res/d3Res/ballTexture/ice.jpg`;
  2447. }
  2448. else {
  2449. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2450. }
  2451. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2452. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2453. }));
  2454. }
  2455. runFireworks(obj, delay, callback) {
  2456. Laya.timer.clearAll(this);
  2457. Laya.timer.once(delay + 1, this, () => {
  2458. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2459. fire.transform.localPositionX = this.transform.localPositionX;
  2460. fire.transform.localPositionY = this.transform.localPositionY;
  2461. fire.transform.localPositionZ = this.transform.localPositionZ;
  2462. let src = fire.getComponent(Partical);
  2463. src.duration = 1000;
  2464. src.setCallback(obj, callback);
  2465. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2466. eft.transform.localPositionX = this.transform.localPositionX;
  2467. eft.transform.localPositionY = this.transform.localPositionY;
  2468. eft.transform.localPositionZ = this.transform.localPositionZ;
  2469. });
  2470. }
  2471. setTransPos(x, y) {
  2472. this.setRotation();
  2473. xGame.common.pos2to3Convert(x, y, this.posV3);
  2474. this.transform.localPositionX = this.posV3.x;
  2475. this.transform.localPositionY = 0;
  2476. this.transform.localPositionZ = this.posV3.z;
  2477. this.transform.localRotationEulerX = 0;
  2478. this.transform.localRotationEulerY = 0;
  2479. this.transform.localRotationEulerZ = 0;
  2480. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2481. this.shadowNode.transform.localPositionY = 0.1;
  2482. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2483. }
  2484. setRotation() {
  2485. if (this.d2BallSrc.canRot) {
  2486. let speed = this.d2BallSrc.rigy.linearVelocity;
  2487. this.rotSpeed.x = speed.x * this.rotRate;
  2488. this.rotSpeed.z = speed.y * this.rotRate;
  2489. this.rotSpeed.y = this.d2BallSrc.rotY;
  2490. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2491. }
  2492. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2493. this.rotSpeed.x = this.rotSpeed.y = 0;
  2494. this.rotSpeed.y = this.d2BallSrc.rotY;
  2495. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2496. }
  2497. }
  2498. setScale() {
  2499. let radius = xGame.common.d2World.rootBall.ui.width;
  2500. let scale = xGame.common.scale2to3Convert(radius);
  2501. this.transform.localScaleX = scale;
  2502. this.transform.localScaleY = scale;
  2503. this.transform.localScaleZ = scale;
  2504. }
  2505. playInHoleEft() {
  2506. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2507. eft.transform.position = this.transform.position;
  2508. }
  2509. playIceEft() {
  2510. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2511. eft.transform.position = this.transform.position;
  2512. }
  2513. get scaleXYZ() {
  2514. return this.transform.localScaleX;
  2515. }
  2516. set scaleXYZ(val) {
  2517. this.transform.localScaleX = val;
  2518. this.transform.localScaleY = val;
  2519. this.transform.localScaleZ = val;
  2520. }
  2521. get posX() {
  2522. return this.transform.localPositionX;
  2523. }
  2524. set posX(val) {
  2525. this.transform.localPositionX = val;
  2526. }
  2527. get posY() {
  2528. return this.transform.localPositionY;
  2529. }
  2530. set posY(val) {
  2531. this.transform.localPositionY = val;
  2532. }
  2533. get posZ() {
  2534. return this.transform.localPositionZ;
  2535. }
  2536. set posZ(val) {
  2537. this.transform.localPositionZ = val;
  2538. }
  2539. destroySelf() {
  2540. this.posV3 = null;
  2541. this.rotSpeed = null;
  2542. this.d2BallSrc = null;
  2543. this.ballNode = null;
  2544. this.gameObj.destroy(true);
  2545. this.transform = null;
  2546. this.destroy();
  2547. }
  2548. }
  2549. class ui_D2Ball extends fgui.GComponent {
  2550. static createInstance() {
  2551. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2552. }
  2553. onConstruct() {
  2554. this.myIcon = (this.getChild("myIcon"));
  2555. this.inner = (this.getChild("inner"));
  2556. this.n8 = (this.getChild("n8"));
  2557. this.n4 = (this.getChild("n4"));
  2558. this.wrongTips = (this.getChild("wrongTips"));
  2559. this.rightTips = (this.getChild("rightTips"));
  2560. this.breathAni = this.getTransition("breathAni");
  2561. }
  2562. }
  2563. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2564. class D2BallSrc extends Laya.Script {
  2565. constructor() {
  2566. super();
  2567. this.number = 0;
  2568. this.startX = 0;
  2569. this.startY = 0;
  2570. this.angleV2 = new Laya.Vector2();
  2571. this.isRootBall = false;
  2572. this.isBlackBall = false;
  2573. this.ballType = "";
  2574. this.canRot = true;
  2575. this.rotY = 0;
  2576. this.poleAngle = 0;
  2577. this.kickPos = { x: 0, y: 0 };
  2578. this.hard = 0;
  2579. this.kickAngle = 0;
  2580. this.borderDis = 0;
  2581. this.speedP10 = 5.6;
  2582. this.lastSpeed = { x: 0, y: 0 };
  2583. this.stillSpeed = 0.12;
  2584. this.ballFunc = "normal";
  2585. this.isRunSkillAni = false;
  2586. this.isInHole = false;
  2587. this.iceOwner = "";
  2588. this.forceRun = false;
  2589. this.myUNID = "";
  2590. this.rectL = 0;
  2591. this.rectR = 0;
  2592. this.rectT = 0;
  2593. this.rectB = 0;
  2594. this.forceVec = new Laya.Vector2();
  2595. this.lastDis = 0;
  2596. this.helpOut = { type: "", x: 0, y: 0 };
  2597. }
  2598. initSelf(number, x, y, d3Ball) {
  2599. if (!this.gameObj)
  2600. this.gameObj = this.owner;
  2601. this.number = number;
  2602. this.startX = x;
  2603. this.startY = y;
  2604. this.d3Ball = d3Ball;
  2605. this.isRootBall = false;
  2606. this.isBlackBall = false;
  2607. this.ballType = "";
  2608. if (number == 0) {
  2609. this.isRootBall = true;
  2610. }
  2611. else if (number == 8) {
  2612. this.isBlackBall = true;
  2613. }
  2614. else {
  2615. if (number <= 7) {
  2616. this.ballType = ballCamp.full;
  2617. }
  2618. else {
  2619. this.ballType = ballCamp.flower;
  2620. }
  2621. }
  2622. this.setInfo();
  2623. this.setD3Ball();
  2624. this.owner["mySrc"] = this;
  2625. this.rigy.linearDamping = 1;
  2626. D2BallSrc._unid++;
  2627. this.myUNID = "d2ball" + D2BallSrc._unid;
  2628. let rect = xGame.common.d2World.borderRect;
  2629. this.rectL = Math.ceil(rect.x) + 20;
  2630. this.rectT = Math.ceil(rect.y) + 20;
  2631. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2632. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2633. }
  2634. setInfo() {
  2635. this.gameObj.x = this.startX;
  2636. this.gameObj.y = this.startY;
  2637. let radius = this.ui.width / 2;
  2638. this.gameObj.width = radius * 2;
  2639. this.gameObj.height = radius * 2;
  2640. if (xGame.common.showDebug) {
  2641. this.ui.myIcon.alpha = 1;
  2642. this.ui.inner.alpha = 1;
  2643. }
  2644. else {
  2645. this.ui.myIcon.alpha = 0;
  2646. this.ui.inner.alpha = 0;
  2647. }
  2648. }
  2649. setD3Ball() {
  2650. this.d3Ball = this.d3Ball;
  2651. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2652. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2653. }
  2654. onUpdate() {
  2655. if (xGame.common.gameMgr.gamePause)
  2656. return;
  2657. if (this.isInHole)
  2658. return;
  2659. if (!xGame.common.d2World.openCheckStill)
  2660. return;
  2661. this.runBall();
  2662. }
  2663. runBall() {
  2664. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2665. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2666. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2667. this.judgeBorder();
  2668. }
  2669. getDestDis(dest) {
  2670. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2671. }
  2672. setmyXY(x, y) {
  2673. this.d3BallSrc.setTransPos(x, y);
  2674. }
  2675. getSpeed() {
  2676. let speed = this.rigy.linearVelocity;
  2677. return speed.x * speed.x + speed.y * speed.y;
  2678. }
  2679. onTriggerEnter(collider) {
  2680. if (!collider || !collider.owner)
  2681. return;
  2682. let coll = "collide";
  2683. let speed = this.getSpeed();
  2684. let sv2 = this.speedP10 * this.speedP10;
  2685. if (collider.label == "ball") {
  2686. if (speed < 9 && this.number != 0)
  2687. coll = "";
  2688. else if (speed < sv2)
  2689. coll = "collide_4";
  2690. else if (speed < sv2 * 6.2)
  2691. coll = "collide_3";
  2692. else if (speed < sv2 * 25)
  2693. coll = "collide_2";
  2694. else if (speed < sv2 * 56)
  2695. coll = "collide_1";
  2696. xGame.soundMgr.playSound(coll);
  2697. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2698. if (collider.owner) {
  2699. let rig = collider.owner.getComponent(D2BallSrc);
  2700. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2701. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2702. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2703. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2704. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2705. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2706. let rx = 0;
  2707. let ry = 0;
  2708. if (this.gameObj.x < this.rectL)
  2709. rx = vx;
  2710. else if (this.gameObj.x > this.rectR)
  2711. rx = -vx;
  2712. else if (this.gameObj.y < this.rectT)
  2713. ry = vy;
  2714. else if (this.gameObj.y > this.rectB)
  2715. ry = -vy;
  2716. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2717. }
  2718. }
  2719. if (this.number != 0) {
  2720. return;
  2721. }
  2722. else {
  2723. if (this.forceRun) {
  2724. console.log("randon force");
  2725. this.applyForce(collider);
  2726. }
  2727. }
  2728. if (xGame.common.d2World.isOnSameLine) {
  2729. xGame.common.d2World.isOnSameLine = false;
  2730. this.rigy.linearVelocity = { x: 0, y: 0 };
  2731. }
  2732. if (xGame.common.gameMgr.firstColliObj == null) {
  2733. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2734. xGame.common.gameMgr.isTouchedBall = true;
  2735. }
  2736. }
  2737. else {
  2738. xGame.common.recoverCameraView();
  2739. let wallStr = "";
  2740. if (speed < 9) { }
  2741. else if (speed < sv2) { }
  2742. else if (speed < sv2 * 6.2)
  2743. wallStr = "wall_30";
  2744. else if (speed < sv2 * 25)
  2745. wallStr = "wall_50";
  2746. else if (speed < sv2 * 56)
  2747. wallStr = "wall_80";
  2748. xGame.soundMgr.playSound(wallStr);
  2749. }
  2750. }
  2751. applyForce(collider) {
  2752. let src = collider.owner.mySrc;
  2753. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2754. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2755. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2756. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2757. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2758. }
  2759. checkWrongBall(playEft = true) {
  2760. if (this.isInHole)
  2761. return;
  2762. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2763. if (this.number != 0 && playEft)
  2764. this.d3BallSrc.playInHoleEft();
  2765. let coll = "inpocket_1";
  2766. let speed = this.getSpeed();
  2767. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2768. if (speed < 9 && this.number != 0)
  2769. coll = "";
  2770. else if (speed < sv2 * 6.2)
  2771. coll = "inpocket_4";
  2772. else if (speed < sv2 * 25)
  2773. coll = "collide_3";
  2774. else if (speed < sv2 * 56)
  2775. coll = "collide_2";
  2776. xGame.soundMgr.playSound(coll);
  2777. this.isInHole = true;
  2778. if (this.number == 0) {
  2779. console.log("白球进了。。");
  2780. this.reset();
  2781. this.rigy.linearVelocity = { x: 0, y: 0 };
  2782. this.hideSelf();
  2783. xGame.common.gameUI.ui.whiteAni.visible = true;
  2784. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2785. xGame.common.gameUI.ui.whiteAni.visible = false;
  2786. }));
  2787. }
  2788. else {
  2789. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2790. xGame.common.d2World.removeOneBall(this);
  2791. this.destroySelf();
  2792. xGame.common.playHappySound(this.number);
  2793. this.runFlyEft();
  2794. }
  2795. }
  2796. runFlyEft() {
  2797. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2798. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2799. }
  2800. }
  2801. hideSelf() {
  2802. if (this.d3Ball)
  2803. this.d3Ball.active = false;
  2804. }
  2805. showSelf() {
  2806. this.isInHole = false;
  2807. if (this.d3Ball && !this.d3Ball.active)
  2808. this.d3Ball.active = true;
  2809. }
  2810. isStill() {
  2811. let speed = this.rigy.linearVelocity;
  2812. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2813. this.rigy.linearVelocity = { x: 0, y: 0 };
  2814. return true;
  2815. }
  2816. return false;
  2817. }
  2818. reset() {
  2819. }
  2820. destroySelf() {
  2821. this.d3BallSrc.destroySelf();
  2822. if (!this.ui.isDisposed) {
  2823. this.ui.removeFromParent();
  2824. this.ui.dispose();
  2825. this.ui = null;
  2826. }
  2827. this.outColli = null;
  2828. this.innerColli = null;
  2829. this.rigy = null;
  2830. this.d3Ball = null;
  2831. this.d3BallSrc = null;
  2832. this.angleV2 = null;
  2833. this.gameObj.destroy(true);
  2834. this.destroy();
  2835. }
  2836. judgeBorder() {
  2837. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2838. return;
  2839. }
  2840. if (this.destroyed)
  2841. return;
  2842. if (xGame.common.gameMode == GameMode.classic)
  2843. return;
  2844. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2845. if (isOver) {
  2846. this.checkWrongBall();
  2847. }
  2848. }
  2849. onClick(e, force = false) {
  2850. if (this.number == 0)
  2851. return;
  2852. if (force) {
  2853. }
  2854. else {
  2855. if (xGame.common.d2World.openCheckStill)
  2856. return;
  2857. if (!xGame.common.gameMgr.selfTurn) {
  2858. return;
  2859. }
  2860. }
  2861. if (!xGame.common.gameMgr.finishOneShoot)
  2862. return;
  2863. let root = xGame.common.d2World.rootBall.gameObj;
  2864. let x = this.gameObj.x - root.x;
  2865. let y = this.gameObj.y - root.y;
  2866. let angle = xGame.common.getfguiRotation(x, y);
  2867. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2868. xGame.common.d2World.getHelpLine();
  2869. xGame.common.clickedBall = true;
  2870. this.checkGuide();
  2871. }
  2872. checkGuide() {
  2873. let guide = DataMgr.getSkillGuide();
  2874. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2875. xGame.common.guideStep++;
  2876. xGame.common.gameUI.ui.guide1.visible = false;
  2877. xGame.common.gameUI.ui.guide2.visible = true;
  2878. }
  2879. }
  2880. checkDistance(disX, disY, angle) {
  2881. let diameter = this.gameObj.width - 1;
  2882. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2883. if (!this.lastDis)
  2884. this.lastDis = dis;
  2885. else {
  2886. if (dis > this.lastDis) {
  2887. this.helpOut.type = "remove";
  2888. return this.helpOut;
  2889. }
  2890. }
  2891. if (dis <= Math.pow(diameter, 2)) {
  2892. let del = 0.01;
  2893. let offest = 0;
  2894. let realX = disX - this.gameObj.x;
  2895. let realY = disY - this.gameObj.y;
  2896. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2897. offest += del;
  2898. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2899. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2900. }
  2901. this.helpOut.type = "ok";
  2902. this.helpOut.x = realX + this.gameObj.x;
  2903. this.helpOut.y = realY + this.gameObj.y;
  2904. return this.helpOut;
  2905. }
  2906. else {
  2907. this.helpOut.type = "no";
  2908. return this.helpOut;
  2909. }
  2910. }
  2911. clearBallEft() {
  2912. this.clearBallRightEft();
  2913. this.clearBallWrongEft();
  2914. }
  2915. clearBallRightEft() {
  2916. this.ui.breathAni.stop();
  2917. this.ui.rightTips.visible = false;
  2918. }
  2919. clearBallWrongEft() {
  2920. this.ui.wrongTips.visible = false;
  2921. }
  2922. showWrongEft() {
  2923. if (!xGame.common.gameMgr.selfTurn)
  2924. return;
  2925. this.ui.wrongTips.visible = true;
  2926. }
  2927. showRightEft() {
  2928. if (!xGame.common.gameMgr.selfTurn)
  2929. return;
  2930. this.ui.rightTips.visible = true;
  2931. this.ui.rightTips.scaleX = 1;
  2932. this.ui.rightTips.scaleY = 1;
  2933. this.ui.breathAni.play();
  2934. }
  2935. setBallFunc(type, owner) {
  2936. if (type == "ice") {
  2937. this.ballFunc = type;
  2938. this.d3BallSrc.setAlbedoTexture(true);
  2939. this.rigy.type = "static";
  2940. this.iceOwner = owner;
  2941. }
  2942. else {
  2943. if (owner == this.iceOwner) {
  2944. this.ballFunc = type;
  2945. this.d3BallSrc.setAlbedoTexture(false);
  2946. this.rigy.type = "dynamic";
  2947. }
  2948. }
  2949. }
  2950. }
  2951. D2BallSrc._unid = 0;
  2952. class D2RootBallSrc extends D2BallSrc {
  2953. constructor() {
  2954. super();
  2955. this.maxSpeed = 0;
  2956. this.classicMaxSpeed = 2.2;
  2957. this.bigSkillMaxSpeed = 4;
  2958. this.angle = 0;
  2959. this.allPercent = 0;
  2960. this.linearPercent = 0;
  2961. this.anglePercent = 0;
  2962. this.maxAngleRate = 0.6;
  2963. this.baseRot = 7;
  2964. this.angleMax = 0;
  2965. this.speed = new Laya.Vector2();
  2966. this.rotSpeed = new Laya.Vector2();
  2967. }
  2968. isStill() {
  2969. let speed = this.rigy.linearVelocity;
  2970. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2971. if (this.anglePercent <= 0.1) {
  2972. this.rigy.linearVelocity = { x: 0, y: 0 };
  2973. return true;
  2974. }
  2975. }
  2976. return false;
  2977. }
  2978. reset() {
  2979. this.linearPercent = 0;
  2980. this.anglePercent = 0;
  2981. }
  2982. setSpeed(percent, angle) {
  2983. this.allPercent = percent;
  2984. this.angle = angle;
  2985. this.setAngleSpeed();
  2986. this.setLinearSpeed();
  2987. let hit = "hit";
  2988. if (percent < 25)
  2989. hit = "hit03";
  2990. else if (percent < 50)
  2991. hit = "hit02";
  2992. else if (percent < 75)
  2993. hit = "hit01";
  2994. xGame.soundMgr.playSound(hit);
  2995. }
  2996. setAngleSpeed() {
  2997. let offest = xGame.common.rodOffest;
  2998. let radius = 82;
  2999. let rate = Math.abs(offest.y / radius) * 0.5;
  3000. if (offest.y > 0)
  3001. this.angleMax = -this.baseRot * 2;
  3002. else
  3003. this.angleMax = this.baseRot;
  3004. this.rotY = -offest.x / radius * 100;
  3005. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3006. this.linearPercent = this.allPercent - this.anglePercent;
  3007. }
  3008. setLinearSpeed() {
  3009. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3010. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3011. if (!xGame.common.longHelpLine) {
  3012. let offset = -150 + xGame.common.randomNum(0, 300);
  3013. offset /= 100;
  3014. this.angle += offset;
  3015. }
  3016. }
  3017. }
  3018. let sin = Math.sin(this.angle * Math.PI / 180);
  3019. let cos = Math.cos(this.angle * Math.PI / 180);
  3020. switch (xGame.common.gameMode) {
  3021. case GameMode.classic:
  3022. this.maxSpeed = this.classicMaxSpeed;
  3023. break;
  3024. case GameMode.bigMove:
  3025. this.maxSpeed = this.bigSkillMaxSpeed;
  3026. break;
  3027. case GameMode.placeBall:
  3028. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3029. if (data.type == 1) {
  3030. this.maxSpeed = this.bigSkillMaxSpeed;
  3031. }
  3032. else {
  3033. this.maxSpeed = this.classicMaxSpeed;
  3034. }
  3035. break;
  3036. default:
  3037. break;
  3038. }
  3039. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3040. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3041. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3042. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3043. this.rigy.applyLinearImpulseToCenter(this.speed);
  3044. }
  3045. onUpdate() {
  3046. if (this.anglePercent > 0.1) {
  3047. this.anglePercent *= 0.97;
  3048. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3049. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3050. this.rigy.applyForceToCenter(this.rotSpeed);
  3051. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3052. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3053. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3054. if (num > 0.9)
  3055. this.canRot = true;
  3056. }
  3057. else
  3058. this.canRot = true;
  3059. if (Math.abs(this.rotY) > 0.1)
  3060. this.rotY *= 0.98;
  3061. super.onUpdate();
  3062. }
  3063. destroySelf() {
  3064. super.destroySelf();
  3065. this.speed = null;
  3066. }
  3067. }
  3068. class D2Ball extends Laya.Sprite {
  3069. constructor(isRootBall = false) {
  3070. super();
  3071. this.ui = ui_D2Ball.createInstance();
  3072. this.pivotX = this.ui.width / 2;
  3073. this.pivotY = this.ui.width / 2;
  3074. this.x = 0;
  3075. this.y = 0;
  3076. this.addChild(this.ui.displayObject);
  3077. this.ui.displayObject.x += this.ui.width / 2;
  3078. this.ui.displayObject.y += this.ui.width / 2;
  3079. if (isRootBall) {
  3080. this.d2Src = this.addComponent(D2RootBallSrc);
  3081. }
  3082. else {
  3083. this.d2Src = this.addComponent(D2BallSrc);
  3084. }
  3085. this.d2Src.ui = this.ui;
  3086. this.addCircleCollider();
  3087. this.addInnerCircleCollider();
  3088. this.addRigyBody();
  3089. }
  3090. addCircleCollider() {
  3091. let colli = xGame.common.getCollider("circle");
  3092. colli.radius = this.ui.width / 2;
  3093. this.addComponentIntance(colli);
  3094. this.d2Src.outColli = colli;
  3095. colli.label = "ball";
  3096. }
  3097. addInnerCircleCollider() {
  3098. let colli = xGame.common.getCollider("circle");
  3099. colli.radius = this.ui.inner.width / 2;
  3100. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3101. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3102. this.addComponentIntance(colli);
  3103. this.d2Src.innerColli = colli;
  3104. colli.label = "inner";
  3105. }
  3106. addRigyBody() {
  3107. let rigy = xGame.common.getRigbody();
  3108. rigy.type = "dynamic";
  3109. this.addComponentIntance(rigy);
  3110. this.d2Src.rigy = rigy;
  3111. }
  3112. disposeSelf() {
  3113. if (!this.ui.isDisposed) {
  3114. this.ui.dispose();
  3115. this.ui.removeFromParent();
  3116. this.ui = null;
  3117. }
  3118. }
  3119. }
  3120. class ui_D2Gan extends fgui.GComponent {
  3121. static createInstance() {
  3122. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3123. }
  3124. onConstruct() {
  3125. this.myIcon = (this.getChild("myIcon"));
  3126. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3127. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3128. this.self = (this.getChild("self"));
  3129. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3130. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3131. this.ai = (this.getChild("ai"));
  3132. }
  3133. }
  3134. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3135. class D2Gan {
  3136. constructor() {
  3137. this.offset = 0.15;
  3138. this.cell = 1.5;
  3139. this.onBallCell = 0.4;
  3140. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3141. this.moveNum = 70;
  3142. this.rulerRate = 0.1;
  3143. this.ui = ui_D2Gan.createInstance();
  3144. this.changeSelfRod();
  3145. this.changeAIRod();
  3146. }
  3147. changeSelfRod() {
  3148. let index = DataMgr.getCurBallRod();
  3149. let data = cfgTable.ballrodData[index + 1];
  3150. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3151. this.selfMySpine && this.selfMySpine.dispose();
  3152. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3153. if (data.spine) {
  3154. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3155. this.selfMySpine = new SpineMgr(data.spine, () => {
  3156. let xx = this.ui.selfEftRoot.width / 2;
  3157. let yy = this.ui.selfEftRoot.height / 2;
  3158. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3159. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3160. outSpine.rotation = -90;
  3161. });
  3162. }
  3163. }
  3164. changeAIRod() {
  3165. let length = Object.keys(cfgTable.ballrodData).length;
  3166. let rand = Math.floor(length * Math.random()) + 1;
  3167. let data = cfgTable.ballrodData[rand];
  3168. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3169. this.aiMySpine && this.aiMySpine.dispose();
  3170. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3171. if (data.spine) {
  3172. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3173. this.aiMySpine = new SpineMgr(data.spine, () => {
  3174. let xx = this.ui.aiEftRoot.width / 2;
  3175. let yy = this.ui.aiEftRoot.height / 2;
  3176. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3177. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3178. outSpine.rotation = -90;
  3179. });
  3180. }
  3181. }
  3182. setGanLastInfo() {
  3183. this.lastInfo.rotation = this.ui.rotation;
  3184. this.lastInfo.x = this.ui.x;
  3185. this.lastInfo.y = this.ui.y;
  3186. }
  3187. rotateSelf(flag, isRuler = false) {
  3188. let angle;
  3189. flag = flag * this.offset;
  3190. if (xGame.common.d2World.isHelpLineOnBall) {
  3191. angle = flag * this.onBallCell;
  3192. }
  3193. else {
  3194. angle = flag * this.cell;
  3195. }
  3196. if (isRuler) {
  3197. angle *= this.rulerRate;
  3198. }
  3199. this.ui.rotation += angle;
  3200. xGame.common.d2World.getHelpLine();
  3201. }
  3202. checkDistance() {
  3203. let target = xGame.common.d2World.targetBall;
  3204. let root = xGame.common.d2World.rootBall;
  3205. if (target == null) {
  3206. return 1;
  3207. }
  3208. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3209. if (dis <= 2500) {
  3210. return 5;
  3211. }
  3212. return 1;
  3213. }
  3214. rotDest(rot) {
  3215. this.ui.rotation = rot;
  3216. xGame.common.d2World.getHelpLine();
  3217. }
  3218. storagePower(powerNum) {
  3219. let pos = (powerNum / 100) * this.moveNum;
  3220. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3221. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3222. this.ui.x = this.lastInfo.x + xx;
  3223. this.ui.y = this.lastInfo.y + yy;
  3224. }
  3225. shoot() {
  3226. this.storagePower(0);
  3227. this.ui.visible = false;
  3228. }
  3229. destroySelf() {
  3230. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3231. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3232. this.selfMySpine && this.selfMySpine.dispose();
  3233. this.aiMySpine && this.aiMySpine.dispose();
  3234. this.lastInfo = null;
  3235. if (!this.ui.isDisposed) {
  3236. this.ui.removeFromParent();
  3237. this.ui.dispose();
  3238. }
  3239. }
  3240. }
  3241. class ui_HelpLine extends fgui.GComponent {
  3242. static createInstance() {
  3243. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3244. }
  3245. onConstruct() {
  3246. this.n10 = (this.getChild("n10"));
  3247. this.rect = (this.getChild("rect"));
  3248. this.dir11 = (this.getChild("dir11"));
  3249. this.dir = (this.getChild("dir"));
  3250. this.rootDir = (this.getChild("rootDir"));
  3251. this.dirDot = (this.getChild("dirDot"));
  3252. }
  3253. }
  3254. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3255. class D2HelpLine {
  3256. constructor() {
  3257. this.starX = 0;
  3258. this.starY = 0;
  3259. this.ui = ui_HelpLine.createInstance();
  3260. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3261. this.starX = this.ui.rect.x;
  3262. this.starY = this.ui.rect.y;
  3263. }
  3264. shoot() {
  3265. this.ui.visible = false;
  3266. }
  3267. destroySelf() {
  3268. if (this.ui.isDisposed) {
  3269. this.ui.removeFromParent();
  3270. this.ui.dispose();
  3271. }
  3272. }
  3273. }
  3274. class D2World extends Laya.Script {
  3275. constructor() {
  3276. super();
  3277. this.ballArr = [];
  3278. this.openCheckStill = false;
  3279. this.checkArr = [];
  3280. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3281. this.isHelpLineOnBall = false;
  3282. this.isOnSameLine = false;
  3283. this.reflectAngle = 0;
  3284. this.powerPercent = 0;
  3285. this.inHolesSpeed = [];
  3286. this.outDir = new Laya.Vector2();
  3287. this.rootDir = new Laya.Vector2();
  3288. this.aiLv = 0;
  3289. this.rootPos = new Laya.Vector2();
  3290. this.tempDir1 = new Laya.Vector2();
  3291. this.tempDir2 = new Laya.Vector2();
  3292. this.tempDir3 = new Laya.Vector2();
  3293. this.ballSize = 33;
  3294. this.destRot = 0;
  3295. }
  3296. initSelf() {
  3297. this.createBalls();
  3298. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3299. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3300. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3301. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3302. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3303. }
  3304. setBorderRect() {
  3305. let ui = xGame.common.gameUI.ui;
  3306. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3307. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3308. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3309. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3310. this.borderRect.x = starX;
  3311. this.borderRect.y = starY;
  3312. this.borderRect.width = width;
  3313. this.borderRect.height = height;
  3314. }
  3315. resetGame() {
  3316. this.openCheckStill = false;
  3317. let temp;
  3318. for (let index = 0; index < this.ballArr.length; index++) {
  3319. temp = this.ballArr[index];
  3320. temp.destroySelf();
  3321. }
  3322. xGame.common.d3World.ballRoot.destroyChildren();
  3323. xGame.common.gameUI.ui.ballNode.removeChildren();
  3324. console.log("进入摧毁逻辑");
  3325. this.d2Gan.destroySelf();
  3326. this.d2HelpLine.destroySelf();
  3327. this.ballArr = [];
  3328. }
  3329. setD2Gan() {
  3330. let ballNode = this.rootBall.ui;
  3331. let d2Gan = new D2Gan();
  3332. this.d2Gan = d2Gan;
  3333. let ganNode = d2Gan.ui;
  3334. ballNode.addChild(ganNode);
  3335. ganNode.pivotX = ganNode.pivotX;
  3336. ganNode.pivotY = ganNode.pivotY;
  3337. ganNode.x = ganNode.myIcon.width / 2;
  3338. ganNode.y = this.rootBall.gameObj.width;
  3339. d2Gan.setGanLastInfo();
  3340. }
  3341. setHelpLine() {
  3342. let d2Help = new D2HelpLine();
  3343. this.d2HelpLine = d2Help;
  3344. }
  3345. createBalls() {
  3346. let cfg;
  3347. switch (xGame.common.gameMode) {
  3348. case GameMode.classic:
  3349. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3350. break;
  3351. case GameMode.bigMove:
  3352. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3353. break;
  3354. case GameMode.placeBall:
  3355. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3356. break;
  3357. default:
  3358. break;
  3359. }
  3360. cfg = JSON.parse(JSON.stringify(cfg));
  3361. for (const key in cfg) {
  3362. if (cfg[key].value == 0) {
  3363. this.createRootBall(cfg[key]);
  3364. delete cfg[key];
  3365. break;
  3366. }
  3367. }
  3368. this.createOtherBalls(cfg);
  3369. }
  3370. createRootBall(data) {
  3371. let root = new D2Ball(true);
  3372. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3373. this.rootBall = root.d2Src;
  3374. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3375. let d3BallSrc = d3Ball.getComponent(Ball);
  3376. xGame.common.d3World.rootBall = d3Ball;
  3377. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3378. let xx = data.x;
  3379. let yy = data.y;
  3380. let numer = data.value;
  3381. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3382. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3383. this.ballArr.push(this.rootBall);
  3384. this.setD2Gan();
  3385. this.setHelpLine();
  3386. }
  3387. createOtherBalls(cfg) {
  3388. let temp;
  3389. let src;
  3390. let data;
  3391. for (const key in cfg) {
  3392. data = cfg[key];
  3393. temp = new D2Ball();
  3394. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3395. src = temp.d2Src;
  3396. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3397. src.initSelf(data.value, data.x, data.y, d3Ball);
  3398. this.ballArr.push(src);
  3399. }
  3400. }
  3401. shoot(percent) {
  3402. this.powerPercent = percent;
  3403. this.openCheckStill = true;
  3404. let d2Angle = this.d2Gan.ui.rotation;
  3405. this.rootBall.setSpeed(percent, d2Angle);
  3406. this.clearBallAllEft();
  3407. this.changePlayerView();
  3408. }
  3409. onUpdate() {
  3410. if (!this.openCheckStill)
  3411. return;
  3412. this.checkStill();
  3413. }
  3414. checkStill() {
  3415. for (let index = 0; index < this.ballArr.length; index++) {
  3416. if (!this.ballArr[index].isStill()) {
  3417. return;
  3418. }
  3419. }
  3420. xGame.eventMgr.event(ALL_BALL_STOP);
  3421. }
  3422. allBallStop() {
  3423. this.openCheckStill = false;
  3424. xGame.common.recoverCameraView();
  3425. }
  3426. waitShoot() {
  3427. if (!this.d2Gan.ui.isDisposed) {
  3428. this.d2Gan.ui.visible = true;
  3429. }
  3430. if (!this.d2HelpLine.ui.isDisposed) {
  3431. this.d2HelpLine.ui.visible = true;
  3432. }
  3433. this.clearBallAllEft();
  3434. this.showBallRightEft();
  3435. this.getHelpLine();
  3436. this.inHolesSpeed = [];
  3437. this.selectOneBall();
  3438. }
  3439. _getAllBallArr() {
  3440. let arr = this.ballArr;
  3441. let outArr = [];
  3442. for (let index = 0; index < arr.length; index++) {
  3443. if (arr[index] instanceof D2RootBallSrc)
  3444. continue;
  3445. if (arr[index].ballFunc == "ice")
  3446. continue;
  3447. if (arr[index].destroyed)
  3448. continue;
  3449. outArr.push(arr[index]);
  3450. }
  3451. return outArr;
  3452. }
  3453. _getBlackObj() {
  3454. let arr = this.ballArr;
  3455. for (let index = 0; index < arr.length; index++) {
  3456. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3457. return arr[index];
  3458. }
  3459. }
  3460. }
  3461. selectOneBall() {
  3462. let all = this._getAllBallArr();
  3463. let target;
  3464. switch (xGame.common.gameMode) {
  3465. case GameMode.classic:
  3466. if (xGame.common.gameMgr.selfTurn) {
  3467. let self = xGame.common.gameMgr.selfBallArr;
  3468. let black = this._getBlackObj();
  3469. if (xGame.common.gameMgr.ensureBallType) {
  3470. if (self.length > 0) {
  3471. let out = [];
  3472. for (let j = 0; j < all.length; j++) {
  3473. if (self.indexOf(all[j].number) > -1) {
  3474. out.push(all[j]);
  3475. }
  3476. }
  3477. target = this.selectBestEnterOne(out);
  3478. }
  3479. else {
  3480. target = this.selectBestEnterOne([black]);
  3481. }
  3482. }
  3483. else {
  3484. target = this.selectBestEnterOne(all);
  3485. }
  3486. }
  3487. else {
  3488. target = this.selectBestEnterOne(all);
  3489. }
  3490. break;
  3491. case GameMode.bigMove:
  3492. target = this.selectBestEnterOne(all);
  3493. break;
  3494. case GameMode.placeBall:
  3495. if (all.length > 0) {
  3496. target = this.selectBestEnterOne(all);
  3497. }
  3498. break;
  3499. default:
  3500. break;
  3501. }
  3502. if (target && !target.destroyed && target.onClick) {
  3503. target.onClick(0, true);
  3504. let num = -200 + xGame.common.randomNum(0, 400);
  3505. num /= 150;
  3506. if (xGame.common.longHelpLine) {
  3507. num = 0;
  3508. }
  3509. this.destRot += num;
  3510. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3511. }
  3512. }
  3513. removeOneBall(ball) {
  3514. for (let index = 0; index < this.ballArr.length; index++) {
  3515. if (this.ballArr[index].id == ball.id) {
  3516. this.ballArr.splice(index, 1);
  3517. break;
  3518. }
  3519. }
  3520. }
  3521. getHelpLine() {
  3522. this.d2HelpLine.ui.dirDot.visible = false;
  3523. this.isOnSameLine = false;
  3524. let startX = this.rootBall.gameObj.x;
  3525. let startY = this.rootBall.gameObj.y;
  3526. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3527. if (dis == null) {
  3528. this.d2HelpLine.ui.visible = false;
  3529. console.error("辅助线异常");
  3530. return;
  3531. }
  3532. this.d2HelpLine.ui.visible = true;
  3533. let angle = this.d2Gan.ui.rotation;
  3534. let radius = 16.5;
  3535. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3536. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3537. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3538. if (colliObj == null) {
  3539. this.getColliPos(disX, disY, radius, angle);
  3540. xGame.common.d2World.isHelpLineOnBall = false;
  3541. this.targetBall = null;
  3542. this.reflectAngle = 0;
  3543. this.showBallWrongEft();
  3544. }
  3545. else {
  3546. let target = colliObj.src;
  3547. let radius = 16.5;
  3548. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3549. dis1 = Math.sqrt(dis1);
  3550. let realDis = colliObj.disHon - dis1;
  3551. let dir = colliObj.dir;
  3552. let xx = startX + dir.x * realDis;
  3553. let yy = startY + dir.y * realDis;
  3554. this.getColliPos(xx, yy, radius, angle);
  3555. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3556. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3557. let offset = xGame.common.rodOffest;
  3558. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3559. this.isOnSameLine = true;
  3560. }
  3561. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3562. xGame.common.d2World.isHelpLineOnBall = true;
  3563. this.targetBall = target;
  3564. this.reflectAngle = reflectAngle;
  3565. this.showBallWrongEft();
  3566. if (xGame.common.longHelpLine) {
  3567. this.delayReflectLine(target, reflectAngle);
  3568. }
  3569. }
  3570. }
  3571. getBorderDot(startX, startY, angle) {
  3572. let radius = 17;
  3573. let distance;
  3574. let isDone;
  3575. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3576. isDone = this.judgeUpDown(distance, angle, startX);
  3577. if (isDone != null) {
  3578. return isDone;
  3579. }
  3580. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3581. isDone = this.judgeUpDown(distance, angle, startX);
  3582. if (isDone != null) {
  3583. return isDone;
  3584. }
  3585. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3586. isDone = this.judgeLeftRight(distance, angle, startY);
  3587. if (isDone != null) {
  3588. return isDone;
  3589. }
  3590. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3591. isDone = this.judgeLeftRight(distance, angle, startY);
  3592. if (isDone != null) {
  3593. return isDone;
  3594. }
  3595. }
  3596. judgeUpDown(distance, angle, startX) {
  3597. let flag = Math.sin(angle * Math.PI / 180);
  3598. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3599. if (distance >= 0) {
  3600. if (flag > 0) {
  3601. if (temp < this.borderRect.x + this.borderRect.width) {
  3602. return distance;
  3603. }
  3604. }
  3605. else {
  3606. if (temp > this.borderRect.x) {
  3607. return distance;
  3608. }
  3609. }
  3610. }
  3611. }
  3612. judgeLeftRight(distance, angle, starY) {
  3613. let flag = -Math.cos(angle * Math.PI / 180);
  3614. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3615. if (distance >= 0) {
  3616. if (flag > 0) {
  3617. if (temp < this.borderRect.y + this.borderRect.height) {
  3618. return distance;
  3619. }
  3620. }
  3621. else {
  3622. if (temp > this.borderRect.y) {
  3623. return distance;
  3624. }
  3625. }
  3626. }
  3627. }
  3628. clearBallAllEft() {
  3629. let temp;
  3630. for (let index = 0; index < this.ballArr.length; index++) {
  3631. temp = this.ballArr[index];
  3632. temp.clearBallEft();
  3633. }
  3634. }
  3635. showBallRightEft() {
  3636. let gameMgr = xGame.common.gameMgr;
  3637. let temp;
  3638. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3639. if (targetArr.length <= 0)
  3640. return;
  3641. for (let index = 0; index < this.ballArr.length; index++) {
  3642. temp = this.ballArr[index];
  3643. if (targetArr.indexOf(temp.number) > -1) {
  3644. temp.showRightEft();
  3645. }
  3646. }
  3647. }
  3648. showBallWrongEft() {
  3649. let gameMgr = xGame.common.gameMgr;
  3650. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3651. if (targetArr.length <= 0)
  3652. return;
  3653. let temp;
  3654. for (let index = 0; index < this.ballArr.length; index++) {
  3655. temp = this.ballArr[index];
  3656. if (this.targetBall && this.targetBall.number == temp.number) {
  3657. if (targetArr.indexOf(temp.number) <= -1) {
  3658. temp.showWrongEft();
  3659. }
  3660. else {
  3661. temp.clearBallWrongEft();
  3662. }
  3663. }
  3664. else {
  3665. temp.clearBallWrongEft();
  3666. }
  3667. }
  3668. }
  3669. getColliPos(x, y, radius, angle) {
  3670. this.d2HelpLine.ui.x = x;
  3671. this.d2HelpLine.ui.y = y;
  3672. let dirX = x - this.rootBall.gameObj.x;
  3673. let dirY = y - this.rootBall.gameObj.y;
  3674. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3675. if (rectH <= 0)
  3676. rectH = 0;
  3677. this.d2HelpLine.ui.rect.height = 0;
  3678. this.d2HelpLine.ui.rect.height = rectH;
  3679. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3680. if (rectH < this.rootBall.gameObj.width) {
  3681. this.d2HelpLine.ui.rect.visible = false;
  3682. }
  3683. else {
  3684. this.d2HelpLine.ui.rect.visible = true;
  3685. }
  3686. this.d2HelpLine.ui.dir.visible = false;
  3687. this.d2HelpLine.ui.rootDir.visible = false;
  3688. }
  3689. getReflectLine(x, y, radius, target) {
  3690. this.d2HelpLine.ui.dir.visible = true;
  3691. let dirX = target.x - x;
  3692. let dirY = target.y - y;
  3693. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3694. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3695. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3696. this.d2HelpLine.ui.dir.height = 48;
  3697. this.d2HelpLine.ui.dir.rotation = angle;
  3698. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3699. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3700. return angle;
  3701. }
  3702. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3703. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3704. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3705. let targetX = target.gameObj.x;
  3706. let targetY = target.gameObj.y;
  3707. this.outDir.setValue(targetX - xx, targetY - yy);
  3708. this.rootDir.setValue(rtX - xx, rtY - yy);
  3709. let ver = Math.PI / 2;
  3710. let sin = Math.sin(ver);
  3711. let cos = Math.cos(ver);
  3712. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3713. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3714. this.outDir.setValue(outX, outY);
  3715. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3716. Laya.Vector2.normalize(this.outDir, this.outDir);
  3717. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3718. if (Math.abs(result) <= 0.08) {
  3719. this.d2HelpLine.ui.rootDir.visible = false;
  3720. return;
  3721. }
  3722. if (result > 0) {
  3723. angle += 90;
  3724. }
  3725. else if (result < 0) {
  3726. angle -= 90;
  3727. }
  3728. this.d2HelpLine.ui.rootDir.visible = true;
  3729. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3730. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3731. this.d2HelpLine.ui.rootDir.rotation = angle;
  3732. }
  3733. delayReflectLine(obj, angle) {
  3734. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3735. return;
  3736. }
  3737. this.isOnSameLine = false;
  3738. let startX = obj.gameObj.x;
  3739. let startY = obj.gameObj.y;
  3740. let dis = this.getBorderDot(startX, startY, angle);
  3741. if (dis == null) {
  3742. this.d2HelpLine.ui.dirDot.visible = false;
  3743. return;
  3744. }
  3745. this.d2HelpLine.ui.visible = true;
  3746. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3747. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3748. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3749. if (colliObj == null) {
  3750. this.setDelayLine(disX, disY, obj, angle);
  3751. }
  3752. else {
  3753. let radius = 16;
  3754. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3755. dis1 = Math.sqrt(dis1);
  3756. let realDis = colliObj.disHon - dis1;
  3757. let dir = colliObj.dir;
  3758. let xx = startX + dir.x * realDis;
  3759. let yy = startY + dir.y * realDis;
  3760. this.setDelayLine(xx, yy, obj, angle);
  3761. }
  3762. }
  3763. setDelayLine(x, y, obj, angle) {
  3764. let dirX = x - obj.gameObj.x;
  3765. let dirY = y - obj.gameObj.y;
  3766. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3767. if (rectH <= 0)
  3768. rectH = 0;
  3769. this.d2HelpLine.ui.dir.height = rectH;
  3770. this.d2HelpLine.ui.dirDot.visible = true;
  3771. this.d2HelpLine.ui.dirDot.x = 17;
  3772. this.d2HelpLine.ui.dirDot.y = 17;
  3773. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3774. ;
  3775. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3776. }
  3777. changePlayerView() {
  3778. if (Math.random() >= 0.7)
  3779. return;
  3780. if (!this.targetBall) {
  3781. return;
  3782. }
  3783. if (!xGame.common.gameMgr.selfTurn)
  3784. return;
  3785. switch (xGame.common.gameMode) {
  3786. case GameMode.classic:
  3787. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3788. if (this.targetBall.number != 8) {
  3789. return;
  3790. }
  3791. }
  3792. break;
  3793. case GameMode.bigMove:
  3794. return;
  3795. case GameMode.placeBall:
  3796. break;
  3797. default:
  3798. break;
  3799. }
  3800. let startX = this.targetBall.gameObj.x;
  3801. let startY = this.targetBall.gameObj.y;
  3802. let angle = this.reflectAngle;
  3803. let dis = this.getBorderDot(startX, startY, angle);
  3804. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3805. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3806. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3807. if (colliObj) {
  3808. return;
  3809. }
  3810. let offset = 40;
  3811. let posObj = xGame.common.gameMgr.posObj;
  3812. let temp;
  3813. let radius;
  3814. let tarX, tarY;
  3815. for (const key in posObj) {
  3816. temp = posObj[key];
  3817. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3818. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3819. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3820. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3821. xGame.common.showOneCamera("angle" + key);
  3822. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3823. Laya.physicsTimer.scale = 0.7;
  3824. break;
  3825. }
  3826. }
  3827. }
  3828. selectBestEnterOne(arr) {
  3829. this.aiLv = xGame.tools.random(1, 11);
  3830. this.aiLv = 10;
  3831. this.wBall = xGame.common.d2World.rootBall;
  3832. this.rootPos.x = this.wBall.gameObj.x;
  3833. this.rootPos.y = this.wBall.gameObj.y;
  3834. this.initHoleBall(arr);
  3835. return this.selectBall();
  3836. }
  3837. selectBall() {
  3838. let ball = null;
  3839. this.destRot = 0;
  3840. let ai = 110 - this.aiLv * 10;
  3841. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3842. let score = false;
  3843. if (this.scoreBall.length < 1) {
  3844. if (this.lineBall.length < 1) {
  3845. for (let i = 0; i < this.kickBall.length; i++) {
  3846. let list = [];
  3847. let bo = this.kickBall[i];
  3848. let bobj = bo.gameObj;
  3849. let rect = xGame.common.d2World.borderRect;
  3850. let mobj = this.wBall.gameObj;
  3851. let minb = bobj.y - rect.y - 20;
  3852. let minw = mobj.y - rect.y - 50;
  3853. if (minb > 0 && minw > 0) {
  3854. let dlenx = 0;
  3855. let dleny = mobj.y - rect.y;
  3856. let spx = mobj.x;
  3857. let spy = rect.y - dleny;
  3858. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3859. }
  3860. minb = rect.y + rect.height - bobj.y - 20;
  3861. minw = rect.y + rect.height - mobj.y - 50;
  3862. if (minb > 0 && minw > 0) {
  3863. let dlenx = 0;
  3864. let dleny = rect.y + rect.height - mobj.y;
  3865. let spx = mobj.x;
  3866. let spy = rect.y + rect.height + dleny;
  3867. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3868. }
  3869. minb = bobj.x - rect.x - 20;
  3870. minw = mobj.x - rect.x - 50;
  3871. if (minb > 0 && minw > 0) {
  3872. let dlenx = mobj.x - rect.x;
  3873. let dleny = 0;
  3874. let spx = rect.x - dlenx;
  3875. let spy = mobj.y;
  3876. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3877. }
  3878. minb = rect.x + rect.width - bobj.x - 20;
  3879. minw = rect.x + rect.width - mobj.x - 50;
  3880. if (minb > 0 && minw > 0) {
  3881. let dlenx = rect.x + rect.width - mobj.x;
  3882. let dleny = 0;
  3883. let spx = rect.x + rect.width + dlenx;
  3884. let spy = mobj.y;
  3885. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3886. }
  3887. list.sort(function (a, b) {
  3888. return a.order - b.order;
  3889. });
  3890. for (let i = 0; i < list.length; i++) {
  3891. let data = list[i];
  3892. let mx = mobj.x - bobj.x;
  3893. let my = mobj.y - bobj.y;
  3894. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3895. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3896. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3897. if (num > 1)
  3898. num = 1;
  3899. let cos = Math.acos(num);
  3900. if (cos > 1.57)
  3901. cos = 1.57;
  3902. else if (cos < 0.01)
  3903. cos = 0.01;
  3904. let tan = Math.tan(cos);
  3905. let dx = tan * data.dleny;
  3906. let dy = tan * data.dlenx;
  3907. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3908. if (Math.abs(bx - 667) < 40)
  3909. continue;
  3910. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3911. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3912. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3913. this.forceMax = dis * 0.08;
  3914. this.destRot += mis * 0.1;
  3915. this.setKick(bx, by);
  3916. return true;
  3917. }
  3918. }
  3919. }
  3920. }
  3921. else {
  3922. ball = xGame.common.getRandArrEle(this.lineBall);
  3923. }
  3924. }
  3925. else {
  3926. for (let i = 0; i < this.scoreBall.length; i++) {
  3927. if (i < this.scoreBall.length - 1) {
  3928. let rand = 70 + this.aiLv * 10 + i * 10;
  3929. if (xGame.tools.random(0, 100) < rand) {
  3930. ball = this.scoreBall[i];
  3931. break;
  3932. }
  3933. }
  3934. else {
  3935. ball = this.scoreBall[i];
  3936. break;
  3937. }
  3938. }
  3939. score = true;
  3940. this.selectNum++;
  3941. }
  3942. if (!ball)
  3943. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3944. let dx = ball.gameObj.x;
  3945. let dy = ball.gameObj.y;
  3946. let kickAngle = 0;
  3947. if (score) {
  3948. dx = ball.kickPos.x;
  3949. dy = ball.kickPos.y;
  3950. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3951. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3952. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3953. if (adot > 1)
  3954. adot = 1;
  3955. kickAngle = Math.acos(adot) * 57.3;
  3956. if (kickAngle > 45) {
  3957. let kdx = ball.kickPos.x - ball.gameObj.x;
  3958. let kdy = ball.kickPos.y - ball.gameObj.y;
  3959. dx = ball.kickPos.x - kdx * mis * 0.3;
  3960. dy = ball.kickPos.y - kdy * mis * 0.3;
  3961. }
  3962. else
  3963. this.destRot += mis;
  3964. }
  3965. else if (ball.poleAngle != 0) {
  3966. this.destRot += ball.poleAngle;
  3967. }
  3968. if (xGame.common.gameMode == 0) {
  3969. let af = kickAngle * 0.08;
  3970. this.forceMax = ball.hard * 0.1 + af * af;
  3971. }
  3972. this.setKick(dx, dy);
  3973. return ball;
  3974. }
  3975. initHoleBall(arr) {
  3976. this.kickBall = [];
  3977. this.lineBall = [];
  3978. this.scoreBall = [];
  3979. this.holeBall = [];
  3980. this.selectNum = 0;
  3981. this.forceNum = 0;
  3982. this.forceMax = 0;
  3983. this.turnNum = 0;
  3984. let list = arr;
  3985. let holes = xGame.common.gameMgr.holePosList;
  3986. let self = xGame.common.aiPlayer;
  3987. for (let i = 0; i < list.length; i++) {
  3988. let obj = list[i];
  3989. if (!obj)
  3990. continue;
  3991. obj.kickPos.x = 0;
  3992. obj.kickPos.y = 0;
  3993. obj.poleAngle = 0;
  3994. obj.hard = 0;
  3995. obj.borderDis = 0;
  3996. obj.kickAngle = 180;
  3997. let b = obj.gameObj;
  3998. let wbp = this.rootPos;
  3999. let bx = wbp.x - b.x;
  4000. let by = wbp.y - b.y;
  4001. obj.borderDis = xGame.tools.random(0, 100);
  4002. this.kickBall.push(obj);
  4003. if (!this.isLine(wbp, obj))
  4004. continue;
  4005. obj.kickAngle = xGame.tools.random(90, 180);
  4006. obj.kickPos.x = b.x;
  4007. obj.kickPos.y = b.y;
  4008. this.lineBall.push(obj);
  4009. let minDis = 999999;
  4010. let hole = false;
  4011. for (let j = 0; j < holes.length; j++) {
  4012. let hp = holes[j];
  4013. if (bx >= 0 && hp.x > b.x + 100)
  4014. continue;
  4015. if (bx <= 0 && hp.x < b.x - 100)
  4016. continue;
  4017. if (by < -10 && hp.y < wbp.y)
  4018. continue;
  4019. if (by > 10 && hp.y > wbp.y)
  4020. continue;
  4021. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4022. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4023. if (dis < minDis) {
  4024. let dx = b.x - this.tempDir1.x * this.ballSize;
  4025. let dy = b.y - this.tempDir1.y * this.ballSize;
  4026. this.tempDir3.x = this.tempDir1.x;
  4027. this.tempDir3.y = this.tempDir1.y;
  4028. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4029. obj.kickPos.x = dx;
  4030. obj.kickPos.y = dy;
  4031. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4032. if (num > 1)
  4033. num = 1;
  4034. obj.kickAngle = Math.acos(num) * 57.3;
  4035. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4036. dis = dis * 2;
  4037. if (Math.abs(hp.x - 600) < 100)
  4038. dis += 50;
  4039. obj.hard = dis + obj.kickAngle * 3;
  4040. hole = true;
  4041. }
  4042. }
  4043. }
  4044. }
  4045. if (hole) {
  4046. this.scoreBall.push(obj);
  4047. this.holeBall.push(obj);
  4048. }
  4049. }
  4050. this.scoreBall.sort(function (a, b) {
  4051. return a.hard - b.hard;
  4052. });
  4053. this.holeBall.sort(function (a, b) {
  4054. return a.kickAngle - b.kickAngle;
  4055. });
  4056. this.kickBall.sort(function (a, b) {
  4057. return a.borderDis - b.borderDis;
  4058. });
  4059. }
  4060. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4061. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4062. let balls = xGame.common.d2World.ballArr;
  4063. let max = xGame.tools.getDis(hx, hy, bx, by);
  4064. for (let index = 0; index < balls.length; index++) {
  4065. let obj = balls[index];
  4066. if (obj.number == 0)
  4067. continue;
  4068. if (obj.number == bn || obj.number == dn)
  4069. continue;
  4070. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4071. if (dis * dis > max)
  4072. continue;
  4073. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4074. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4075. if (num > 1)
  4076. num = 1;
  4077. if (num < 0)
  4078. continue;
  4079. let gap = Math.sin(Math.acos(num)) * dis;
  4080. if (gap < this.ballSize)
  4081. return true;
  4082. }
  4083. return false;
  4084. }
  4085. isLine(xy, ball) {
  4086. let bx = xy.x;
  4087. let by = xy.y;
  4088. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4089. let dis = ball.getDestDis(xy);
  4090. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4091. let sin = Math.sin(angle);
  4092. let cos = Math.cos(angle);
  4093. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4094. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4095. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4096. let dx = bx + this.tempDir2.x * dis;
  4097. let dy = by + this.tempDir2.y * dis;
  4098. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4099. sin = Math.sin(-angle);
  4100. cos = Math.cos(-angle);
  4101. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4102. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4103. dx = bx + this.tempDir2.x * dis;
  4104. dy = by + this.tempDir2.y * dis;
  4105. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4106. if (isr && isl)
  4107. return false;
  4108. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4109. }
  4110. return true;
  4111. }
  4112. setKick(dx, dy) {
  4113. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4114. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4115. this.tempDir1.x = 0;
  4116. this.tempDir1.y = 1;
  4117. this.tempDir2.y = -this.tempDir2.y;
  4118. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4119. if (num > 1)
  4120. num = 1;
  4121. let rot = Math.acos(num) * 57.3;
  4122. if (this.tempDir2.x < 0)
  4123. rot = 360 - rot;
  4124. this.destRot += rot;
  4125. }
  4126. }
  4127. class ui_UIGame extends fgui.GComponent {
  4128. static createInstance() {
  4129. return (fgui.UIPackage.createObject("game", "UIGame"));
  4130. }
  4131. onConstruct() {
  4132. this.c1 = this.getController("c1");
  4133. this.d3Root = (this.getChild("d3Root"));
  4134. this.clickNode = (this.getChild("clickNode"));
  4135. this.d2Root = (this.getChild("d2Root"));
  4136. this.topNode = (this.getChild("topNode"));
  4137. this.n72 = (this.getChild("n72"));
  4138. this.n40 = (this.getChild("n40"));
  4139. this.rulerNode = (this.getChild("rulerNode"));
  4140. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4141. this.n50 = (this.getChild("n50"));
  4142. this.keduNode = (this.getChild("keduNode"));
  4143. this.powerTxt = (this.getChild("powerTxt"));
  4144. this.powerNode = (this.getChild("powerNode"));
  4145. this.colorNode = (this.getChild("colorNode"));
  4146. this.powerEft = (this.getChild("powerEft"));
  4147. this.myPowerNode = (this.getChild("myPowerNode"));
  4148. this.ganNode = (this.getChild("ganNode"));
  4149. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4150. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4151. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4152. this.skillRod = (this.getChild("skillRod"));
  4153. this.border = (this.getChild("border"));
  4154. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4155. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4156. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4157. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4158. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4159. this.guanyuNode = (this.getChild("guanyuNode"));
  4160. this.helpBtn = (this.getChild("helpBtn"));
  4161. this.wordsBtn = (this.getChild("wordsBtn"));
  4162. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4163. this.returnBtn = (this.getChild("returnBtn"));
  4164. this.ballNode = (this.getChild("ballNode"));
  4165. this.whiteAni = (this.getChild("whiteAni"));
  4166. this.blackAni = (this.getChild("blackAni"));
  4167. this.selfTurn = (this.getChild("selfTurn"));
  4168. this.aiTurn = (this.getChild("aiTurn"));
  4169. this.deskNode = (this.getChild("deskNode"));
  4170. this.moveNode = (this.getChild("moveNode"));
  4171. this.selfTalk = (this.getChild("selfTalk"));
  4172. this.aiTalk = (this.getChild("aiTalk"));
  4173. this.d2Node = (this.getChild("d2Node"));
  4174. this.snowNode = (this.getChild("snowNode"));
  4175. this.guide2 = (this.getChild("guide2"));
  4176. this.guide1 = (this.getChild("guide1"));
  4177. this.guide3 = (this.getChild("guide3"));
  4178. this.guideNode = (this.getChild("guideNode"));
  4179. }
  4180. }
  4181. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4182. class ui_UIGameEnd extends fgui.GComponent {
  4183. static createInstance() {
  4184. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4185. }
  4186. onConstruct() {
  4187. this.c1 = this.getController("c1");
  4188. this.n22 = (this.getChild("n22"));
  4189. this.n2 = (this.getChild("n2"));
  4190. this.n52 = (this.getChild("n52"));
  4191. this.n53 = (this.getChild("n53"));
  4192. this.coinNode = (this.getChild("coinNode"));
  4193. this.closeNode = (this.getChild("closeNode"));
  4194. this.moneyNode = (this.getChild("moneyNode"));
  4195. this.secretary = (this.getChild("secretary"));
  4196. this.n27 = (this.getChild("n27"));
  4197. this.n29 = (this.getChild("n29"));
  4198. this.talkNode = (this.getChild("talkNode"));
  4199. this.n38 = (this.getChild("n38"));
  4200. this.n39 = (this.getChild("n39"));
  4201. this.n40 = (this.getChild("n40"));
  4202. this.awardNode = (this.getChild("awardNode"));
  4203. this.starNumNode = (this.getChild("starNumNode"));
  4204. this.n47 = (this.getChild("n47"));
  4205. this.conditionNode = (this.getChild("conditionNode"));
  4206. this.isGetAward = (this.getChild("isGetAward"));
  4207. this.leftBtn = (this.getChild("leftBtn"));
  4208. this.rightBtn = (this.getChild("rightBtn"));
  4209. this.btnNode = (this.getChild("btnNode"));
  4210. }
  4211. }
  4212. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4213. class ui_UIAddCoin extends fgui.GComponent {
  4214. static createInstance() {
  4215. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4216. }
  4217. onConstruct() {
  4218. this.n11 = (this.getChild("n11"));
  4219. this.myNode = (this.getChild("myNode"));
  4220. this.t0 = this.getTransition("t0");
  4221. }
  4222. }
  4223. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4224. class UIAddCoin extends UIBase {
  4225. constructor() {
  4226. super();
  4227. this.coinNum = 2000;
  4228. }
  4229. onConstructor() {
  4230. this.ui = ui_UIAddCoin.createInstance();
  4231. this.contentPane = this.ui;
  4232. this.isEject = false;
  4233. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4234. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4235. }
  4236. show() {
  4237. super.show();
  4238. this.ui.t0.play();
  4239. }
  4240. videoAddCoin() {
  4241. console.log('zh:qjff_AD_for_UIAddCoin');
  4242. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4243. }
  4244. else {
  4245. console.log('zh:AD 失败,直接发放奖励');
  4246. this.qjff_AD_for_UIAddCoin();
  4247. }
  4248. }
  4249. qjff_AD_for_UIAddCoin() {
  4250. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4251. this.hide();
  4252. }
  4253. }
  4254. UIAddCoin.uiName = "UIAddCoin";
  4255. class ui_UIInvitation extends fgui.GComponent {
  4256. static createInstance() {
  4257. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4258. }
  4259. onConstruct() {
  4260. this.n14 = (this.getChild("n14"));
  4261. this.myNode = (this.getChild("myNode"));
  4262. this.t0 = this.getTransition("t0");
  4263. }
  4264. }
  4265. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4266. class UIInvitation extends UIBase {
  4267. constructor() {
  4268. super();
  4269. }
  4270. onConstructor() {
  4271. this.ui = ui_UIInvitation.createInstance();
  4272. this.contentPane = this.ui;
  4273. this.isEject = false;
  4274. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4275. }
  4276. show() {
  4277. super.show();
  4278. }
  4279. enterGame() {
  4280. xGame.common.gameMode = GameMode.classic;
  4281. DataMgr.setChallengeTimes(1);
  4282. xGame.common.passAwardCoin = 2000;
  4283. let need = xGame.common.classicNiceNeddCoin;
  4284. if (DataMgr.coinEnough(need)) {
  4285. DataMgr.setCoin(-need);
  4286. xGame.eventMgr.event(RESTART_GAME, true);
  4287. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4288. }
  4289. else {
  4290. xGame.eventMgr.event(RESTART_GAME, true);
  4291. }
  4292. this.hide();
  4293. }
  4294. hide() {
  4295. super.hide();
  4296. }
  4297. }
  4298. UIInvitation.uiName = "UIInvitation";
  4299. class ui_UIMain extends fgui.GComponent {
  4300. static createInstance() {
  4301. return (fgui.UIPackage.createObject("game", "UIMain"));
  4302. }
  4303. onConstruct() {
  4304. this.n47 = (this.getChild("n47"));
  4305. this.n10 = (this.getChild("n10"));
  4306. this.secretary = (this.getChild("secretary"));
  4307. this.shopBtn = (this.getChild("shopBtn"));
  4308. this.moneyNode = (this.getChild("moneyNode"));
  4309. this.headNode = (this.getChild("headNode"));
  4310. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4311. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4312. this.classicBtn = (this.getChild("classicBtn"));
  4313. this.globalBtn = (this.getChild("globalBtn"));
  4314. this.n44 = (this.getChild("n44"));
  4315. this.signBtn = (this.getChild("signBtn"));
  4316. this.drawBtn = (this.getChild("drawBtn"));
  4317. this.settingNode = (this.getChild("settingNode"));
  4318. this.n45 = (this.getChild("n45"));
  4319. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4320. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4321. this.rankBtn = (this.getChild("rankBtn"));
  4322. this.n46 = (this.getChild("n46"));
  4323. this.liucheng1 = (this.getChild("liucheng1"));
  4324. this.rightBtn = (this.getChild("rightBtn"));
  4325. this.n75 = (this.getChild("n75"));
  4326. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4327. this.liucheng2 = (this.getChild("liucheng2"));
  4328. this.guideBtn = (this.getChild("guideBtn"));
  4329. this.n73 = (this.getChild("n73"));
  4330. this.wordsNode = (this.getChild("wordsNode"));
  4331. this.enterGuide = (this.getChild("enterGuide"));
  4332. this.talkNode = (this.getChild("talkNode"));
  4333. this.n83 = (this.getChild("n83"));
  4334. this.n84 = (this.getChild("n84"));
  4335. this.n_Logout = (this.getChild("n_Logout"));
  4336. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4337. this.n_dengLu = (this.getChild("n_dengLu"));
  4338. }
  4339. }
  4340. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4341. class ui_UIMoyu extends fgui.GComponent {
  4342. static createInstance() {
  4343. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4344. }
  4345. onConstruct() {
  4346. this.ageTip = (this.getChild("ageTip"));
  4347. this.mainBg = (this.getChild("mainBg"));
  4348. this.xyNode = (this.getChild("xyNode"));
  4349. this.rnNode = (this.getChild("rnNode"));
  4350. this.fcmNode = (this.getChild("fcmNode"));
  4351. this.ageNode = (this.getChild("ageNode"));
  4352. this.tipNode = (this.getChild("tipNode"));
  4353. this.msgNode = (this.getChild("msgNode"));
  4354. }
  4355. }
  4356. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4357. class MoyuMgr {
  4358. static initMoyu() {
  4359. this.moyuView = new MoyuView();
  4360. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4361. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4362. this.moyuView.ui.displayObject.zOrder = 1000;
  4363. this.moyuView.init();
  4364. this.moyuView.showTip(true);
  4365. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4366. window['XApk'] = this;
  4367. }
  4368. static showAge(show) {
  4369. if (this.moyuView)
  4370. this.moyuView.showAge(show);
  4371. }
  4372. static onPlatMsg(idx) {
  4373. if (!MoyuMgr.moyuView)
  4374. return;
  4375. if (idx == '0') {
  4376. MoyuMgr.moyuView.showTip(false);
  4377. }
  4378. }
  4379. static showAgree(call) {
  4380. if (this.moyuView)
  4381. this.moyuView.showAgree(call);
  4382. else
  4383. call && call();
  4384. }
  4385. static showXy(type = 1) {
  4386. if (this.moyuView)
  4387. this.moyuView.showXy(type);
  4388. }
  4389. }
  4390. MoyuMgr.isAdvise = false;
  4391. class MoyuView {
  4392. constructor() {
  4393. this.ysxyNum = 1;
  4394. this.ysJson = null;
  4395. this.ui = ui_UIMoyu.createInstance();
  4396. }
  4397. init() {
  4398. this.ui.mainBg.visible = false;
  4399. this.ui.xyNode.visible = false;
  4400. this.ui.ageNode.visible = false;
  4401. this.ui.tipNode.visible = false;
  4402. this.ui.rnNode.visible = false;
  4403. this.ui.fcmNode.visible = false;
  4404. this.ui.ageTip.visible = false;
  4405. this.ui.msgNode.visible = false;
  4406. this.ui.visible = false;
  4407. this.ui.xyNode.xyList.setVirtual();
  4408. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4409. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4410. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4411. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4412. this.ui.xyNode.btnKnown.visible = false;
  4413. this.ui.xyNode.xy1.visible = false;
  4414. this.ui.xyNode.xy2.visible = false;
  4415. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4416. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4417. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4418. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4419. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4420. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4421. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4422. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4423. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4424. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4425. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4426. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4427. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4428. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4429. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4430. this.ysxyNum = 2;
  4431. }
  4432. }
  4433. onClick(obj) {
  4434. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4435. switch (obj) {
  4436. case this.ui.ageTip:
  4437. if (Moyu.isTTApk) {
  4438. this.ui.ageNode.visible = true;
  4439. this.ui.mainBg.visible = true;
  4440. }
  4441. break;
  4442. case this.ui.tipNode:
  4443. this.showTip(false);
  4444. break;
  4445. case this.ui.ageNode.btnAge:
  4446. this.ui.ageNode.visible = false;
  4447. this.ui.mainBg.visible = false;
  4448. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4449. this.ui.visible = false;
  4450. break;
  4451. case this.ui.xyNode.btnXy3:
  4452. case this.ui.xyNode.btnXy1:
  4453. this.loadXy(1);
  4454. break;
  4455. case this.ui.xyNode.btnXy2:
  4456. this.loadXy(2);
  4457. break;
  4458. case this.ui.xyNode.btnBack:
  4459. this.ui.xyNode.xy1.visible = true;
  4460. this.ui.xyNode.xy2.visible = false;
  4461. break;
  4462. case this.ui.xyNode.btnKnown:
  4463. this.ui.xyNode.visible = false;
  4464. this.ui.mainBg.visible = false;
  4465. this.ui.visible = false;
  4466. break;
  4467. case this.ui.rnNode.btnCheck:
  4468. this.check();
  4469. break;
  4470. case this.ui.rnNode.btnExit:
  4471. case this.ui.xyNode.btnNo:
  4472. this.ysxyNum--;
  4473. if (this.ysxyNum > 0)
  4474. this.showMsg("Refuse to quit the game once again");
  4475. else {
  4476. Moyu.userAgree(false);
  4477. Moyu.exit();
  4478. }
  4479. break;
  4480. case this.ui.xyNode.btnSure:
  4481. case this.ui.xyNode.btnYes:
  4482. DataMgr.userData.isAgree = true;
  4483. DataMgr.saveUserData();
  4484. this.onAgree();
  4485. break;
  4486. case this.ui.rnNode.btnDone:
  4487. this.ui.rnNode.visible = false;
  4488. this.ui.visible = false;
  4489. break;
  4490. case this.ui.fcmNode.btnRn:
  4491. this.showRn();
  4492. break;
  4493. }
  4494. }
  4495. showTip(show) {
  4496. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4497. return;
  4498. if (show) {
  4499. MoyuMgr.isAdvise = true;
  4500. this.ui.visible = true;
  4501. this.ui.tipNode.visible = true;
  4502. this.ui.tipNode.alpha = 1;
  4503. Laya.timer.once(1000, this, this.showTip, [false]);
  4504. }
  4505. else {
  4506. this.ui.tipNode.alpha = 1;
  4507. this.ui.tipNode.visible = true;
  4508. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4509. this.ui.tipNode.visible = false;
  4510. MoyuMgr.isAdvise = false;
  4511. }), 1000);
  4512. }
  4513. }
  4514. showAge(show, px = 0, py = 0) {
  4515. if (Moyu.platType > 10 && !Moyu.isIos) {
  4516. this.ui.ageTip.x = px;
  4517. this.ui.ageTip.y = py;
  4518. this.ui.ageTip.visible = show;
  4519. if (show)
  4520. this.ui.visible = true;
  4521. }
  4522. }
  4523. showAgree(call) {
  4524. this.agreeCall = call;
  4525. this.onAgree();
  4526. return;
  4527. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4528. this.showXy(0);
  4529. }
  4530. else
  4531. this.onAgree();
  4532. }
  4533. onAgree() {
  4534. if (!this.ui.ageNode.visible)
  4535. this.ui.visible = false;
  4536. this.ui.xyNode.visible = false;
  4537. Moyu.userAgree(true);
  4538. this.showAge(false);
  4539. this.agreeCall && this.agreeCall();
  4540. this.showRn();
  4541. }
  4542. showMsg(txt) {
  4543. this.ui.msgNode.txtMsg.text = txt;
  4544. this.ui.msgNode.visible = true;
  4545. this.ui.msgNode.alpha = 1;
  4546. this.ui.visible = true;
  4547. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4548. this.ui.msgNode.visible = false;
  4549. }), 2500, true);
  4550. }
  4551. showRn() {
  4552. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4553. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4554. this.ui.rnNode.rn1.visible = true;
  4555. this.ui.rnNode.rn2.visible = false;
  4556. this.ui.rnNode.rn3.visible = false;
  4557. this.ui.rnNode.rn4.visible = false;
  4558. this.ui.rnNode.visible = true;
  4559. this.ui.mainBg.visible = true;
  4560. this.ui.rnNode.btnDone.visible = false;
  4561. this.ui.rnNode.btnExit.visible = true;
  4562. this.ui.rnNode.btnCheck.visible = true;
  4563. this.ui.fcmNode.visible = false;
  4564. this.ui.visible = true;
  4565. return;
  4566. }
  4567. }
  4568. this.showFcm();
  4569. }
  4570. showFcm() {
  4571. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4572. Moyu.initFCM(true);
  4573. if (Moyu.gameTime < 1)
  4574. this.fcmLoop();
  4575. else if (Moyu.gameTime < 999)
  4576. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4577. }
  4578. }
  4579. fcmLoop() {
  4580. if (Moyu.gameTime < 1) {
  4581. this.ui.rnNode.visible = false;
  4582. this.ui.fcmNode.visible = true;
  4583. this.ui.mainBg.visible = true;
  4584. this.ui.visible = true;
  4585. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4586. Laya.timer.clear(this.ui, this.fcmLoop);
  4587. }
  4588. }
  4589. check() {
  4590. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4591. this.ui.rnNode.rn1.visible = false;
  4592. this.ui.rnNode.rn2.visible = false;
  4593. this.ui.rnNode.rn4.visible = true;
  4594. }
  4595. else if (this.ui.rnNode.rn4.visible) {
  4596. let name = this.ui.rnNode.inputName.text;
  4597. let code = this.ui.rnNode.inputCode.text;
  4598. if (code && code.length == 18) {
  4599. this.ui.rnNode.rn1.visible = false;
  4600. this.ui.rnNode.rn4.visible = false;
  4601. Moyu.authenticate(name, code, (res) => {
  4602. this.ui.rnNode.rn2.visible = !res;
  4603. this.ui.rnNode.rn3.visible = res;
  4604. this.ui.rnNode.btnDone.visible = res;
  4605. this.ui.rnNode.btnExit.visible = !res;
  4606. this.ui.rnNode.btnCheck.visible = !res;
  4607. if (res)
  4608. this.showFcm();
  4609. });
  4610. }
  4611. else
  4612. this.showMsg("信息填写不完整");
  4613. }
  4614. }
  4615. loadXy(type = 0) {
  4616. this.ui.xyNode.xy1.visible = false;
  4617. this.ui.xyNode.xy2.visible = true;
  4618. this.ui.xyNode.xyList.scrollToView(0);
  4619. if (type == 1) {
  4620. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4621. }
  4622. else if (type == 2) {
  4623. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4624. }
  4625. }
  4626. showXy(type = 0) {
  4627. this.xyBtn();
  4628. if (type == 0) {
  4629. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4630. this.ui.xyNode.btnSure.visible = true;
  4631. }
  4632. else {
  4633. this.ui.xyNode.btnYes.visible = true;
  4634. this.ui.xyNode.btnNo.visible = true;
  4635. }
  4636. }
  4637. else {
  4638. this.ui.xyNode.btnKnown.visible = true;
  4639. this.ui.mainBg.visible = true;
  4640. }
  4641. this.ui.xyNode.xy1.visible = true;
  4642. this.ui.xyNode.xy2.visible = false;
  4643. this.ui.xyNode.visible = true;
  4644. this.ui.visible = true;
  4645. }
  4646. xyBtn() {
  4647. this.ui.xyNode.btnSure.visible = false;
  4648. this.ui.xyNode.btnYes.visible = false;
  4649. this.ui.xyNode.btnNo.visible = false;
  4650. this.ui.xyNode.btnKnown.visible = false;
  4651. {
  4652. this.ui.xyNode.btnXy3.visible = false;
  4653. this.ui.xyNode.btnXy2.visible = true;
  4654. this.ui.xyNode.btnXy1.visible = true;
  4655. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4656. }
  4657. }
  4658. createXY(json) {
  4659. this.ysJson = json.content;
  4660. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4661. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4662. this.ui.xyNode.xy2.visible = true;
  4663. }
  4664. renderListItem(idx, cell) {
  4665. let xy = this.ysJson[idx];
  4666. cell.height = xy.line * 30;
  4667. cell.xyItem.text = xy.text;
  4668. }
  4669. onDestroy() {
  4670. this.agreeCall = null;
  4671. }
  4672. }
  4673. class SettingNode {
  4674. constructor(ui) {
  4675. this.showSetting = false;
  4676. this.openSound = true;
  4677. this.openShake = true;
  4678. this.ui = ui;
  4679. this.ui.soundBtn.onClick(this, this.switchSound);
  4680. this.ui.shakeBtn.onClick(this, this.switchShake);
  4681. this.ui.xyBtn.onClick(this, this.onXy);
  4682. this.ui.clickNode.onClick(this, this.changeSetting);
  4683. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4684. this.ui.xyBtn.visible = false;
  4685. this.ui.shakeBtn.visible = false;
  4686. }
  4687. changeSetting() {
  4688. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4689. this.showSetting = !this.showSetting;
  4690. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4691. }
  4692. switchSound() {
  4693. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4694. this.openSound = !this.openSound;
  4695. Moyu.onSetting(this.openSound, this.openShake);
  4696. xGame.soundMgr.onSetting(this.openSound);
  4697. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4698. }
  4699. switchShake() {
  4700. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4701. this.openShake = !this.openShake;
  4702. Moyu.onSetting(this.openSound, this.openShake);
  4703. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4704. }
  4705. onXy() {
  4706. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4707. MoyuMgr.showXy(1);
  4708. }
  4709. }
  4710. class ui_UILevelDisplay extends fgui.GComponent {
  4711. static createInstance() {
  4712. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4713. }
  4714. onConstruct() {
  4715. this.n9 = (this.getChild("n9"));
  4716. this.myNode = (this.getChild("myNode"));
  4717. this.closeNode = (this.getChild("closeNode"));
  4718. }
  4719. }
  4720. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4721. class ui_UILevelProp extends fgui.GComponent {
  4722. static createInstance() {
  4723. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4724. }
  4725. onConstruct() {
  4726. this.n16 = (this.getChild("n16"));
  4727. this.myNode = (this.getChild("myNode"));
  4728. this.closeBtn = (this.getChild("closeBtn"));
  4729. this.moneyNode = (this.getChild("moneyNode"));
  4730. this.t1 = this.getTransition("t1");
  4731. }
  4732. }
  4733. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4734. class ui_ShowItem extends fgui.GComponent {
  4735. static createInstance() {
  4736. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4737. }
  4738. onConstruct() {
  4739. this.myImg = (this.getChild("myImg"));
  4740. }
  4741. }
  4742. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4743. class ShowItem {
  4744. constructor() {
  4745. this.ui = ui_ShowItem.createInstance();
  4746. }
  4747. destroySelf() {
  4748. if (!this.ui.isDisposed) {
  4749. this.ui.removeFromParent();
  4750. this.ui.dispose();
  4751. }
  4752. }
  4753. setParent(parent) {
  4754. parent.addChild(this.ui);
  4755. }
  4756. setPos(x, y) {
  4757. this.ui.x = x;
  4758. this.ui.y = y;
  4759. }
  4760. setUrl(index) {
  4761. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4762. }
  4763. }
  4764. class ui_UIPower extends fgui.GComponent {
  4765. static createInstance() {
  4766. return (fgui.UIPackage.createObject("game", "UIPower"));
  4767. }
  4768. onConstruct() {
  4769. this.n11 = (this.getChild("n11"));
  4770. this.myNode = (this.getChild("myNode"));
  4771. this.t0 = this.getTransition("t0");
  4772. }
  4773. }
  4774. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4775. class UIPower extends UIBase {
  4776. constructor() {
  4777. super();
  4778. }
  4779. onConstructor() {
  4780. this.ui = ui_UIPower.createInstance();
  4781. this.contentPane = this.ui;
  4782. this.isEject = false;
  4783. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4784. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4785. }
  4786. show() {
  4787. super.show();
  4788. this.ui.t0.play();
  4789. }
  4790. videoGetPower() {
  4791. console.log('zh:qjff_AD_for_uipower');
  4792. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4793. }
  4794. else {
  4795. console.log('zh:AD 失败,直接发放奖励');
  4796. this.qjff_AD_for_uipower();
  4797. }
  4798. }
  4799. qjff_AD_for_uipower() {
  4800. DataMgr.setPower(xGame.common.videoPower, true);
  4801. xGame.eventMgr.event(POWER_TIME);
  4802. this.hide();
  4803. }
  4804. }
  4805. UIPower.uiName = "UIPower";
  4806. class LocalStorageManager {
  4807. test1() {
  4808. LocalStorageManager.setItem("playerName", "Tom");
  4809. LocalStorageManager.setItem("playerLevel", 5);
  4810. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4811. const name = LocalStorageManager.getItem("playerName");
  4812. const level = LocalStorageManager.getItem("playerLevel");
  4813. const data = LocalStorageManager.getItem("playerData");
  4814. console.log(name);
  4815. console.log(level);
  4816. console.log(data);
  4817. LocalStorageManager.removeItem("playerLevel");
  4818. }
  4819. static setItem(key, value) {
  4820. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4821. }
  4822. static getItem(key) {
  4823. const data = Laya.LocalStorage.getItem(key);
  4824. if (data === null)
  4825. return null;
  4826. try {
  4827. return JSON.parse(data);
  4828. }
  4829. catch (e) {
  4830. return data;
  4831. }
  4832. }
  4833. static removeItem(key) {
  4834. Laya.LocalStorage.removeItem(key);
  4835. }
  4836. static clear() {
  4837. Laya.LocalStorage.clear();
  4838. }
  4839. static hasJosnKey(key) {
  4840. var value = Laya.LocalStorage.getJSON(key);
  4841. if (value != null) {
  4842. return true;
  4843. }
  4844. else {
  4845. return false;
  4846. }
  4847. }
  4848. static hasKey(key) {
  4849. return Laya.LocalStorage.getItem(key) !== null;
  4850. }
  4851. }
  4852. class UILevelProp extends UIBase {
  4853. constructor() {
  4854. super();
  4855. this.firstPos = 385;
  4856. this.secondPos = 467;
  4857. this.showItemArr = [];
  4858. }
  4859. onFontLoaded() {
  4860. try {
  4861. this.ui.myNode.conditionTxt.font = "arial";
  4862. console.log("zh: onFontLoaded 设置arial字体成功");
  4863. }
  4864. catch (error) {
  4865. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4866. }
  4867. }
  4868. onConstructor() {
  4869. this.ui = ui_UILevelProp.createInstance();
  4870. this.contentPane = this.ui;
  4871. this.isEject = false;
  4872. this.addUIClick(this.ui.closeBtn, this.hide);
  4873. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4874. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4875. }
  4876. show(level) {
  4877. super.show();
  4878. this.ui.t1.play();
  4879. this.level = level;
  4880. this.data = cfgTable.placeballData[this.level];
  4881. this.updateSelf();
  4882. this.showPreView();
  4883. this.moneyNode.ui.c1.selectedIndex = 2;
  4884. this.moneyNode.checkPowerTime();
  4885. this.moneyNode.powerChange();
  4886. }
  4887. showPreView() {
  4888. let item;
  4889. let data;
  4890. for (let index = 0; index < this.showItemArr.length; index++) {
  4891. item = this.showItemArr[index];
  4892. item.destroySelf();
  4893. }
  4894. this.showItemArr = [];
  4895. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4896. for (const key in cfgData) {
  4897. data = cfgData[key];
  4898. item = new ShowItem();
  4899. item.setParent(this.ui.myNode.displayRoot);
  4900. item.setPos(data.x, data.y);
  4901. item.setUrl(data.value);
  4902. this.showItemArr.push(item);
  4903. }
  4904. }
  4905. updateSelf() {
  4906. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4907. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4908. if (this.data.ball == -1) {
  4909. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4910. }
  4911. else {
  4912. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4913. }
  4914. let localData = DataMgr.getPlaceBallLevel(this.level);
  4915. let getAward = localData.getAward;
  4916. let cfg = cfgTable.placeballData[this.level];
  4917. let coin = this.data.award[0];
  4918. let diamond = this.data.award[1];
  4919. if (cfg.type == PlaceBallType.challenge) {
  4920. diamond = 0;
  4921. coin = 100;
  4922. }
  4923. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4924. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4925. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4926. if (cfg.type == PlaceBallType.challenge) {
  4927. this.ui.myNode.coinNode.numTxt.text = "";
  4928. }
  4929. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4930. if (coin > 0 && diamond > 0) {
  4931. this.ui.myNode.diamondNode.x = 385;
  4932. this.ui.myNode.coinNode.x = 467;
  4933. }
  4934. else {
  4935. this.ui.myNode.diamondNode.x = 385;
  4936. this.ui.myNode.coinNode.x = 385;
  4937. }
  4938. if (!getAward) {
  4939. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4940. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4941. }
  4942. else {
  4943. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4944. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4945. }
  4946. }
  4947. startGame() {
  4948. if (DataMgr.powerEnough()) {
  4949. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  4950. this.ui.myNode.startBtn.touchable = false;
  4951. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4952. console.log('zh:startGame ');
  4953. this.ui.myNode.startBtn.touchable = true;
  4954. DataMgr.setPower(-1);
  4955. xGame.eventMgr.event(POWER_TIME);
  4956. xGame.common.gameMode = GameMode.placeBall;
  4957. xGame.common.placeBallCurLevel = this.level;
  4958. xGame.uiMgr.Show(UIGame);
  4959. this.logEventForChallenge_level_start(this.level);
  4960. xGame.uiMgr.Hide(UILevelDisplay);
  4961. xGame.uiMgr.Hide(UIMain);
  4962. this.hide();
  4963. }));
  4964. }
  4965. else {
  4966. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  4967. xGame.uiMgr.Show(UIPower);
  4968. }
  4969. }
  4970. logEventForChallenge_level_start(level) {
  4971. let keyStr = 'sjmd_challenge_level_start';
  4972. let jsonStr = {
  4973. "count": 1,
  4974. "gold_balance ": DataMgr.getCoin(),
  4975. "level": level,
  4976. "diamond_balance ": DataMgr.getDiamond()
  4977. };
  4978. if (LocalStorageManager.hasJosnKey(keyStr)) {
  4979. const d = LocalStorageManager.getItem(keyStr);
  4980. if (level > d.level) {
  4981. jsonStr.count = d.count + 1;
  4982. LocalStorageManager.setItem(keyStr, jsonStr);
  4983. }
  4984. else {
  4985. }
  4986. }
  4987. else {
  4988. LocalStorageManager.setItem(keyStr, jsonStr);
  4989. }
  4990. const reqStr = JSON.stringify(jsonStr);
  4991. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  4992. }
  4993. hide() {
  4994. super.hide();
  4995. }
  4996. }
  4997. UILevelProp.uiName = "UILevelProp";
  4998. class PutBallLevelDisplay {
  4999. constructor(ui, index) {
  5000. this.index = 0;
  5001. this.ui = ui;
  5002. this.index = index;
  5003. this.ui.onClick(this, this.clickSelf);
  5004. this.updateSelf();
  5005. this.ui.levelTxt.text = (this.index + 1) + "";
  5006. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5007. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5008. }
  5009. updateSelf() {
  5010. let level = this.index + 1;
  5011. this.data = DataMgr.getPlaceBallLevel(level);
  5012. this.ui.starNode.c1.selectedIndex = this.data.star;
  5013. let isChallenge = cfgTable.placeballData[level].type;
  5014. if (this.data.isCur) {
  5015. if (isChallenge) {
  5016. this.ui.c1.selectedIndex = 5;
  5017. }
  5018. else {
  5019. this.ui.c1.selectedIndex = 2;
  5020. }
  5021. }
  5022. else {
  5023. if (this.data.play) {
  5024. if (this.data.star == 3) {
  5025. this.ui.c1.selectedIndex = 0;
  5026. }
  5027. else {
  5028. this.ui.c1.selectedIndex = 1;
  5029. }
  5030. }
  5031. else {
  5032. if (isChallenge) {
  5033. this.ui.c1.selectedIndex = 4;
  5034. }
  5035. else {
  5036. this.ui.c1.selectedIndex = 3;
  5037. }
  5038. }
  5039. }
  5040. }
  5041. clickSelf() {
  5042. if (!this.data.play)
  5043. return;
  5044. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5045. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5046. }
  5047. }
  5048. class UILevelDisplay extends UIBase {
  5049. constructor() {
  5050. super();
  5051. }
  5052. onConstructor() {
  5053. this.ui = ui_UILevelDisplay.createInstance();
  5054. this.contentPane = this.ui;
  5055. this.isEject = false;
  5056. this.myList = this.ui.myNode.myList;
  5057. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5058. this.levelItemArr = [];
  5059. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5060. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5061. this.myList.numItems = levelNum;
  5062. if (Moyu.isKs)
  5063. this.ui.closeNode.closeBtn.x += 100;
  5064. }
  5065. levelItemRender(index, target) {
  5066. let item = new PutBallLevelDisplay(target, index);
  5067. this.levelItemArr.push(item);
  5068. }
  5069. show() {
  5070. super.show();
  5071. this.updateLevel();
  5072. this.scrollToPlace();
  5073. }
  5074. updateLevel() {
  5075. let temp;
  5076. for (let index = 0; index < this.levelItemArr.length; index++) {
  5077. temp = this.levelItemArr[index];
  5078. temp.updateSelf();
  5079. }
  5080. }
  5081. scrollToPlace() {
  5082. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5083. let passArr = DataMgr.getPlaceBallLevelList();
  5084. let offest = passArr.length;
  5085. if (offest >= maxNum - 1)
  5086. offest = maxNum - 1;
  5087. this.myList.scrollToView(offest, true, true);
  5088. }
  5089. hide() {
  5090. super.hide();
  5091. }
  5092. }
  5093. UILevelDisplay.uiName = "UILevelDisplay";
  5094. class ui_UIMatching extends fgui.GComponent {
  5095. static createInstance() {
  5096. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5097. }
  5098. onConstruct() {
  5099. this.n5 = (this.getChild("n5"));
  5100. this.n49 = (this.getChild("n49"));
  5101. this.n51 = (this.getChild("n51"));
  5102. this.n64 = (this.getChild("n64"));
  5103. this.n2 = (this.getChild("n2"));
  5104. this.n53 = (this.getChild("n53"));
  5105. this.n54 = (this.getChild("n54"));
  5106. this.n56 = (this.getChild("n56"));
  5107. this.n58 = (this.getChild("n58"));
  5108. this.n59 = (this.getChild("n59"));
  5109. this.n57 = (this.getChild("n57"));
  5110. this.n60 = (this.getChild("n60"));
  5111. this.n62 = (this.getChild("n62"));
  5112. this.awardTxt = (this.getChild("awardTxt"));
  5113. this.n61 = (this.getChild("n61"));
  5114. this.selfHead = (this.getChild("selfHead"));
  5115. this.aiHead = (this.getChild("aiHead"));
  5116. this.n82 = (this.getChild("n82"));
  5117. this.n84 = (this.getChild("n84"));
  5118. this.n83 = (this.getChild("n83"));
  5119. this.t1 = this.getTransition("t1");
  5120. this.t2 = this.getTransition("t2");
  5121. this.t3 = this.getTransition("t3");
  5122. this.t4 = this.getTransition("t4");
  5123. }
  5124. }
  5125. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5126. class UIMatching extends UIBase {
  5127. constructor() {
  5128. super();
  5129. }
  5130. onConstructor() {
  5131. this.ui = ui_UIMatching.createInstance();
  5132. this.contentPane = this.ui;
  5133. this.isEject = false;
  5134. }
  5135. show(callback) {
  5136. super.show();
  5137. PlatMgr.showBanner(true);
  5138. this.callback = callback;
  5139. let user = Moyu.getUserInfo();
  5140. if (!this.selfPot) {
  5141. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5142. }
  5143. if (!this.aiPot) {
  5144. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5145. }
  5146. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5147. this.ui.selfHead.nameTxt.text = user.nickName;
  5148. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5149. this.ui.aiHead.nameTxt.text = "???";
  5150. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5151. this.ui.selfHead.c1.selectedIndex = 0;
  5152. this.ui.aiHead.c1.selectedIndex = 0;
  5153. this.ui.selfHead.x = this.selfPot.x;
  5154. this.ui.selfHead.y = this.selfPot.y;
  5155. this.ui.aiHead.x = this.aiPot.x;
  5156. this.ui.aiHead.y = this.aiPot.y;
  5157. switch (xGame.common.gameMode) {
  5158. case GameMode.classic:
  5159. break;
  5160. case GameMode.bigMove:
  5161. this.initSkillData();
  5162. break;
  5163. default:
  5164. break;
  5165. }
  5166. this.ui.t1.play(Laya.Handler.create(this, () => {
  5167. this.ui.t2.play(Laya.Handler.create(this, () => {
  5168. switch (xGame.common.gameMode) {
  5169. case GameMode.classic:
  5170. this.waitingPeople();
  5171. break;
  5172. case GameMode.bigMove:
  5173. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5174. break;
  5175. default:
  5176. break;
  5177. }
  5178. }));
  5179. }));
  5180. }
  5181. initSkillData() {
  5182. this.skillSelectData = [];
  5183. let skillUrl = xGame.common.skillIconList;
  5184. let skillName = xGame.common.skillNameList;
  5185. let skillLevel = DataMgr.getBigSkillList();
  5186. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5187. for (let index = 0; index < 5; index++) {
  5188. let obj = {};
  5189. obj.skillImg = skillUrl[index];
  5190. obj.skillName = skillName[index];
  5191. obj.skillType = skillType[index];
  5192. obj.skillLevel = skillLevel[index];
  5193. this.skillSelectData.push(obj);
  5194. }
  5195. }
  5196. getAISkillLevel(myLevel) {
  5197. let video = xGame.common.upSkillLevel;
  5198. let aiLevel;
  5199. let temp;
  5200. if (video) {
  5201. temp = xGame.common.randomNum(-2, -1);
  5202. }
  5203. else {
  5204. if (myLevel <= 5) {
  5205. temp = xGame.common.randomNum(1, 3);
  5206. }
  5207. else if (myLevel <= 9) {
  5208. temp = xGame.common.randomNum(-2, 1);
  5209. }
  5210. else {
  5211. temp = xGame.common.randomNum(-4, 0);
  5212. }
  5213. }
  5214. aiLevel = temp + myLevel;
  5215. if (aiLevel <= 1)
  5216. aiLevel = 1;
  5217. if (aiLevel >= 10)
  5218. aiLevel = 10;
  5219. return aiLevel;
  5220. }
  5221. getAISkillType() {
  5222. return xGame.common.randomNum(1, 4);
  5223. let successTimes = DataMgr.getSkillSuccessTimes();
  5224. let info = cfgTable.aiskillData[successTimes];
  5225. if (!info) {
  5226. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5227. info = cfgTable.aiskillData[max];
  5228. }
  5229. let dataArr = info.skillselect;
  5230. let myCfg = {};
  5231. for (let index = 0; index < dataArr.length; index++) {
  5232. let temp = dataArr[index].split('-');
  5233. myCfg[temp[0]] = {};
  5234. myCfg[temp[0]].id = parseInt(temp[0]);
  5235. myCfg[temp[0]].weight = parseInt(temp[1]);
  5236. }
  5237. let aiCfg = xGame.common.initWeight(myCfg);
  5238. let curData = xGame.common.getRandomWeightData(aiCfg);
  5239. return parseInt(curData.id);
  5240. }
  5241. getAISkillData(index) {
  5242. let myLevel = this.skillSelectData[index].skillLevel;
  5243. let aiLevel = this.getAISkillLevel(myLevel);
  5244. let aiType = this.getAISkillType() - 1;
  5245. return { aiLevel, aiType } = { aiLevel, aiType };
  5246. }
  5247. skillSelectFinish(index) {
  5248. let aiInfo = this.getAISkillData(index);
  5249. xGame.common.gameMgr.selfCurSkill = index;
  5250. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5251. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5252. this.ui.selfHead.c1.selectedIndex = 1;
  5253. this.ui.aiHead.c1.selectedIndex = 1;
  5254. let myData = this.skillSelectData[index];
  5255. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5256. let guide = DataMgr.getSkillGuide();
  5257. if (guide == 0) {
  5258. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5259. }
  5260. else {
  5261. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5262. }
  5263. let aiData = this.skillSelectData[aiInfo.aiType];
  5264. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5265. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5266. this.waitingPeople();
  5267. }
  5268. waitingPeople() {
  5269. let time = xGame.common.randomNum(1000, 3000);
  5270. time += 1000;
  5271. Laya.timer.once(time, this, () => {
  5272. this.matchingSuccess();
  5273. });
  5274. }
  5275. matchingSuccess() {
  5276. let gameUI = xGame.common.gameUI;
  5277. let name = gameUI.ui.topNode.aiNameTxt.text;
  5278. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5279. this.ui.aiHead.nameTxt.text = name;
  5280. this.ui.aiHead.headImg.url = url;
  5281. name = gameUI.ui.topNode.selfNameTxt.text;
  5282. url = gameUI.ui.topNode.selfHeadLoader.url;
  5283. this.ui.selfHead.nameTxt.text = name;
  5284. this.ui.selfHead.headImg.url = url;
  5285. this.ui.t3.play(Laya.Handler.create(this, () => {
  5286. this.callback && this.callback();
  5287. this.ui.t4.play(Laya.Handler.create(this, () => {
  5288. this.destroySelf();
  5289. }));
  5290. }));
  5291. }
  5292. destroySelf() {
  5293. this.callback = null;
  5294. this.skillSelectData = null;
  5295. this.selfPot = null;
  5296. this.aiPot = null;
  5297. if (!this.ui.isDisposed) {
  5298. this.ui.removeFromParent();
  5299. this.ui.dispose();
  5300. }
  5301. xGame.uiMgr.destroyUI(this);
  5302. }
  5303. }
  5304. UIMatching.uiName = "UIMatching";
  5305. class ui_UIRanking extends fgui.GComponent {
  5306. static createInstance() {
  5307. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5308. }
  5309. onConstruct() {
  5310. this.n26 = (this.getChild("n26"));
  5311. this.myNode = (this.getChild("myNode"));
  5312. }
  5313. }
  5314. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5315. class UIRanking extends UIBase {
  5316. constructor() {
  5317. super();
  5318. this.showSelf = true;
  5319. this.rankType = 1;
  5320. this.rankList = [];
  5321. this.topX = 10;
  5322. this.myIndex = this.topX + 1;
  5323. this.myStar = 0;
  5324. }
  5325. onConstructor() {
  5326. this.ui = ui_UIRanking.createInstance();
  5327. this.contentPane = this.ui;
  5328. this.isEject = false;
  5329. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5330. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5331. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5332. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5333. this.ui.myNode.myList.setVirtual();
  5334. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5335. }
  5336. show() {
  5337. super.show();
  5338. this.getPaiHangBangDataFormJosnFile();
  5339. this.updateSelf();
  5340. let self = Moyu.getUserInfo();
  5341. if (!self.isAuth) {
  5342. Moyu.initUser(this, () => {
  5343. DataMgr.upRankData();
  5344. });
  5345. }
  5346. }
  5347. getPaiHangBangDataFormJosnFile() {
  5348. const rankingList = cfgTable.paiHangBangData.list;
  5349. this.updateItemData(rankingList);
  5350. }
  5351. updateSelfItem() {
  5352. console.log('zh:Moyu.platType =' + Moyu.platType);
  5353. let self = Moyu.getUserInfo();
  5354. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5355. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5356. if (this.myIndex > this.topX) {
  5357. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5358. }
  5359. else {
  5360. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5361. }
  5362. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5363. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5364. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5365. }
  5366. updateItemData(data) {
  5367. this.myStar = xGame.common.getAllStarNum();
  5368. if (this.rankList.length < 2) {
  5369. this.rankList = data;
  5370. let self = Moyu.getUserInfo();
  5371. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5372. self.headIcon = self.headIcon;
  5373. for (let i = 0; i < data.length; i++) {
  5374. let data = this.rankList[i];
  5375. if (data.userId == self.userId) {
  5376. this.rankList.splice(i, 1);
  5377. break;
  5378. }
  5379. }
  5380. for (let i = 0; i < data.length; i++) {
  5381. let data = this.rankList[i];
  5382. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5383. this.myIndex = i + 1;
  5384. let user = { headIcon: self.headIcon, nickName: "myself" };
  5385. let ud = { user: user, data: {} };
  5386. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5387. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5388. if (Moyu.platType < 11) {
  5389. user.headIcon = self.headIcon;
  5390. user.nickName = self.nickName;
  5391. }
  5392. this.rankList.splice(i, 0, md);
  5393. break;
  5394. }
  5395. }
  5396. }
  5397. this.updateSelfItem();
  5398. this.ui.myNode.myList.numItems = this.rankList.length;
  5399. }
  5400. updateItemUI(index, obj) {
  5401. let data = this.rankList[index];
  5402. let userData = JSON.parse(data.userData).user;
  5403. obj.nameTxt.text = userData.nickName.toString();
  5404. obj.valueTxt.text = data.rankScore;
  5405. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5406. obj.rankTxt.text = index + 1;
  5407. switch (index) {
  5408. case 0:
  5409. this.setImg(obj, 1, 0, 0);
  5410. obj.rankTxt.color = "#FFC047";
  5411. break;
  5412. case 1:
  5413. this.setImg(obj, 0, 1, 0);
  5414. obj.rankTxt.color = "#ACACAC";
  5415. break;
  5416. case 2:
  5417. this.setImg(obj, 0, 0, 1);
  5418. obj.rankTxt.color = "#D09672";
  5419. break;
  5420. default:
  5421. this.setImg(obj, 0, 0, 0);
  5422. obj.rankTxt.color = "#496FAB";
  5423. break;
  5424. }
  5425. }
  5426. setImg(obj, a, b, c) {
  5427. obj.img1.visible = a ? true : false;
  5428. obj.img2.visible = b ? true : false;
  5429. obj.img3.visible = c ? true : false;
  5430. }
  5431. changeList(type) {
  5432. this.rankType = type;
  5433. this.updateSelf();
  5434. }
  5435. changeSelfNode() {
  5436. this.showSelf = !this.showSelf;
  5437. this.updateSelf();
  5438. }
  5439. updateSelf() {
  5440. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5441. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5442. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5443. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5444. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5445. }
  5446. }
  5447. UIRanking.uiName = "UIRanking";
  5448. class ui_UISecretary extends fgui.GComponent {
  5449. static createInstance() {
  5450. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5451. }
  5452. onConstruct() {
  5453. this.n0 = (this.getChild("n0"));
  5454. this.myNode = (this.getChild("myNode"));
  5455. this.closeBtn = (this.getChild("closeBtn"));
  5456. this.t0 = this.getTransition("t0");
  5457. }
  5458. }
  5459. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5460. class UISecretary extends UIBase {
  5461. constructor() {
  5462. super();
  5463. this.curIndex = 1;
  5464. }
  5465. onConstructor() {
  5466. this.ui = ui_UISecretary.createInstance();
  5467. this.contentPane = this.ui;
  5468. this.isEject = false;
  5469. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5470. this.nodeObj = { left: null, right: null, cur: null };
  5471. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5472. }
  5473. show() {
  5474. super.show();
  5475. this.ui.t0.play();
  5476. this.updateData();
  5477. }
  5478. addSecretarySpine(node, spineName) {
  5479. if (spineName == "mishu") {
  5480. if (this.secretarySpine1) {
  5481. node.displayObject.destroyChildren();
  5482. this.playWoman(this.secretarySpine1, node.displayObject);
  5483. }
  5484. else {
  5485. let spine1 = new SpineMgr("mishu", () => {
  5486. this.secretarySpine1 = spine1;
  5487. this.playWoman(this.secretarySpine1, node.displayObject);
  5488. });
  5489. }
  5490. }
  5491. else {
  5492. if (this.secretarySpine2) {
  5493. node.displayObject.destroyChildren();
  5494. this.playWoman(this.secretarySpine2, node.displayObject);
  5495. }
  5496. else {
  5497. let spine2 = new SpineMgr("xiaomishu2", () => {
  5498. this.secretarySpine2 = spine2;
  5499. this.playWoman(this.secretarySpine2, node.displayObject);
  5500. });
  5501. }
  5502. }
  5503. }
  5504. playWoman(node, parent) {
  5505. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5506. let yy = this.ui.myNode.gameNode3.secretary.height;
  5507. let scale = 1.5;
  5508. if (node == this.secretarySpine2) {
  5509. scale = 1.2;
  5510. }
  5511. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5512. node.play(data, 0, true, parent);
  5513. }
  5514. turnLeft() {
  5515. this.curIndex--;
  5516. if (this.curIndex < 1) {
  5517. this.curIndex = 2;
  5518. }
  5519. let left = this.nodeObj.left;
  5520. let right = this.nodeObj.right;
  5521. let cur = this.nodeObj.cur;
  5522. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5523. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5524. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5525. this.updateData();
  5526. }));
  5527. this.ui.myNode.setChildIndex(right, 2);
  5528. this.nodeObj.left = cur;
  5529. this.nodeObj.right = left;
  5530. this.nodeObj.cur = right;
  5531. }
  5532. turnRight() {
  5533. this.curIndex++;
  5534. if (this.curIndex > 2) {
  5535. this.curIndex = 1;
  5536. }
  5537. let left = this.nodeObj.left;
  5538. let right = this.nodeObj.right;
  5539. let cur = this.nodeObj.cur;
  5540. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5541. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5542. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5543. this.updateData();
  5544. }));
  5545. this.ui.myNode.setChildIndex(left, 2);
  5546. this.nodeObj.left = right;
  5547. this.nodeObj.right = cur;
  5548. this.nodeObj.cur = left;
  5549. }
  5550. updateData() {
  5551. console.log('zh: updateData FFFFFFFFFF');
  5552. let data = cfgTable.secretaryshopData;
  5553. let children = this.ui.myNode._children;
  5554. let temp;
  5555. let curData;
  5556. for (let index = 0; index < children.length; index++) {
  5557. temp = children[index];
  5558. curData = data[1];
  5559. temp.heightTxt.text = curData.height;
  5560. temp.foodTxt.text = curData.food;
  5561. temp.historyTxt.text = curData.history;
  5562. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5563. this.addSecretarySpine(temp.secretary, curData.spine);
  5564. let womanIndex = curData.id - 1;
  5565. let getWoman = DataMgr.getSecretary(womanIndex);
  5566. let curUse = DataMgr.getCurSecretary();
  5567. if (getWoman) {
  5568. if (curUse == womanIndex) {
  5569. temp.purchaseBtn.c1.selectedIndex = 1;
  5570. }
  5571. else {
  5572. temp.purchaseBtn.c1.selectedIndex = 2;
  5573. }
  5574. }
  5575. else {
  5576. temp.purchaseBtn.c1.selectedIndex = 0;
  5577. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5578. }
  5579. temp.purchaseBtn.visible = false;
  5580. }
  5581. }
  5582. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5583. console.log('zh: 点击了clickSecretary ');
  5584. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5585. if (getWoman) {
  5586. if (curUse != womanIndex) {
  5587. console.log();
  5588. DataMgr.setCurSecretary(womanIndex);
  5589. this.updateData();
  5590. }
  5591. }
  5592. else {
  5593. console.log('zh:点击购买了');
  5594. let need = needDiamond;
  5595. if (DataMgr.diamondEnough(need)) {
  5596. DataMgr.setDiamond(-need);
  5597. DataMgr.setSecretary(womanIndex, 1);
  5598. DataMgr.setCurSecretary(womanIndex);
  5599. this.updateData();
  5600. }
  5601. else {
  5602. xGame.uiMgr.Show(UIAddProp, 1);
  5603. }
  5604. }
  5605. }
  5606. closeSelf() {
  5607. this.hide();
  5608. }
  5609. }
  5610. UISecretary.uiName = "UISecretary";
  5611. class ui_UIShop extends fgui.GComponent {
  5612. static createInstance() {
  5613. return (fgui.UIPackage.createObject("game", "UIShop"));
  5614. }
  5615. onConstruct() {
  5616. this.n48 = (this.getChild("n48"));
  5617. this.n0 = (this.getChild("n0"));
  5618. this.secretary = (this.getChild("secretary"));
  5619. this.talkNode = (this.getChild("talkNode"));
  5620. this.closeNode = (this.getChild("closeNode"));
  5621. this.moneyNode = (this.getChild("moneyNode"));
  5622. this.myNode = (this.getChild("myNode"));
  5623. }
  5624. }
  5625. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5626. class BallRodDisplay {
  5627. constructor(ui, index) {
  5628. this.index = 0;
  5629. this.uiIndex = 0;
  5630. this.ui = ui;
  5631. this.index = index;
  5632. this.initData();
  5633. }
  5634. initData() {
  5635. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5636. let data = cfgTable.ballrodData[this.index + 1];
  5637. this.ui.nameTxt.text = data.name;
  5638. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5639. this.ui.levelNode.c1.selectedIndex = data.quality;
  5640. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5641. if (data.spine) {
  5642. this.mySpine = new SpineMgr(data.spine, () => {
  5643. let xx = 150;
  5644. let yy = 70;
  5645. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5646. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5647. });
  5648. }
  5649. }
  5650. updateSelf() {
  5651. console.log('zh:updateSelf -------------- ');
  5652. let get = DataMgr.getBallRod(this.index);
  5653. if (get == null)
  5654. get = 1;
  5655. let curUse = DataMgr.getCurBallRod();
  5656. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5657. if (get) {
  5658. if (curUse == this.index) {
  5659. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5660. }
  5661. else {
  5662. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5663. }
  5664. }
  5665. else {
  5666. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5667. }
  5668. }
  5669. buyBallRod() {
  5670. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5671. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5672. switch (selectedIndex) {
  5673. case 0:
  5674. break;
  5675. case 1:
  5676. console.log('zh:点击了 USE THIS');
  5677. DataMgr.setCurBallRod(this.index);
  5678. let curUse = DataMgr.getCurBallRod();
  5679. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5680. let ui = xGame.uiMgr.getUI(UIShop);
  5681. ui.updateBallRod();
  5682. break;
  5683. case 2:
  5684. let data = cfgTable.ballrodData[this.index + 1];
  5685. let need = data.price;
  5686. if (DataMgr.diamondEnough(need)) {
  5687. DataMgr.setDiamond(-need);
  5688. DataMgr.setBallRod(this.index, 1);
  5689. DataMgr.setCurBallRod(this.index);
  5690. let ui = xGame.uiMgr.getUI(UIShop);
  5691. ui.updateBallRod();
  5692. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5693. }
  5694. else {
  5695. xGame.uiMgr.Show(UIAddProp, 1);
  5696. }
  5697. break;
  5698. default:
  5699. break;
  5700. }
  5701. }
  5702. logEventForGouMaiGan(qiuGanName) {
  5703. const ev = {
  5704. value: qiuGanName
  5705. };
  5706. const jsonStr = JSON.stringify(ev);
  5707. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5708. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5709. }
  5710. }
  5711. class UIShop extends UIBase {
  5712. constructor() {
  5713. super();
  5714. this.itemNums = 0;
  5715. this.curType = "";
  5716. }
  5717. onConstructor() {
  5718. this.ui = ui_UIShop.createInstance();
  5719. this.contentPane = this.ui;
  5720. this.isEject = false;
  5721. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5722. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5723. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  5724. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  5725. this.addUIClick(this.ui, this.interuptSecretary);
  5726. console.log('zh:this.renderBallRodthis.renderBallRodthis.renderBallRodthis.renderBallRod = ' + this.renderBallRod);
  5727. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5728. this.ballRodArr = [];
  5729. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5730. this.ui.myNode.myList.numItems = this.itemNums;
  5731. }
  5732. show(type) {
  5733. super.show();
  5734. console.log('zh:show type = ' + type);
  5735. this.curType = type == 0 ? "qiugan" : "daoju";
  5736. this.switchBtn("qiugan");
  5737. this.playSecretaryIdle();
  5738. this.updateBallRod();
  5739. }
  5740. test123() {
  5741. console.log('zh:test123 ');
  5742. }
  5743. switchBtn(type) {
  5744. console.log('zh:1111切換 sel type=' + type);
  5745. if (type == "") {
  5746. type = this.curType;
  5747. }
  5748. else {
  5749. if (this.curType == type) {
  5750. return;
  5751. }
  5752. else {
  5753. this.curType = type;
  5754. }
  5755. }
  5756. if (type == "qiugan") {
  5757. console.log('zh:qg sel');
  5758. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  5759. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  5760. this.ui.myNode.myList.visible = true;
  5761. this.ui.myNode.djList.visible = false;
  5762. }
  5763. else {
  5764. console.log('zh:dj sel');
  5765. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  5766. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  5767. this.ui.myNode.myList.visible = false;
  5768. this.ui.myNode.djList.visible = true;
  5769. }
  5770. }
  5771. updateBallRod() {
  5772. for (let index = 0; index < this.ballRodArr.length; index++) {
  5773. this.ballRodArr[index].updateSelf();
  5774. }
  5775. }
  5776. renderBallRod(sort, obj) {
  5777. let index = this.getIndexBySort(sort + 1) - 1;
  5778. let ballRod = new BallRodDisplay(obj, index);
  5779. this.ballRodArr.push(ballRod);
  5780. }
  5781. getIndexBySort(sort) {
  5782. let object = cfgTable.ballrodData;
  5783. for (const key in object) {
  5784. if (object[key].sort == sort) {
  5785. return parseInt(key);
  5786. }
  5787. }
  5788. }
  5789. playSecretaryIdle() {
  5790. let parent = this.ui.secretary.displayObject;
  5791. parent.destroyChildren();
  5792. let xx = this.ui.secretary.width / 2;
  5793. let yy = this.ui.secretary.height;
  5794. let scale = xGame.common.getSecretaryScale();
  5795. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5796. xGame.common.secretary.play(data, 0, true, parent);
  5797. }
  5798. interuptSecretary() {
  5799. Laya.timer.clearAll(this);
  5800. this.playSecretaryRandomSound();
  5801. }
  5802. playSecretaryRandomSound() {
  5803. if (this.isHide)
  5804. return;
  5805. let time = xGame.common.randomNum(45000, 60000);
  5806. Laya.timer.once(time, this, () => {
  5807. if (this.isHide)
  5808. return;
  5809. let index = xGame.common.randomNum(4, 7);
  5810. xGame.soundMgr.playSound("s_main0" + index);
  5811. let words = 1;
  5812. switch (index) {
  5813. case 4:
  5814. words = 5;
  5815. break;
  5816. case 5:
  5817. words = 3;
  5818. break;
  5819. case 6:
  5820. words = 6;
  5821. break;
  5822. case 7:
  5823. words = 7;
  5824. break;
  5825. default:
  5826. break;
  5827. }
  5828. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5829. this.playSecretaryRandomSound();
  5830. });
  5831. }
  5832. closeSelf() {
  5833. this.hide();
  5834. }
  5835. }
  5836. UIShop.uiName = "UIShop";
  5837. class ui_UISign extends fgui.GComponent {
  5838. static createInstance() {
  5839. return (fgui.UIPackage.createObject("game", "UISign"));
  5840. }
  5841. onConstruct() {
  5842. this.n6 = (this.getChild("n6"));
  5843. this.closeNode = (this.getChild("closeNode"));
  5844. this.myNode = (this.getChild("myNode"));
  5845. this.moneyNode = (this.getChild("moneyNode"));
  5846. this.secretary = (this.getChild("secretary"));
  5847. this.talkNode = (this.getChild("talkNode"));
  5848. this.tripleBtn = (this.getChild("tripleBtn"));
  5849. this.normalBtn = (this.getChild("normalBtn"));
  5850. this.tipsNode = (this.getChild("tipsNode"));
  5851. this.againBtn = (this.getChild("againBtn"));
  5852. this.t0 = this.getTransition("t0");
  5853. }
  5854. }
  5855. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5856. class SignMax {
  5857. constructor(ui) {
  5858. this.ui = ui;
  5859. }
  5860. updateSelf(index, sameDay, curDayIndex) {
  5861. let data = cfgTable.signData[index + 1];
  5862. this.ui.titleTxt.text = data.title;
  5863. let arr1 = data.award[0].split('-');
  5864. let arr2 = data.award[1].split('-');
  5865. let num1 = parseInt(arr1[1]);
  5866. let num2 = parseInt(arr2[1]);
  5867. this.ui.numTxt1.text = num1 + "";
  5868. this.ui.numTxt2.text = num2 + "";
  5869. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5870. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5871. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5872. this.ui.numTxt1.visible = false;
  5873. }
  5874. else {
  5875. this.ui.numTxt1.visible = true;
  5876. }
  5877. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5878. this.ui.numTxt2.visible = false;
  5879. }
  5880. else {
  5881. this.ui.numTxt2.visible = true;
  5882. }
  5883. if (index < curDayIndex) {
  5884. this.ui.c1.selectedIndex = 1;
  5885. }
  5886. else if (index == curDayIndex) {
  5887. if (sameDay) {
  5888. this.ui.c1.selectedIndex = 2;
  5889. }
  5890. else {
  5891. this.ui.c1.selectedIndex = 2;
  5892. }
  5893. }
  5894. else {
  5895. this.ui.c1.selectedIndex = 0;
  5896. }
  5897. }
  5898. }
  5899. class SignNormal {
  5900. constructor(ui) {
  5901. this.ui = ui;
  5902. }
  5903. updateSelf(index, sameDay, curDayIndex) {
  5904. let data = cfgTable.signData[index + 1];
  5905. this.ui.titleTxt.text = data.title;
  5906. let arr = data.award[0].split('-');
  5907. let type = parseInt(arr[0]);
  5908. let num = parseInt(arr[1]);
  5909. this.ui.numTxt.text = num + "";
  5910. if (type > 2) {
  5911. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5912. this.ui.myIcon.rotation = 0;
  5913. }
  5914. else {
  5915. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5916. this.ui.myIcon.rotation = 0;
  5917. }
  5918. if (xGame.common.signAwardContainsRod(data.award)) {
  5919. this.ui.numTxt.visible = false;
  5920. }
  5921. else {
  5922. this.ui.numTxt.visible = true;
  5923. }
  5924. if (index < curDayIndex) {
  5925. this.ui.c1.selectedIndex = 1;
  5926. }
  5927. else if (index == curDayIndex) {
  5928. if (sameDay) {
  5929. this.ui.c1.selectedIndex = 2;
  5930. }
  5931. else {
  5932. this.ui.c1.selectedIndex = 2;
  5933. }
  5934. }
  5935. else {
  5936. this.ui.c1.selectedIndex = 0;
  5937. }
  5938. }
  5939. }
  5940. class UISign extends UIBase {
  5941. constructor() {
  5942. super();
  5943. this.curDayIndex = 0;
  5944. this.starX = 0;
  5945. }
  5946. onConstructor() {
  5947. this.ui = ui_UISign.createInstance();
  5948. this.contentPane = this.ui;
  5949. this.isEject = false;
  5950. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5951. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5952. this.initSignItem();
  5953. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5954. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5955. }
  5956. show() {
  5957. super.show();
  5958. this.ui.t0.play();
  5959. this.playSecretaryIdle();
  5960. this.updateSign();
  5961. }
  5962. initSignItem() {
  5963. this.signArr = [];
  5964. for (let index = 0; index < 6; index++) {
  5965. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5966. this.signArr.push(temp);
  5967. }
  5968. this.signMax = new SignMax(this.ui.myNode.day7);
  5969. if (Moyu.isKs)
  5970. this.ui.closeNode.closeBtn.x += 100;
  5971. }
  5972. updateSign() {
  5973. let sameDay = xGame.common.judgeSameDay();
  5974. let max = 7;
  5975. this.curDayIndex = DataMgr.getSignData();
  5976. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5977. this.curDayIndex = 0;
  5978. if (!sameDay) {
  5979. this.ui.normalBtn.visible = true;
  5980. this.ui.tipsNode.visible = false;
  5981. this.ui.againBtn.visible = false;
  5982. }
  5983. else {
  5984. this.ui.normalBtn.visible = false;
  5985. let again = DataMgr.getExtraSign();
  5986. let isCurrency = false;
  5987. let index = this.curDayIndex;
  5988. if (index == 0)
  5989. index = 7;
  5990. let award = cfgTable.signData[index].award;
  5991. let num = award[0].split("-")[0];
  5992. if (num == "1" || num == "2")
  5993. isCurrency = true;
  5994. let showAgain = again == 0 && isCurrency;
  5995. this.ui.againBtn.visible = showAgain;
  5996. this.ui.tipsNode.visible = !showAgain;
  5997. }
  5998. for (let index = 0; index < this.signArr.length; index++) {
  5999. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6000. }
  6001. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6002. }
  6003. playSecretaryIdle() {
  6004. let parent = this.ui.secretary.displayObject;
  6005. parent.destroyChildren();
  6006. let xx = this.ui.secretary.width / 2;
  6007. let yy = this.ui.secretary.height;
  6008. let scale = xGame.common.getSecretaryScale();
  6009. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6010. xGame.common.secretary.play(data, 0, true, parent);
  6011. }
  6012. closeSelf() {
  6013. this.hide();
  6014. }
  6015. normalGetAward() {
  6016. let sameDay = xGame.common.judgeSameDay();
  6017. if (!sameDay) {
  6018. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6019. let temp;
  6020. let type;
  6021. let num;
  6022. let arr = [];
  6023. for (let index = 0; index < award.length; index++) {
  6024. temp = award[index].split("-");
  6025. type = parseInt(temp[0]);
  6026. num = parseInt(temp[1]);
  6027. let awardType = new AwardType();
  6028. awardType.num = num;
  6029. awardType.type = type;
  6030. arr.push(awardType);
  6031. }
  6032. xGame.common.getAward(arr, (watchVideo) => {
  6033. this.curDayIndex++;
  6034. if (this.curDayIndex > 7)
  6035. this.curDayIndex = 0;
  6036. DataMgr.setSignData(this.curDayIndex);
  6037. DataMgr.setSignTime(new Date().getTime());
  6038. if (watchVideo) {
  6039. DataMgr.setExtraSign(1);
  6040. Moyu.sendDataEvent("signIn1");
  6041. }
  6042. this.updateSign();
  6043. });
  6044. }
  6045. }
  6046. againGetAward() {
  6047. Moyu.sendDataEvent("signIn2");
  6048. console.log('zh:qjff_AD_for_uisign');
  6049. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6050. }
  6051. else {
  6052. console.log('zh:AD 失败,直接发放奖励');
  6053. this.qjff_AD_for_uisign();
  6054. }
  6055. }
  6056. qjff_AD_for_uisign() {
  6057. let index = this.curDayIndex;
  6058. if (index == 0)
  6059. index = 7;
  6060. let award = cfgTable.signData[index].award;
  6061. let temp;
  6062. let type;
  6063. let num;
  6064. for (let index = 0; index < award.length; index++) {
  6065. temp = award[index].split("-");
  6066. type = parseInt(temp[0]);
  6067. num = parseInt(temp[1]) * 3;
  6068. xGame.common.playObjFlyAnim(num, type);
  6069. }
  6070. DataMgr.setExtraSign(1);
  6071. this.updateSign();
  6072. }
  6073. }
  6074. UISign.uiName = "UISign";
  6075. class ui_UISkill extends fgui.GComponent {
  6076. static createInstance() {
  6077. return (fgui.UIPackage.createObject("game", "UISkill"));
  6078. }
  6079. onConstruct() {
  6080. this.n48 = (this.getChild("n48"));
  6081. this.n0 = (this.getChild("n0"));
  6082. this.secretary = (this.getChild("secretary"));
  6083. this.talkNode = (this.getChild("talkNode"));
  6084. this.closeNode = (this.getChild("closeNode"));
  6085. this.moneyNode = (this.getChild("moneyNode"));
  6086. this.skillNode = (this.getChild("skillNode"));
  6087. this.guideNode = (this.getChild("guideNode"));
  6088. }
  6089. }
  6090. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6091. class SkillDisplay {
  6092. constructor(ui, data, uiIndex) {
  6093. this.starX = 0;
  6094. this.starY = 0;
  6095. this.index = 0;
  6096. this.ui = ui;
  6097. this.data = data;
  6098. this.index = uiIndex;
  6099. this.initSelf();
  6100. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6101. }
  6102. initSelf() {
  6103. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6104. this.ui.nameTxt.text = this.data.name;
  6105. this.ui.describeTxt.text = this.data.describe;
  6106. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6107. this.ui.startBtn.onClick(this, this.startGame);
  6108. this.updateSelf();
  6109. }
  6110. updateSelf() {
  6111. this.checkTry();
  6112. let level = DataMgr.getBigSkillByIndex(this.index);
  6113. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6114. }
  6115. checkTry() {
  6116. let index = this.index;
  6117. let level = DataMgr.getBigSkillByIndex(index);
  6118. if (level == null) {
  6119. DataMgr.setBigSkill(index, 1, false);
  6120. level = 1;
  6121. }
  6122. this.ui.levelTxt.text = "LV." + level;
  6123. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6124. this.ui.tryNode.visible = true;
  6125. else
  6126. this.ui.tryNode.visible = false;
  6127. }
  6128. clickAddLevel() {
  6129. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6130. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6131. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6132. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6133. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6134. }
  6135. else {
  6136. console.log('zh:AD 失败,直接发放奖励');
  6137. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6138. }
  6139. }
  6140. qjff_AD_for_skilldisplay_clickAddLevel() {
  6141. DataMgr.setBigSkill(this.data.index, 1);
  6142. this.updateSelf();
  6143. xGame.common.upSkillLevel = true;
  6144. }
  6145. startGame() {
  6146. console.log('zh:rod skill startgame');
  6147. if (this.data.index == 3) {
  6148. alert('Coming soon!');
  6149. return;
  6150. }
  6151. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6152. let needCoin = xGame.common.bigMoveNeedCoin;
  6153. xGame.common.passAwardCoin = 2000;
  6154. let guide = DataMgr.getSkillGuide();
  6155. console.log('zh:startGame guide=' + guide);
  6156. xGame.common.temSelfLevel = 0;
  6157. if (guide == 0) {
  6158. needCoin = 0;
  6159. xGame.common.temSelfLevel = 100;
  6160. }
  6161. if (DataMgr.coinEnough(needCoin)) {
  6162. DataMgr.setCoin(-needCoin);
  6163. xGame.common.curPlayerSkillType = this.index;
  6164. if (guide == 0)
  6165. xGame.common.curPlayerSkillType = 0;
  6166. console.log('zh: skilldisplay 1');
  6167. xGame.uiMgr.Show(UIGame);
  6168. xGame.uiMgr.Hide(UIMain);
  6169. xGame.uiMgr.Show(UIMatching, () => {
  6170. xGame.common.gameUI.ui.alpha = 1;
  6171. xGame.common.gameUI.startGame();
  6172. xGame.uiMgr.Hide(UISkill);
  6173. });
  6174. this.logEventForRod_start();
  6175. }
  6176. else {
  6177. console.log('zh: skilldisplay 2');
  6178. xGame.uiMgr.Show(UIAddProp, 0);
  6179. Moyu.sendDataEvent("AddCoinVideo");
  6180. }
  6181. }
  6182. logEventForRod_start() {
  6183. let gfmsIdx = xGame.common.curPlayerSkillType;
  6184. console.log('zh:选择的技能=' + gfmsIdx);
  6185. let gfmc = 'Skyfall Shot';
  6186. if (gfmsIdx == 0) {
  6187. gfmc = 'Skyfall Shot';
  6188. }
  6189. if (gfmsIdx == 1) {
  6190. gfmc = 'Surging break';
  6191. }
  6192. if (gfmsIdx == 2) {
  6193. gfmc = 'Frost Lock';
  6194. }
  6195. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6196. let jsonStr = {
  6197. "count": 0,
  6198. "name": gfmc
  6199. };
  6200. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6201. const d = LocalStorageManager.getItem(keyStr);
  6202. jsonStr.count = d.count + 1;
  6203. LocalStorageManager.setItem(keyStr, jsonStr);
  6204. }
  6205. else {
  6206. LocalStorageManager.setItem(keyStr, jsonStr);
  6207. }
  6208. const reqStr = JSON.stringify(jsonStr);
  6209. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6210. }
  6211. }
  6212. class UISkill extends UIBase {
  6213. constructor() {
  6214. super();
  6215. this.skillData = [];
  6216. }
  6217. onConstructor() {
  6218. this.ui = ui_UISkill.createInstance();
  6219. this.contentPane = this.ui;
  6220. this.isEject = false;
  6221. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6222. this.initSkillData();
  6223. console.log('zh:aaaaaa1111111111');
  6224. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6225. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6226. console.log('zh:aaaaaa22222222');
  6227. this.displayList = [];
  6228. this.ui.skillNode.skillList.numItems = 3;
  6229. this.addUIClick(this.ui, this.interuptSecretary);
  6230. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6231. this.ui.talkNode.visible = false;
  6232. if (Moyu.isKs)
  6233. this.ui.closeNode.closeBtn.x += 100;
  6234. }
  6235. show() {
  6236. super.show();
  6237. this.playSecretaryIdle();
  6238. this.moneyNode.ui.c1.selectedIndex = 1;
  6239. Laya.timer.clearAll(this);
  6240. xGame.soundMgr.playSound("s_start");
  6241. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6242. let guide = DataMgr.getSkillGuide();
  6243. this.ui.guideNode.visible = guide == 0;
  6244. let item = this.getSkillItemByUIIndex(0);
  6245. if (guide == 0) {
  6246. item.ui.c1.selectedIndex = 1;
  6247. }
  6248. else {
  6249. item.ui.c1.selectedIndex = 0;
  6250. }
  6251. this.ui.guideNode.guideBtn.visible = guide == 0;
  6252. for (let index = 0; index < this.displayList.length; index++) {
  6253. this.displayList[index].checkTry();
  6254. }
  6255. }
  6256. getSkillItemByUIIndex(cur) {
  6257. for (let index = 0; index < this.displayList.length; index++) {
  6258. if (this.displayList[index].index == cur) {
  6259. return this.displayList[index];
  6260. }
  6261. }
  6262. }
  6263. enterGuideLevel() {
  6264. let item = this.getSkillItemByUIIndex(0);
  6265. item.startGame();
  6266. if (DataMgr.getNewUser())
  6267. Moyu.sendDataEvent("gameStart1");
  6268. }
  6269. initSkillData() {
  6270. this.skillData = [];
  6271. let nameList = xGame.common.skillNameList;
  6272. let iconList = xGame.common.skillIconList;
  6273. let describeList = [
  6274. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6275. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6276. "The power of frost descends—freezing the flow and taking full control of the game!"
  6277. ];
  6278. console.log('zh:initSkillData 111111111');
  6279. let data;
  6280. for (let index = 0; index < nameList.length; index++) {
  6281. data = {};
  6282. data.name = nameList[index];
  6283. data.icon = iconList[index];
  6284. data.describe = describeList[index];
  6285. data.index = index;
  6286. this.skillData.push(data);
  6287. }
  6288. }
  6289. updateSkillItem(index, target) {
  6290. if (this.displayList[index] == null) {
  6291. let uiIndex;
  6292. switch (index) {
  6293. case 0:
  6294. uiIndex = 1;
  6295. break;
  6296. case 1:
  6297. uiIndex = 0;
  6298. break;
  6299. case 2:
  6300. uiIndex = 2;
  6301. break;
  6302. case 3:
  6303. uiIndex = 3;
  6304. break;
  6305. default:
  6306. break;
  6307. }
  6308. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6309. this.displayList.push(temp);
  6310. }
  6311. }
  6312. playSecretaryIdle() {
  6313. let parent = this.ui.secretary.displayObject;
  6314. parent.destroyChildren();
  6315. let xx = this.ui.secretary.width / 2;
  6316. let yy = this.ui.secretary.height;
  6317. let scale = xGame.common.getSecretaryScale();
  6318. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6319. xGame.common.secretary.play(data, 0, true, parent);
  6320. }
  6321. returnUIMain() {
  6322. this.hide();
  6323. xGame.common.stopGirlPop(this.ui.talkNode);
  6324. xGame.uiMgr.Show(UIMain);
  6325. }
  6326. interuptSecretary() {
  6327. Laya.timer.clearAll(this);
  6328. this.playSecretaryRandomSound();
  6329. }
  6330. playSecretaryRandomSound() {
  6331. if (this.isHide)
  6332. return;
  6333. let time = xGame.common.randomNum(45000, 60000);
  6334. Laya.timer.once(time, this, () => {
  6335. if (this.isHide)
  6336. return;
  6337. let index = xGame.common.randomNum(4, 7);
  6338. xGame.soundMgr.playSound("s_main0" + index);
  6339. let words = 1;
  6340. switch (index) {
  6341. case 4:
  6342. words = 5;
  6343. break;
  6344. case 5:
  6345. words = 3;
  6346. break;
  6347. case 6:
  6348. words = 6;
  6349. break;
  6350. case 7:
  6351. words = 7;
  6352. break;
  6353. default:
  6354. break;
  6355. }
  6356. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6357. this.playSecretaryRandomSound();
  6358. });
  6359. }
  6360. }
  6361. UISkill.uiName = "UISkill";
  6362. class ui_UIMsg extends fgui.GComponent {
  6363. static createInstance() {
  6364. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6365. }
  6366. onConstruct() {
  6367. this.tipsNode = (this.getChild("tipsNode"));
  6368. }
  6369. }
  6370. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6371. class UIMsg extends UIBase {
  6372. constructor() {
  6373. super();
  6374. }
  6375. onConstructor() {
  6376. this.ui = ui_UIMsg.createInstance();
  6377. this.contentPane = this.ui;
  6378. this.isEject = false;
  6379. this.isMuti = true;
  6380. }
  6381. show(msg, callback) {
  6382. super.show();
  6383. this.ui.tipsNode.msgTxt.text = msg;
  6384. this.ui.alpha = 1;
  6385. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6386. this.hide();
  6387. callback && callback();
  6388. }), 1000);
  6389. }
  6390. }
  6391. UIMsg.uiName = "UIMsg";
  6392. class ui_UIModeSelection extends fgui.GComponent {
  6393. static createInstance() {
  6394. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6395. }
  6396. onConstruct() {
  6397. this.n19 = (this.getChild("n19"));
  6398. this.closeBtn = (this.getChild("closeBtn"));
  6399. this.myNode = (this.getChild("myNode"));
  6400. this.t0 = this.getTransition("t0");
  6401. }
  6402. }
  6403. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6404. class UIModeSelection extends UIBase {
  6405. constructor() {
  6406. super();
  6407. }
  6408. onConstructor() {
  6409. this.ui = ui_UIModeSelection.createInstance();
  6410. this.contentPane = this.ui;
  6411. this.isEject = false;
  6412. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6413. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6414. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6415. this.addUIClick(this.ui.closeBtn, this.hide);
  6416. this.peopleArr = [65, 990, 580];
  6417. this.peopleOffest = [5, 10, 10];
  6418. }
  6419. show(callback) {
  6420. this.updateSelf();
  6421. super.show();
  6422. this.ui.t0.play();
  6423. this.callback = callback;
  6424. }
  6425. updateSelf() {
  6426. let cfg = cfgTable.modeselectData;
  6427. for (let index = 1; index <= 3; index++) {
  6428. let node = this.ui.myNode["type" + index];
  6429. node.need.text = cfg[index].need;
  6430. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6431. node.peopleTxt.text = this.getRandPeople(index - 1);
  6432. }
  6433. }
  6434. enterGame(type) {
  6435. console.log('zh: 进入经典模式 type: ' + type);
  6436. xGame.common.classicRoomType = type;
  6437. let cfg = cfgTable.modeselectData[type];
  6438. let need = cfg.need;
  6439. xGame.common.passAwardCoin = cfg.award;
  6440. if (DataMgr.coinEnough(need)) {
  6441. DataMgr.setCoin(-need);
  6442. this.ui.myNode["type" + type].t0.play();
  6443. Laya.timer.once(200, this, () => {
  6444. this.callback && this.callback();
  6445. });
  6446. this.logEventForClassic_start();
  6447. }
  6448. else {
  6449. Moyu.sendDataEvent("AddCoinVideo");
  6450. xGame.uiMgr.Show(UIAddProp, 0);
  6451. }
  6452. }
  6453. getRandPeople(index) {
  6454. let rand = this.peopleOffest[index];
  6455. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6456. }
  6457. logEventForClassic_start() {
  6458. let rtype = xGame.common.classicRoomType;
  6459. let msmc = '';
  6460. if (rtype == 1) {
  6461. msmc = 'beginner';
  6462. }
  6463. if (rtype == 2) {
  6464. msmc = 'expert';
  6465. }
  6466. if (rtype == 3) {
  6467. msmc = 'master';
  6468. }
  6469. let keyStr = 'sjmd_classic_start_' + rtype;
  6470. let jsonStr = {
  6471. "difficulty": msmc,
  6472. "classic_count": 1,
  6473. "difficulty_count": 1
  6474. };
  6475. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6476. const d = LocalStorageManager.getItem(keyStr);
  6477. jsonStr.classic_count = d.classic_count + 1;
  6478. jsonStr.difficulty_count = d.difficulty_count + 1;
  6479. LocalStorageManager.setItem(keyStr, jsonStr);
  6480. }
  6481. else {
  6482. LocalStorageManager.setItem(keyStr, jsonStr);
  6483. }
  6484. const reqStr = JSON.stringify(jsonStr);
  6485. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6486. }
  6487. }
  6488. UIModeSelection.uiName = "UIModeSelection";
  6489. class ui_UIReg extends fgui.GComponent {
  6490. static createInstance() {
  6491. return (fgui.UIPackage.createObject("game", "UIReg"));
  6492. }
  6493. onConstruct() {
  6494. this.n38 = (this.getChild("n38"));
  6495. this.n9 = (this.getChild("n9"));
  6496. this.n14 = (this.getChild("n14"));
  6497. this.n15 = (this.getChild("n15"));
  6498. this.n34 = (this.getChild("n34"));
  6499. this.closeBtn = (this.getChild("closeBtn"));
  6500. this.lab_tip = (this.getChild("lab_tip"));
  6501. this.n43 = (this.getChild("n43"));
  6502. this.txt_ua = (this.getChild("txt_ua"));
  6503. this.n44 = (this.getChild("n44"));
  6504. this.txt_up1 = (this.getChild("txt_up1"));
  6505. this.n45 = (this.getChild("n45"));
  6506. this.txt_up2 = (this.getChild("txt_up2"));
  6507. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6508. this.btn_reg = (this.getChild("btn_reg"));
  6509. this.n50 = (this.getChild("n50"));
  6510. }
  6511. }
  6512. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6513. class ui_UILogin extends fgui.GComponent {
  6514. static createInstance() {
  6515. return (fgui.UIPackage.createObject("game", "UILogin"));
  6516. }
  6517. onConstruct() {
  6518. this.c1 = this.getController("c1");
  6519. this.n18 = (this.getChild("n18"));
  6520. this.n7 = (this.getChild("n7"));
  6521. this.n5 = (this.getChild("n5"));
  6522. this.n6 = (this.getChild("n6"));
  6523. this.closeBtn = (this.getChild("closeBtn"));
  6524. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6525. this.btn_login = (this.getChild("btn_login"));
  6526. this.n30 = (this.getChild("n30"));
  6527. this.n31 = (this.getChild("n31"));
  6528. this.txt_up = (this.getChild("txt_up"));
  6529. this.n32 = (this.getChild("n32"));
  6530. this.txt_ua = (this.getChild("txt_ua"));
  6531. }
  6532. }
  6533. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6534. class UILogin extends UIBase {
  6535. constructor() {
  6536. super();
  6537. }
  6538. onConstructor() {
  6539. this.ui = ui_UILogin.createInstance();
  6540. this.contentPane = this.ui;
  6541. this.isEject = false;
  6542. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6543. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6544. this.addUIClick(this.ui.btn_login, this.userLogin);
  6545. }
  6546. show() {
  6547. super.show();
  6548. this.x = (Laya.stage.width - this.width) / 2;
  6549. this.y = (Laya.stage.height - this.height) / 2;
  6550. }
  6551. closeSelf() {
  6552. this.hide();
  6553. }
  6554. userLogin() {
  6555. let ua = this.ui.txt_ua.text;
  6556. let up = this.ui.txt_up.text;
  6557. if (ua && up) {
  6558. let reqData = JSON.stringify({
  6559. username: ua.trim(),
  6560. password: up.trim(),
  6561. fromMark: 'app_game'
  6562. });
  6563. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6564. try {
  6565. console.log('zh:res = ' + JSON.stringify(res));
  6566. let code = res.code;
  6567. let msg = res.msg;
  6568. if (code == 200) {
  6569. let keyStr = 'userInfo';
  6570. let jsonStr = {
  6571. "username": res.username,
  6572. "token": res.token
  6573. };
  6574. LocalStorageManager.setItem(keyStr, jsonStr);
  6575. xGame.uiMgr.Show(UIMsg, msg);
  6576. this.closeSelf();
  6577. }
  6578. else {
  6579. xGame.uiMgr.Show(UIMsg, msg);
  6580. }
  6581. }
  6582. catch (error) {
  6583. console.log('error=' + error);
  6584. alert(error);
  6585. }
  6586. finally {
  6587. }
  6588. });
  6589. }
  6590. else {
  6591. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6592. }
  6593. }
  6594. gotoRegPage() {
  6595. this.closeSelf();
  6596. xGame.uiMgr.Show(UIReg);
  6597. }
  6598. }
  6599. UILogin.uiName = "UILogin";
  6600. class UIReg extends UIBase {
  6601. constructor() {
  6602. super();
  6603. }
  6604. onConstructor() {
  6605. this.ui = ui_UIReg.createInstance();
  6606. this.contentPane = this.ui;
  6607. this.isEject = false;
  6608. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6609. this.addUIClick(this.ui.btn_reg, this.regUser);
  6610. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6611. }
  6612. show() {
  6613. super.show();
  6614. this.x = (Laya.stage.width - this.width) / 2;
  6615. this.y = (Laya.stage.height - this.height) / 2;
  6616. }
  6617. closeSelf() {
  6618. this.hide();
  6619. }
  6620. regUser() {
  6621. this.ui.lab_tip.visible = false;
  6622. let ua = this.ui.txt_ua.text;
  6623. let up1 = this.ui.txt_up1.text;
  6624. let up2 = this.ui.txt_up2.text;
  6625. if (ua && up1 && up2 && up1 == up2) {
  6626. let reqData = JSON.stringify({
  6627. username: ua.trim(),
  6628. password: up1.trim(),
  6629. fromMark: 'app_game'
  6630. });
  6631. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6632. try {
  6633. console.log('zh:res = ' + JSON.stringify(res));
  6634. let code = res.code;
  6635. let msg = res.msg;
  6636. xGame.uiMgr.Show(UIMsg, msg);
  6637. if (code == 200) {
  6638. this.ui.lab_tip.color = "#FFFFFF";
  6639. xGame.uiMgr.Show(UIMsg, msg);
  6640. this.closeSelf();
  6641. }
  6642. else {
  6643. this.ui.lab_tip.color = "#FF0000";
  6644. xGame.uiMgr.Show(UIMsg, msg);
  6645. }
  6646. }
  6647. catch (error) {
  6648. console.log('error=' + error);
  6649. alert(error);
  6650. }
  6651. finally {
  6652. }
  6653. });
  6654. }
  6655. else {
  6656. if (up1 != up2) {
  6657. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  6658. }
  6659. else {
  6660. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6661. }
  6662. }
  6663. }
  6664. gotoLogin() {
  6665. this.closeSelf();
  6666. xGame.uiMgr.Show(UILogin);
  6667. }
  6668. }
  6669. UIReg.uiName = "UIReg";
  6670. class ui_UIGetAward extends fgui.GComponent {
  6671. static createInstance() {
  6672. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6673. }
  6674. onConstruct() {
  6675. this.n4 = (this.getChild("n4"));
  6676. this.n0 = (this.getChild("n0"));
  6677. this.myList = (this.getChild("myList"));
  6678. this.n1 = (this.getChild("n1"));
  6679. this.eftNode = (this.getChild("eftNode"));
  6680. this.btnNode = (this.getChild("btnNode"));
  6681. this.t0 = this.getTransition("t0");
  6682. }
  6683. }
  6684. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6685. class UIGetAward extends UIBase {
  6686. constructor() {
  6687. super();
  6688. this.showTriple = true;
  6689. }
  6690. onConstructor() {
  6691. this.ui = ui_UIGetAward.createInstance();
  6692. this.contentPane = this.ui;
  6693. this.isEject = false;
  6694. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6695. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6696. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6697. }
  6698. show(arr, showTriple, callback) {
  6699. super.show();
  6700. this.ui.t0.play();
  6701. this.ui.eftNode.visible = true;
  6702. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6703. this.ui.eftNode.visible = false;
  6704. }), 1, 0, 0, 0.9);
  6705. this.awardArr = arr;
  6706. this.showTriple = showTriple;
  6707. this.callback = callback;
  6708. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6709. this.ui.myList.numItems = arr.length;
  6710. xGame.soundMgr.playSound("getaward");
  6711. }
  6712. updateSelf(index, obj) {
  6713. let temp = this.awardArr[index];
  6714. let icon = this.getIcon(temp.type);
  6715. let str = icon;
  6716. if (temp.type > 2) {
  6717. str = "s" + icon;
  6718. }
  6719. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6720. obj.myIcon.rotation = 0;
  6721. obj.numTxt.text = temp.num + "";
  6722. obj.numTxt.visible = temp.type > 2 ? false : true;
  6723. obj.nameTxt.text = this.getNameStr(temp.type);
  6724. }
  6725. renderItem(index, obj) {
  6726. this.updateSelf(index, obj);
  6727. }
  6728. tripleGetAward() {
  6729. console.log('zh:qjff_AD_for_uigetAward');
  6730. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6731. }
  6732. else {
  6733. console.log('zh:AD 失败,直接发放奖励');
  6734. this.qjff_AD_for_uigetAward();
  6735. }
  6736. }
  6737. qjff_AD_for_uigetAward() {
  6738. this.getAward(3);
  6739. }
  6740. normalGetAward() {
  6741. if (PlatMgr.isMisVideo())
  6742. this.tripleGetAward();
  6743. else
  6744. this.getAward();
  6745. }
  6746. getAward(times = 1) {
  6747. this.hide();
  6748. for (let index = 0; index < this.awardArr.length; index++) {
  6749. this.awardArr[index].num *= times;
  6750. }
  6751. this.callback && this.callback(times != 1);
  6752. }
  6753. getIcon(type) {
  6754. switch (type) {
  6755. case Prop.diamond:
  6756. return "ty_zs";
  6757. case Prop.coin:
  6758. return "ty_jb";
  6759. case Prop.gan1:
  6760. return "qg1";
  6761. case Prop.gan2:
  6762. return "qg2";
  6763. case Prop.gan3:
  6764. return "qg3";
  6765. case Prop.gan4:
  6766. return "qg4";
  6767. default:
  6768. break;
  6769. }
  6770. }
  6771. getNameStr(type) {
  6772. switch (type) {
  6773. case Prop.diamond:
  6774. return "Diamond";
  6775. case Prop.coin:
  6776. return "Coins";
  6777. case Prop.gan1:
  6778. case Prop.gan2:
  6779. case Prop.gan3:
  6780. case Prop.gan4:
  6781. return cfgTable.ballrodData[type - 1].name;
  6782. default:
  6783. break;
  6784. }
  6785. }
  6786. }
  6787. UIGetAward.uiName = "UIGetAward";
  6788. class ui_UIRepentProp extends fgui.GComponent {
  6789. static createInstance() {
  6790. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6791. }
  6792. onConstruct() {
  6793. this.c1 = this.getController("c1");
  6794. this.n11 = (this.getChild("n11"));
  6795. this.regretNode = (this.getChild("regretNode"));
  6796. this.helpLineNode = (this.getChild("helpLineNode"));
  6797. this.t0 = this.getTransition("t0");
  6798. }
  6799. }
  6800. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6801. class UIRepentProp extends UIBase {
  6802. constructor() {
  6803. super();
  6804. this.viewType = 0;
  6805. this.regretType = 0;
  6806. }
  6807. onConstructor() {
  6808. this.ui = ui_UIRepentProp.createInstance();
  6809. this.contentPane = this.ui;
  6810. this.isEject = false;
  6811. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6812. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6813. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6814. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6815. }
  6816. show(viewType, regretType, callback) {
  6817. PlatMgr.showInsert(true);
  6818. this.viewType = viewType;
  6819. this.regretType = regretType;
  6820. this.callback = callback;
  6821. super.show();
  6822. this.ui.t0.play();
  6823. this.ui.c1.selectedIndex = this.viewType;
  6824. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6825. if (this.viewType == 0) {
  6826. let guide = DataMgr.getGuideHelpLine();
  6827. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6828. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6829. }
  6830. xGame.common.gameMgr.gamePause = true;
  6831. }
  6832. hideSelf() {
  6833. xGame.common.gameMgr.gamePause = false;
  6834. this.callback && this.callback(false);
  6835. this.hide();
  6836. }
  6837. videoRegret() {
  6838. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6839. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6840. }
  6841. else {
  6842. console.log('zh:AD 失败,直接发放奖励');
  6843. this.qjff_AD_for_UIrepentProp_videoRegret();
  6844. }
  6845. }
  6846. qjff_AD_for_UIrepentProp_videoRegret() {
  6847. this.callback && this.callback(true);
  6848. this.hideSelf();
  6849. }
  6850. videoAddHelpLine() {
  6851. let guide = DataMgr.getGuideHelpLine();
  6852. if (guide == 0) {
  6853. this.callback && this.callback(true);
  6854. this.hideSelf();
  6855. DataMgr.setGuideHelpLine();
  6856. xGame.common.gameUI.ui.guideNode.visible = false;
  6857. }
  6858. else {
  6859. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6860. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6861. }
  6862. else {
  6863. console.log('zh:AD 失败,直接发放奖励');
  6864. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6865. }
  6866. }
  6867. }
  6868. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6869. this.callback && this.callback(true);
  6870. this.hideSelf();
  6871. }
  6872. }
  6873. UIRepentProp.uiName = "UIRepentProp";
  6874. class UIMain extends UIBase {
  6875. constructor() {
  6876. super();
  6877. this.firstEnter = true;
  6878. }
  6879. nativeCallJs(msg) {
  6880. let t = msg;
  6881. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6882. switch (t) {
  6883. case 'qjff_chouJiang':
  6884. let dui = xGame.uiMgr.getUI(UIDraw);
  6885. dui.qjff_chouJiang();
  6886. break;
  6887. case 'qjff_AD_for_uisign':
  6888. let dui2 = xGame.uiMgr.getUI(UISign);
  6889. dui2.qjff_AD_for_uisign();
  6890. break;
  6891. case 'qjff_AD_for_uitry':
  6892. let dui3 = xGame.uiMgr.getUI(UITry);
  6893. dui3.qjff_AD_for_uitry();
  6894. break;
  6895. case 'qjff_AD_for_uipower':
  6896. let dui4 = xGame.uiMgr.getUI(UIPower);
  6897. dui4.qjff_AD_for_uipower();
  6898. break;
  6899. case 'qjff_AD_for_uigetAward':
  6900. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6901. dui5.qjff_AD_for_uigetAward();
  6902. break;
  6903. case 'qjff_AD_for_uiGameEnd':
  6904. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6905. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6906. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6907. break;
  6908. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6909. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6910. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6911. break;
  6912. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6913. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6914. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6915. break;
  6916. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6917. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6918. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6919. break;
  6920. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6921. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6922. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6923. break;
  6924. case 'qjff_AD_for_UIBOX_onOpenBox':
  6925. let dui11 = xGame.uiMgr.getUI(UIBox);
  6926. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6927. break;
  6928. case 'qjff_AD_for_UIAddCoin':
  6929. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6930. dui12.qjff_AD_for_UIAddCoin();
  6931. break;
  6932. case '111a':
  6933. let dui14 = xGame.uiMgr.getUI(UISign);
  6934. dui14.qjff_AD_for_uisign();
  6935. break;
  6936. case '222a':
  6937. let dui15 = xGame.uiMgr.getUI(UISign);
  6938. dui15.qjff_AD_for_uisign();
  6939. break;
  6940. case '333a':
  6941. let dui16 = xGame.uiMgr.getUI(UISign);
  6942. dui16.qjff_AD_for_uisign();
  6943. break;
  6944. default:
  6945. console.log('zh:未知的方法名字' + t);
  6946. break;
  6947. }
  6948. }
  6949. onConstructor() {
  6950. console.log('zh: UIMain onConstructor');
  6951. this.ui = ui_UIMain.createInstance();
  6952. this.contentPane = this.ui;
  6953. this.isEject = false;
  6954. this.addEvent();
  6955. this.addClickSpine();
  6956. this.settingNode = new SettingNode(this.ui.settingNode);
  6957. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6958. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6959. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6960. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6961. let curUse = DataMgr.getCurSecretary();
  6962. this.changeSecretary(curUse);
  6963. this.ui.talkNode.visible = false;
  6964. let guide = DataMgr.getSkillGuide();
  6965. if (xGame.common.isNewDay && guide == 1) {
  6966. xGame.common.isNewDay = false;
  6967. xGame.soundMgr.playSound("s_main01");
  6968. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6969. console.log("zh:播放小秘书每天语音");
  6970. }
  6971. this.onGetUserInfo();
  6972. this.ui.n83.visible = false;
  6973. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  6974. const d = LocalStorageManager.getItem(keyForLoginInfo);
  6975. let ua = d.username;
  6976. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  6977. }
  6978. this.c_btn_for_user();
  6979. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6980. }
  6981. Logout() {
  6982. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  6983. LocalStorageManager.removeItem(keyForLoginInfo);
  6984. this.freshUser();
  6985. }
  6986. }
  6987. gotoLogin() {
  6988. xGame.uiMgr.Show(UILogin);
  6989. }
  6990. gotoRegUser() {
  6991. xGame.uiMgr.Show(UIReg);
  6992. }
  6993. c_btn_for_user() {
  6994. this.ui.n_Logout.visible = false;
  6995. this.ui.n_dengLu.visible = false;
  6996. this.ui.n_zhuCe.visible = false;
  6997. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  6998. this.ui.n_Logout.visible = true;
  6999. }
  7000. else {
  7001. this.ui.n_dengLu.visible = true;
  7002. }
  7003. }
  7004. changeSecretary(curUse) {
  7005. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7006. xGame.common.secretary && xGame.common.secretary.dispose();
  7007. this.addSecretarySpine(name);
  7008. }
  7009. addSecretarySpine(name) {
  7010. let spine = new SpineMgr(name, () => {
  7011. this.playSecretaryIdle();
  7012. });
  7013. xGame.common.secretary = spine;
  7014. }
  7015. addClickSpine() {
  7016. let clickSpine = new SpineMgr("dianji", () => {
  7017. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7018. let parent = Laya.stage;
  7019. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7020. clickSpine.play(data, 0, false, parent, (spine) => {
  7021. spine.destroy(true);
  7022. });
  7023. });
  7024. });
  7025. }
  7026. addEvent() {
  7027. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7028. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7029. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7030. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7031. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7032. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7033. this.addUIClick(this.ui, this.interuptSecretary);
  7034. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7035. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7036. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7037. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7038. this.addUIClick(this.ui.signBtn, this.openSignView);
  7039. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7040. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7041. this.addUIClick(this.ui.n_Logout, this.Logout);
  7042. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7043. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7044. }
  7045. show(showFailWords) {
  7046. super.show();
  7047. this.moneyNode.ui.c1.selectedIndex = 1;
  7048. this.playSecretaryIdle();
  7049. xGame.soundMgr.playMusic("caromhall01", 0);
  7050. Laya.timer.clearAll(this);
  7051. this.playSecretaryRandomSound();
  7052. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7053. if (showFailWords) {
  7054. console.log('zh:uimain.ts ');
  7055. setTimeout(() => {
  7056. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7057. let words = -1;
  7058. if (str == "s_main02") {
  7059. words = 2;
  7060. }
  7061. else {
  7062. words = 3;
  7063. }
  7064. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7065. xGame.soundMgr.playSound(str);
  7066. }, 300);
  7067. }
  7068. this.showGuide();
  7069. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7070. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7071. let guide = DataMgr.getSkillGuide();
  7072. if (guide == 1) {
  7073. let randTime = xGame.common.randomNum(300, 800);
  7074. if (this.firstEnter) {
  7075. console.log("zh: firstEnter");
  7076. this.firstEnter = false;
  7077. randTime += 900;
  7078. }
  7079. else {
  7080. console.log("zh: no firstEnter");
  7081. }
  7082. Laya.timer.once(randTime, this, () => {
  7083. xGame.common.autoPopUIView();
  7084. });
  7085. }
  7086. }
  7087. checkActive(show) {
  7088. }
  7089. showGuide() {
  7090. let guide = DataMgr.getSkillGuide();
  7091. this.ui.guideBtn.visible = guide == 0;
  7092. this.ui.enterGuide.visible = false;
  7093. this.ui.secretaryGuide.visible = guide == 0;
  7094. if (guide == 0) {
  7095. console.log("zh:显示引导");
  7096. xGame.soundMgr.playSound("s_guide");
  7097. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7098. }
  7099. else {
  7100. console.log("zh:不需要显示引导");
  7101. }
  7102. }
  7103. ensureSecretary() {
  7104. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7105. this.ui.secretaryGuide.visible = false;
  7106. this.ui.enterGuide.visible = true;
  7107. this.ui.wordsNode.t0.play();
  7108. if (DataMgr.getNewUser())
  7109. Moyu.sendDataEvent("gameReady");
  7110. }
  7111. playSecretaryIdle() {
  7112. let parent = this.ui.secretary.displayObject;
  7113. parent.destroyChildren();
  7114. let xx = this.ui.secretary.width / 2;
  7115. let yy = this.ui.secretary.height;
  7116. let scale = xGame.common.getSecretaryScale();
  7117. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7118. console.log("zh:playSecretaryIdle", data);
  7119. xGame.common.secretary.play(data, 0, true, parent);
  7120. }
  7121. startGame(type) {
  7122. xGame.common.gameMode = type;
  7123. Moyu.sendDataEvent("PlayGame", { type: type });
  7124. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7125. switch (xGame.common.gameMode) {
  7126. case GameMode.classic:
  7127. console.log('zh:进入经典模式111111111');
  7128. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7129. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7130. console.log('zh:classic db_over_lev=', db_over_lev);
  7131. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7132. console.log('zh:判断是否可以玩该模式classic =NO');
  7133. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7134. xGame.uiMgr.Show(UIMsg, tipStr);
  7135. return;
  7136. }
  7137. else {
  7138. console.log('zh:可以玩该模式classic 66666666666666');
  7139. this.beginGame();
  7140. }
  7141. }
  7142. else {
  7143. console.log('zh:不需要判断是否可以玩该classic');
  7144. let challengeTimes = DataMgr.getChallengeTimes();
  7145. if (challengeTimes == 0) {
  7146. xGame.uiMgr.Show(UIInvitation);
  7147. }
  7148. else {
  7149. this.beginGame();
  7150. }
  7151. break;
  7152. }
  7153. case GameMode.bigMove:
  7154. console.error('zh:bigMove check');
  7155. let guide = DataMgr.getSkillGuide();
  7156. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7157. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7158. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7159. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7160. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7161. xGame.uiMgr.Show(UIMsg, tipStr);
  7162. return;
  7163. }
  7164. else {
  7165. console.log('zh:可以玩该模式 bigMove');
  7166. this.beginGame();
  7167. if (DataMgr.getNewUser())
  7168. Moyu.sendDataEvent("gameStart0");
  7169. }
  7170. }
  7171. else {
  7172. this.beginGame();
  7173. if (DataMgr.getNewUser())
  7174. Moyu.sendDataEvent("gameStart0");
  7175. }
  7176. break;
  7177. default:
  7178. console.error('zh:未知错误!!!!');
  7179. break;
  7180. }
  7181. }
  7182. beginGame(isNice = false) {
  7183. console.log('zh:beginGame ');
  7184. let guide = DataMgr.getSkillGuide();
  7185. if (guide == 1) {
  7186. console.log('zh:非新手引导,showInternAd ');
  7187. JSBridgeUtils.instance.showInternAd('beginGame');
  7188. }
  7189. else {
  7190. console.log('zh:新手引导,不显示AD ');
  7191. }
  7192. console.log('zh:beginGame 2 go');
  7193. if (xGame.common.gameMode == GameMode.classic) {
  7194. if (isNice) {
  7195. this.enterClassic();
  7196. }
  7197. else {
  7198. xGame.uiMgr.Show(UIModeSelection, () => {
  7199. console.log('zh:BBBBBBBBBBBBBBB');
  7200. this.enterClassic();
  7201. });
  7202. }
  7203. }
  7204. else if (xGame.common.gameMode == GameMode.bigMove) {
  7205. this.ui.enterGuide.visible = false;
  7206. xGame.uiMgr.Show(UISkill);
  7207. }
  7208. }
  7209. enterClassic() {
  7210. xGame.uiMgr.Show(UIGame);
  7211. xGame.uiMgr.Show(UIMatching, () => {
  7212. if (!this.isHide)
  7213. this.hide();
  7214. xGame.common.gameUI.ui.alpha = 1;
  7215. xGame.common.gameUI.startGame();
  7216. xGame.uiMgr.Hide(UIGameEnd);
  7217. });
  7218. }
  7219. startGlobal() {
  7220. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7221. }
  7222. startWeekly() {
  7223. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7224. }
  7225. zhouSaiMonth() {
  7226. console.log('zh: zhouSaiMonth 被调用');
  7227. }
  7228. startPlaceBall() {
  7229. xGame.uiMgr.Show(UILevelDisplay);
  7230. }
  7231. hide() {
  7232. console.log('zh:uimain hide ...');
  7233. super.hide();
  7234. xGame.common.stopGirlPop(this.ui.talkNode);
  7235. }
  7236. onGetUserInfo(force = false) {
  7237. if (Moyu.isWx) {
  7238. let info = Moyu.getSystemInfo();
  7239. if (info)
  7240. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7241. }
  7242. else {
  7243. Moyu.initUser(this, this.freshUser, force);
  7244. }
  7245. this.freshUser();
  7246. }
  7247. freshUser() {
  7248. let user = Moyu.getUserInfo();
  7249. if (!user.isAuth) {
  7250. user.headIcon = 'res/ty_touxiang.png';
  7251. }
  7252. else {
  7253. DataMgr.upRankData();
  7254. }
  7255. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7256. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7257. let keyStr = keyForLoginInfo;
  7258. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7259. const d = LocalStorageManager.getItem(keyStr);
  7260. let ua = d.username;
  7261. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7262. }
  7263. else {
  7264. }
  7265. this.c_btn_for_user();
  7266. }
  7267. interuptSecretary() {
  7268. Laya.timer.clearAll(this);
  7269. this.playSecretaryRandomSound();
  7270. }
  7271. playSecretaryRandomSound() {
  7272. if (this.isHide)
  7273. return;
  7274. let time = xGame.common.randomNum(45000, 60000);
  7275. Laya.timer.once(time, this, () => {
  7276. if (this.isHide)
  7277. return;
  7278. let index = xGame.common.randomNum(4, 7);
  7279. xGame.soundMgr.playSound("s_main0" + index);
  7280. let words = 1;
  7281. switch (index) {
  7282. case 4:
  7283. words = 5;
  7284. break;
  7285. case 5:
  7286. words = 3;
  7287. break;
  7288. case 6:
  7289. words = 6;
  7290. break;
  7291. case 7:
  7292. words = 7;
  7293. break;
  7294. default:
  7295. break;
  7296. }
  7297. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7298. this.playSecretaryRandomSound();
  7299. });
  7300. }
  7301. openSecretaryView() {
  7302. xGame.uiMgr.Show(UISecretary);
  7303. Moyu.sendDataEvent("secretary");
  7304. }
  7305. openShopView() {
  7306. xGame.uiMgr.Show(UIShop, 0);
  7307. }
  7308. openSignView() {
  7309. xGame.uiMgr.Show(UISign);
  7310. }
  7311. openDrawView() {
  7312. xGame.uiMgr.Show(UIDraw);
  7313. }
  7314. openRanking() {
  7315. console.log('zh:phb openRanking');
  7316. xGame.uiMgr.Show(UIRanking);
  7317. Moyu.sendDataEvent("rankingList");
  7318. }
  7319. }
  7320. UIMain.uiName = "UIMain";
  7321. class UIGameEnd extends UIBase {
  7322. constructor() {
  7323. super();
  7324. this.success = false;
  7325. this.awardCoinNum = 1000;
  7326. this.awardDiamondNum = 10;
  7327. }
  7328. onConstructor() {
  7329. this.ui = ui_UIGameEnd.createInstance();
  7330. this.contentPane = this.ui;
  7331. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7332. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7333. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7334. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7335. this.ui.talkNode.visible = false;
  7336. if (Moyu.isKs)
  7337. this.ui.closeNode.closeBtn.x += 100;
  7338. }
  7339. updateType() {
  7340. switch (xGame.common.gameMode) {
  7341. case GameMode.classic:
  7342. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7343. this.ui.coinNode.visible = this.success;
  7344. if (!this.success) {
  7345. Laya.timer.once(500, this, () => {
  7346. xGame.uiMgr.Show(UIAddCoin);
  7347. });
  7348. }
  7349. else {
  7350. this.logEventForClassic_win();
  7351. }
  7352. this.logEventForClassic_complete();
  7353. this.ui.isGetAward.visible = false;
  7354. this.ui.leftBtn.c1.selectedIndex = 3;
  7355. this.ui.rightBtn.c1.selectedIndex = 0;
  7356. this.moneyNode.ui.c1.selectedIndex = 1;
  7357. break;
  7358. case GameMode.bigMove:
  7359. console.log('zh:招法模式 aaaaaa bigMove');
  7360. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7361. this.ui.coinNode.visible = this.success;
  7362. if (xGame.common.gameMode == GameMode.bigMove) {
  7363. if (this.success) {
  7364. DataMgr.setSkillSuccessTimes(1, true);
  7365. DataMgr.setSkillAccTimes(1);
  7366. }
  7367. else {
  7368. DataMgr.setSkillSuccessTimes(0, false);
  7369. }
  7370. }
  7371. this.logEventForRod_complete_N();
  7372. if (!this.success) {
  7373. Laya.timer.once(500, this, () => {
  7374. xGame.uiMgr.Show(UIAddCoin);
  7375. });
  7376. }
  7377. else {
  7378. this.logEventForRod_win();
  7379. }
  7380. this.ui.isGetAward.visible = false;
  7381. this.ui.leftBtn.c1.selectedIndex = 3;
  7382. this.ui.rightBtn.c1.selectedIndex = 0;
  7383. this.moneyNode.ui.c1.selectedIndex = 1;
  7384. break;
  7385. case GameMode.placeBall:
  7386. this.ui.coinNode.visible = false;
  7387. if (this.success) {
  7388. if (xGame.common.placeBallStarNum == 3) {
  7389. this.ui.c1.selectedIndex = 2;
  7390. }
  7391. else {
  7392. this.ui.c1.selectedIndex = 3;
  7393. }
  7394. let level = xGame.common.placeBallCurLevel;
  7395. if (level > 59) {
  7396. this.logEventForChallenge_level_complete(level);
  7397. }
  7398. else {
  7399. this.logEventForChallenge_level_N(level);
  7400. }
  7401. }
  7402. else {
  7403. this.ui.c1.selectedIndex = 4;
  7404. }
  7405. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7406. if (cfg.type == PlaceBallType.challenge) {
  7407. this.ui.c1.selectedIndex = 2;
  7408. }
  7409. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7410. this.updatePlaceBallBtn();
  7411. this.updatePlaceBallStarNum();
  7412. this.updatePlaceBallAwardState();
  7413. this.moneyNode.ui.c1.selectedIndex = 2;
  7414. this.moneyNode.checkPowerTime();
  7415. this.moneyNode.powerChange();
  7416. DataMgr.upRankData();
  7417. break;
  7418. default:
  7419. break;
  7420. }
  7421. }
  7422. logEventForRod_complete_N() {
  7423. let gfmsIdx = xGame.common.curPlayerSkillType;
  7424. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7425. let gfmc = 'Skyfall Shot';
  7426. if (gfmsIdx == 0) {
  7427. gfmc = 'Skyfall Shot';
  7428. }
  7429. if (gfmsIdx == 1) {
  7430. gfmc = 'Surging break';
  7431. }
  7432. if (gfmsIdx == 2) {
  7433. gfmc = 'Frost Lock';
  7434. }
  7435. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7436. console.log('zh:logEventForRod_complete_N level = ' + level);
  7437. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7438. let jsonStr = {
  7439. "count": 0,
  7440. "name": gfmc
  7441. };
  7442. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7443. const d = LocalStorageManager.getItem(keyStr);
  7444. jsonStr.count = d.count + 1;
  7445. LocalStorageManager.setItem(keyStr, jsonStr);
  7446. }
  7447. else {
  7448. LocalStorageManager.setItem(keyStr, jsonStr);
  7449. }
  7450. const d2 = LocalStorageManager.getItem(keyStr);
  7451. let count = d2.count;
  7452. console.log('zh:logEventForRod_complete_N count = ' + count);
  7453. if (count % 5 == 0) {
  7454. const reqStr = JSON.stringify(jsonStr);
  7455. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7456. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7457. }
  7458. }
  7459. logEventForRod_win() {
  7460. console.log('zh:logEventForRod_win,胜利');
  7461. let gfmsIdx = xGame.common.curPlayerSkillType;
  7462. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7463. let gfmc = 'Skyfall Shot';
  7464. if (gfmsIdx == 0) {
  7465. gfmc = 'Skyfall Shot';
  7466. }
  7467. if (gfmsIdx == 1) {
  7468. gfmc = 'Surging break';
  7469. }
  7470. if (gfmsIdx == 2) {
  7471. gfmc = 'Frost Lock';
  7472. }
  7473. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7474. console.log('zh:logEventForRod_win level = ' + level);
  7475. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7476. let jsonStr = {
  7477. "count": 1,
  7478. "name": gfmc + ' Lev' + level
  7479. };
  7480. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7481. const d = LocalStorageManager.getItem(keyStr);
  7482. jsonStr.count = d.count + 1;
  7483. LocalStorageManager.setItem(keyStr, jsonStr);
  7484. }
  7485. else {
  7486. LocalStorageManager.setItem(keyStr, jsonStr);
  7487. }
  7488. const reqStr = JSON.stringify(jsonStr);
  7489. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7490. }
  7491. logEventForClassic_win() {
  7492. console.log('zh:logEventForClassic_win,胜利');
  7493. let rtype = xGame.common.classicRoomType;
  7494. let msmc = '';
  7495. if (rtype == 1) {
  7496. msmc = 'beginner';
  7497. }
  7498. if (rtype == 2) {
  7499. msmc = 'expert';
  7500. }
  7501. if (rtype == 3) {
  7502. msmc = 'master';
  7503. }
  7504. let keyStr = 'sjmd_classic_win_' + rtype;
  7505. let jsonStr = {
  7506. "difficulty": msmc,
  7507. "classic_count": 1,
  7508. "difficulty_count": 1
  7509. };
  7510. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7511. const d = LocalStorageManager.getItem(keyStr);
  7512. jsonStr.classic_count = d.classic_count + 1;
  7513. jsonStr.difficulty_count = d.difficulty_count + 1;
  7514. LocalStorageManager.setItem(keyStr, jsonStr);
  7515. }
  7516. else {
  7517. LocalStorageManager.setItem(keyStr, jsonStr);
  7518. }
  7519. const reqStr = JSON.stringify(jsonStr);
  7520. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7521. }
  7522. logEventForClassic_complete() {
  7523. console.log('zh:logEventForClassic_complete,胜利');
  7524. let rtype = xGame.common.classicRoomType;
  7525. let msmc = '';
  7526. if (rtype == 1) {
  7527. msmc = 'beginner';
  7528. }
  7529. if (rtype == 2) {
  7530. msmc = 'expert';
  7531. }
  7532. if (rtype == 3) {
  7533. msmc = 'master';
  7534. }
  7535. let keyStr = 'sjmd_classic_complete_' + rtype;
  7536. let jsonStr = {
  7537. "msmc": msmc,
  7538. "count": 0
  7539. };
  7540. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7541. const d = LocalStorageManager.getItem(keyStr);
  7542. jsonStr.count = d.count + 1;
  7543. LocalStorageManager.setItem(keyStr, jsonStr);
  7544. }
  7545. else {
  7546. LocalStorageManager.setItem(keyStr, jsonStr);
  7547. }
  7548. if (jsonStr.count % 5 == 0) {
  7549. const reqStr = JSON.stringify(jsonStr);
  7550. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  7551. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  7552. }
  7553. }
  7554. updatePlaceBallBtn() {
  7555. this.ui.leftBtn.c1.selectedIndex = 5;
  7556. if (this.success) {
  7557. this.ui.rightBtn.c1.selectedIndex = 14;
  7558. }
  7559. else {
  7560. if (xGame.common.placeBallStarNum == 3) {
  7561. this.ui.rightBtn.c1.selectedIndex = 14;
  7562. }
  7563. else {
  7564. this.ui.rightBtn.c1.selectedIndex = 1;
  7565. }
  7566. }
  7567. }
  7568. updatePlaceBallStarNum() {
  7569. let starNum = xGame.common.placeBallStarNum;
  7570. if (starNum == 0)
  7571. this.ui.starNumNode.c1.selectedIndex = 3;
  7572. else {
  7573. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  7574. }
  7575. }
  7576. updatePlaceBallAwardState() {
  7577. let level = xGame.common.placeBallCurLevel;
  7578. let starNum = xGame.common.placeBallStarNum;
  7579. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7580. let data = cfgTable.placeballData[level].award;
  7581. let cfg = cfgTable.placeballData[level];
  7582. this.awardDiamondNum = data[1];
  7583. this.awardCoinNum = data[0];
  7584. if (cfg.type == PlaceBallType.challenge) {
  7585. this.awardDiamondNum = 0;
  7586. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7587. }
  7588. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  7589. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  7590. if (cfg.type == PlaceBallType.challenge) {
  7591. this.ui.awardNode.coinNode.visible = true;
  7592. }
  7593. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  7594. this.ui.awardNode.diamondNode.x = 265;
  7595. this.ui.awardNode.coinNode.x = 354;
  7596. }
  7597. else {
  7598. this.ui.awardNode.diamondNode.x = 291;
  7599. this.ui.awardNode.coinNode.x = 291;
  7600. }
  7601. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  7602. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  7603. if (this.awardCoinNum == 0) {
  7604. this.ui.awardNode.coinNode.numTxt.text = "";
  7605. }
  7606. if (getAward) {
  7607. this.ui.isGetAward.visible = true;
  7608. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  7609. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  7610. }
  7611. else {
  7612. this.ui.isGetAward.visible = false;
  7613. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7614. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7615. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7616. }
  7617. else {
  7618. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7619. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7620. }
  7621. }
  7622. }
  7623. show(success) {
  7624. super.show();
  7625. xGame.eventMgr.event(RESET_GAME);
  7626. this.success = success;
  7627. Laya.timer.clearAll(this);
  7628. this.playSecretaryAni();
  7629. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7630. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7631. offsetTime = Math.floor(offsetTime / 1000);
  7632. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7633. this.updateType();
  7634. Laya.timer.once(200, this, () => {
  7635. this.addAward(() => {
  7636. this.updateType();
  7637. Laya.timer.once(500, this, () => {
  7638. this.showChallengeLevel();
  7639. });
  7640. });
  7641. });
  7642. if (this.success) {
  7643. JSBridgeUtils.instance.showInternAd('gameend_success');
  7644. console.log('zh:game end 成功');
  7645. xGame.soundMgr.playSound('slots_roll01');
  7646. xGame.soundMgr.playSound("s_win");
  7647. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7648. this.diyGameDataUtilForGameWin();
  7649. }
  7650. else {
  7651. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7652. console.log('zh:game end失败');
  7653. xGame.soundMgr.playSound('matchwin01');
  7654. xGame.soundMgr.playSound("s_lose");
  7655. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7656. }
  7657. let challengeNum = DataMgr.getChallengeTimes();
  7658. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7659. DataMgr.setChallengeTimes(1);
  7660. }
  7661. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7662. DataMgr.setClassicTimes();
  7663. }
  7664. }
  7665. diyGameDataUtilForGameWin() {
  7666. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7667. switch (xGame.common.gameMode) {
  7668. case GameMode.classic:
  7669. console.log('zh:DiyGameDataUtilForGameWin 111');
  7670. case GameMode.bigMove:
  7671. console.log('zh:DiyGameDataUtilForGameWin 222');
  7672. this.restartGame();
  7673. break;
  7674. case GameMode.placeBall:
  7675. console.log('zh:DiyGameDataUtilForGameWin 333');
  7676. var level = xGame.common.placeBallCurLevel;
  7677. console.log('zh:练习模式 联系了多少LEV=' + level);
  7678. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7679. if (level > db_over_lev) {
  7680. DataMgr.setChallengeMode_overLev(level);
  7681. }
  7682. break;
  7683. default:
  7684. console.log('zh:DiyGameDataUtilForGameWin 444');
  7685. break;
  7686. }
  7687. }
  7688. showChallengeLevel() {
  7689. if (DataMgr.getChallengeTimes() != 0)
  7690. return;
  7691. let skill = DataMgr.getSkillAccTimes();
  7692. let put = DataMgr.getPlaceBallLevelList().length;
  7693. if (skill >= 3 || put >= 5) {
  7694. xGame.uiMgr.Show(UIInvitation);
  7695. this.hide();
  7696. }
  7697. }
  7698. addAward(callback) {
  7699. if (!this.success) {
  7700. callback && callback();
  7701. return;
  7702. }
  7703. switch (xGame.common.gameMode) {
  7704. case GameMode.classic:
  7705. this.awardCoinNum = xGame.common.passAwardCoin;
  7706. this.awardDiamondNum = 0;
  7707. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7708. break;
  7709. case GameMode.bigMove:
  7710. this.awardCoinNum = xGame.common.passAwardCoin;
  7711. this.awardDiamondNum = 0;
  7712. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7713. callback && callback();
  7714. break;
  7715. case GameMode.placeBall:
  7716. let level = xGame.common.placeBallCurLevel;
  7717. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  7718. if (xGame.common.placeBallStarNum != 3) {
  7719. callback && callback();
  7720. return;
  7721. }
  7722. else {
  7723. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7724. if (getAward) {
  7725. callback && callback();
  7726. return;
  7727. }
  7728. }
  7729. let cfg = cfgTable.placeballData[level];
  7730. let data = cfgTable.placeballData[level].award;
  7731. this.awardCoinNum = data[0];
  7732. this.awardDiamondNum = data[1];
  7733. if (cfg.type == PlaceBallType.challenge) {
  7734. this.awardDiamondNum = 0;
  7735. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7736. }
  7737. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  7738. let diamondAward;
  7739. if (this.awardDiamondNum > 0) {
  7740. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  7741. xGame.common.getAward([diamondAward, coinAward], callback);
  7742. }
  7743. else {
  7744. xGame.common.getAward([coinAward], callback);
  7745. }
  7746. if (cfg.type == PlaceBallType.normal) {
  7747. DataMgr.setPlaceBallAward(level);
  7748. }
  7749. break;
  7750. default:
  7751. break;
  7752. }
  7753. }
  7754. playSecretaryAni_old() {
  7755. let parent = this.ui.secretary.displayObject;
  7756. parent.destroyChildren();
  7757. let xx = this.ui.secretary.width / 2;
  7758. let yy = this.ui.secretary.height;
  7759. let scale = xGame.common.getSecretaryScale();
  7760. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7761. if (this.success) {
  7762. let rand = Math.random() <= 0.5 ? 2 : 3;
  7763. xGame.common.secretary.play(data, rand, false, parent, () => {
  7764. xGame.common.secretary.play(data, 1, true, parent);
  7765. });
  7766. }
  7767. else {
  7768. xGame.common.secretary.play(data, 0, true, parent);
  7769. }
  7770. }
  7771. playSecretaryAni() {
  7772. let parent = this.ui.secretary.displayObject;
  7773. parent.destroyChildren();
  7774. let xx = this.ui.secretary.width / 2;
  7775. let yy = this.ui.secretary.height;
  7776. let scale = xGame.common.getSecretaryScale();
  7777. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7778. if (this.success) {
  7779. let rand = 0;
  7780. xGame.common.secretary.play(data, 0, true, parent);
  7781. }
  7782. else {
  7783. xGame.common.secretary.play(data, 0, true, parent);
  7784. }
  7785. }
  7786. restartGame() {
  7787. switch (xGame.common.gameMode) {
  7788. case GameMode.classic:
  7789. xGame.eventMgr.event(RESTART_GAME);
  7790. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7791. break;
  7792. case GameMode.bigMove:
  7793. this.hide();
  7794. xGame.eventMgr.event(RESTART_GAME);
  7795. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7796. break;
  7797. default:
  7798. break;
  7799. }
  7800. }
  7801. hide() {
  7802. super.hide();
  7803. xGame.common.stopGirlPop(this.ui.talkNode);
  7804. PlatMgr.showBanner(false);
  7805. }
  7806. returnHome() {
  7807. this.hide();
  7808. let showFailWords = !this.success;
  7809. xGame.uiMgr.Show(UIMain, showFailWords);
  7810. }
  7811. clickLeftBtn() {
  7812. switch (xGame.common.gameMode) {
  7813. case GameMode.classic:
  7814. case GameMode.bigMove:
  7815. this.returnHome();
  7816. break;
  7817. case GameMode.placeBall:
  7818. let level = xGame.common.placeBallCurLevel;
  7819. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7820. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7821. break;
  7822. default:
  7823. break;
  7824. }
  7825. }
  7826. powerStartPlaceBallLevel(level, btn) {
  7827. if (DataMgr.powerEnough()) {
  7828. btn.touchable = false;
  7829. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7830. btn.touchable = true;
  7831. DataMgr.setPower(-1);
  7832. xGame.eventMgr.event(POWER_TIME);
  7833. this.startPlaceBallLevel(level);
  7834. this.logEventForChallenge_level_start(level);
  7835. }));
  7836. }
  7837. else {
  7838. xGame.uiMgr.Show(UIPower, 0);
  7839. }
  7840. }
  7841. clickRightBtn() {
  7842. switch (xGame.common.gameMode) {
  7843. case GameMode.classic:
  7844. console.log('zh:clickRightBtn 111');
  7845. case GameMode.bigMove:
  7846. console.log('zh:clickRightBtn 222');
  7847. this.restartGame();
  7848. break;
  7849. case GameMode.placeBall:
  7850. console.log('zh:clickRightBtn 333');
  7851. let level = xGame.common.placeBallCurLevel;
  7852. let data = DataMgr.getPlaceBallLevel(level);
  7853. let curPss = data.play && !data.isCur;
  7854. if (curPss) {
  7855. console.log('zh:clickRightBtn 333-111');
  7856. console.log('zh:当前LV=' + level);
  7857. if (level == 60) {
  7858. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7859. Laya.timer.once(3000, this, () => {
  7860. this.returnHome();
  7861. });
  7862. }
  7863. else {
  7864. let lev = level + 1;
  7865. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  7866. }
  7867. }
  7868. else {
  7869. console.log('zh:clickRightBtn 333-000');
  7870. Moyu.sendDataEvent("placeBallNextLevel");
  7871. console.log('zh:qjff_AD_for_uiGameEnd');
  7872. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7873. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7874. }
  7875. else {
  7876. console.log('zh:AD 失败,直接发放奖励');
  7877. this.qjff_AD_for_uiGameEnd(level);
  7878. }
  7879. }
  7880. break;
  7881. default:
  7882. console.log('zh:clickRightBtn 444');
  7883. break;
  7884. }
  7885. }
  7886. logEventForChallenge_level_start(level) {
  7887. let keyStr = 'sjmd_challenge_level_start';
  7888. let jsonStr = {
  7889. "count": 0,
  7890. "gold_balance ": DataMgr.getCoin(),
  7891. "level": level,
  7892. "diamond_balance ": DataMgr.getDiamond()
  7893. };
  7894. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7895. const d = LocalStorageManager.getItem(keyStr);
  7896. if (level > d.level) {
  7897. jsonStr.count = d.count + 1;
  7898. LocalStorageManager.setItem(keyStr, jsonStr);
  7899. }
  7900. else {
  7901. }
  7902. }
  7903. else {
  7904. LocalStorageManager.setItem(keyStr, jsonStr);
  7905. }
  7906. const reqStr = JSON.stringify(jsonStr);
  7907. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  7908. }
  7909. qjff_AD_for_uiGameEnd(level) {
  7910. DataMgr.setPlaceBallLevel(level, 1);
  7911. this.startPlaceBallLevel(level + 1);
  7912. }
  7913. startPlaceBallLevel(level) {
  7914. xGame.common.gameMode = GameMode.placeBall;
  7915. xGame.common.placeBallCurLevel = level;
  7916. xGame.uiMgr.Show(UIGame);
  7917. this.hide();
  7918. }
  7919. logEventForChallenge_level_complete(level) {
  7920. let keyStr = 'sjmd_challenge_level_complete';
  7921. let jsonStr = {
  7922. "count": 1,
  7923. "gold_balance ": DataMgr.getCoin(),
  7924. "level": level,
  7925. "diamond_balance ": DataMgr.getDiamond()
  7926. };
  7927. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7928. const d = LocalStorageManager.getItem(keyStr);
  7929. jsonStr.count = d.count + 1;
  7930. LocalStorageManager.setItem(keyStr, jsonStr);
  7931. }
  7932. else {
  7933. LocalStorageManager.setItem(keyStr, jsonStr);
  7934. }
  7935. const reqStr = JSON.stringify(jsonStr);
  7936. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  7937. }
  7938. logEventForChallenge_level_N(level) {
  7939. console.log('zh:logEventForChallenge_level_N ' + level);
  7940. let keyStr = 'sjmd_challenge_level_N';
  7941. if (LocalStorageManager.hasKey(keyStr)) {
  7942. let lev = LocalStorageManager.getItem(keyStr);
  7943. if (level > lev) {
  7944. LocalStorageManager.setItem(keyStr, level);
  7945. }
  7946. if ((level) % 5 == 0) {
  7947. console.log('zh:每5关上报1次');
  7948. let sjmc = 'challenge_level_' + level;
  7949. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  7950. let sjmcForFirebase = 'challenge_level_' + level;
  7951. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  7952. }
  7953. else {
  7954. console.log('zh:5 no 上报');
  7955. }
  7956. }
  7957. else {
  7958. LocalStorageManager.setItem(keyStr, level);
  7959. }
  7960. }
  7961. }
  7962. UIGameEnd.uiName = "UIGameEnd";
  7963. class ui_UIVideoShare extends fgui.GComponent {
  7964. static createInstance() {
  7965. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7966. }
  7967. onConstruct() {
  7968. this.n10 = (this.getChild("n10"));
  7969. this.myNode = (this.getChild("myNode"));
  7970. this.t0 = this.getTransition("t0");
  7971. }
  7972. }
  7973. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7974. class UIVideoShare extends UIBase {
  7975. constructor() {
  7976. super();
  7977. this.success = false;
  7978. this.awardNum = 0;
  7979. this.isShared = true;
  7980. }
  7981. onConstructor() {
  7982. this.ui = ui_UIVideoShare.createInstance();
  7983. this.contentPane = this.ui;
  7984. this.isEject = false;
  7985. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7986. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7987. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7988. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7989. }
  7990. show(success) {
  7991. super.show();
  7992. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7993. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7994. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7995. this.success = success;
  7996. let time = xGame.common.randomNum(600, 1500);
  7997. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  7998. if (success)
  7999. xGame.soundMgr.playSound("applause");
  8000. this.ui.t0.play();
  8001. this.checkShareState();
  8002. let times = DataMgr.getDailyVideoShareTimes();
  8003. this.awardNum = times == 0 ? 2000 : 200;
  8004. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8005. }
  8006. checkShareState() {
  8007. if (PlatMgr.forceShare == 0) {
  8008. this.ui.myNode.closeBtn.visible = true;
  8009. this.ui.myNode.tipsNode.visible = false;
  8010. this.ui.myNode.closeBtn.x = 90;
  8011. this.ui.myNode.shareBtn.x = 342;
  8012. }
  8013. else if (PlatMgr.forceShare == 1) {
  8014. this.ui.myNode.closeBtn.visible = false;
  8015. this.ui.myNode.tipsNode.visible = true;
  8016. this.ui.myNode.shareBtn.x = 218;
  8017. this.isShared = true;
  8018. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8019. }
  8020. }
  8021. checkForceShare() {
  8022. this.isShared = !this.isShared;
  8023. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8024. }
  8025. videoShare() {
  8026. if (PlatMgr.forceShare == 1) {
  8027. if (this.isShared) {
  8028. this.shareGame();
  8029. }
  8030. else {
  8031. this.hideSelf();
  8032. }
  8033. }
  8034. else {
  8035. this.shareGame();
  8036. }
  8037. }
  8038. shareGame() {
  8039. Moyu.sendDataEvent("VideoShare");
  8040. if (Moyu.canShare() > 100) {
  8041. Moyu.shareGame((success) => {
  8042. if (success) {
  8043. DataMgr.setDailyVideoShareTimes(1);
  8044. DataMgr.setCoin(this.awardNum);
  8045. }
  8046. this.hideSelf();
  8047. }, this);
  8048. }
  8049. else {
  8050. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8051. this.hideSelf();
  8052. }
  8053. }
  8054. hideSelf() {
  8055. this.hide();
  8056. xGame.uiMgr.Show(UIGameEnd, this.success);
  8057. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8058. xGame.common.screenImg.destroy();
  8059. xGame.common.screenImg = null;
  8060. }
  8061. }
  8062. }
  8063. UIVideoShare.uiName = "UIVideoShare";
  8064. class ui_UITips extends fgui.GComponent {
  8065. static createInstance() {
  8066. return (fgui.UIPackage.createObject("game", "UITips"));
  8067. }
  8068. onConstruct() {
  8069. this.n0 = (this.getChild("n0"));
  8070. this.myNode = (this.getChild("myNode"));
  8071. this.t0 = this.getTransition("t0");
  8072. }
  8073. }
  8074. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8075. class UITips extends UIBase {
  8076. constructor() {
  8077. super();
  8078. this.type = 0;
  8079. }
  8080. onConstructor() {
  8081. this.ui = ui_UITips.createInstance();
  8082. this.contentPane = this.ui;
  8083. this.isEject = false;
  8084. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8085. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8086. }
  8087. show(tipsTxt, womanTxt, type) {
  8088. super.show();
  8089. this.ui.t0.play();
  8090. this.ui.myNode.tipsTxt.text = tipsTxt;
  8091. this.ui.myNode.womanTxt.text = womanTxt;
  8092. PlatMgr.showInsert(true);
  8093. this.ui.myNode.c1.selectedIndex = type;
  8094. this.type = type;
  8095. switch (this.type) {
  8096. case TipsType.exitGame:
  8097. xGame.common.gameMgr.gamePause = true;
  8098. break;
  8099. case TipsType.foul:
  8100. Laya.timer.once(200, this, () => {
  8101. xGame.common.gameMgr.gamePause = true;
  8102. });
  8103. break;
  8104. default:
  8105. break;
  8106. }
  8107. }
  8108. clickLeftBtn() {
  8109. this.hide();
  8110. xGame.common.gameMgr.gamePause = false;
  8111. switch (this.type) {
  8112. case TipsType.exitGame:
  8113. break;
  8114. case TipsType.foul:
  8115. break;
  8116. default:
  8117. break;
  8118. }
  8119. }
  8120. clickRightBtn() {
  8121. this.hide();
  8122. switch (this.type) {
  8123. case TipsType.exitGame:
  8124. xGame.eventMgr.event(RESET_GAME);
  8125. xGame.uiMgr.Show(UIMain);
  8126. Moyu.recordEnd(this, null);
  8127. xGame.common.longHelpLine = false;
  8128. break;
  8129. case TipsType.foul:
  8130. xGame.common.gameMgr.gamePause = false;
  8131. Laya.timer.clearAll(this);
  8132. break;
  8133. default:
  8134. break;
  8135. }
  8136. }
  8137. }
  8138. UITips.uiName = "UITips";
  8139. class GameMgr {
  8140. constructor() {
  8141. this.selfCamp = "";
  8142. this.selfFoulNum = 0;
  8143. this.selfBallArr = [];
  8144. this.selfTimer = 0;
  8145. this.selfScore = 0;
  8146. this.aiCamp = "";
  8147. this.aiFoulNum = 0;
  8148. this.aiBallArr = [];
  8149. this.aiTimer = 0;
  8150. this.aiScore = 0;
  8151. this.aiSkillLevelNum = 1;
  8152. this.targertScore = 0;
  8153. this.setTime = 30;
  8154. this.selfTurnRate = 0.5;
  8155. this.accTime = 0;
  8156. this.curFoul = "";
  8157. this.maxFoulTimes = 3;
  8158. this.isFirstInGame = true;
  8159. this.firstColliObj = null;
  8160. this.inHoleBalls = [];
  8161. this.blackNum = 8;
  8162. this.success = false;
  8163. this.holePosList = [];
  8164. this.posObj = {};
  8165. this._selfTurn = false;
  8166. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8167. this.ensureBallType = false;
  8168. this.isOpenBall = true;
  8169. this.finishOneShoot = true;
  8170. this.isEnd = false;
  8171. this.isChangeTurn = false;
  8172. this.isInterrupt = false;
  8173. this.aiPlayedBreakArmy = false;
  8174. this.isTouchedBall = false;
  8175. this.finishBalls = 0;
  8176. this.needBalls = 0;
  8177. this.allBallNum = 0;
  8178. this.placeBallPosData = {};
  8179. this.curHP = 0;
  8180. this.showLongView = false;
  8181. this.firstShoot = true;
  8182. this._gamePause = false;
  8183. this.trunCount = 0;
  8184. this.isBlackInHole = false;
  8185. this.isEnter = true;
  8186. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8187. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8188. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8189. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8190. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8191. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8192. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8193. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8194. }
  8195. get gamePause() {
  8196. return this._gamePause;
  8197. }
  8198. set gamePause(v) {
  8199. if (v) {
  8200. Laya.physicsTimer.pause();
  8201. }
  8202. else {
  8203. Laya.physicsTimer.resume();
  8204. }
  8205. this._gamePause = v;
  8206. }
  8207. get selfTurn() {
  8208. return this._selfTurn;
  8209. }
  8210. set selfTurn(val) {
  8211. this.trunCount++;
  8212. this._selfTurn = val;
  8213. if (val) {
  8214. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8215. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8216. }
  8217. else {
  8218. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8219. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8220. if (this.trunCount > 1)
  8221. PlatMgr.openBox();
  8222. }
  8223. }
  8224. resetGame() {
  8225. this.inHoleBalls = [];
  8226. this.isFirstInGame = true;
  8227. this.firstColliObj = null;
  8228. this.aiCamp = "";
  8229. this.selfCamp = "";
  8230. this.aiFoulNum = 0;
  8231. this.selfFoulNum = 0;
  8232. this.selfBallArr = [];
  8233. this.aiBallArr = [];
  8234. this.gamePause = false;
  8235. this.ensureBallType = false;
  8236. this.isInterrupt = false;
  8237. this.updateLeftBall();
  8238. this.clearTime();
  8239. this.aiPlayedBreakArmy = false;
  8240. this.isBlackInHole = false;
  8241. this.placeBallPosData = {};
  8242. if (xGame.common.d3World.knifeRoot) {
  8243. xGame.common.d3World.knifeRoot.destroyChildren();
  8244. }
  8245. }
  8246. gameReady() {
  8247. this.trunCount = 0;
  8248. this.firstColliObj = null;
  8249. this.isFirstInGame = true;
  8250. this.selfTurn = Math.random() <= this.selfTurnRate;
  8251. let challengeNum = DataMgr.getChallengeTimes();
  8252. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8253. this.selfTurn = true;
  8254. }
  8255. if (xGame.common.gameMode == GameMode.placeBall)
  8256. this.selfTurn = true;
  8257. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8258. this.selfTurn = true;
  8259. }
  8260. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8261. this.checkGuide();
  8262. if (xGame.common.uiRodMethod)
  8263. xGame.common.uiRodMethod.resetRod();
  8264. xGame.common.d2World.getHelpLine();
  8265. this.isOpenBall = true;
  8266. this.isTouchedBall = false;
  8267. xGame.common.aiPlayer.stopRun();
  8268. this.setTime = 30;
  8269. let ui = xGame.common.gameUI.ui;
  8270. switch (xGame.common.gameMode) {
  8271. case GameMode.classic:
  8272. xGame.common.aiPlayer.init();
  8273. this.blackNum = 8;
  8274. this.placeRootBall();
  8275. this.peoplePlay(9, 10);
  8276. ui.wordsBtn.visible = true;
  8277. ui.aiWordsBtn.visible = true;
  8278. xGame.common.talkMgr.changeAIState(true);
  8279. DataMgr.gameData.gameCount++;
  8280. DataMgr.saveGameData();
  8281. break;
  8282. case GameMode.bigMove:
  8283. this.blackNum = -1;
  8284. this.selfScore = 0;
  8285. this.aiScore = 0;
  8286. xGame.common.aiPlayer.init();
  8287. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8288. this.updateSelfScore();
  8289. this.updateAIScore();
  8290. this.updateTargetSroce();
  8291. this.placeRootBall();
  8292. this.peoplePlay(9, 10);
  8293. ui.wordsBtn.visible = true;
  8294. ui.aiWordsBtn.visible = true;
  8295. xGame.common.talkMgr.changeAIState(true);
  8296. if (DataMgr.getSkillGuide() < 1)
  8297. DataMgr.gameData.gameCount = 0;
  8298. else {
  8299. DataMgr.gameData.gameCount++;
  8300. DataMgr.saveGameData();
  8301. PlatMgr.openTry();
  8302. }
  8303. if (xGame.common.d3World.knifeRoot) {
  8304. xGame.common.d3World.knifeRoot.destroyChildren();
  8305. }
  8306. break;
  8307. case GameMode.placeBall:
  8308. this.blackNum = -1;
  8309. this.selfTurn = true;
  8310. this.setTime = 10000;
  8311. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8312. this.curHP = this.placeBallData.hp;
  8313. if (this.placeBallData.ball == -1)
  8314. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8315. else
  8316. this.needBalls = this.placeBallData.ball;
  8317. console.log("需要的进球数目", this.needBalls);
  8318. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8319. this.finishBalls = 0;
  8320. this.placeBallPosData = {};
  8321. this.updatePlaceBallPos();
  8322. this.updatePlaceBallState();
  8323. this.finishOneShoot = true;
  8324. xGame.common.gameUI.ui.moveNode.visible = false;
  8325. this.isOpenBall = false;
  8326. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8327. ui.wordsBtn.visible = false;
  8328. ui.aiWordsBtn.visible = false;
  8329. xGame.common.talkMgr.changeAIState(false);
  8330. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8331. PlatMgr.openBox();
  8332. });
  8333. break;
  8334. default:
  8335. break;
  8336. }
  8337. this.showLongView = false;
  8338. xGame.common.wordsMgr.comboTimes = 1;
  8339. let guide = DataMgr.getSkillGuide();
  8340. if (guide)
  8341. xGame.eventMgr.event(WAIT_SHOOT);
  8342. xGame.common.upSkillLevel = false;
  8343. xGame.common.gameStartTime = new Date().getTime();
  8344. this.firstShoot = true;
  8345. }
  8346. checkGuide() {
  8347. let guide = DataMgr.getSkillGuide();
  8348. let gameUI = xGame.common.gameUI.ui;
  8349. gameUI.guide1.visible = false;
  8350. gameUI.guide2.visible = false;
  8351. gameUI.guide3.visible = false;
  8352. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8353. this.selfTurn = true;
  8354. }
  8355. else {
  8356. return;
  8357. }
  8358. let oneBall = this.getOneBall();
  8359. gameUI.guide1.visible = true;
  8360. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8361. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8362. }
  8363. getOneBall() {
  8364. let arr = xGame.common.d2World.ballArr;
  8365. for (let index = 0; index < arr.length; index++) {
  8366. if (arr[index].number == 0)
  8367. continue;
  8368. return arr[index];
  8369. }
  8370. }
  8371. updateSelfScore() {
  8372. let ui = xGame.common.gameUI.ui.topNode;
  8373. ui.selfScoreTxt.text = this.selfScore + "";
  8374. }
  8375. updateAIScore() {
  8376. let ui = xGame.common.gameUI.ui.topNode;
  8377. ui.aiScoreTxt.text = this.aiScore + "";
  8378. }
  8379. updateTargetSroce() {
  8380. let ui = xGame.common.gameUI.ui.topNode;
  8381. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8382. }
  8383. updateLeftBall() {
  8384. let topUI = xGame.common.gameUI.ui.topNode;
  8385. topUI.selfBallList.numItems = this.selfBallArr.length;
  8386. topUI.aiBallList.numItems = this.aiBallArr.length;
  8387. }
  8388. ballShoot() {
  8389. this.clearTime();
  8390. this.finishOneShoot = false;
  8391. xGame.common.gameUI.ui.moveNode.visible = false;
  8392. if (xGame.common.gameUI.ui.guideNode.visible) {
  8393. xGame.common.gameUI.ui.guideNode.visible = false;
  8394. }
  8395. if (this.firstShoot) {
  8396. this.firstShoot = false;
  8397. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8398. }
  8399. }
  8400. ensureCamp(number) {
  8401. this.ensureBallType = true;
  8402. this.isOpenBall = false;
  8403. if (xGame.common.gameMode != GameMode.classic)
  8404. return;
  8405. let full = [1, 2, 3, 4, 5, 6, 7];
  8406. let flower = [9, 10, 11, 12, 13, 14, 15];
  8407. let sayWords = "";
  8408. if (this.selfTurn) {
  8409. if (number <= 7) {
  8410. this.selfCamp = ballCamp.full;
  8411. this.selfBallArr = full;
  8412. this.aiCamp = ballCamp.flower;
  8413. this.aiBallArr = flower;
  8414. sayWords = cfgTable.wordsData[3].msg;
  8415. }
  8416. else {
  8417. this.selfCamp = ballCamp.flower;
  8418. this.selfBallArr = flower;
  8419. this.aiCamp = ballCamp.full;
  8420. this.aiBallArr = full;
  8421. sayWords = cfgTable.wordsData[4].msg;
  8422. }
  8423. }
  8424. else {
  8425. if (number <= 7) {
  8426. this.selfCamp = ballCamp.flower;
  8427. this.selfBallArr = flower;
  8428. this.aiCamp = ballCamp.full;
  8429. this.aiBallArr = full;
  8430. sayWords = cfgTable.wordsData[2].msg;
  8431. }
  8432. else {
  8433. this.selfCamp = ballCamp.full;
  8434. this.selfBallArr = full;
  8435. this.aiCamp = ballCamp.flower;
  8436. this.aiBallArr = flower;
  8437. sayWords = cfgTable.wordsData[1].msg;
  8438. }
  8439. }
  8440. this.updateLeftBall();
  8441. xGame.uiMgr.Show(UIMsg, sayWords);
  8442. }
  8443. updatePlaceBallState() {
  8444. let ui = xGame.common.gameUI.ui;
  8445. switch (this.placeBallData.type) {
  8446. case PlaceBallType.normal:
  8447. let normal = ui.placeNormalNode;
  8448. normal.hpTxt.text = this.curHP + "";
  8449. this.updatePlaceBallStar(normal);
  8450. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8451. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8452. break;
  8453. case PlaceBallType.challenge:
  8454. let challenge = ui.placeChallengeNode;
  8455. challenge.hpTxt.text = "Shots:" + this.curHP;
  8456. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8457. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8458. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8459. break;
  8460. default:
  8461. break;
  8462. }
  8463. }
  8464. playSubHpAni() {
  8465. let ui = xGame.common.gameUI.ui;
  8466. switch (this.placeBallData.type) {
  8467. case PlaceBallType.normal:
  8468. let normal = ui.placeNormalNode;
  8469. normal.hpTxt.visible = false;
  8470. normal.starAni.c1.selectedIndex = 1;
  8471. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8472. normal.hpTxt.visible = true;
  8473. normal.starAni.c1.selectedIndex = 0;
  8474. }));
  8475. break;
  8476. default:
  8477. break;
  8478. }
  8479. }
  8480. getEndStarNum() {
  8481. let num;
  8482. let level = xGame.common.placeBallCurLevel;
  8483. if (this.curHP == this.placeBallData.hp) {
  8484. num = 3;
  8485. }
  8486. else if (this.curHP <= 1) {
  8487. num = 1;
  8488. }
  8489. else {
  8490. num = 2;
  8491. }
  8492. if (!this.success) {
  8493. num = 0;
  8494. }
  8495. else {
  8496. DataMgr.setPlaceBallLevel(level, num);
  8497. }
  8498. let myType = cfgTable.placeballData[level].type;
  8499. if (this.success && myType == 1) {
  8500. num = 3;
  8501. }
  8502. xGame.common.placeBallStarNum = num;
  8503. }
  8504. updatePlaceBallStar(node) {
  8505. let star = 0;
  8506. if (this.curHP == this.placeBallData.hp) {
  8507. star = 3;
  8508. }
  8509. else if (this.curHP >= 2) {
  8510. star = 2;
  8511. }
  8512. else if (this.curHP == 1) {
  8513. star = 1;
  8514. }
  8515. else {
  8516. star = 0;
  8517. }
  8518. let temp;
  8519. for (let index = 1; index <= 3; index++) {
  8520. temp = node["star" + index];
  8521. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8522. }
  8523. node.myProgress.value = (star / 3) * 100;
  8524. }
  8525. openRegretView(isFoul, GoalNum, challenge = false) {
  8526. let regretType = -1;
  8527. if (isFoul) {
  8528. regretType = 1;
  8529. }
  8530. else {
  8531. if (GoalNum <= 0) {
  8532. regretType = 0;
  8533. }
  8534. }
  8535. if (challenge) {
  8536. regretType = 1;
  8537. }
  8538. if (regretType != -1) {
  8539. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8540. if (success) {
  8541. this.curHP++;
  8542. this.updatePlaceBallState();
  8543. this.setPlaceBallAllPos();
  8544. xGame.common.gameUI.ui.moveNode.visible = false;
  8545. }
  8546. else {
  8547. if (this.curHP <= 0) {
  8548. this.success = false;
  8549. this.gameEnd();
  8550. }
  8551. this.playSubHpAni();
  8552. }
  8553. this.updatePlaceBallState();
  8554. this.updatePlaceBallPos();
  8555. });
  8556. }
  8557. }
  8558. setPlaceBallAllPos() {
  8559. let allBall = xGame.common.d2World.ballArr;
  8560. let cfgArr = this.placeBallPosData;
  8561. let temp;
  8562. let obj;
  8563. for (let index = 0; index < allBall.length; index++) {
  8564. temp = allBall[index];
  8565. if (temp.destroyed)
  8566. continue;
  8567. obj = cfgArr[temp.myUNID];
  8568. if (obj && obj.src && !obj.src.destroyed) {
  8569. temp.gameObj.x = obj.posX;
  8570. temp.gameObj.y = obj.posY;
  8571. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  8572. }
  8573. }
  8574. xGame.common.d2World.getHelpLine();
  8575. }
  8576. updatePlaceBallPos() {
  8577. let arr = xGame.common.d2World.ballArr;
  8578. let temp;
  8579. for (let index = 0; index < arr.length; index++) {
  8580. temp = arr[index];
  8581. if (!this.placeBallPosData[temp.myUNID]) {
  8582. this.placeBallPosData[temp.myUNID] = {
  8583. src: temp,
  8584. posX: temp.gameObj.x,
  8585. posY: temp.gameObj.y
  8586. };
  8587. }
  8588. else {
  8589. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  8590. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  8591. }
  8592. }
  8593. let check;
  8594. for (const key in this.placeBallPosData) {
  8595. check = this.placeBallPosData[key];
  8596. if (check.src.destroyed) {
  8597. delete this.placeBallPosData[key];
  8598. }
  8599. }
  8600. }
  8601. gameRun(type) {
  8602. if (this.gamePause)
  8603. return;
  8604. this.curFoul = this.getFoulType();
  8605. if (type) {
  8606. xGame.common.d2World.d2Gan.shoot();
  8607. xGame.common.gameUI.forceCancel();
  8608. this.curFoul = type;
  8609. }
  8610. this.isEnd = false;
  8611. this.isChangeTurn = true;
  8612. if (xGame.common.gameMode == GameMode.classic) {
  8613. this.judgeClassic(this.curFoul);
  8614. this.checkClassicWords(() => {
  8615. xGame.common.destroyClassicEmotion();
  8616. if (this.isEnd) {
  8617. if (this.isBlackInHole) {
  8618. xGame.common.gameUI.ui.blackAni.visible = true;
  8619. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  8620. xGame.common.gameUI.ui.blackAni.visible = false;
  8621. this.gameEnd();
  8622. }));
  8623. }
  8624. else {
  8625. this.gameEnd();
  8626. }
  8627. }
  8628. else {
  8629. this.waitShoot();
  8630. xGame.eventMgr.event(WAIT_SHOOT);
  8631. }
  8632. });
  8633. }
  8634. else if (xGame.common.gameMode == GameMode.bigMove) {
  8635. xGame.common.aiPlayer.stopRun();
  8636. let scoreArr = this.getScore(this.curFoul);
  8637. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  8638. this.isEnd = true;
  8639. }
  8640. this.checkBigSkillWords(() => {
  8641. if (this.isEnd) {
  8642. this.gameEnd();
  8643. }
  8644. else {
  8645. this.waitShoot();
  8646. xGame.eventMgr.event(WAIT_SHOOT);
  8647. }
  8648. });
  8649. }
  8650. else if (xGame.common.gameMode == GameMode.placeBall) {
  8651. xGame.common.destroyAwardSpine();
  8652. let isFoul = this.curFoul == FoulType.rootHole;
  8653. let GoalNum = this.inHoleBalls.length;
  8654. if (this.inHoleBalls.indexOf(0) > -1)
  8655. GoalNum -= 1;
  8656. if (isFoul) {
  8657. this.placeRootBall();
  8658. }
  8659. console.log("neeballs", this.needBalls);
  8660. console.log("当前完成的goalNum", GoalNum);
  8661. this.finishBalls += GoalNum;
  8662. console.log("当前完成的finishballs", this.finishBalls);
  8663. let need = this.needBalls;
  8664. if (this.placeBallData.type == PlaceBallType.challenge) {
  8665. need += 100;
  8666. }
  8667. if (this.finishBalls >= need) {
  8668. this.success = true;
  8669. this.gameEnd();
  8670. }
  8671. else {
  8672. switch (this.placeBallData.type) {
  8673. case PlaceBallType.normal:
  8674. if (!isFoul && GoalNum > 0) {
  8675. this.updatePlaceBallPos();
  8676. this.updatePlaceBallState();
  8677. }
  8678. else {
  8679. this.curHP--;
  8680. this.openRegretView(isFoul, GoalNum);
  8681. }
  8682. this.waitShoot();
  8683. xGame.eventMgr.event(WAIT_SHOOT);
  8684. break;
  8685. case PlaceBallType.challenge:
  8686. this.curHP--;
  8687. this.updatePlaceBallState();
  8688. if (isFoul) {
  8689. this.openRegretView(isFoul, GoalNum, true);
  8690. }
  8691. else {
  8692. this.updatePlaceBallPos();
  8693. if (this.curHP <= 0) {
  8694. this.success = true;
  8695. this.gameEnd();
  8696. }
  8697. }
  8698. this.waitShoot();
  8699. xGame.eventMgr.event(WAIT_SHOOT);
  8700. break;
  8701. default:
  8702. break;
  8703. }
  8704. }
  8705. }
  8706. }
  8707. checkClassicWords(callback) {
  8708. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  8709. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  8710. let type = this.getClassicWordsType();
  8711. if (condition && type != -1) {
  8712. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  8713. xGame.soundMgr.playSound(str);
  8714. xGame.common.wordsMgr.playClassicWords(type, callback);
  8715. }
  8716. else {
  8717. Laya.timer.once(300, this, () => {
  8718. callback && callback();
  8719. });
  8720. }
  8721. }
  8722. getClassicWordsType() {
  8723. let d2world = xGame.common.d2World;
  8724. let type = -1;
  8725. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  8726. type = ClassicWordsType.perfectShow;
  8727. return type;
  8728. }
  8729. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  8730. type = ClassicWordsType.directShoot;
  8731. return type;
  8732. }
  8733. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  8734. type = ClassicWordsType.anotherShoot;
  8735. return type;
  8736. }
  8737. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  8738. type = ClassicWordsType.bigPower;
  8739. return type;
  8740. }
  8741. let minSpeed = 1;
  8742. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  8743. type = ClassicWordsType.hardShoot;
  8744. return type;
  8745. }
  8746. if (this.inHoleBalls.length > 0) {
  8747. type = ClassicWordsType.directShoot;
  8748. return type;
  8749. }
  8750. return type;
  8751. }
  8752. checkBigSkillWords(callback) {
  8753. if (this.curFoul == FoulType.timeOut) {
  8754. callback && callback();
  8755. }
  8756. else {
  8757. let playSkill = false;
  8758. if (this.selfTurn) {
  8759. playSkill = true;
  8760. }
  8761. else {
  8762. if (!this.aiPlayedBreakArmy) {
  8763. this.aiPlayedBreakArmy = true;
  8764. playSkill = true;
  8765. }
  8766. if (this.aiCurSkill != SkillType.breakArmy) {
  8767. playSkill = true;
  8768. }
  8769. }
  8770. if (xGame.common.skillMgr.playedLastSkill) {
  8771. xGame.common.skillMgr.playedLastSkill = false;
  8772. playSkill = false;
  8773. }
  8774. if (playSkill) {
  8775. xGame.common.skillMgr.runBigSkill((extraScore) => {
  8776. let selfExtra = 0;
  8777. let aiExtra = 0;
  8778. if (this.selfTurn)
  8779. selfExtra += extraScore;
  8780. else
  8781. aiExtra += extraScore;
  8782. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  8783. this.isEnd = true;
  8784. }
  8785. this.playBigSkillTimes(callback);
  8786. });
  8787. }
  8788. else {
  8789. this.playBigSkillTimes(callback);
  8790. }
  8791. }
  8792. }
  8793. playBigSkillTimes(callback) {
  8794. let length = this.inHoleBalls.length;
  8795. if (this.inHoleBalls.indexOf(0) > -1) {
  8796. length = this.inHoleBalls.length - 1;
  8797. }
  8798. if (length <= 0) {
  8799. callback && callback();
  8800. return;
  8801. }
  8802. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  8803. callback && callback();
  8804. });
  8805. }
  8806. playSkillTips() {
  8807. let levelNum = 0;
  8808. let curType;
  8809. if (this.selfTurn) {
  8810. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  8811. curType = this.selfCurSkill;
  8812. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8813. levelNum += 5;
  8814. }
  8815. }
  8816. else {
  8817. levelNum = this.aiSkillLevelNum;
  8818. curType = this.aiCurSkill;
  8819. }
  8820. let str = ``;
  8821. switch (curType) {
  8822. case SkillType.highSpace:
  8823. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8824. break;
  8825. case SkillType.breakArmy:
  8826. str = `You pocketed ${levelNum} extra balls`;
  8827. break;
  8828. case SkillType.ice:
  8829. str = `${levelNum * 2} extra balls were frozen`;
  8830. break;
  8831. case SkillType.fireworks:
  8832. str = `${levelNum} extra balls exploded `;
  8833. break;
  8834. case SkillType.GuanYu:
  8835. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8836. break;
  8837. default:
  8838. break;
  8839. }
  8840. xGame.uiMgr.Show(UIMsg, str);
  8841. }
  8842. getFoulType() {
  8843. let foulType = "";
  8844. if (this.firstColliObj == null) {
  8845. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8846. return FoulType.rootHole;
  8847. }
  8848. return FoulType.notTouch;
  8849. }
  8850. else {
  8851. if (this.selfTurn) {
  8852. if (this.selfBallArr.length > 0) {
  8853. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8854. foulType = FoulType.wrongTouch;
  8855. }
  8856. }
  8857. else {
  8858. if (this.ensureBallType) {
  8859. }
  8860. else {
  8861. if (this.firstColliObj == this.blackNum) {
  8862. foulType = FoulType.wrongTouch;
  8863. }
  8864. }
  8865. }
  8866. }
  8867. else {
  8868. if (this.aiBallArr.length > 0) {
  8869. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8870. foulType = FoulType.wrongTouch;
  8871. }
  8872. }
  8873. else {
  8874. if (this.ensureBallType) {
  8875. }
  8876. else {
  8877. if (this.firstColliObj == this.blackNum) {
  8878. foulType = FoulType.wrongTouch;
  8879. }
  8880. }
  8881. }
  8882. }
  8883. if (this.inHoleBalls.length <= 0) {
  8884. return foulType;
  8885. }
  8886. let temp;
  8887. if (this.inHoleBalls.indexOf(0) > -1) {
  8888. foulType = FoulType.rootHole;
  8889. }
  8890. else {
  8891. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8892. temp = this.inHoleBalls[index];
  8893. if (this.selfTurn) {
  8894. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8895. foulType = FoulType.wrongHole;
  8896. break;
  8897. }
  8898. }
  8899. else {
  8900. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8901. foulType = FoulType.wrongHole;
  8902. break;
  8903. }
  8904. }
  8905. }
  8906. }
  8907. let foo;
  8908. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8909. temp = this.inHoleBalls[index];
  8910. foo = this.selfBallArr.indexOf(temp);
  8911. if (foo > -1) {
  8912. this.selfBallArr.splice(foo, 1);
  8913. }
  8914. foo = this.aiBallArr.indexOf(temp);
  8915. if (foo > -1) {
  8916. this.aiBallArr.splice(foo, 1);
  8917. }
  8918. }
  8919. this.updateLeftBall();
  8920. }
  8921. return foulType;
  8922. }
  8923. judgeGameEndByBlack(arr) {
  8924. if (this.selfTurn) {
  8925. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8926. this.selfFoulNum = this.maxFoulTimes;
  8927. return true;
  8928. }
  8929. }
  8930. else {
  8931. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8932. this.aiFoulNum = this.maxFoulTimes;
  8933. return true;
  8934. }
  8935. }
  8936. }
  8937. judgeClassic(type) {
  8938. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8939. xGame.common.aiPlayer.stopRun();
  8940. if (this.judgeNormalSuccess()) {
  8941. this.isEnd = true;
  8942. return;
  8943. }
  8944. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8945. if (this.selfTurn) {
  8946. if (isFoul) {
  8947. this.selfFoulNum++;
  8948. }
  8949. if (this.selfFoulNum >= this.maxFoulTimes) {
  8950. this.success = false;
  8951. this.isEnd = true;
  8952. return;
  8953. }
  8954. }
  8955. else {
  8956. if (isFoul)
  8957. this.aiFoulNum++;
  8958. if (this.aiFoulNum >= this.maxFoulTimes) {
  8959. this.success = true;
  8960. this.isEnd = true;
  8961. return;
  8962. }
  8963. }
  8964. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8965. this.isChangeTurn = false;
  8966. }
  8967. else {
  8968. this.isInterrupt = true;
  8969. }
  8970. }
  8971. waitShoot() {
  8972. if (xGame.common.gameMode == GameMode.classic) {
  8973. switch (this.curFoul) {
  8974. case FoulType.timeOut:
  8975. case FoulType.rootHole:
  8976. this.selfTurn = !this.selfTurn;
  8977. this.peoplePlay(5, 6, true);
  8978. break;
  8979. case FoulType.notTouch:
  8980. this.selfTurn = !this.selfTurn;
  8981. this.peoplePlay(7, 7);
  8982. break;
  8983. case FoulType.wrongHole:
  8984. this.selfTurn = !this.selfTurn;
  8985. this.peoplePlay(11, 11);
  8986. break;
  8987. default:
  8988. if (this.inHoleBalls.length > 0) {
  8989. this.peoplePlay(0, 0, false, false);
  8990. }
  8991. else {
  8992. this.selfTurn = !this.selfTurn;
  8993. this.peoplePlay(7, 7);
  8994. }
  8995. break;
  8996. }
  8997. }
  8998. else if (xGame.common.gameMode == GameMode.bigMove) {
  8999. if (this.curFoul == FoulType.timeOut) {
  9000. this.selfTurn = !this.selfTurn;
  9001. this.peoplePlay(14, 15);
  9002. this.placeRootBall();
  9003. }
  9004. else {
  9005. this.selfTurn = !this.selfTurn;
  9006. if (this.curFoul == FoulType.rootHole) {
  9007. this.peoplePlay(12, 13);
  9008. this.placeRootBall();
  9009. }
  9010. else {
  9011. this.peoplePlay(0, 0, false, false);
  9012. }
  9013. }
  9014. }
  9015. else if (xGame.common.gameMode == GameMode.placeBall) {
  9016. this.finishOneShoot = true;
  9017. }
  9018. this.gameResult();
  9019. }
  9020. gameResult() {
  9021. this.firstColliObj = null;
  9022. this.inHoleBalls = [];
  9023. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9024. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9025. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9026. if (xGame.common.uiRodMethod)
  9027. xGame.common.uiRodMethod.resetRod();
  9028. xGame.common.d2World.rootBall.showSelf();
  9029. this.clearIceSkill();
  9030. if (this.selfTurn) {
  9031. PlatMgr.gameInsert();
  9032. }
  9033. xGame.common.d3World.knifeRoot.destroyChildren();
  9034. if (this.selfTurn) {
  9035. xGame.common.gameUI.showHelpLineGuide();
  9036. xGame.common.gameUI.setTurnAlpha(true);
  9037. }
  9038. else {
  9039. xGame.common.gameUI.setTurnAlpha(false);
  9040. }
  9041. }
  9042. getScore(type) {
  9043. let selfAdd = 0;
  9044. let aiAdd = 0;
  9045. if (type == FoulType.timeOut) {
  9046. if (this.selfTurn)
  9047. aiAdd += 3;
  9048. else
  9049. selfAdd += 3;
  9050. }
  9051. else {
  9052. if (this.inHoleBalls.length > 0) {
  9053. if (this.selfTurn) {
  9054. if (type == FoulType.rootHole) {
  9055. aiAdd += 3;
  9056. if (this.inHoleBalls.length - 1 > 0) {
  9057. selfAdd += this.inHoleBalls.length - 1;
  9058. }
  9059. }
  9060. else {
  9061. selfAdd += this.inHoleBalls.length;
  9062. }
  9063. }
  9064. else {
  9065. if (type == FoulType.rootHole) {
  9066. selfAdd += 3;
  9067. if (this.inHoleBalls.length - 1 > 0) {
  9068. aiAdd += this.inHoleBalls.length - 1;
  9069. }
  9070. }
  9071. else {
  9072. aiAdd += this.inHoleBalls.length;
  9073. }
  9074. }
  9075. }
  9076. }
  9077. return [selfAdd, aiAdd];
  9078. }
  9079. judgeScoreEnd(selfAdd, aiAdd) {
  9080. this.selfScore += selfAdd;
  9081. this.aiScore += aiAdd;
  9082. this.updateAIScore();
  9083. this.updateSelfScore();
  9084. if (this.selfScore >= this.targertScore) {
  9085. this.success = true;
  9086. return true;
  9087. }
  9088. if (this.aiScore >= this.targertScore) {
  9089. this.success = false;
  9090. return true;
  9091. }
  9092. let ballArr = xGame.common.d2World.ballArr;
  9093. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9094. if (this.selfScore > this.aiScore) {
  9095. this.success = true;
  9096. return true;
  9097. }
  9098. else if (this.selfScore < this.aiScore) {
  9099. this.success = false;
  9100. return true;
  9101. }
  9102. else {
  9103. if (this.selfTurn) {
  9104. this.success = false;
  9105. }
  9106. else {
  9107. this.success = true;
  9108. }
  9109. return true;
  9110. }
  9111. }
  9112. }
  9113. clearIceSkill() {
  9114. let arr = xGame.common.d2World.ballArr;
  9115. let temp;
  9116. if (this.selfTurn) {
  9117. if (this.selfCurSkill == SkillType.ice) {
  9118. for (let index = 0; index < arr.length; index++) {
  9119. temp = arr[index];
  9120. if (temp.ballFunc == "ice") {
  9121. temp.setBallFunc("normal", "self");
  9122. }
  9123. }
  9124. }
  9125. }
  9126. else {
  9127. if (this.aiCurSkill == SkillType.ice) {
  9128. for (let index = 0; index < arr.length; index++) {
  9129. temp = arr[index];
  9130. if (temp.ballFunc == "ice") {
  9131. temp.setBallFunc("normal", "ai");
  9132. }
  9133. }
  9134. }
  9135. }
  9136. }
  9137. judgeNormalSuccess() {
  9138. if (this.selfTurn) {
  9139. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9140. this.success = true;
  9141. return true;
  9142. }
  9143. }
  9144. else {
  9145. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9146. this.success = false;
  9147. return true;
  9148. }
  9149. }
  9150. }
  9151. gameEnd() {
  9152. if (Moyu.isTT) {
  9153. xGame.common.screenImg = getScreenImg();
  9154. }
  9155. console.log("游戏结束", this.success);
  9156. xGame.common.aiPlayer.stopRun();
  9157. if (xGame.common.gameMode == GameMode.placeBall) {
  9158. this.getEndStarNum();
  9159. this.updatePlaceBallState();
  9160. }
  9161. this.isEnter = false;
  9162. Moyu.recordEnd(this, () => {
  9163. if (this.isEnter)
  9164. return;
  9165. this.isEnter = true;
  9166. console.log("进入录结束回调");
  9167. this.enterNext();
  9168. });
  9169. Laya.timer.once(1000, this, () => {
  9170. if (this.isEnter)
  9171. return;
  9172. this.isEnter = true;
  9173. this.enterNext();
  9174. });
  9175. xGame.common.longHelpLine = false;
  9176. }
  9177. enterNext() {
  9178. Laya.timer.clearAll(this);
  9179. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9180. xGame.uiMgr.Show(UIVideoShare, this.success);
  9181. }
  9182. else {
  9183. xGame.uiMgr.Show(UIGameEnd, this.success);
  9184. }
  9185. }
  9186. aiLeave() {
  9187. let ui = xGame.common.gameUI.ui;
  9188. ui.topNode.aiNameTxt.text = "offline";
  9189. }
  9190. aiGameEnd(suc) {
  9191. this.success = suc;
  9192. xGame.common.aiPlayer.stopRun();
  9193. if (this.success) {
  9194. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9195. Laya.timer.once(1000, this, () => {
  9196. this.clearTime();
  9197. this.gameEnd();
  9198. });
  9199. }
  9200. }
  9201. openTimer() {
  9202. let src = xGame.common.gameUI;
  9203. if (this.selfTurn) {
  9204. src.ui.topNode.selfProgress.visible = true;
  9205. src.ui.topNode.aiProgress.visible = false;
  9206. this.curTimer = src.ui.topNode.selfProgress;
  9207. }
  9208. else {
  9209. src.ui.topNode.selfProgress.visible = false;
  9210. src.ui.topNode.aiProgress.visible = true;
  9211. this.curTimer = src.ui.topNode.aiProgress;
  9212. }
  9213. this.accTime = 0;
  9214. Laya.timer.clearAll(this);
  9215. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9216. this.curTimer.value = 100;
  9217. }
  9218. updateTime(dt) {
  9219. if (this.gamePause)
  9220. return;
  9221. this.accTime += dt;
  9222. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9223. if (this.accTime >= this.setTime) {
  9224. this.clearTime();
  9225. console.log("时钟进入了gameRun");
  9226. this.gameRun(FoulType.timeOut);
  9227. }
  9228. }
  9229. clearTime() {
  9230. let src = xGame.common.gameUI;
  9231. src.ui.topNode.selfProgress.visible = false;
  9232. src.ui.topNode.aiProgress.visible = false;
  9233. Laya.timer.clearAll(this);
  9234. }
  9235. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9236. let ui = xGame.common.gameUI.ui;
  9237. let selfMsg, aiMsg;
  9238. if (sayWords) {
  9239. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9240. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9241. if (Foul) {
  9242. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9243. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9244. this.placeRootBall();
  9245. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9246. if (this.curFoul == FoulType.rootHole) {
  9247. if (!DataMgr.getRootBallFoul()) {
  9248. DataMgr.setRootBallFoul();
  9249. aiMsg = "";
  9250. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9251. let woman = "Boss, pay attention next time~";
  9252. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9253. }
  9254. }
  9255. else if (this.curFoul == FoulType.timeOut) {
  9256. if (!DataMgr.getTimeoutFoul()) {
  9257. DataMgr.setTimeoutFoul();
  9258. aiMsg = "";
  9259. let tips = "Game timeout, 3 fouls, this game failed.";
  9260. let woman = "Boss, pay attention to the timeline~";
  9261. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9262. }
  9263. }
  9264. }
  9265. }
  9266. }
  9267. if (this.selfTurn) {
  9268. if (sayWords) {
  9269. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9270. ui.selfTurn.visible = true;
  9271. ui.aiTurn.visible = false;
  9272. ui.selfTurn.t0.play();
  9273. Moyu.vibration();
  9274. });
  9275. }
  9276. }
  9277. else {
  9278. let aiNum = xGame.tools.random(1, 11);
  9279. let challengeNum = DataMgr.getChallengeTimes();
  9280. let delay = false;
  9281. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9282. aiNum = 9;
  9283. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9284. aiNum = 3;
  9285. if (challengeNum == 3) {
  9286. if (!this.showLongView) {
  9287. this.showLongView = true;
  9288. delay = true;
  9289. }
  9290. }
  9291. }
  9292. }
  9293. if (delay) {
  9294. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9295. if (success) {
  9296. xGame.common.longHelpLine = true;
  9297. xGame.common.d2World.getHelpLine();
  9298. }
  9299. else {
  9300. aiNum = 10;
  9301. }
  9302. xGame.common.aiPlayer.setAiLevel(aiNum);
  9303. if (sayWords) {
  9304. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9305. xGame.common.aiPlayer.runAI();
  9306. ui.selfTurn.visible = false;
  9307. ui.aiTurn.visible = true;
  9308. ui.aiTurn.t0.play();
  9309. });
  9310. }
  9311. else {
  9312. xGame.common.aiPlayer.runAI();
  9313. }
  9314. this.openTimer();
  9315. this.finishOneShoot = true;
  9316. if (this.selfTurn) {
  9317. ui.topNode.selfKuang.visible = true;
  9318. ui.topNode.aiKuang.visible = false;
  9319. ui.topNode.selfTips.visible = true;
  9320. ui.topNode.aiTips.visible = false;
  9321. }
  9322. else {
  9323. ui.topNode.selfKuang.visible = false;
  9324. ui.topNode.aiKuang.visible = true;
  9325. ui.topNode.selfTips.visible = false;
  9326. ui.topNode.aiTips.visible = true;
  9327. }
  9328. });
  9329. return;
  9330. }
  9331. if (xGame.common.gameMode == GameMode.classic) {
  9332. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9333. if (cfg) {
  9334. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9335. aiNum = aiLevel;
  9336. }
  9337. }
  9338. xGame.common.aiPlayer.setAiLevel(aiNum);
  9339. if (sayWords) {
  9340. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9341. xGame.common.aiPlayer.runAI();
  9342. ui.selfTurn.visible = false;
  9343. ui.aiTurn.visible = true;
  9344. ui.aiTurn.t0.play();
  9345. });
  9346. }
  9347. else {
  9348. xGame.common.aiPlayer.runAI();
  9349. }
  9350. }
  9351. this.openTimer();
  9352. this.finishOneShoot = true;
  9353. if (this.selfTurn) {
  9354. ui.topNode.selfKuang.visible = true;
  9355. ui.topNode.aiKuang.visible = false;
  9356. ui.topNode.selfTips.visible = true;
  9357. ui.topNode.aiTips.visible = false;
  9358. }
  9359. else {
  9360. ui.topNode.selfKuang.visible = false;
  9361. ui.topNode.aiKuang.visible = true;
  9362. ui.topNode.selfTips.visible = false;
  9363. ui.topNode.aiTips.visible = true;
  9364. }
  9365. }
  9366. placeRootBall() {
  9367. let rootBall = xGame.common.d2World.rootBall;
  9368. if (!rootBall)
  9369. return;
  9370. rootBall.gameObj.x = this.lastRootBallPos.x;
  9371. rootBall.gameObj.y = this.lastRootBallPos.y;
  9372. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9373. let moveNode = xGame.common.gameUI.ui.moveNode;
  9374. moveNode.visible = true;
  9375. moveNode.x = this.lastRootBallPos.x;
  9376. moveNode.y = this.lastRootBallPos.y;
  9377. if (!this.selfTurn) {
  9378. xGame.common.aiPlayer.resetRoot();
  9379. }
  9380. }
  9381. }
  9382. class ui_guanyuAni extends fgui.GComponent {
  9383. static createInstance() {
  9384. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9385. }
  9386. onConstruct() {
  9387. this.n0 = (this.getChild("n0"));
  9388. }
  9389. }
  9390. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9391. class UIFireworks extends UIBase {
  9392. constructor() {
  9393. super();
  9394. }
  9395. onConstructor() {
  9396. this.isEject = false;
  9397. }
  9398. show(callback) {
  9399. super.show();
  9400. }
  9401. }
  9402. UIFireworks.uiName = "UIFireworks";
  9403. class ui_UIGuanYu extends fgui.GComponent {
  9404. static createInstance() {
  9405. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9406. }
  9407. onConstruct() {
  9408. this.n2 = (this.getChild("n2"));
  9409. this.n1 = (this.getChild("n1"));
  9410. this.n3 = (this.getChild("n3"));
  9411. this.n4 = (this.getChild("n4"));
  9412. this.n5 = (this.getChild("n5"));
  9413. this.n6 = (this.getChild("n6"));
  9414. this.n8 = (this.getChild("n8"));
  9415. this.n7 = (this.getChild("n7"));
  9416. this.t0 = this.getTransition("t0");
  9417. }
  9418. }
  9419. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9420. class UIGuanYu extends UIBase {
  9421. constructor() {
  9422. super();
  9423. }
  9424. onConstructor() {
  9425. this.ui = ui_UIGuanYu.createInstance();
  9426. this.contentPane = this.ui;
  9427. this.isEject = false;
  9428. }
  9429. show(callback) {
  9430. super.show();
  9431. this.ui.t0.play(Laya.Handler.create(this, () => {
  9432. callback && callback();
  9433. this.hide();
  9434. }));
  9435. }
  9436. }
  9437. UIGuanYu.uiName = "UIGuanYu";
  9438. class SkillMgr {
  9439. constructor() {
  9440. this.leveNum = 0;
  9441. this.extraScore = 0;
  9442. this.selfTurn = false;
  9443. this.playedLastSkill = false;
  9444. this.tweenArr = [];
  9445. this._finishNum = 0;
  9446. this._curFinish = 0;
  9447. this._rootX = 0;
  9448. this._rootY = 0;
  9449. this.knifeTimes = 0;
  9450. this.knifeV2 = new Laya.Vector2();
  9451. this.knifeV3 = new Laya.Vector3();
  9452. this.rtStarX = 0;
  9453. this.rtStarY = 0;
  9454. this.addBigSkillSpine();
  9455. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9456. }
  9457. addBigSkillSpine() {
  9458. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9459. console.log("extra2 success");
  9460. });
  9461. }
  9462. runBigSkill(callback) {
  9463. this.tweenArr = [];
  9464. this.callback = callback;
  9465. this.judgeSkill();
  9466. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9467. let guide = DataMgr.getSkillGuide();
  9468. if (!xGame.common.gameMgr.selfTurn) {
  9469. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9470. }
  9471. else {
  9472. if (xGame.common.temSelfLevel != 0) {
  9473. this.leveNum = xGame.common.temSelfLevel;
  9474. }
  9475. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9476. this.leveNum += 5;
  9477. }
  9478. }
  9479. if (guide == 0) {
  9480. DataMgr.setSkillGuide(1);
  9481. if (DataMgr.getNewUser()) {
  9482. Moyu.sendDataEvent("gameFirstPlay");
  9483. DataMgr.setNewUser();
  9484. }
  9485. }
  9486. this.playSpineAni(() => {
  9487. switch (this.curSkill) {
  9488. case SkillType.highSpace:
  9489. this.runHighSpace();
  9490. break;
  9491. case SkillType.breakArmy:
  9492. this.runBreakArmy();
  9493. break;
  9494. case SkillType.ice:
  9495. this.runIce();
  9496. break;
  9497. case SkillType.fireworks:
  9498. this.runFireworks();
  9499. break;
  9500. case SkillType.GuanYu:
  9501. this.runGuanYu();
  9502. break;
  9503. default:
  9504. break;
  9505. }
  9506. });
  9507. }
  9508. judgeSkill() {
  9509. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9510. let gameMgr = xGame.common.gameMgr;
  9511. let type;
  9512. for (let index = 0; index < typeArr.length; index++) {
  9513. type = typeArr[index];
  9514. if (gameMgr.selfTurn) {
  9515. if (gameMgr.selfCurSkill == type) {
  9516. this.selfTurn = true;
  9517. this.curSkill = type;
  9518. return;
  9519. }
  9520. }
  9521. else {
  9522. if (gameMgr.aiCurSkill == type) {
  9523. this.selfTurn = false;
  9524. this.curSkill = type;
  9525. return;
  9526. }
  9527. }
  9528. }
  9529. }
  9530. playSpineAni(callback) {
  9531. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9532. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9533. parent.destroyChildren();
  9534. let aniIndex = 0;
  9535. let skillSpine;
  9536. switch (this.curSkill) {
  9537. case SkillType.highSpace:
  9538. aniIndex = 1;
  9539. xGame.soundMgr.playSound("skill01");
  9540. skillSpine = this.skillSpine2;
  9541. data.scaleX = 0.5;
  9542. data.scaleY = 0.5;
  9543. skillSpine.play(data, 1, false, parent, () => {
  9544. callback && callback();
  9545. });
  9546. break;
  9547. case SkillType.breakArmy:
  9548. aniIndex = 2;
  9549. xGame.soundMgr.playSound("skill02");
  9550. skillSpine = this.skillSpine2;
  9551. data.scaleX = 0.5;
  9552. data.scaleY = 0.5;
  9553. skillSpine.play(data, 2, false, parent, () => {
  9554. callback && callback();
  9555. });
  9556. break;
  9557. case SkillType.ice:
  9558. aniIndex = 0;
  9559. xGame.soundMgr.playSound("skill03");
  9560. skillSpine = this.skillSpine2;
  9561. data.scaleX = 0.5;
  9562. data.scaleY = 0.5;
  9563. skillSpine.play(data, 0, false, parent, () => {
  9564. callback && callback();
  9565. });
  9566. break;
  9567. case SkillType.fireworks:
  9568. xGame.soundMgr.playSound("skill_04_01");
  9569. xGame.soundMgr.playSound("skill04");
  9570. xGame.uiMgr.Show(UIFireworks, callback);
  9571. break;
  9572. case SkillType.GuanYu:
  9573. xGame.soundMgr.playSound("skill05_1");
  9574. xGame.soundMgr.playSound("skill05");
  9575. xGame.uiMgr.Show(UIGuanYu, callback);
  9576. break;
  9577. default:
  9578. break;
  9579. }
  9580. }
  9581. getAllBallArr() {
  9582. let arr = xGame.common.d2World.ballArr;
  9583. let outArr = [];
  9584. for (let index = 0; index < arr.length; index++) {
  9585. if (arr[index] instanceof D2RootBallSrc)
  9586. continue;
  9587. if (arr[index].ballFunc == "ice")
  9588. continue;
  9589. if (arr[index].destroyed)
  9590. continue;
  9591. outArr.push(arr[index]);
  9592. }
  9593. return outArr;
  9594. }
  9595. getOneArr(deletObj) {
  9596. let allArr = this.getAllBallArr();
  9597. let temp;
  9598. for (let index = 0; index < allArr.length; index++) {
  9599. temp = allArr[index];
  9600. if (temp.id == deletObj.id) {
  9601. allArr.splice(index, 1);
  9602. break;
  9603. }
  9604. }
  9605. return allArr;
  9606. }
  9607. getNearBallBag(ball) {
  9608. let ui = xGame.common.gameUI.ui;
  9609. let circleArr = [];
  9610. for (let index = 1; index <= 6; index++) {
  9611. circleArr.push(ui.border["circle" + index]);
  9612. }
  9613. let outIndex = 0;
  9614. let temp;
  9615. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  9616. ;
  9617. let dis = 0;
  9618. for (let index = 1; index < circleArr.length; index++) {
  9619. temp = circleArr[index];
  9620. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  9621. if (dis < min) {
  9622. min = dis;
  9623. outIndex = index;
  9624. }
  9625. }
  9626. return [circleArr[outIndex], outIndex];
  9627. }
  9628. ballFlyToBag(ballArr, time = 300) {
  9629. let temp;
  9630. let hole;
  9631. this._finishNum = ballArr.length;
  9632. this._curFinish = 0;
  9633. let holeObj = {};
  9634. let holeCfg = {
  9635. "1": 0,
  9636. "2": 0,
  9637. "3": 0,
  9638. "4": 0,
  9639. "5": 0,
  9640. "6": 0
  9641. };
  9642. for (let index = 0; index < ballArr.length; index++) {
  9643. temp = ballArr[index];
  9644. temp.outColli.isSensor = true;
  9645. temp.innerColli.isSensor = true;
  9646. temp.isRunSkillAni = true;
  9647. let holeArr = this.getNearBallBag(temp);
  9648. hole = holeArr[0];
  9649. holeObj[index] = holeArr[1];
  9650. temp.d3BallSrc.scaleXYZ = 0.5;
  9651. this.tweenArr.push(temp.d3BallSrc, temp);
  9652. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9653. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  9654. }));
  9655. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  9656. let mIndex = holeObj[this._curFinish];
  9657. let isDone = holeCfg[mIndex];
  9658. if (isDone) {
  9659. ballArr[this._curFinish].checkWrongBall(false);
  9660. }
  9661. else {
  9662. holeCfg[mIndex] = 1;
  9663. ballArr[this._curFinish].checkWrongBall();
  9664. }
  9665. this._curFinish++;
  9666. if (this._curFinish >= this._finishNum) {
  9667. if (this.curSkill == SkillType.highSpace) {
  9668. }
  9669. else if (this.curSkill == SkillType.breakArmy) {
  9670. let rootBall = xGame.common.d2World.rootBall;
  9671. rootBall.gameObj.x = this._rootX;
  9672. rootBall.gameObj.y = this._rootY;
  9673. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9674. xGame.common.d2World.d2Gan.ui.visible = true;
  9675. xGame.common.d2World.d2HelpLine.ui.visible = true;
  9676. xGame.common.d2World.getHelpLine();
  9677. this.callback && this.callback(this.extraScore);
  9678. }
  9679. }
  9680. }));
  9681. }
  9682. }
  9683. runHighSpace() {
  9684. let rootBall = xGame.common.d2World.rootBall;
  9685. rootBall.showSelf();
  9686. let d3Src = rootBall.d3BallSrc;
  9687. let allArr = this.getAllBallArr();
  9688. if (allArr.length <= 0) {
  9689. this.callback && this.callback(0);
  9690. return;
  9691. }
  9692. let selectBall = xGame.common.d2World.targetBall;
  9693. let wrong = selectBall && selectBall.destroyed;
  9694. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  9695. selectBall = xGame.common.getRandArrEle(allArr);
  9696. }
  9697. let targetD3Src = selectBall.d3BallSrc;
  9698. xGame.common.d2World.d2Gan.ui.visible = false;
  9699. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9700. d3Src.scaleXYZ = 0.5;
  9701. this.tweenArr.push(d3Src);
  9702. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9703. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9704. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  9705. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  9706. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  9707. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  9708. let outArr = [selectBall];
  9709. let other = this.leveNum - 1;
  9710. if (other > 0) {
  9711. let nearArr = this.getOneArr(selectBall);
  9712. if (nearArr.length > 0) {
  9713. xGame.common.botherArr(nearArr);
  9714. if (other >= nearArr.length)
  9715. other = nearArr.length;
  9716. for (let index = 0; index < other; index++) {
  9717. outArr.push(nearArr[index]);
  9718. }
  9719. }
  9720. }
  9721. xGame.common.extraMoveNum = other + 1;
  9722. this.extraScore = other + 1;
  9723. this._rootX = selectBall.gameObj.x;
  9724. this._rootY = selectBall.gameObj.y;
  9725. rootBall.gameObj.x = this._rootX;
  9726. rootBall.gameObj.y = this._rootY;
  9727. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9728. Laya.Tween.clearAll(d3Src);
  9729. this.addRandomForce(outArr);
  9730. }));
  9731. }));
  9732. }
  9733. addRandomForce(outArr) {
  9734. if (outArr.length > 0) {
  9735. xGame.common.d2World.openCheckStill = true;
  9736. this.playedLastSkill = true;
  9737. }
  9738. let temp;
  9739. for (let index = 0; index < outArr.length; index++) {
  9740. let angle = xGame.common.randomNum(0, 360);
  9741. let linearPercent = xGame.common.randomNum(65, 100);
  9742. temp = outArr[index];
  9743. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  9744. }
  9745. }
  9746. setLinearSpeed(angle, rigy, linearPercent) {
  9747. let sin = Math.sin(angle * Math.PI / 180);
  9748. let cos = Math.cos(angle * Math.PI / 180);
  9749. let maxSpeed = 4;
  9750. let speed = new Laya.Vector2();
  9751. speed.x = maxSpeed * linearPercent * sin;
  9752. speed.y = -maxSpeed * linearPercent * cos;
  9753. rigy.applyLinearImpulseToCenter(speed);
  9754. }
  9755. runBreakArmy() {
  9756. xGame.common.d2World.d2Gan.ui.visible = false;
  9757. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9758. let gameUI = xGame.common.gameUI.ui;
  9759. gameUI.skillRod.visible = true;
  9760. gameUI.skillRod.rotation = 110;
  9761. let outArr = this.getAllBallArr();
  9762. if (outArr.length <= 0) {
  9763. gameUI.skillRod.visible = false;
  9764. this.callback && this.callback(0);
  9765. return;
  9766. }
  9767. xGame.common.botherArr(outArr);
  9768. if (this.leveNum >= outArr.length)
  9769. this.leveNum = outArr.length;
  9770. let deleteNum = outArr.length - this.leveNum;
  9771. outArr.splice(0, deleteNum);
  9772. this.extraScore = this.leveNum;
  9773. let potX = gameUI.skillRod.x;
  9774. let potY = gameUI.skillRod.y;
  9775. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  9776. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  9777. let disArr = [];
  9778. for (let index = 0; index < outArr.length; index++) {
  9779. let obj = outArr[index];
  9780. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  9781. dis = Math.pow(dis, 0.5);
  9782. disArr.push(dis);
  9783. }
  9784. this.tweenArr.push(gameUI.skillRod);
  9785. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9786. })).update = Laya.Handler.create(this, (e, t, c) => {
  9787. let angle = gameUI.skillRod.rotation;
  9788. let xx;
  9789. let yy;
  9790. let temp;
  9791. for (let index = 0; index < outArr.length; index++) {
  9792. temp = outArr[index];
  9793. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  9794. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  9795. yy -= 20;
  9796. temp.gameObj.x = xx;
  9797. temp.gameObj.y = yy;
  9798. temp.d3BallSrc.setTransPos(xx, yy);
  9799. }
  9800. if (angle <= 60) {
  9801. Laya.Tween.clearAll(gameUI.skillRod);
  9802. this.ballFlyToBag(outArr, 150);
  9803. gameUI.skillRod.visible = false;
  9804. }
  9805. }, null, false);
  9806. }
  9807. runIce() {
  9808. let ballArr = xGame.common.d2World.ballArr;
  9809. this.leveNum *= 2;
  9810. if (this.leveNum >= ballArr.length - 1)
  9811. this.leveNum = ballArr.length - 1;
  9812. let tempArr = [];
  9813. let outArr = [];
  9814. for (let index = 0; index < ballArr.length; index++) {
  9815. if (ballArr[index] instanceof D2RootBallSrc)
  9816. continue;
  9817. tempArr.push(ballArr[index]);
  9818. }
  9819. if (tempArr.length <= 0) {
  9820. this.callback && this.callback(0);
  9821. return;
  9822. }
  9823. xGame.common.botherArr(tempArr);
  9824. for (let index = 0; index < this.leveNum; index++) {
  9825. outArr.push(tempArr[index]);
  9826. }
  9827. this.extraScore = this.leveNum;
  9828. let temp;
  9829. for (let index = 0; index < outArr.length; index++) {
  9830. temp = outArr[index];
  9831. temp.d3BallSrc.playIceEft();
  9832. }
  9833. Laya.timer.once(2000, this, () => {
  9834. for (let index = 0; index < outArr.length; index++) {
  9835. temp = outArr[index];
  9836. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9837. temp.setBallFunc("ice", str);
  9838. }
  9839. this.callback && this.callback(0);
  9840. });
  9841. }
  9842. runFireworks() {
  9843. let allArr = this.getAllBallArr();
  9844. if (allArr.length <= 0) {
  9845. this.callback && this.callback(0);
  9846. return;
  9847. }
  9848. xGame.common.d2World.d2Gan.ui.visible = false;
  9849. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9850. let outArr = [];
  9851. let other = this.leveNum;
  9852. if (other > 0) {
  9853. if (allArr.length > 0) {
  9854. xGame.common.botherArr(allArr);
  9855. if (other >= allArr.length)
  9856. other = allArr.length;
  9857. for (let index = 0; index < other; index++) {
  9858. outArr.push(allArr[index]);
  9859. }
  9860. }
  9861. }
  9862. xGame.common.extraMoveNum = other;
  9863. this.extraScore = other;
  9864. this.addRandmomFireworks(outArr);
  9865. }
  9866. addRandmomFireworks(outArr) {
  9867. Laya.timer.once(1100, this, () => {
  9868. if (outArr.length > 0) {
  9869. xGame.common.d2World.openCheckStill = true;
  9870. this.playedLastSkill = true;
  9871. }
  9872. });
  9873. xGame.soundMgr.playSound("skill_04_02");
  9874. let temp;
  9875. let delay = -200;
  9876. for (let index = 0; index < outArr.length; index++) {
  9877. temp = outArr[index];
  9878. delay += 200;
  9879. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9880. let angle = xGame.common.randomNum(0, 360);
  9881. angle = this.getFireworksAngle(obj);
  9882. let linearPercent = xGame.common.randomNum(45, 80);
  9883. if (!obj.destroyed)
  9884. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9885. });
  9886. }
  9887. }
  9888. getFireworksAngle(obj) {
  9889. let rootBall = xGame.common.d2World.rootBall;
  9890. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9891. }
  9892. resetGame() {
  9893. Laya.timer.clearAll(this);
  9894. if (this.tweenArr) {
  9895. for (let index = 0; index < this.tweenArr.length; index++) {
  9896. Laya.Tween.clearAll(this.tweenArr[index]);
  9897. }
  9898. }
  9899. this.tweenArr = null;
  9900. }
  9901. runGuanYu() {
  9902. xGame.common.d2World.d2Gan.ui.visible = false;
  9903. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9904. let rootBall = xGame.common.d2World.rootBall;
  9905. if (rootBall.isInHole) {
  9906. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9907. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9908. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9909. rootBall.showSelf();
  9910. }
  9911. this.rtStarX = rootBall.gameObj.x;
  9912. this.rtStarY = rootBall.gameObj.y;
  9913. this.knifeTimes = 0;
  9914. this.playedLastSkill = true;
  9915. rootBall.forceRun = true;
  9916. rootBall.rigy.type = "static";
  9917. xGame.common.d2World.openCheckStill = true;
  9918. this.guanyuRandomKnife();
  9919. }
  9920. guanyuRandomKnife() {
  9921. let rootBall = xGame.common.d2World.rootBall;
  9922. let dir = this.getRandDir();
  9923. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9924. console.log("当前angle", angle);
  9925. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9926. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9927. let dis = 324;
  9928. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9929. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9930. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9931. this.rtStarX = rootBall.gameObj.x;
  9932. this.rtStarY = rootBall.gameObj.y;
  9933. this.knifeTimes++;
  9934. let skillLevel;
  9935. if (xGame.common.gameMgr.selfTurn) {
  9936. skillLevel = DataMgr.getBigSkillByIndex(4);
  9937. }
  9938. else {
  9939. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9940. }
  9941. if (!skillLevel)
  9942. skillLevel = 1;
  9943. skillLevel += 2;
  9944. if (this.knifeTimes < skillLevel) {
  9945. Laya.timer.once(400, this, () => {
  9946. this.guanyuRandomKnife();
  9947. });
  9948. }
  9949. else {
  9950. rootBall.forceRun = false;
  9951. rootBall.rigy.type = "dynamic";
  9952. xGame.common.extraMoveNum = skillLevel;
  9953. }
  9954. }));
  9955. }
  9956. getRandDir() {
  9957. let rootBall = xGame.common.d2World.rootBall;
  9958. let allBall = this.getAllBallArr();
  9959. let target = xGame.common.getRandArrEle(allBall);
  9960. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9961. return this.knifeV2;
  9962. }
  9963. cloneKnife(x, y, rotation) {
  9964. let parent = xGame.common.d3World.knifeRoot;
  9965. let prefab = xGame.common.d3World.knife;
  9966. let clone = prefab.clone();
  9967. parent.addChild(clone);
  9968. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9969. clone.transform.localPositionX = this.knifeV3.x;
  9970. clone.transform.localPositionY = 0;
  9971. clone.transform.localPositionZ = this.knifeV3.z;
  9972. clone.transform.localRotationEulerX = 0;
  9973. clone.transform.localRotationEulerY = rotation;
  9974. clone.transform.localRotationEulerZ = 0;
  9975. clone.active = true;
  9976. return clone;
  9977. }
  9978. cloneGuanYuEft(x, y, angle) {
  9979. return;
  9980. let parent = xGame.common.gameUI.ui.guanyuNode;
  9981. let eft = new ui_guanyuAni();
  9982. eft.parent = parent;
  9983. eft.x = x;
  9984. eft.y = y;
  9985. eft.rotation = angle;
  9986. }
  9987. }
  9988. class ui_UIWordsList extends fgui.GComponent {
  9989. static createInstance() {
  9990. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9991. }
  9992. onConstruct() {
  9993. this.c1 = this.getController("c1");
  9994. this.n74 = (this.getChild("n74"));
  9995. this.clickNode = (this.getChild("clickNode"));
  9996. this.myNode = (this.getChild("myNode"));
  9997. this.n68 = (this.getChild("n68"));
  9998. this.n66 = (this.getChild("n66"));
  9999. this.n55 = (this.getChild("n55"));
  10000. this.wordsBtn = (this.getChild("wordsBtn"));
  10001. this.emotionBtn = (this.getChild("emotionBtn"));
  10002. this.mybggg = (this.getChild("mybggg"));
  10003. this.wordsList = (this.getChild("wordsList"));
  10004. this.emotionList = (this.getChild("emotionList"));
  10005. this.myRoot = (this.getChild("myRoot"));
  10006. }
  10007. }
  10008. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10009. class EmotionDisplay {
  10010. constructor(index, ui) {
  10011. this.ui = ui;
  10012. this.index = index;
  10013. this.ui.onClick(this, this.clickSelf);
  10014. this.updateSelf();
  10015. }
  10016. updateSelf() {
  10017. let data = cfgTable.emotionData[this.index + 1];
  10018. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10019. }
  10020. clickSelf() {
  10021. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10022. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10023. xGame.common.talkMgr.closeTalkView();
  10024. }
  10025. }
  10026. class WordsDisplay {
  10027. constructor(index, ui) {
  10028. this.ui = ui;
  10029. this.index = index;
  10030. this.ui.onClick(this, this.clickSelf);
  10031. this.updateSelf();
  10032. }
  10033. updateSelf() {
  10034. let data = cfgTable.talkwordsData[this.index + 1];
  10035. this.ui.txt.text = data.msg;
  10036. }
  10037. clickSelf() {
  10038. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10039. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10040. xGame.common.talkMgr.closeTalkView();
  10041. }
  10042. }
  10043. class UIWordsList extends UIBase {
  10044. constructor() {
  10045. super();
  10046. }
  10047. onConstructor() {
  10048. this.ui = ui_UIWordsList.createInstance();
  10049. this.contentPane = this.ui;
  10050. this.isEject = false;
  10051. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10052. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10053. this.addUIClick(this.ui.clickNode, this.hide);
  10054. this.initTalkList();
  10055. this.initEmotionList();
  10056. }
  10057. show() {
  10058. super.show();
  10059. }
  10060. initTalkList() {
  10061. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10062. let data = cfgTable.talkwordsData;
  10063. let length = Object.keys(data).length;
  10064. this.ui.wordsList.numItems = length;
  10065. }
  10066. initEmotionList() {
  10067. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10068. let data = cfgTable.emotionData;
  10069. let length = Object.keys(data).length;
  10070. this.ui.emotionList.numItems = length;
  10071. }
  10072. renderTalkItem(index, obj) {
  10073. let temp = new WordsDisplay(index, obj);
  10074. }
  10075. renderEmotionItem(index, obj) {
  10076. let temp = new EmotionDisplay(index, obj);
  10077. }
  10078. openTalkList() {
  10079. this.ui.c1.selectedIndex = 0;
  10080. }
  10081. openEmotionList() {
  10082. this.ui.c1.selectedIndex = 1;
  10083. }
  10084. }
  10085. UIWordsList.uiName = "UIWordsList";
  10086. class TalkMgr {
  10087. constructor() {
  10088. this.aiSpeak = true;
  10089. this.emotionList = [];
  10090. this.talkList = [];
  10091. this.addEvent();
  10092. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10093. this.emotionList = [];
  10094. this.talkList = [];
  10095. for (let k in cfgTable.emotionData) {
  10096. this.emotionList.push(cfgTable.emotionData[k].id);
  10097. }
  10098. for (let k in cfgTable.talkwordsData) {
  10099. this.talkList.push(cfgTable.talkwordsData[k].id);
  10100. }
  10101. }
  10102. addEvent() {
  10103. let ui = xGame.common.gameUI.ui;
  10104. ui.wordsBtn.visible = true;
  10105. ui.wordsBtn.onClick(this, this.openTalkView);
  10106. ui.aiWordsBtn.visible = true;
  10107. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10108. }
  10109. openTalkView() {
  10110. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10111. xGame.uiMgr.Show(UIWordsList);
  10112. }
  10113. closeTalkView() {
  10114. xGame.uiMgr.Hide(UIWordsList);
  10115. }
  10116. clickAIState() {
  10117. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10118. this.aiSpeak = !this.aiSpeak;
  10119. this.changeAIState(this.aiSpeak);
  10120. }
  10121. changeAIState(speak) {
  10122. this.aiSpeak = speak;
  10123. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10124. if (speak) {
  10125. btn.c1.selectedIndex = 0;
  10126. }
  10127. else {
  10128. btn.c1.selectedIndex = 1;
  10129. }
  10130. }
  10131. showSelfTalk(wordsId) {
  10132. let ui = xGame.common.gameUI.ui;
  10133. ui.selfTalk.visible = true;
  10134. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10135. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10136. ui.selfTalk.t0.play();
  10137. }
  10138. showSelfEmotion(emotionId) {
  10139. let ui = xGame.common.gameUI.ui;
  10140. ui.selfTalk.visible = true;
  10141. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10142. this.selfSpine && this.selfSpine.dispose();
  10143. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10144. let spineData = cfgTable.emotionData[emotionId].spine;
  10145. this.selfSpine = new SpineMgr(spineData, () => {
  10146. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10147. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10148. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10149. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10150. });
  10151. ui.selfTalk.t0.play();
  10152. }
  10153. showAITalk(wordsId) {
  10154. if (!this.aiSpeak)
  10155. return;
  10156. if (DataMgr.gameData.gameCount < 2)
  10157. return;
  10158. if (wordsId < 1)
  10159. wordsId = this.getRandTalk();
  10160. let ui = xGame.common.gameUI.ui;
  10161. ui.aiTalk.visible = true;
  10162. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10163. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10164. ui.aiTalk.t0.play();
  10165. }
  10166. getRandTalk() {
  10167. let rand = xGame.tools.random(0, this.talkList.length);
  10168. return this.emotionList[rand];
  10169. }
  10170. getRandEmotion() {
  10171. let rand = xGame.tools.random(0, this.emotionList.length);
  10172. return this.emotionList[rand];
  10173. }
  10174. showAIEmotion(emotionId) {
  10175. if (!this.aiSpeak)
  10176. return;
  10177. if (DataMgr.gameData.gameCount < 2)
  10178. return;
  10179. if (emotionId < 1)
  10180. emotionId = this.getRandEmotion();
  10181. let ui = xGame.common.gameUI.ui;
  10182. ui.aiTalk.visible = true;
  10183. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10184. this.aiSpine && this.aiSpine.dispose();
  10185. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10186. let spineData = cfgTable.emotionData[emotionId].spine;
  10187. this.aiSpine = new SpineMgr(spineData, () => {
  10188. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10189. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10190. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10191. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10192. });
  10193. ui.aiTalk.t0.play();
  10194. }
  10195. resetGame() {
  10196. let ui = xGame.common.gameUI.ui;
  10197. ui.aiTalk.visible = false;
  10198. ui.selfTalk.visible = false;
  10199. this.aiSpine && this.aiSpine.dispose();
  10200. this.selfSpine && this.selfSpine.dispose();
  10201. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10202. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10203. this.closeTalkView();
  10204. }
  10205. }
  10206. class WordsMgr {
  10207. constructor() {
  10208. this.comboTimes = 1;
  10209. this.skillTimes = 0;
  10210. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10211. this.comboSpine = new SpineMgr("yxz_liangan");
  10212. this.skillSpine = new SpineMgr("yiganxqiu");
  10213. this.scoreSpine = new SpineMgr("defen");
  10214. }
  10215. setClassicCombo(isInterrupt) {
  10216. if (isInterrupt) {
  10217. this.comboTimes = 0;
  10218. }
  10219. }
  10220. playClassicWords(type, callback) {
  10221. this.callback = callback;
  10222. let aniIndex = type;
  10223. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10224. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10225. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10226. mySpine.destroy(true);
  10227. this.playClassicTimes();
  10228. });
  10229. }
  10230. playClassicTimes() {
  10231. this.comboTimes++;
  10232. if (this.comboTimes <= 1) {
  10233. this.callback && this.callback();
  10234. }
  10235. else {
  10236. let aniIndex = this.comboTimes - 1;
  10237. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10238. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10239. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10240. mySpine.destroy(true);
  10241. this.callback && this.callback();
  10242. });
  10243. }
  10244. }
  10245. playBigSkillTimes(times, callback) {
  10246. if (times <= 0) {
  10247. callback && callback();
  10248. return;
  10249. }
  10250. this.callback = callback;
  10251. let pre = "sz_0";
  10252. let aniIndex = 0;
  10253. this.getWordsImg(times, pre, () => {
  10254. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10255. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10256. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10257. let r1 = ``;
  10258. let r2 = ``;
  10259. if (times <= 9) {
  10260. r1 = `res/d2Res/${pre}${times}.png`;
  10261. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10262. aniIndex = 0;
  10263. }
  10264. else {
  10265. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10266. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10267. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10268. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10269. aniIndex = 1;
  10270. }
  10271. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10272. mySpine.destroy(true);
  10273. xGame.common.gameMgr.playSkillTips();
  10274. this.playScore(times);
  10275. xGame.common.playRandomMutiBallBigSkillSound();
  10276. }, mySpine);
  10277. });
  10278. }
  10279. playScore(score) {
  10280. let pre = "sz_";
  10281. let aniIndex = 0;
  10282. this.getWordsImg(score, pre, () => {
  10283. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10284. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10285. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10286. let r1 = ``;
  10287. let r2 = ``;
  10288. if (score <= 9) {
  10289. r1 = `res/d2Res/${pre}${score}.png`;
  10290. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10291. aniIndex = 0;
  10292. }
  10293. else {
  10294. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10295. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10296. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10297. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10298. aniIndex = 1;
  10299. }
  10300. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10301. mySpine.destroy(true);
  10302. this.callback && this.callback();
  10303. }, mySpine);
  10304. });
  10305. }
  10306. getWordsImg(number, pre = "", callback) {
  10307. let arr = [];
  10308. if (number <= 9) {
  10309. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10310. }
  10311. else {
  10312. 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 });
  10313. }
  10314. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10315. callback && callback();
  10316. }));
  10317. }
  10318. }
  10319. class ui_UIRodMethod extends fgui.GComponent {
  10320. static createInstance() {
  10321. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10322. }
  10323. onConstruct() {
  10324. this.n24 = (this.getChild("n24"));
  10325. this.white = (this.getChild("white"));
  10326. this.dot = (this.getChild("dot"));
  10327. this.sureBtn = (this.getChild("sureBtn"));
  10328. this.n20 = (this.getChild("n20"));
  10329. this.n21 = (this.getChild("n21"));
  10330. this.n22 = (this.getChild("n22"));
  10331. this.n23 = (this.getChild("n23"));
  10332. this.n5 = (this.getChild("n5"));
  10333. this.n14 = (this.getChild("n14"));
  10334. this.t0 = this.getTransition("t0");
  10335. }
  10336. }
  10337. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10338. class UIRodMethod extends UIBase {
  10339. constructor() {
  10340. super();
  10341. this.isPressd = false;
  10342. }
  10343. onConstructor() {
  10344. this.ui = ui_UIRodMethod.createInstance();
  10345. this.contentPane = this.ui;
  10346. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10347. this.moveDir = new Laya.Vector2();
  10348. this.moveDest = new Laya.Vector2();
  10349. this.centerPos = new Laya.Vector2();
  10350. xGame.common.uiRodMethod = this;
  10351. }
  10352. show() {
  10353. super.show();
  10354. xGame.common.gameMgr.gamePause = true;
  10355. this.openPressDotEvent();
  10356. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10357. this.centerPos.x = this.ui.white.x;
  10358. this.centerPos.y = this.ui.white.y;
  10359. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10360. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10361. this.setDot();
  10362. }
  10363. setDot() {
  10364. this.ui.dot.x = this.moveDest.x;
  10365. this.ui.dot.y = this.moveDest.y;
  10366. }
  10367. closeSelf() {
  10368. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10369. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10370. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10371. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10372. xGame.common.gameMgr.gamePause = false;
  10373. this.hide();
  10374. }
  10375. openPressDotEvent() {
  10376. this.closePressDotEvent();
  10377. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10378. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10379. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10380. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10381. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10382. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10383. }
  10384. closePressDotEvent() {
  10385. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10386. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10387. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10388. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10389. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10390. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10391. }
  10392. onDown(e) {
  10393. if (e.type == Laya.Event.MOUSE_DOWN)
  10394. this.isPressd = true;
  10395. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10396. this.isPressd = false;
  10397. if (!this.isPressd)
  10398. return;
  10399. this.moveDest.x = e.stageX;
  10400. this.moveDest.y = e.stageY;
  10401. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10402. if (dis > 6724) {
  10403. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10404. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10405. }
  10406. this.setDot();
  10407. }
  10408. resetRod() {
  10409. this.ui.dot.x = this.ui.white.x;
  10410. this.ui.dot.y = this.ui.white.y;
  10411. this.gameRod.dot.x = this.gameRod.bg.x;
  10412. this.gameRod.dot.y = this.gameRod.bg.y;
  10413. xGame.common.rodOffest.x = 0;
  10414. xGame.common.rodOffest.y = 0;
  10415. }
  10416. }
  10417. UIRodMethod.uiName = "UIRodMethod";
  10418. class UIGame extends UIBase {
  10419. constructor() {
  10420. super();
  10421. this.powerNum = 0;
  10422. this.isD3Inited = false;
  10423. this.isPrePlay = false;
  10424. this.isMoveRod = false;
  10425. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10426. this.rulerDis = 20;
  10427. this.rulerOffset = 0;
  10428. }
  10429. onConstructor() {
  10430. this.ui = ui_UIGame.createInstance();
  10431. this.contentPane = this.ui;
  10432. this.ui.x += xGame.common.sysOffestNum;
  10433. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10434. this.isEject = false;
  10435. xGame.common.gameUI = this;
  10436. this.initSelf();
  10437. }
  10438. isTurnSelf() {
  10439. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10440. return true;
  10441. }
  10442. }
  10443. initSelf() {
  10444. let topUI = this.ui.topNode;
  10445. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10446. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10447. this.barInfo = {};
  10448. this.barInfo.curY = 0;
  10449. this.barInfo.height = this.ui.powerNode.height;
  10450. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10451. this.barInfo.powerStartY = this.ui.powerNode.y;
  10452. xGame.common.aiPlayer = new AIPlayer();
  10453. xGame.common.gameMgr = new GameMgr();
  10454. xGame.common.skillMgr = new SkillMgr();
  10455. xGame.common.wordsMgr = new WordsMgr();
  10456. xGame.common.talkMgr = new TalkMgr();
  10457. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10458. console.log("加载经典模式表情文件chenggon !");
  10459. });
  10460. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10461. console.log("挑战模式奖励模式spine加载成功!");
  10462. });
  10463. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10464. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10465. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10466. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10467. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10468. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10469. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10470. }
  10471. getGanZiImg() {
  10472. let index = DataMgr.getCurBallRod();
  10473. let data = cfgTable.ballrodData[index + 1];
  10474. let gan_url = xGame.common.getGameIconUrl(data.img);
  10475. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10476. this.ui.powerNode.showImg.url = gan_url;
  10477. console.log('zh:修改杆子图标O K');
  10478. }
  10479. returnHome() {
  10480. let tips = "Are you sure to exit the game?";
  10481. let woman = "Boss, why don't you play for a while longer?";
  10482. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10483. }
  10484. addRodMethodClick() {
  10485. if (this.isTurnSelf()) {
  10486. xGame.uiMgr.Show(UIRodMethod);
  10487. }
  10488. }
  10489. clickHelpLineBtn(force = false) {
  10490. if (!this.isTurnSelf())
  10491. return;
  10492. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10493. if (success) {
  10494. xGame.common.longHelpLine = true;
  10495. xGame.common.d2World.getHelpLine();
  10496. Moyu.sendDataEvent("guideNum");
  10497. }
  10498. else {
  10499. }
  10500. });
  10501. }
  10502. renderSelfDisplayBalls(index, target) {
  10503. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10504. target.myImg.url = xGame.common.getGameIconUrl(str);
  10505. }
  10506. renderAIDisplayBalls(index, target) {
  10507. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10508. target.myImg.url = xGame.common.getGameIconUrl(str);
  10509. ;
  10510. }
  10511. updateMode() {
  10512. if (xGame.common.gameMode == GameMode.classic) {
  10513. this.ui.topNode.scoreNode.visible = false;
  10514. }
  10515. else if (xGame.common.gameMode == GameMode.bigMove) {
  10516. this.ui.topNode.scoreNode.visible = true;
  10517. }
  10518. }
  10519. show() {
  10520. super.show();
  10521. console.log("zh:uigame show AADD");
  10522. this.ui.alpha = 0;
  10523. this.updateSelf();
  10524. xGame.common.gameMgr.gamePause = false;
  10525. xGame.common.gameUI.ui.blackAni.visible = false;
  10526. xGame.common.gameUI.ui.whiteAni.visible = false;
  10527. this.ui.powerEft.visible = false;
  10528. this.ui.colorNode.visible = false;
  10529. this.updateHead();
  10530. let curUse = DataMgr.getCurBallRod();
  10531. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10532. this.getGanZiImg();
  10533. }
  10534. updateSelf() {
  10535. if (xGame.common.gameMode == GameMode.classic) {
  10536. this.ui.c1.selectedIndex = 0;
  10537. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10538. this.ui.topNode.middleNode.visible = true;
  10539. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10540. }
  10541. else if (xGame.common.gameMode == GameMode.bigMove) {
  10542. this.ui.c1.selectedIndex = 0;
  10543. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10544. this.ui.topNode.middleNode.visible = false;
  10545. let max = xGame.cfgMgr.getMaxBigMoveLength();
  10546. let rand = xGame.common.randomNum(1, max);
  10547. let guide = DataMgr.getSkillGuide();
  10548. if (guide == 0)
  10549. rand = 1;
  10550. xGame.common.bigMoveLevelIndex = rand;
  10551. }
  10552. else if (xGame.common.gameMode == GameMode.placeBall) {
  10553. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  10554. this.ui.c1.selectedIndex = 1 + data.type;
  10555. this.ui.alpha = 1;
  10556. this.startGame();
  10557. }
  10558. this.updateMode();
  10559. this.initD3world();
  10560. this.initD2world();
  10561. }
  10562. startGame() {
  10563. this.ui.snowNode.visible = Math.random() <= 0.1;
  10564. this.ui.d2Node.visible = false;
  10565. xGame.common.d3World.d3Hand.gameObj.active = false;
  10566. xGame.common.d3World.tableSrc.init();
  10567. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10568. this.cameraViewChange(() => {
  10569. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  10570. switch (xGame.common.gameMode) {
  10571. case GameMode.classic:
  10572. xGame.common.d3World.d3Hand.gameObj.active = true;
  10573. this.playPutBallD3Ani();
  10574. break;
  10575. case GameMode.bigMove:
  10576. this.enterGame();
  10577. Laya.timer.once(500, this, () => {
  10578. this.ui.topNode.middleNode.visible = true;
  10579. this.ui.topNode.middleNode.t0.play();
  10580. });
  10581. break;
  10582. case GameMode.placeBall:
  10583. this.enterGame();
  10584. break;
  10585. default:
  10586. break;
  10587. }
  10588. });
  10589. PlatMgr.showBanner(false);
  10590. }
  10591. enterGame() {
  10592. this.ui.d2Node.visible = true;
  10593. xGame.common.d3World.d3Hand.gameObj.active = false;
  10594. xGame.common.showOneCamera("mainCamera");
  10595. Moyu.recordGame(30, true);
  10596. if (!this.isPrePlay) {
  10597. this.isPrePlay = true;
  10598. xGame.common.d3World.prePlayEft();
  10599. }
  10600. xGame.common.gameMgr.gameReady();
  10601. this.openAllEvent();
  10602. this.ui.snowNode.visible = false;
  10603. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  10604. this.ui.helpBtn.visible = condition;
  10605. }
  10606. showHelpLineGuide() {
  10607. let longGuide = DataMgr.getGuideHelpLine();
  10608. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  10609. this.ui.helpBtn.visible = true;
  10610. this.ui.guideNode.visible = true;
  10611. }
  10612. }
  10613. setTurnAlpha(alpha) {
  10614. this.ui.keduNode.alpha = alpha;
  10615. this.ui.ganNode.alpha = alpha;
  10616. this.ui.rodMethodNode.alpha = alpha;
  10617. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  10618. }
  10619. cameraViewChange(callback) {
  10620. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10621. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  10622. xGame.common.showOneCamera("visitAngle");
  10623. cameraSrc.localRotationEulerY = 180;
  10624. cameraSrc.localRotationEulerZ = 0;
  10625. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  10626. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  10627. callback && callback();
  10628. }));
  10629. }));
  10630. }
  10631. playPutBallD3Ani() {
  10632. xGame.common.showOneCamera("mainCamera");
  10633. let handSrc = xGame.common.d3World.d3Hand;
  10634. handSrc.gameObj.active = true;
  10635. handSrc.transform.localPositionZ = 3;
  10636. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10637. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  10638. handSrc.gameObj.active = false;
  10639. this.enterGame();
  10640. }), 400);
  10641. }));
  10642. }
  10643. updateHead() {
  10644. let user = Moyu.getUserInfo();
  10645. this.ui.topNode.selfNameTxt.text = user.nickName;
  10646. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  10647. let aiData = xGame.cfgMgr.getRandomUserInfo();
  10648. if (DataMgr.getSkillGuide() < 1) {
  10649. this.ui.topNode.aiNameTxt.text = 'billiards';
  10650. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  10651. }
  10652. else {
  10653. this.ui.topNode.aiNameTxt.text = aiData.name;
  10654. let randNo = Math.floor(Math.random() * 10) + 1;
  10655. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  10656. }
  10657. }
  10658. initD2world() {
  10659. let node = this.ui.d2Root.displayObject;
  10660. let src = node.getComponent(D2World);
  10661. if (!src) {
  10662. xGame.common.d2World = node.addComponent(D2World);
  10663. }
  10664. xGame.common.d2World.initSelf();
  10665. }
  10666. initD3world() {
  10667. if (this.isD3Inited)
  10668. return;
  10669. this.isD3Inited = true;
  10670. let scene3D = xGame.common.d3Scene;
  10671. this.ui.d3Root.displayObject.addChild(scene3D);
  10672. scene3D.active = true;
  10673. xGame.common.d3World.tableSrc.setBorderPos();
  10674. }
  10675. onRootMove(e) {
  10676. let rootBall = xGame.common.d2World.rootBall;
  10677. this.ui.moveNode.x = e.x;
  10678. this.ui.moveNode.y = e.y;
  10679. rootBall.gameObj.x = e.x;
  10680. rootBall.gameObj.y = e.y;
  10681. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  10682. }
  10683. aiRootMove(move) {
  10684. if (move)
  10685. this.hideBallUI();
  10686. else {
  10687. this.showBallUI();
  10688. xGame.common.d2World.getHelpLine();
  10689. }
  10690. }
  10691. aiForce(type, force = 0) {
  10692. this.pressTarget = PressType.powerNode;
  10693. if (type == 1)
  10694. this.onEventUp({ force: true });
  10695. else if (type == 2)
  10696. this.onEventMove({ stageY: force, force: true });
  10697. }
  10698. onEventPress(e) {
  10699. if (e.stopPropagation)
  10700. e.stopPropagation();
  10701. if (!this.isTurnSelf())
  10702. return;
  10703. let target = e.target;
  10704. switch (target) {
  10705. case this.ui.myPowerNode.displayObject:
  10706. this.pressTarget = PressType.powerNode;
  10707. this.barInfo.curY = e.stageY;
  10708. this.updateBarInfo();
  10709. break;
  10710. case this.ui.moveNode.displayObject:
  10711. this.pressTarget = PressType.moveNode;
  10712. this.hideBallUI();
  10713. this.eventObj.curX = this.ui.moveNode.x;
  10714. this.eventObj.curY = this.ui.moveNode.y;
  10715. this.ui.moveNode.finger.visible = false;
  10716. this.eventObj.lastX = e.stageX;
  10717. this.eventObj.lastY = e.stageY;
  10718. break;
  10719. case this.ui.rulerClickNode.displayObject:
  10720. this.pressTarget = PressType.rulerNode;
  10721. this.eventObj.lastY = e.stageY;
  10722. break;
  10723. case this.ui.d2Root.displayObject:
  10724. this.pressTarget = PressType.d2Root;
  10725. this.eventObj.lastX = e.stageX;
  10726. this.eventObj.lastY = e.stageY;
  10727. this.eventObj.starX = e.stageX;
  10728. this.eventObj.starY = e.stageY;
  10729. this.eventObj.curX = 0;
  10730. this.eventObj.curY = 0;
  10731. xGame.common.d2World.d2Gan.setGanLastInfo();
  10732. this.rulerOffset = 0;
  10733. break;
  10734. default:
  10735. break;
  10736. }
  10737. }
  10738. onEventMove(e) {
  10739. if (e.stopPropagation)
  10740. e.stopPropagation();
  10741. if (e && e.force) {
  10742. }
  10743. else {
  10744. if (!this.isTurnSelf())
  10745. return;
  10746. }
  10747. switch (this.pressTarget) {
  10748. case PressType.powerNode:
  10749. this.barInfo.curY = e.stageY;
  10750. this.updateBarInfo();
  10751. this.isMoveRod = true;
  10752. break;
  10753. case PressType.moveNode:
  10754. let rootBall = xGame.common.d2World.rootBall;
  10755. let radius = rootBall.gameObj.width / 2;
  10756. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  10757. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  10758. let border = xGame.common.d2World.borderRect;
  10759. if (curX <= border.x + radius)
  10760. curX = border.x + radius;
  10761. else if (curX >= border.x + border.width - radius)
  10762. curX = border.x + border.width - radius;
  10763. if (curY <= border.y + radius)
  10764. curY = border.y + radius;
  10765. else if (curY >= border.y + border.height - radius)
  10766. curY = border.y + border.height - radius;
  10767. if (xGame.common.gameMgr.isOpenBall) {
  10768. if (curX >= border.x + border.openBallW - radius)
  10769. curX = border.x + border.openBallW - radius;
  10770. }
  10771. this.ui.moveNode.x = curX;
  10772. this.ui.moveNode.y = curY;
  10773. rootBall.gameObj.x = curX;
  10774. rootBall.gameObj.y = curY;
  10775. rootBall.d3BallSrc.setTransPos(curX, curY);
  10776. this.isMoveRod = true;
  10777. break;
  10778. case PressType.rulerNode:
  10779. let yy = e.stageY - this.eventObj.lastY;
  10780. this.eventObj.lastY = e.stageY;
  10781. let ruler1 = this.ui.rulerNode.img1;
  10782. let ruler2 = this.ui.rulerNode.img2;
  10783. ruler1.y += yy;
  10784. ruler2.y += yy;
  10785. this.rulerOffset += yy;
  10786. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  10787. this.rulerOffset = 0;
  10788. xGame.soundMgr.playSound("inch", 1, 10);
  10789. }
  10790. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  10791. let h = ruler1.height;
  10792. this.checkGuide();
  10793. this.isMoveRod = true;
  10794. if (ruler1.y >= h) {
  10795. ruler1.y = -h;
  10796. ruler2.y = 0;
  10797. return;
  10798. }
  10799. else if (ruler1.y <= -h) {
  10800. ruler1.y = h;
  10801. ruler2.y = 0;
  10802. return;
  10803. }
  10804. if (ruler2.y >= h) {
  10805. ruler2.y = -h;
  10806. ruler1.y = 0;
  10807. return;
  10808. }
  10809. else if (ruler2.y <= -h) {
  10810. ruler2.y = h;
  10811. ruler1.y = 0;
  10812. return;
  10813. }
  10814. break;
  10815. case PressType.d2Root:
  10816. this.eventObj.curX = e.stageX;
  10817. this.eventObj.curY = e.stageY;
  10818. let offset = this.checkRodMoveDir();
  10819. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10820. this.eventObj.lastX = e.stageX;
  10821. this.eventObj.lastY = e.stageY;
  10822. break;
  10823. default:
  10824. break;
  10825. }
  10826. }
  10827. onEventUp(e) {
  10828. if (e.stopPropagation)
  10829. e.stopPropagation();
  10830. if (e && e.force) {
  10831. }
  10832. else {
  10833. if (!this.isTurnSelf())
  10834. return;
  10835. }
  10836. switch (this.pressTarget) {
  10837. case PressType.powerNode:
  10838. this.ui.powerNode.value = 0;
  10839. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10840. this.ui.powerTxt.text = "";
  10841. if (this.powerNum > 0) {
  10842. xGame.eventMgr.event(BALL_SHOOT);
  10843. xGame.common.d2World.shoot(this.powerNum);
  10844. xGame.common.d2World.d2Gan.shoot();
  10845. xGame.common.d2World.d2HelpLine.shoot();
  10846. this.finishGuide();
  10847. this.ui.powerEft.visible = false;
  10848. this.ui.colorNode.visible = false;
  10849. let ganStr = "";
  10850. if (this.powerNum <= 30) {
  10851. ganStr = "gan_30";
  10852. }
  10853. else if (this.powerNum <= 60) {
  10854. ganStr = "gan_50";
  10855. }
  10856. else {
  10857. ganStr = "gan_80";
  10858. }
  10859. xGame.soundMgr.playSound(ganStr);
  10860. }
  10861. break;
  10862. case PressType.moveNode:
  10863. let rootBall = xGame.common.d2World.rootBall;
  10864. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10865. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10866. let isIntersect = this.judgeBallIntersect();
  10867. if (isIntersect) {
  10868. this.ui.moveNode.x = lastX;
  10869. this.ui.moveNode.y = lastY;
  10870. rootBall.gameObj.x = lastX;
  10871. rootBall.gameObj.y = lastY;
  10872. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10873. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10874. }
  10875. else {
  10876. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10877. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10878. }
  10879. this.showBallUI();
  10880. this.ui.moveNode.finger.visible = true;
  10881. xGame.common.d2World.getHelpLine();
  10882. break;
  10883. case PressType.rulerNode:
  10884. break;
  10885. case PressType.d2Root:
  10886. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10887. if (dis <= 25) {
  10888. this.moveToClickDot(e);
  10889. }
  10890. break;
  10891. default:
  10892. break;
  10893. }
  10894. this.pressTarget = -1;
  10895. }
  10896. checkGuide() {
  10897. let guide = DataMgr.getSkillGuide();
  10898. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10899. xGame.common.guideStep++;
  10900. xGame.common.gameUI.ui.guide2.visible = false;
  10901. xGame.common.gameUI.ui.guide3.visible = true;
  10902. }
  10903. }
  10904. finishGuide() {
  10905. let guide = DataMgr.getSkillGuide();
  10906. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10907. xGame.common.guideStep = 10;
  10908. this.closeAllGuide();
  10909. console.log('zh: 新手引导完毕');
  10910. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  10911. }
  10912. }
  10913. closeAllGuide() {
  10914. xGame.common.gameUI.ui.guide1.visible = false;
  10915. xGame.common.gameUI.ui.guide2.visible = false;
  10916. xGame.common.gameUI.ui.guide3.visible = false;
  10917. }
  10918. updateBarInfo() {
  10919. let star = this.ui.powerNode.y;
  10920. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10921. if (rate >= 1)
  10922. rate = 1;
  10923. if (rate <= 0)
  10924. rate = 0;
  10925. this.powerNum = Math.ceil(rate * 100);
  10926. this.ui.powerNode.value = this.powerNum;
  10927. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10928. this.ui.colorNode.value = this.powerNum;
  10929. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10930. this.ui.powerEft.visible = this.powerNum != 0;
  10931. this.ui.colorNode.visible = this.powerNum != 0;
  10932. this.ui.powerTxt.text = this.powerNum + "";
  10933. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10934. }
  10935. forceCancel() {
  10936. this.ui.powerNode.value = 0;
  10937. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10938. this.ui.powerTxt.text = "";
  10939. }
  10940. checkRodMoveDir() {
  10941. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10942. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10943. if (tempX >= 0 && tempY <= 0) {
  10944. return this.checkDir();
  10945. }
  10946. else if (tempX < 0 && tempY < 0) {
  10947. return this.checkDir(1, -1);
  10948. }
  10949. else if (tempX < 0 && tempY > 0) {
  10950. return this.checkDir(-1, -1);
  10951. }
  10952. else {
  10953. return this.checkDir(-1, 1);
  10954. }
  10955. }
  10956. checkDir(flagX = 1, flagY = 1) {
  10957. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10958. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10959. if (offsetY == 0) {
  10960. return offsetX * flagX;
  10961. }
  10962. if (offsetX == 0) {
  10963. return offsetY * flagY;
  10964. }
  10965. let angle = offsetY / offsetX;
  10966. if (Math.abs(angle) >= 1) {
  10967. return offsetY * flagY;
  10968. }
  10969. else {
  10970. return offsetX * flagX;
  10971. }
  10972. }
  10973. judgeBallIntersect() {
  10974. let rootBall = xGame.common.d2World.rootBall;
  10975. let ballArr = xGame.common.d2World.ballArr;
  10976. let radius = rootBall.gameObj.width / 2;
  10977. let temp;
  10978. let isIntersect = false;
  10979. for (let index = 0; index < ballArr.length; index++) {
  10980. temp = ballArr[index];
  10981. if (temp.number == rootBall.number)
  10982. continue;
  10983. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10984. if (isIntersect) {
  10985. break;
  10986. }
  10987. }
  10988. return isIntersect;
  10989. }
  10990. hideBallUI() {
  10991. let d2Gan = xGame.common.d2World.d2Gan;
  10992. if (!d2Gan.ui.isDisposed)
  10993. d2Gan.ui.visible = false;
  10994. let d2Help = xGame.common.d2World.d2HelpLine;
  10995. if (!d2Help.ui.isDisposed)
  10996. d2Help.ui.visible = false;
  10997. let rootBall = xGame.common.d2World.rootBall;
  10998. if (!rootBall.destroyed) {
  10999. rootBall.gameObj.active = false;
  11000. }
  11001. }
  11002. showBallUI() {
  11003. let d2Gan = xGame.common.d2World.d2Gan;
  11004. if (!d2Gan.ui.isDisposed)
  11005. d2Gan.ui.visible = true;
  11006. let d2Help = xGame.common.d2World.d2HelpLine;
  11007. if (!d2Help.ui.isDisposed)
  11008. d2Help.ui.visible = true;
  11009. let rootBall = xGame.common.d2World.rootBall;
  11010. if (!rootBall.destroyed) {
  11011. rootBall.gameObj.active = true;
  11012. }
  11013. }
  11014. moveToClickDot(e) {
  11015. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11016. let root = xGame.common.d2World.rootBall.gameObj;
  11017. let xx = e.stageX - xGame.common.sysOffestNum;
  11018. let yy = e.stageY;
  11019. let x = xx - root.x;
  11020. let y = yy - root.y;
  11021. let angle = xGame.common.getfguiRotation(x, y);
  11022. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11023. xGame.common.d2World.getHelpLine();
  11024. }
  11025. this.isMoveRod = false;
  11026. xGame.common.clickedBall = false;
  11027. }
  11028. openAllEvent() {
  11029. this.closeAllEvent();
  11030. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11031. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11032. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11033. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11034. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11035. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11036. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11037. }
  11038. closeAllEvent() {
  11039. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11040. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11041. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11042. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11043. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11044. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11045. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11046. }
  11047. resetGame() {
  11048. this.closeAllEvent();
  11049. this.hideBallUI();
  11050. xGame.common.gameMgr.gamePause = true;
  11051. }
  11052. }
  11053. UIGame.uiName = "UIGame";
  11054. class UIAddProp extends UIBase {
  11055. constructor() {
  11056. super();
  11057. this.curType = "";
  11058. }
  11059. onConstructor() {
  11060. this.ui = ui_UIAddProp.createInstance();
  11061. this.contentPane = this.ui;
  11062. this.isEject = false;
  11063. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11064. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11065. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11066. this.updateUI();
  11067. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11068. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11069. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11070. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11071. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11072. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11073. }
  11074. show(type) {
  11075. super.show();
  11076. this.curType = type == 0 ? "coin" : "diamond";
  11077. this.switchBtn("");
  11078. this.ui.t0.play();
  11079. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11080. PlatMgr.showInsert(true);
  11081. }
  11082. closeSelf() {
  11083. this.hide();
  11084. }
  11085. updateUI() {
  11086. let data = cfgTable.moneyData;
  11087. let temp;
  11088. let obj;
  11089. for (const key in data) {
  11090. temp = data[key];
  11091. obj = this.ui.myNode["node" + key];
  11092. if (parseInt(key) <= 2) {
  11093. obj.diamondTxt.text = "+" + temp.num;
  11094. }
  11095. else {
  11096. obj.coinTxt.text = temp.num;
  11097. obj.diamondTxt.text = temp.get.split('_')[1];
  11098. }
  11099. }
  11100. this.updateDiamondShare();
  11101. }
  11102. updateDiamondShare() {
  11103. let data = DataMgr.getShareDiamondTimes();
  11104. if (data >= xGame.common.maxShareDiamondTimes) {
  11105. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11106. this.ui.myNode.node1.touchable = false;
  11107. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11108. }
  11109. else {
  11110. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11111. this.ui.myNode.node1.touchable = true;
  11112. }
  11113. }
  11114. switchBtn(type) {
  11115. if (type == "")
  11116. type = this.curType;
  11117. else {
  11118. if (this.curType == type) {
  11119. return;
  11120. }
  11121. else {
  11122. this.curType = type;
  11123. }
  11124. }
  11125. if (type == "coin") {
  11126. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11127. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11128. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11129. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11130. this.ui.myNode.c1.selectedIndex = 0;
  11131. }
  11132. else {
  11133. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11134. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11135. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11136. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11137. this.ui.myNode.c1.selectedIndex = 1;
  11138. }
  11139. }
  11140. convertCoin(index) {
  11141. let data = cfgTable.moneyData[index];
  11142. let coinNum = data.num;
  11143. let str = data.get.split('_')[1];
  11144. let needDiamond = parseInt(str);
  11145. if (DataMgr.diamondEnough(needDiamond)) {
  11146. DataMgr.setDiamond(-needDiamond);
  11147. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11148. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11149. }
  11150. else {
  11151. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11152. this.switchBtn("diamond");
  11153. }
  11154. }
  11155. videoGetDiamond() {
  11156. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11157. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11158. }
  11159. else {
  11160. console.log('zh:AD 失败,直接发放奖励');
  11161. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11162. }
  11163. }
  11164. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11165. let num = cfgTable.moneyData[2].num;
  11166. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11167. this.closeSelf();
  11168. }
  11169. videoGetCoin() {
  11170. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11171. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11172. }
  11173. else {
  11174. console.log('zh:AD 失败,直接发放奖励');
  11175. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11176. }
  11177. }
  11178. qjff_AD_for_uiAddProp_videoGetCoin() {
  11179. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11180. this.closeSelf();
  11181. }
  11182. shareGetDiamond() {
  11183. let times = DataMgr.getShareDiamondTimes();
  11184. if (times >= xGame.common.maxShareDiamondTimes) {
  11185. console.log('zh: 233333333333 maxShareDiamondTimes');
  11186. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11187. }
  11188. else {
  11189. console.log('zh:33333333333333ad');
  11190. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11191. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11192. }
  11193. else {
  11194. console.log('zh:AD 失败,直接发放奖励');
  11195. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11196. }
  11197. }
  11198. }
  11199. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11200. let diamond = xGame.common.randomNum(50, 100);
  11201. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11202. DataMgr.setShareDiamondTimes(1);
  11203. this.updateDiamondShare();
  11204. }
  11205. openPutBallView() {
  11206. let end = xGame.uiMgr.getUI(UIGameEnd);
  11207. let skill = xGame.uiMgr.getUI(UISkill);
  11208. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11209. let uigame = xGame.uiMgr.getUI(UIGame);
  11210. if (end && !end.isHide) {
  11211. xGame.uiMgr.Hide(UIGameEnd);
  11212. xGame.uiMgr.Show(UIMain);
  11213. }
  11214. if (skill && !skill.isHide)
  11215. xGame.uiMgr.Hide(UISkill);
  11216. if (uigame && !uigame.isHide)
  11217. xGame.uiMgr.Hide(UIGame);
  11218. if (level && !level.isHide) {
  11219. }
  11220. else {
  11221. xGame.uiMgr.Show(UILevelDisplay);
  11222. }
  11223. this.closeSelf();
  11224. }
  11225. }
  11226. UIAddProp.uiName = "UIAddProp";
  11227. class MoneyNode {
  11228. constructor(ui) {
  11229. this.leftTime = 0;
  11230. this.ui = ui;
  11231. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11232. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11233. this.ui.addPowerBtn.onClick(this, this.addPower);
  11234. this.ui.c1.selectedIndex = 1;
  11235. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11236. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11237. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11238. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11239. this.coinChange();
  11240. this.diamondChange();
  11241. this.powerChange();
  11242. }
  11243. addPower() {
  11244. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11245. xGame.uiMgr.Show(UIPower);
  11246. }
  11247. powerChange() {
  11248. let powerNum = DataMgr.getPower();
  11249. this.ui.powerTxt.text = powerNum + "";
  11250. }
  11251. checkPowerTime() {
  11252. let cur = new Date().getTime();
  11253. let last = DataMgr.getPowerTime();
  11254. if (last == 0) {
  11255. last = cur;
  11256. DataMgr.setPowerTime(cur);
  11257. }
  11258. let power = DataMgr.getPower();
  11259. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11260. Laya.timer.clearAll(this);
  11261. if (power >= xGame.common.natureMaxPower) {
  11262. this.ui.powerTimeTxt.text = "";
  11263. DataMgr.setPowerTime(cur);
  11264. return;
  11265. }
  11266. if (power + offset >= xGame.common.natureMaxPower) {
  11267. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11268. this.ui.powerTimeTxt.text = "";
  11269. DataMgr.setPowerTime(cur);
  11270. }
  11271. else {
  11272. if (offset > 0) {
  11273. DataMgr.setPower(offset);
  11274. DataMgr.setPowerTime(cur);
  11275. }
  11276. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11277. this.leftTime = xGame.common.powerRecoverNum - time;
  11278. if (this.leftTime <= 0)
  11279. this.leftTime = 0;
  11280. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11281. Laya.timer.loop(1000, this, this.updatePowerTime);
  11282. }
  11283. }
  11284. updatePowerTime() {
  11285. this.leftTime -= 1;
  11286. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11287. if (this.leftTime <= 0) {
  11288. this.checkPowerTime();
  11289. }
  11290. }
  11291. coinChange() {
  11292. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11293. }
  11294. diamondChange() {
  11295. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11296. }
  11297. addCoin() {
  11298. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11299. Moyu.sendDataEvent("AddCoinBtn");
  11300. xGame.uiMgr.Show(UIAddProp, 0);
  11301. }
  11302. addDiamond() {
  11303. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11304. Moyu.sendDataEvent("AddDiamondBtn");
  11305. xGame.uiMgr.Show(UIAddProp, 1);
  11306. }
  11307. }
  11308. class UIDraw extends UIBase {
  11309. constructor() {
  11310. super();
  11311. this.curKey = 0;
  11312. }
  11313. onConstructor() {
  11314. this.ui = ui_UIDraw.createInstance();
  11315. this.contentPane = this.ui;
  11316. this.isEject = false;
  11317. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11318. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11319. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11320. this.initDraw();
  11321. this.initUI();
  11322. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11323. if (Moyu.isKs)
  11324. this.ui.closeNode.closeBtn.x += 100;
  11325. }
  11326. show() {
  11327. super.show();
  11328. this.ui.t0.play();
  11329. this.playSecretaryIdle();
  11330. this.updateDraw();
  11331. this.checkFree();
  11332. if (PlatMgr.bannerDelay > 0) {
  11333. this.ui.closeNode.closeBtn.visible = false;
  11334. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11335. this.ui.closeNode.closeBtn.visible = true;
  11336. });
  11337. }
  11338. PlatMgr.showRateBanner();
  11339. }
  11340. hide() {
  11341. Laya.timer.clearAll(this);
  11342. super.hide();
  11343. }
  11344. checkFree() {
  11345. let isFree = DataMgr.getDailyfreeDrawTimes();
  11346. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11347. }
  11348. initDraw() {
  11349. this.drawObj = [];
  11350. let data = cfgTable.drawData;
  11351. let temp;
  11352. let weight = 0;
  11353. for (const key in data) {
  11354. temp = data[key];
  11355. weight += temp.weight;
  11356. this.drawObj.push(weight);
  11357. }
  11358. this.allWeight = weight;
  11359. }
  11360. initUI() {
  11361. let data = cfgTable.drawData;
  11362. let temp;
  11363. let img;
  11364. let txt;
  11365. for (const key in data) {
  11366. temp = data[key];
  11367. img = this.ui.myNode.rotNode["img" + key];
  11368. txt = this.ui.myNode.rotNode["txt" + key];
  11369. img.url = xGame.common.getGameIconUrl(temp.icon);
  11370. txt.visible = true;
  11371. if (temp.award > 2) {
  11372. img.rotation = 0;
  11373. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11374. }
  11375. else {
  11376. img.rotation = temp.rotation;
  11377. txt.text = temp.num;
  11378. }
  11379. }
  11380. }
  11381. getCurkey() {
  11382. let rand = Math.random() * this.allWeight;
  11383. let temp;
  11384. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11385. temp = this.drawObj[index];
  11386. if (index == 0) {
  11387. if (rand < temp) {
  11388. return index + 1;
  11389. }
  11390. }
  11391. else {
  11392. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11393. return index + 1;
  11394. }
  11395. }
  11396. }
  11397. return 2;
  11398. }
  11399. startDraw() {
  11400. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11401. if (freeTimes > 0) {
  11402. this.beginDraw();
  11403. DataMgr.setDailyfreeDrawTimes(0);
  11404. this.checkFree();
  11405. }
  11406. else {
  11407. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11408. }
  11409. else {
  11410. console.log('zh:AD 失败,直接发放奖励');
  11411. this.qjff_chouJiang();
  11412. }
  11413. }
  11414. }
  11415. qjff_chouJiang() {
  11416. this.beginDraw();
  11417. }
  11418. beginDraw() {
  11419. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11420. this.ui.drawBtn.touchable = false;
  11421. this.curKey = this.getCurkey();
  11422. console.log("当前key", this.curKey);
  11423. let cell = 60;
  11424. let lap = 3;
  11425. let angle = cell * (this.curKey - 1) + lap * 360;
  11426. let target = this.ui.myNode.rotNode;
  11427. target.rotation = 0;
  11428. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11429. console.log("旋转完成");
  11430. this.ui.drawBtn.touchable = true;
  11431. this.getAward();
  11432. }));
  11433. }
  11434. getAward() {
  11435. let data = cfgTable.drawData[this.curKey];
  11436. let temp = new AwardType();
  11437. temp.type = data.award;
  11438. temp.num = data.num;
  11439. xGame.common.getAward([temp], () => {
  11440. DataMgr.setDrawTimes(1);
  11441. this.updateDraw();
  11442. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11443. });
  11444. }
  11445. updateDraw() {
  11446. let drawTimes = DataMgr.getDrawTimes();
  11447. let awardTimes = DataMgr.getDrawAwardTimes();
  11448. if (Math.floor(drawTimes / 3) > awardTimes) {
  11449. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11450. this.ui.extraNode.boxBtn.touchable = true;
  11451. this.ui.extraNode.tipsTxt.text = "3/3";
  11452. this.ui.extraNode.barNode.width = 265;
  11453. this.getExtraAward();
  11454. }
  11455. else {
  11456. this.ui.extraNode.boxBtn.t0.stop();
  11457. this.ui.extraNode.boxBtn.touchable = false;
  11458. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11459. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11460. }
  11461. let data = cfgTable.drawData[1];
  11462. if (awardTimes == 0) {
  11463. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11464. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11465. this.ui.myNode.rotNode.img1.rotation = 0;
  11466. }
  11467. else {
  11468. let award = data.nextid;
  11469. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11470. this.ui.myNode.rotNode.txt1.text = award[1];
  11471. this.ui.myNode.rotNode.img1.rotation = 0;
  11472. }
  11473. }
  11474. getExtraAward() {
  11475. let drawTimes = DataMgr.getDrawTimes();
  11476. let awardTimes = DataMgr.getDrawAwardTimes();
  11477. let data = cfgTable.drawData[1];
  11478. let award = new AwardType();
  11479. if (awardTimes == 0) {
  11480. award.num = data.num;
  11481. award.type = data.award;
  11482. xGame.common.getAward([award], () => {
  11483. let all = Math.floor(drawTimes / 3);
  11484. DataMgr.setDrawAwardTimes(all);
  11485. this.updateDraw();
  11486. });
  11487. }
  11488. else {
  11489. award.num = parseInt(data.nextid[1]);
  11490. award.type = parseInt(data.nextid[0]);
  11491. xGame.common.getAward([award], () => {
  11492. let all = Math.floor(drawTimes / 3);
  11493. DataMgr.setDrawAwardTimes(all);
  11494. this.updateDraw();
  11495. });
  11496. }
  11497. }
  11498. closeSelf() {
  11499. this.hide();
  11500. }
  11501. playSecretaryIdle() {
  11502. let parent = this.ui.secretary.displayObject;
  11503. parent.destroyChildren();
  11504. let xx = this.ui.secretary.width / 2;
  11505. let yy = this.ui.secretary.height;
  11506. let scale = xGame.common.getSecretaryScale();
  11507. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11508. xGame.common.secretary.play(data, 0, true, parent);
  11509. }
  11510. }
  11511. UIDraw.uiName = "UIDraw";
  11512. class ui_UIFlyEft extends fgui.GComponent {
  11513. static createInstance() {
  11514. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11515. }
  11516. onConstruct() {
  11517. this.n0 = (this.getChild("n0"));
  11518. this.n1 = (this.getChild("n1"));
  11519. this.n2 = (this.getChild("n2"));
  11520. this.n3 = (this.getChild("n3"));
  11521. this.n4 = (this.getChild("n4"));
  11522. this.n5 = (this.getChild("n5"));
  11523. this.n6 = (this.getChild("n6"));
  11524. this.n7 = (this.getChild("n7"));
  11525. this.iconNode = (this.getChild("iconNode"));
  11526. this.txt = (this.getChild("txt"));
  11527. this.txtNode = (this.getChild("txtNode"));
  11528. }
  11529. }
  11530. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  11531. class UIFlyEft extends UIBase {
  11532. constructor() {
  11533. super();
  11534. this.max = 8;
  11535. this.delay = 0;
  11536. }
  11537. onConstructor() {
  11538. this.ui = ui_UIFlyEft.createInstance();
  11539. this.contentPane = this.ui;
  11540. this.isEject = false;
  11541. this.isMuti = true;
  11542. this.ui.x += xGame.common.sysOffestNum;
  11543. }
  11544. getArrPos() {
  11545. if (this.iconPos && this.iconPos.length > 0)
  11546. return;
  11547. this.iconPos = [];
  11548. let temp;
  11549. for (let index = 0; index < this.max; index++) {
  11550. temp = this.ui["n" + index];
  11551. this.iconPos.push([temp.x, temp.y]);
  11552. }
  11553. }
  11554. show(stPos, edPos, num, type, callback) {
  11555. super.show();
  11556. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  11557. this.getArrPos();
  11558. this.updateUI(type);
  11559. this.updatePos();
  11560. this.runFly(edPos, callback);
  11561. this.runWorlds(stPos, num);
  11562. }
  11563. updateUI(type) {
  11564. let temp;
  11565. let str;
  11566. for (let index = 0; index < this.max; index++) {
  11567. temp = this.ui["n" + index];
  11568. str = this.getIconStr(type);
  11569. temp.url = xGame.common.getGameIconUrl(str);
  11570. }
  11571. }
  11572. getIconStr(type) {
  11573. switch (type) {
  11574. case Prop.diamond:
  11575. return "ty_zs";
  11576. case Prop.coin:
  11577. return "ty_jb";
  11578. default:
  11579. break;
  11580. }
  11581. }
  11582. updatePos() {
  11583. let temp;
  11584. for (let index = 0; index < this.max; index++) {
  11585. temp = this.ui["n" + index];
  11586. temp.x = this.iconPos[index][0];
  11587. temp.y = this.iconPos[index][1];
  11588. }
  11589. }
  11590. runFly(endPos, callback) {
  11591. let all = 0;
  11592. let temp;
  11593. for (let index = 0; index < this.max; index++) {
  11594. temp = this.ui["n" + index];
  11595. temp.visible = true;
  11596. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  11597. temp.visible = false;
  11598. all++;
  11599. if (all >= this.max) {
  11600. callback && callback();
  11601. }
  11602. }), 20 * index);
  11603. }
  11604. }
  11605. runWorlds(stPos, num) {
  11606. let str = "+" + num;
  11607. this.ui.txt.text = str;
  11608. let starX = stPos.x;
  11609. let starY = stPos.y + 50;
  11610. this.ui.txt.x = starX;
  11611. this.ui.txt.y = starY;
  11612. this.ui.txt.visible = true;
  11613. this.ui.txt.alpha = 1;
  11614. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  11615. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  11616. this.ui.txt.visible = false;
  11617. this.hide();
  11618. }));
  11619. }));
  11620. }
  11621. }
  11622. UIFlyEft.uiName = "UIFlyEft";
  11623. class Common {
  11624. constructor() {
  11625. this.convertNum = 0.025;
  11626. this.VectorUp = new Laya.Vector3(0, 1, 0);
  11627. this.scaleV3One = new Laya.Vector3();
  11628. this.scaleV3Two = new Laya.Vector3();
  11629. this.posV4 = new Laya.Vector4();
  11630. this.showDebug = false;
  11631. this.openGuide = true;
  11632. this.rodOffest = new Laya.Vector2(0, 0);
  11633. this.rodAngle = 0;
  11634. this.gameMode = GameMode.classic;
  11635. this.bigMoveLevelIndex = 1;
  11636. this.bigMoveNeedCoin = 1000;
  11637. this.classicNiceNeddCoin = 1000;
  11638. this.passAwardCoin = 2000;
  11639. this.classicRoomType = 1;
  11640. this.maxPower = 20;
  11641. this.natureMaxPower = 5;
  11642. this.videoPower = 2;
  11643. this.powerRecoverNum = 900;
  11644. this.curPlayerSkillType = 0;
  11645. this.isNewDay = false;
  11646. this.clickedBall = false;
  11647. this.placeBallCurLevel = 0;
  11648. this.placeBallStarNum = 0;
  11649. this.longHelpLine = false;
  11650. this.maxShareDiamondTimes = 3;
  11651. this.guideStep = 0;
  11652. this.temSelfLevel = 0;
  11653. this.extraMoveNum = 0;
  11654. this.curRankID = 0;
  11655. this.rankID = {
  11656. normalStar: 12000,
  11657. wxStar: 12001
  11658. };
  11659. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  11660. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  11661. this.btnClickStr = "buttonclick";
  11662. this.maxSkillLevel = 10;
  11663. this.upSkillLevel = false;
  11664. this.gameStartTime = 0;
  11665. this._sysOffestNum = 0;
  11666. this.angleV2 = new Laya.Vector2();
  11667. this.rootV = new Laya.Vector2(0, 1);
  11668. this.tempDir1 = new Laya.Vector2();
  11669. this.tempDir2 = new Laya.Vector2();
  11670. this.ballSize = 33;
  11671. this.stPos = new Laya.Point();
  11672. this.edPos = new Laya.Point();
  11673. Common._instance = this;
  11674. window["common"] = this;
  11675. }
  11676. static getInstance() {
  11677. if (!this._instance) {
  11678. this._instance = new Common();
  11679. }
  11680. return this._instance;
  11681. }
  11682. get sysOffestNum() {
  11683. if (this._sysOffestNum == 0) {
  11684. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  11685. }
  11686. return this._sysOffestNum;
  11687. }
  11688. testShader() {
  11689. let test = new LightShader();
  11690. test.texture = "res/d3Res/ballTexture/ball1.png";
  11691. Laya.stage.addChild(test);
  11692. }
  11693. playScale(node) {
  11694. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  11695. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  11696. }));
  11697. }));
  11698. }
  11699. setGroup(colli, ...group) {
  11700. let out = 0;
  11701. for (let index = 0; index < group.length; index++) {
  11702. if (index == 0) {
  11703. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11704. }
  11705. else {
  11706. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11707. }
  11708. }
  11709. colli.collisionGroup = out;
  11710. }
  11711. setCanGroupWith(colli, ...group) {
  11712. let out = 0;
  11713. for (let index = 0; index < group.length; index++) {
  11714. if (index == 0) {
  11715. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11716. }
  11717. else {
  11718. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11719. }
  11720. }
  11721. colli.canCollideWith = out;
  11722. }
  11723. loadPrefab(name, callback) {
  11724. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  11725. let prefab = new Laya.Prefab();
  11726. prefab.json = obj;
  11727. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  11728. callback && callback(img);
  11729. }));
  11730. }
  11731. pos2to3Convert(x, y, d3Pos) {
  11732. x = x + this.sysOffestNum;
  11733. d3Pos.setValue(x, y, 0);
  11734. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  11735. if (success) {
  11736. }
  11737. else {
  11738. console.error("转换出错了。。。。。。。。");
  11739. }
  11740. }
  11741. scale2to3Convert(num) {
  11742. this.scaleV3One.setValue(0, 0, 0);
  11743. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  11744. this.scaleV3Two.setValue(0, num, 0);
  11745. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  11746. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  11747. return outNum;
  11748. }
  11749. pos3to2Convert(d3Pos) {
  11750. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  11751. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  11752. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  11753. d3Pos.x -= this.sysOffestNum;
  11754. }
  11755. scale3to2Convert(num) {
  11756. let scale = this.scale2to3Convert(1);
  11757. let d2Out = num / scale;
  11758. return d2Out;
  11759. }
  11760. getCollider(type, restitution = 0.9, density = 10) {
  11761. let colli;
  11762. if (type == "box")
  11763. colli = new Laya.BoxCollider();
  11764. else
  11765. colli = new Laya.CircleCollider();
  11766. colli.friction = 0;
  11767. colli.restitution = restitution;
  11768. colli.density = density;
  11769. return colli;
  11770. }
  11771. getRigbody() {
  11772. let rigy = new Laya.RigidBody();
  11773. rigy.bullet = true;
  11774. rigy.allowRotation = false;
  11775. rigy.allowSleep = false;
  11776. rigy.gravityScale = 0;
  11777. return rigy;
  11778. }
  11779. getfguiRotation(x, y) {
  11780. this.angleV2.setValue(x, y);
  11781. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11782. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11783. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  11784. angle = -angle;
  11785. }
  11786. return 180 + angle;
  11787. }
  11788. getAngle(x, y) {
  11789. this.angleV2.setValue(x, y);
  11790. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11791. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11792. return angle;
  11793. }
  11794. randomNum(a, b) {
  11795. return a + Math.floor((b - a + 1) * Math.random());
  11796. }
  11797. getRandArrEle(arr) {
  11798. return arr[Math.floor(arr.length * Math.random())];
  11799. }
  11800. getSign(val) {
  11801. return val >= 0 ? 1 : -1;
  11802. }
  11803. botherArr(arr) {
  11804. let times = arr.length + 2;
  11805. let length = arr.length;
  11806. let a;
  11807. let b;
  11808. let temp;
  11809. for (let index = 0; index < times; index++) {
  11810. a = Math.floor(Math.random() * length);
  11811. b = Math.floor(Math.random() * length);
  11812. temp = arr[a];
  11813. arr[a] = arr[b];
  11814. arr[b] = temp;
  11815. }
  11816. }
  11817. getGameIconUrl(id) {
  11818. return "ui://game/" + id;
  11819. }
  11820. getComponentUrl(id) {
  11821. return "ui://game/" + id;
  11822. }
  11823. getAnimation() {
  11824. }
  11825. judgeSkillType(type = SkillType.highSpace) {
  11826. if (this.gameMode == GameMode.classic)
  11827. return;
  11828. let gameMgr = this.gameMgr;
  11829. if (gameMgr.selfTurn) {
  11830. if (gameMgr.selfCurSkill == type) {
  11831. return true;
  11832. }
  11833. }
  11834. else {
  11835. if (gameMgr.aiCurSkill == type) {
  11836. return true;
  11837. }
  11838. }
  11839. }
  11840. ballColliHole(collider) {
  11841. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11842. xGame.common.gameMgr.isFirstInGame = false;
  11843. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11844. }
  11845. collider.owner.mySrc.checkWrongBall();
  11846. }
  11847. getArrMaxEle(arr) {
  11848. let max = -Infinity;
  11849. for (let index = 0; index < arr.length; index++) {
  11850. max = Math.max(arr[index], max);
  11851. }
  11852. return max;
  11853. }
  11854. getArrMinEle(arr) {
  11855. let min = Infinity;
  11856. for (let index = 0; index < arr.length; index++) {
  11857. min = Math.min(arr[index], min);
  11858. }
  11859. return min;
  11860. }
  11861. playRandomMutiBallBigSkillSound() {
  11862. if (Math.random() <= 0.5)
  11863. return;
  11864. let rand = this.randomNum(1, 6);
  11865. let str = "ganfa0" + rand;
  11866. xGame.soundMgr.playSound(str);
  11867. }
  11868. showOneCamera(type) {
  11869. let object = xGame.common.d3World.cameraObj;
  11870. for (const key in object) {
  11871. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11872. object[key].init();
  11873. object[key].owner.active = key == type;
  11874. }
  11875. }
  11876. }
  11877. checkBallOverBorder(x, y) {
  11878. let radius = 17;
  11879. let condition = this._checkBorder(x + radius, y) ||
  11880. this._checkBorder(x - radius, y) ||
  11881. this._checkBorder(x, y + radius) ||
  11882. this._checkBorder(x, y - radius);
  11883. if (condition) {
  11884. return true;
  11885. }
  11886. }
  11887. _checkBorder(x, y) {
  11888. let borderRect = this.d2World.borderRect;
  11889. let xOffest = 20;
  11890. let yOffest = 20;
  11891. if (y <= borderRect.y - yOffest) {
  11892. return true;
  11893. }
  11894. if (y >= borderRect.y + borderRect.height + yOffest) {
  11895. return true;
  11896. }
  11897. if (x <= borderRect.x - xOffest) {
  11898. return true;
  11899. }
  11900. if (x >= borderRect.x + borderRect.width + xOffest) {
  11901. return true;
  11902. }
  11903. }
  11904. initWeight(cfg) {
  11905. let allCfgData = { data: {}, allWeightNum: 0 };
  11906. let weightCfg = allCfgData.data;
  11907. let weight = 0;
  11908. for (const key in cfg) {
  11909. weightCfg[key] = {};
  11910. weightCfg[key].id = cfg[key].id;
  11911. weightCfg[key].minWeight = weight;
  11912. weight += cfg[key].weight;
  11913. weightCfg[key].maxWeight = weight;
  11914. }
  11915. allCfgData.allWeightNum = weight;
  11916. return allCfgData;
  11917. }
  11918. getRandomWeightData(cfg) {
  11919. let weightCfg = cfg.data;
  11920. let allWeightNum = cfg.allWeightNum;
  11921. let rand = Math.floor(Math.random() * allWeightNum);
  11922. for (const key in weightCfg) {
  11923. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11924. return weightCfg[key];
  11925. }
  11926. }
  11927. return weightCfg[1];
  11928. }
  11929. showGirlTalkPop(wordsIndex, node, msgNode) {
  11930. node.visible = true;
  11931. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11932. node.t0.play(Laya.Handler.create(this, () => {
  11933. node.visible = false;
  11934. }));
  11935. }
  11936. stopGirlPop(node) {
  11937. node.t0.stop();
  11938. node.visible = false;
  11939. }
  11940. createHead(loader, url, size = 107) {
  11941. if (Laya.Browser.name == "Browser") {
  11942. loader.url = url;
  11943. return;
  11944. }
  11945. else {
  11946. console.log('zh:url=', url);
  11947. loader.url = url;
  11948. }
  11949. }
  11950. addTestCoin(num) {
  11951. DataMgr.setCoin(num);
  11952. }
  11953. addTestDiamond(num) {
  11954. DataMgr.setDiamond(num);
  11955. }
  11956. addTestSkill() {
  11957. DataMgr.setBigSkill(0, 99);
  11958. DataMgr.setBigSkill(1, 99);
  11959. DataMgr.setBigSkill(2, 99);
  11960. }
  11961. playClassicEmotion(number, x, y) {
  11962. if (this.gameMode == GameMode.bigMove)
  11963. return;
  11964. let randIndex = this.randomNum(0, 2);
  11965. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11966. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11967. if (this.gameMgr.selfTurn) {
  11968. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11969. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11970. }
  11971. else {
  11972. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11973. }
  11974. else {
  11975. if (number == this.gameMgr.blackNum) {
  11976. if (this.gameMgr.selfBallArr.length == 0) {
  11977. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11978. }
  11979. else {
  11980. }
  11981. }
  11982. else {
  11983. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11984. }
  11985. }
  11986. }
  11987. }
  11988. else {
  11989. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11990. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11991. }
  11992. else {
  11993. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11994. }
  11995. else {
  11996. if (number == this.gameMgr.blackNum) {
  11997. if (this.gameMgr.aiBallArr.length == 0) {
  11998. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11999. }
  12000. else {
  12001. }
  12002. }
  12003. else {
  12004. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12005. }
  12006. }
  12007. }
  12008. }
  12009. }
  12010. playHappySound(number) {
  12011. if (this.gameMode != GameMode.classic)
  12012. return;
  12013. if (number == 8)
  12014. return;
  12015. let play = false;
  12016. if (this.gameMgr.selfTurn) {
  12017. if (this.gameMgr.ensureBallType) {
  12018. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12019. play = true;
  12020. }
  12021. }
  12022. else {
  12023. play = true;
  12024. }
  12025. }
  12026. else {
  12027. if (this.gameMgr.ensureBallType) {
  12028. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12029. play = true;
  12030. }
  12031. }
  12032. else {
  12033. play = true;
  12034. }
  12035. }
  12036. if (play)
  12037. xGame.soundMgr.playSound("applause");
  12038. }
  12039. destroyClassicEmotion() {
  12040. if (this.gameMode == GameMode.bigMove)
  12041. return;
  12042. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12043. parent.destroyChildren();
  12044. }
  12045. playAwardSpine(x, y) {
  12046. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12047. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12048. this.awardSpine.play(data, 0, false, parent);
  12049. }
  12050. destroyAwardSpine() {
  12051. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12052. parent.destroyChildren();
  12053. }
  12054. isBlock(bx, by, hx, hy, except = null) {
  12055. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12056. let balls = xGame.common.d2World.ballArr;
  12057. let outArr = [];
  12058. for (let index = 0; index < balls.length; index++) {
  12059. let obj = balls[index];
  12060. if (obj.number == 0)
  12061. continue;
  12062. if (obj == except)
  12063. continue;
  12064. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12065. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12066. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12067. if (num >= 1)
  12068. num = 1;
  12069. if (num < 0)
  12070. continue;
  12071. let gap = Math.sin(Math.acos(num)) * dis;
  12072. if (gap < this.ballSize) {
  12073. outArr.push({
  12074. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12075. disHon: Math.cos(Math.acos(num)) * dis,
  12076. disVer: Math.sin(Math.acos(num)) * dis,
  12077. src: balls[index],
  12078. dir: this.tempDir1
  12079. });
  12080. }
  12081. }
  12082. if (outArr.length > 0) {
  12083. outArr.sort((a, b) => { return a.dis - b.dis; });
  12084. return outArr[0];
  12085. }
  12086. }
  12087. AngleBetween(vector1, vector2) {
  12088. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12089. return rad * (180 / Math.PI);
  12090. }
  12091. getSecretaryScale() {
  12092. if (this.secretary.spineName == "mishu") {
  12093. return 1.28;
  12094. }
  12095. else {
  12096. return 1.024;
  12097. }
  12098. }
  12099. signAwardContainsRod(arr) {
  12100. let temp;
  12101. for (let index = 0; index < arr.length; index++) {
  12102. temp = arr[index].split('-')[0];
  12103. if (parseInt(temp) > 2) {
  12104. return true;
  12105. }
  12106. }
  12107. }
  12108. judgeSameDay() {
  12109. let lastTime = DataMgr.getSignTime();
  12110. let curTime = new Date().getTime();
  12111. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12112. return true;
  12113. }
  12114. return false;
  12115. }
  12116. getAward(arr, callback) {
  12117. let showTriple = arr[0].type <= 2;
  12118. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12119. let temp;
  12120. for (let index = 0; index < arr.length; index++) {
  12121. temp = arr[index];
  12122. switch (temp.type) {
  12123. case 1:
  12124. this.playObjFlyAnim(temp.num, temp.type);
  12125. break;
  12126. case 2:
  12127. this.playObjFlyAnim(temp.num, temp.type);
  12128. break;
  12129. case 3:
  12130. case 4:
  12131. case 5:
  12132. case 6:
  12133. DataMgr.setBallRod(temp.type - 2, 1);
  12134. DataMgr.setCurBallRod(temp.type - 2);
  12135. break;
  12136. default:
  12137. break;
  12138. }
  12139. }
  12140. callback && callback(watchVideo);
  12141. });
  12142. }
  12143. getMoneyNode() {
  12144. let moneyNode;
  12145. let sign = xGame.uiMgr.getUI(UISign);
  12146. let draw = xGame.uiMgr.getUI(UIDraw);
  12147. let end = xGame.uiMgr.getUI(UIGameEnd);
  12148. let skill = xGame.uiMgr.getUI(UISkill);
  12149. if (sign && !sign.isHide)
  12150. moneyNode = sign.ui.moneyNode;
  12151. if (draw && !draw.isHide)
  12152. moneyNode = draw.ui.moneyNode;
  12153. if (end && !end.isHide)
  12154. moneyNode = end.ui.moneyNode;
  12155. if (skill && !skill.isHide)
  12156. moneyNode = skill.ui.moneyNode;
  12157. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12158. let main = xGame.uiMgr.getUI(UIMain);
  12159. if (condition1 && main && !main.isHide) {
  12160. moneyNode = main.ui.moneyNode;
  12161. }
  12162. return moneyNode;
  12163. }
  12164. playObjFlyAnim(num, type, callback = null) {
  12165. this.stPos.x = Laya.stage.width / 2;
  12166. this.stPos.y = Laya.stage.height / 2;
  12167. let moneyNode = this.getMoneyNode();
  12168. switch (type) {
  12169. case Prop.diamond:
  12170. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12171. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12172. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12173. this.edPos.x /= 2;
  12174. this.edPos.y /= 2;
  12175. break;
  12176. case Prop.coin:
  12177. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12178. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12179. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12180. this.edPos.x /= 2;
  12181. this.edPos.y /= 2;
  12182. break;
  12183. default:
  12184. break;
  12185. }
  12186. xGame.soundMgr.playSound("coinbag");
  12187. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12188. switch (type) {
  12189. case Prop.diamond:
  12190. DataMgr.setDiamond(num);
  12191. break;
  12192. case Prop.coin:
  12193. DataMgr.setCoin(num);
  12194. break;
  12195. default:
  12196. break;
  12197. }
  12198. callback && callback();
  12199. });
  12200. }
  12201. autoPopUIView() {
  12202. let arr = [];
  12203. let sign = this.judgeSameDay() ? false : true;
  12204. if (sign)
  12205. arr.push("sign");
  12206. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12207. if (draw)
  12208. arr.push("draw");
  12209. if (arr.length <= 0)
  12210. return;
  12211. let str = this.getRandArrEle(arr);
  12212. switch (str) {
  12213. case "sign":
  12214. xGame.uiMgr.Show(UISign);
  12215. break;
  12216. case "draw":
  12217. xGame.uiMgr.Show(UIDraw);
  12218. break;
  12219. default:
  12220. break;
  12221. }
  12222. }
  12223. getMSTime(time) {
  12224. let min = Math.floor(time / 60);
  12225. let sec = Math.floor((time - min * 60));
  12226. if (sec < 10)
  12227. sec = "0" + sec;
  12228. if (min < 10)
  12229. min = "0" + min;
  12230. return `${min}:${sec}`;
  12231. }
  12232. testPower() {
  12233. DataMgr.setPower(0, false);
  12234. }
  12235. getAllStarNum() {
  12236. let data = DataMgr.getPlaceBallLevelList();
  12237. let out = 0;
  12238. for (let index = 0; index < data.length; index++) {
  12239. out += data[index].star;
  12240. }
  12241. return out;
  12242. }
  12243. recoverCameraView() {
  12244. Laya.timer.once(900, this, () => {
  12245. xGame.common.showOneCamera("mainCamera");
  12246. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12247. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12248. xGame.common.gameUI.ui.border.alpha = 0;
  12249. if (Laya.physicsTimer.scale < 1) {
  12250. Laya.physicsTimer.scale = 1;
  12251. }
  12252. }
  12253. });
  12254. }
  12255. getClassicLevel() {
  12256. let successTimes = DataMgr.getClassicTimes();
  12257. let needKey = "";
  12258. let lastKey = "";
  12259. let cfg = cfgTable.classictimesData;
  12260. let data;
  12261. for (const key in cfg) {
  12262. data = cfg[key];
  12263. if (successTimes <= data.times) {
  12264. needKey = key;
  12265. }
  12266. lastKey = key;
  12267. }
  12268. if (needKey == "")
  12269. needKey = lastKey;
  12270. return cfg[needKey];
  12271. }
  12272. }
  12273. Common._instance = null;
  12274. class ui_Component92 extends fgui.GComponent {
  12275. static createInstance() {
  12276. return (fgui.UIPackage.createObject("game", "Component92"));
  12277. }
  12278. onConstruct() {
  12279. this.n0 = (this.getChild("n0"));
  12280. }
  12281. }
  12282. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12283. class ui_Component129 extends fgui.GProgressBar {
  12284. static createInstance() {
  12285. return (fgui.UIPackage.createObject("game", "Component129"));
  12286. }
  12287. onConstruct() {
  12288. this.bar_v = (this.getChild("bar_v"));
  12289. this.n84 = (this.getChild("n84"));
  12290. }
  12291. }
  12292. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12293. class ui_Component130 extends fgui.GComponent {
  12294. static createInstance() {
  12295. return (fgui.UIPackage.createObject("game", "Component130"));
  12296. }
  12297. onConstruct() {
  12298. this.ani = (this.getChild("ani"));
  12299. this.t0 = this.getTransition("t0");
  12300. }
  12301. }
  12302. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  12303. class ui_powerEft extends fgui.GComponent {
  12304. static createInstance() {
  12305. return (fgui.UIPackage.createObject("game", "powerEft"));
  12306. }
  12307. onConstruct() {
  12308. this.ani = (this.getChild("ani"));
  12309. this.n88 = (this.getChild("n88"));
  12310. this.n89 = (this.getChild("n89"));
  12311. }
  12312. }
  12313. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12314. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12315. static createInstance() {
  12316. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12317. }
  12318. onConstruct() {
  12319. this.c1 = this.getController("c1");
  12320. this.n2 = (this.getChild("n2"));
  12321. this.n22 = (this.getChild("n22"));
  12322. this.n23 = (this.getChild("n23"));
  12323. this.n15 = (this.getChild("n15"));
  12324. this.challenge = (this.getChild("challenge"));
  12325. this.n17 = (this.getChild("n17"));
  12326. this.n3 = (this.getChild("n3"));
  12327. this.starNode = (this.getChild("starNode"));
  12328. this.levelTxt = (this.getChild("levelTxt"));
  12329. this.n14 = (this.getChild("n14"));
  12330. this.n19 = (this.getChild("n19"));
  12331. this.n20 = (this.getChild("n20"));
  12332. this.n21 = (this.getChild("n21"));
  12333. this.special = (this.getChild("special"));
  12334. }
  12335. }
  12336. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12337. class ui_Component79 extends fgui.GComponent {
  12338. static createInstance() {
  12339. return (fgui.UIPackage.createObject("game", "Component79"));
  12340. }
  12341. onConstruct() {
  12342. this.c1 = this.getController("c1");
  12343. this.n7 = (this.getChild("n7"));
  12344. this.n8 = (this.getChild("n8"));
  12345. this.n9 = (this.getChild("n9"));
  12346. this.n10 = (this.getChild("n10"));
  12347. this.n11 = (this.getChild("n11"));
  12348. this.n12 = (this.getChild("n12"));
  12349. }
  12350. }
  12351. ui_Component79.URL = "ui://isxx5ak7avag477";
  12352. class ui_Component80 extends fgui.GComponent {
  12353. static createInstance() {
  12354. return (fgui.UIPackage.createObject("game", "Component80"));
  12355. }
  12356. onConstruct() {
  12357. this.n0 = (this.getChild("n0"));
  12358. this.n1 = (this.getChild("n1"));
  12359. this.myList = (this.getChild("myList"));
  12360. this.t0 = this.getTransition("t0");
  12361. }
  12362. }
  12363. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12364. class ui_SignNormal extends fgui.GComponent {
  12365. static createInstance() {
  12366. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12367. }
  12368. onConstruct() {
  12369. this.c1 = this.getController("c1");
  12370. this.n7 = (this.getChild("n7"));
  12371. this.n15 = (this.getChild("n15"));
  12372. this.titleTxt = (this.getChild("titleTxt"));
  12373. this.n8 = (this.getChild("n8"));
  12374. this.myIcon = (this.getChild("myIcon"));
  12375. this.numTxt = (this.getChild("numTxt"));
  12376. this.n12 = (this.getChild("n12"));
  12377. this.n13 = (this.getChild("n13"));
  12378. this.n17 = (this.getChild("n17"));
  12379. this.n14 = (this.getChild("n14"));
  12380. }
  12381. }
  12382. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12383. class ui_Button_reg extends fgui.GButton {
  12384. static createInstance() {
  12385. return (fgui.UIPackage.createObject("game", "Button_reg"));
  12386. }
  12387. onConstruct() {
  12388. this.button = this.getController("button");
  12389. this.n6 = (this.getChild("n6"));
  12390. this.n4 = (this.getChild("n4"));
  12391. }
  12392. }
  12393. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  12394. class ui_screenNode extends fgui.GComponent {
  12395. static createInstance() {
  12396. return (fgui.UIPackage.createObject("game", "screenNode"));
  12397. }
  12398. onConstruct() {
  12399. this.n9 = (this.getChild("n9"));
  12400. this.screenImg = (this.getChild("screenImg"));
  12401. }
  12402. }
  12403. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12404. class ui_GetAwrad_com1 extends fgui.GComponent {
  12405. static createInstance() {
  12406. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12407. }
  12408. onConstruct() {
  12409. this.n38 = (this.getChild("n38"));
  12410. this.n39 = (this.getChild("n39"));
  12411. this.n40 = (this.getChild("n40"));
  12412. this.t0 = this.getTransition("t0");
  12413. this.t1 = this.getTransition("t1");
  12414. }
  12415. }
  12416. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12417. class ui_GetAwrad_com2 extends fgui.GComponent {
  12418. static createInstance() {
  12419. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12420. }
  12421. onConstruct() {
  12422. this.n39 = (this.getChild("n39"));
  12423. this.n40 = (this.getChild("n40"));
  12424. this.t0 = this.getTransition("t0");
  12425. }
  12426. }
  12427. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12428. class ui_Component128 extends fgui.GComponent {
  12429. static createInstance() {
  12430. return (fgui.UIPackage.createObject("game", "Component128"));
  12431. }
  12432. onConstruct() {
  12433. this.n38 = (this.getChild("n38"));
  12434. this.n40 = (this.getChild("n40"));
  12435. }
  12436. }
  12437. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12438. class ui_Component100_1 extends fgui.GComponent {
  12439. static createInstance() {
  12440. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12441. }
  12442. onConstruct() {
  12443. this.myNode = (this.getChild("myNode"));
  12444. this.t0 = this.getTransition("t0");
  12445. }
  12446. }
  12447. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12448. class ui_Component142 extends fgui.GComponent {
  12449. static createInstance() {
  12450. return (fgui.UIPackage.createObject("game", "Component142"));
  12451. }
  12452. onConstruct() {
  12453. this.n41 = (this.getChild("n41"));
  12454. this.n42 = (this.getChild("n42"));
  12455. }
  12456. }
  12457. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12458. class ui_main_guang extends fgui.GComponent {
  12459. static createInstance() {
  12460. return (fgui.UIPackage.createObject("game", "main_guang"));
  12461. }
  12462. onConstruct() {
  12463. this.n1 = (this.getChild("n1"));
  12464. this.n2 = (this.getChild("n2"));
  12465. this.n3 = (this.getChild("n3"));
  12466. this.n4 = (this.getChild("n4"));
  12467. this.n5 = (this.getChild("n5"));
  12468. this.n6 = (this.getChild("n6"));
  12469. this.n8 = (this.getChild("n8"));
  12470. this.t0 = this.getTransition("t0");
  12471. }
  12472. }
  12473. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12474. class ui_try_com1 extends fgui.GComponent {
  12475. static createInstance() {
  12476. return (fgui.UIPackage.createObject("game", "try_com1"));
  12477. }
  12478. onConstruct() {
  12479. this.c1 = this.getController("c1");
  12480. this.n0 = (this.getChild("n0"));
  12481. this.n2 = (this.getChild("n2"));
  12482. this.cancelBtn = (this.getChild("cancelBtn"));
  12483. this.videoBtn = (this.getChild("videoBtn"));
  12484. this.n9 = (this.getChild("n9"));
  12485. this.n24 = (this.getChild("n24"));
  12486. this.titleTxt = (this.getChild("titleTxt"));
  12487. this.n32 = (this.getChild("n32"));
  12488. this.n29 = (this.getChild("n29"));
  12489. this.n36 = (this.getChild("n36"));
  12490. this.txtTime = (this.getChild("txtTime"));
  12491. this.t0 = this.getTransition("t0");
  12492. }
  12493. }
  12494. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12495. class ui_try_com2 extends fgui.GComponent {
  12496. static createInstance() {
  12497. return (fgui.UIPackage.createObject("game", "try_com2"));
  12498. }
  12499. onConstruct() {
  12500. this.skillicon = (this.getChild("skillicon"));
  12501. this.n35 = (this.getChild("n35"));
  12502. this.n31 = (this.getChild("n31"));
  12503. this.n32 = (this.getChild("n32"));
  12504. this.n33 = (this.getChild("n33"));
  12505. this.n34 = (this.getChild("n34"));
  12506. }
  12507. }
  12508. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12509. class ui_try_com3 extends fgui.GComponent {
  12510. static createInstance() {
  12511. return (fgui.UIPackage.createObject("game", "try_com3"));
  12512. }
  12513. onConstruct() {
  12514. this.n33 = (this.getChild("n33"));
  12515. this.n34 = (this.getChild("n34"));
  12516. this.n35 = (this.getChild("n35"));
  12517. this.t0 = this.getTransition("t0");
  12518. }
  12519. }
  12520. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  12521. class ui_huihe1 extends fgui.GComponent {
  12522. static createInstance() {
  12523. return (fgui.UIPackage.createObject("game", "huihe1"));
  12524. }
  12525. onConstruct() {
  12526. this.n0 = (this.getChild("n0"));
  12527. this.n1 = (this.getChild("n1"));
  12528. this.t0 = this.getTransition("t0");
  12529. }
  12530. }
  12531. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  12532. class ui_huihe2 extends fgui.GComponent {
  12533. static createInstance() {
  12534. return (fgui.UIPackage.createObject("game", "huihe2"));
  12535. }
  12536. onConstruct() {
  12537. this.n0 = (this.getChild("n0"));
  12538. this.n1 = (this.getChild("n1"));
  12539. this.t0 = this.getTransition("t0");
  12540. }
  12541. }
  12542. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  12543. class ui_Component143 extends fgui.GComponent {
  12544. static createInstance() {
  12545. return (fgui.UIPackage.createObject("game", "Component143"));
  12546. }
  12547. onConstruct() {
  12548. this.n3 = (this.getChild("n3"));
  12549. this.n4 = (this.getChild("n4"));
  12550. this.n5 = (this.getChild("n5"));
  12551. this.n6 = (this.getChild("n6"));
  12552. this.n7 = (this.getChild("n7"));
  12553. this.n8 = (this.getChild("n8"));
  12554. this.n9 = (this.getChild("n9"));
  12555. this.n10 = (this.getChild("n10"));
  12556. this.t0 = this.getTransition("t0");
  12557. }
  12558. }
  12559. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  12560. class ui_dh_jingbi2 extends fgui.GComponent {
  12561. static createInstance() {
  12562. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  12563. }
  12564. onConstruct() {
  12565. this.n0 = (this.getChild("n0"));
  12566. this.n1 = (this.getChild("n1"));
  12567. this.n2 = (this.getChild("n2"));
  12568. this.n3 = (this.getChild("n3"));
  12569. this.n4 = (this.getChild("n4"));
  12570. this.n5 = (this.getChild("n5"));
  12571. this.n6 = (this.getChild("n6"));
  12572. this.n8 = (this.getChild("n8"));
  12573. this.n10 = (this.getChild("n10"));
  12574. this.t0 = this.getTransition("t0");
  12575. }
  12576. }
  12577. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  12578. class ui_dh_jingbi2_1 extends fgui.GComponent {
  12579. static createInstance() {
  12580. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  12581. }
  12582. onConstruct() {
  12583. this.n1 = (this.getChild("n1"));
  12584. this.n4 = (this.getChild("n4"));
  12585. this.t0 = this.getTransition("t0");
  12586. }
  12587. }
  12588. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  12589. class ui_dh_jingbi3 extends fgui.GComponent {
  12590. static createInstance() {
  12591. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  12592. }
  12593. onConstruct() {
  12594. this.n0 = (this.getChild("n0"));
  12595. this.n1 = (this.getChild("n1"));
  12596. this.n2 = (this.getChild("n2"));
  12597. this.n3 = (this.getChild("n3"));
  12598. this.n4 = (this.getChild("n4"));
  12599. this.n5 = (this.getChild("n5"));
  12600. this.n6 = (this.getChild("n6"));
  12601. this.n8 = (this.getChild("n8"));
  12602. this.n10 = (this.getChild("n10"));
  12603. this.t0 = this.getTransition("t0");
  12604. }
  12605. }
  12606. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  12607. class ui_dh_jingbi3_1 extends fgui.GComponent {
  12608. static createInstance() {
  12609. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  12610. }
  12611. onConstruct() {
  12612. this.n3 = (this.getChild("n3"));
  12613. this.n1 = (this.getChild("n1"));
  12614. this.t0 = this.getTransition("t0");
  12615. }
  12616. }
  12617. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  12618. class ui_hb_jinbi1 extends fgui.GButton {
  12619. static createInstance() {
  12620. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  12621. }
  12622. onConstruct() {
  12623. this.n20 = (this.getChild("n20"));
  12624. this.n25 = (this.getChild("n25"));
  12625. this.coinTxt = (this.getChild("coinTxt"));
  12626. this.n28 = (this.getChild("n28"));
  12627. this.n32 = (this.getChild("n32"));
  12628. this.n38 = (this.getChild("n38"));
  12629. this.n45 = (this.getChild("n45"));
  12630. this.getTips = (this.getChild("getTips"));
  12631. this.n39 = (this.getChild("n39"));
  12632. this.diamondTxt = (this.getChild("diamondTxt"));
  12633. this.n41 = (this.getChild("n41"));
  12634. this.n42 = (this.getChild("n42"));
  12635. this.n46 = (this.getChild("n46"));
  12636. this.n47 = (this.getChild("n47"));
  12637. this.n48 = (this.getChild("n48"));
  12638. this.t0 = this.getTransition("t0");
  12639. }
  12640. }
  12641. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  12642. class ui_hb_jinbi2 extends fgui.GButton {
  12643. static createInstance() {
  12644. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  12645. }
  12646. onConstruct() {
  12647. this.n20 = (this.getChild("n20"));
  12648. this.n25 = (this.getChild("n25"));
  12649. this.coinTxt = (this.getChild("coinTxt"));
  12650. this.n28 = (this.getChild("n28"));
  12651. this.n32 = (this.getChild("n32"));
  12652. this.n38 = (this.getChild("n38"));
  12653. this.n39 = (this.getChild("n39"));
  12654. this.diamondTxt = (this.getChild("diamondTxt"));
  12655. this.n41 = (this.getChild("n41"));
  12656. this.n42 = (this.getChild("n42"));
  12657. this.n43 = (this.getChild("n43"));
  12658. this.n44 = (this.getChild("n44"));
  12659. this.n45 = (this.getChild("n45"));
  12660. this.t0 = this.getTransition("t0");
  12661. }
  12662. }
  12663. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  12664. class ui_hb_jinbi3 extends fgui.GButton {
  12665. static createInstance() {
  12666. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  12667. }
  12668. onConstruct() {
  12669. this.n20 = (this.getChild("n20"));
  12670. this.n25 = (this.getChild("n25"));
  12671. this.coinTxt = (this.getChild("coinTxt"));
  12672. this.n28 = (this.getChild("n28"));
  12673. this.n32 = (this.getChild("n32"));
  12674. this.n38 = (this.getChild("n38"));
  12675. this.n39 = (this.getChild("n39"));
  12676. this.diamondTxt = (this.getChild("diamondTxt"));
  12677. this.n41 = (this.getChild("n41"));
  12678. this.n42 = (this.getChild("n42"));
  12679. this.n43 = (this.getChild("n43"));
  12680. this.n44 = (this.getChild("n44"));
  12681. this.n45 = (this.getChild("n45"));
  12682. this.t0 = this.getTransition("t0");
  12683. }
  12684. }
  12685. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  12686. class ui_Component104 extends fgui.GComponent {
  12687. static createInstance() {
  12688. return (fgui.UIPackage.createObject("game", "Component104"));
  12689. }
  12690. onConstruct() {
  12691. this.c1 = this.getController("c1");
  12692. this.n12 = (this.getChild("n12"));
  12693. this.coinBtn = (this.getChild("coinBtn"));
  12694. this.diamondBtn = (this.getChild("diamondBtn"));
  12695. this.node3 = (this.getChild("node3"));
  12696. this.node4 = (this.getChild("node4"));
  12697. this.node5 = (this.getChild("node5"));
  12698. this.node1 = (this.getChild("node1"));
  12699. this.node2 = (this.getChild("node2"));
  12700. this.node6 = (this.getChild("node6"));
  12701. this.t0 = this.getTransition("t0");
  12702. }
  12703. }
  12704. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  12705. class ui_Component105 extends fgui.GButton {
  12706. static createInstance() {
  12707. return (fgui.UIPackage.createObject("game", "Component105"));
  12708. }
  12709. onConstruct() {
  12710. this.c1 = this.getController("c1");
  12711. this.n49 = (this.getChild("n49"));
  12712. this.n18 = (this.getChild("n18"));
  12713. this.n46 = (this.getChild("n46"));
  12714. this.n48 = (this.getChild("n48"));
  12715. }
  12716. }
  12717. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  12718. class ui_Component106 extends fgui.GButton {
  12719. static createInstance() {
  12720. return (fgui.UIPackage.createObject("game", "Component106"));
  12721. }
  12722. onConstruct() {
  12723. this.c1 = this.getController("c1");
  12724. this.n49 = (this.getChild("n49"));
  12725. this.n18 = (this.getChild("n18"));
  12726. this.n46 = (this.getChild("n46"));
  12727. this.n48 = (this.getChild("n48"));
  12728. }
  12729. }
  12730. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  12731. class ui_hb_zs1 extends fgui.GButton {
  12732. static createInstance() {
  12733. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  12734. }
  12735. onConstruct() {
  12736. this.c1 = this.getController("c1");
  12737. this.n20 = (this.getChild("n20"));
  12738. this.n21 = (this.getChild("n21"));
  12739. this.n26 = (this.getChild("n26"));
  12740. this.n27 = (this.getChild("n27"));
  12741. this.shareTxt = (this.getChild("shareTxt"));
  12742. this.n32 = (this.getChild("n32"));
  12743. this.n38 = (this.getChild("n38"));
  12744. this.n39 = (this.getChild("n39"));
  12745. this.n44 = (this.getChild("n44"));
  12746. this.diamondTxt = (this.getChild("diamondTxt"));
  12747. this.n41 = (this.getChild("n41"));
  12748. this.n45 = (this.getChild("n45"));
  12749. this.n47 = (this.getChild("n47"));
  12750. this.n48 = (this.getChild("n48"));
  12751. this.randTxt = (this.getChild("randTxt"));
  12752. this.n50 = (this.getChild("n50"));
  12753. this.t0 = this.getTransition("t0");
  12754. }
  12755. }
  12756. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  12757. class ui_dh_zs1 extends fgui.GComponent {
  12758. static createInstance() {
  12759. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  12760. }
  12761. onConstruct() {
  12762. this.n10 = (this.getChild("n10"));
  12763. this.n9 = (this.getChild("n9"));
  12764. this.n1 = (this.getChild("n1"));
  12765. this.n2 = (this.getChild("n2"));
  12766. this.n3 = (this.getChild("n3"));
  12767. this.n4 = (this.getChild("n4"));
  12768. this.n5 = (this.getChild("n5"));
  12769. this.n6 = (this.getChild("n6"));
  12770. this.n8 = (this.getChild("n8"));
  12771. this.n11 = (this.getChild("n11"));
  12772. this.t0 = this.getTransition("t0");
  12773. }
  12774. }
  12775. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  12776. class ui_dh_zs1_1 extends fgui.GComponent {
  12777. static createInstance() {
  12778. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  12779. }
  12780. onConstruct() {
  12781. this.n3 = (this.getChild("n3"));
  12782. this.n1 = (this.getChild("n1"));
  12783. this.t0 = this.getTransition("t0");
  12784. }
  12785. }
  12786. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  12787. class ui_hb_zs2 extends fgui.GButton {
  12788. static createInstance() {
  12789. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  12790. }
  12791. onConstruct() {
  12792. this.n20 = (this.getChild("n20"));
  12793. this.n21 = (this.getChild("n21"));
  12794. this.n26 = (this.getChild("n26"));
  12795. this.n27 = (this.getChild("n27"));
  12796. this.n32 = (this.getChild("n32"));
  12797. this.n38 = (this.getChild("n38"));
  12798. this.n39 = (this.getChild("n39"));
  12799. this.n44 = (this.getChild("n44"));
  12800. this.diamondTxt = (this.getChild("diamondTxt"));
  12801. this.n41 = (this.getChild("n41"));
  12802. this.n45 = (this.getChild("n45"));
  12803. this.t0 = this.getTransition("t0");
  12804. }
  12805. }
  12806. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  12807. class ui_hb_zs3 extends fgui.GButton {
  12808. static createInstance() {
  12809. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  12810. }
  12811. onConstruct() {
  12812. this.n20 = (this.getChild("n20"));
  12813. this.n21 = (this.getChild("n21"));
  12814. this.n26 = (this.getChild("n26"));
  12815. this.n27 = (this.getChild("n27"));
  12816. this.n32 = (this.getChild("n32"));
  12817. this.n38 = (this.getChild("n38"));
  12818. this.n47 = (this.getChild("n47"));
  12819. this.t0 = this.getTransition("t0");
  12820. }
  12821. }
  12822. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12823. class ui_dh_zs2 extends fgui.GComponent {
  12824. static createInstance() {
  12825. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12826. }
  12827. onConstruct() {
  12828. this.n10 = (this.getChild("n10"));
  12829. this.n9 = (this.getChild("n9"));
  12830. this.n1 = (this.getChild("n1"));
  12831. this.n2 = (this.getChild("n2"));
  12832. this.n3 = (this.getChild("n3"));
  12833. this.n4 = (this.getChild("n4"));
  12834. this.n5 = (this.getChild("n5"));
  12835. this.n6 = (this.getChild("n6"));
  12836. this.n8 = (this.getChild("n8"));
  12837. this.n11 = (this.getChild("n11"));
  12838. this.t0 = this.getTransition("t0");
  12839. }
  12840. }
  12841. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12842. class ui_dh_zs2_1 extends fgui.GComponent {
  12843. static createInstance() {
  12844. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12845. }
  12846. onConstruct() {
  12847. this.n3 = (this.getChild("n3"));
  12848. this.n1 = (this.getChild("n1"));
  12849. this.t0 = this.getTransition("t0");
  12850. }
  12851. }
  12852. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12853. class ui_dh_zs3 extends fgui.GComponent {
  12854. static createInstance() {
  12855. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12856. }
  12857. onConstruct() {
  12858. this.n10 = (this.getChild("n10"));
  12859. this.n9 = (this.getChild("n9"));
  12860. this.n1 = (this.getChild("n1"));
  12861. this.n2 = (this.getChild("n2"));
  12862. this.n3 = (this.getChild("n3"));
  12863. this.n4 = (this.getChild("n4"));
  12864. this.n5 = (this.getChild("n5"));
  12865. this.n6 = (this.getChild("n6"));
  12866. this.n8 = (this.getChild("n8"));
  12867. this.n11 = (this.getChild("n11"));
  12868. this.t0 = this.getTransition("t0");
  12869. }
  12870. }
  12871. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12872. class ui_dh_zs3_1 extends fgui.GComponent {
  12873. static createInstance() {
  12874. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12875. }
  12876. onConstruct() {
  12877. this.n3 = (this.getChild("n3"));
  12878. this.n1 = (this.getChild("n1"));
  12879. this.t0 = this.getTransition("t0");
  12880. }
  12881. }
  12882. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12883. class ui_Component107 extends fgui.GComponent {
  12884. static createInstance() {
  12885. return (fgui.UIPackage.createObject("game", "Component107"));
  12886. }
  12887. onConstruct() {
  12888. this.n18 = (this.getChild("n18"));
  12889. this.n19 = (this.getChild("n19"));
  12890. this.n20 = (this.getChild("n20"));
  12891. this.n21 = (this.getChild("n21"));
  12892. this.n22 = (this.getChild("n22"));
  12893. this.levelTxt = (this.getChild("levelTxt"));
  12894. this.t0 = this.getTransition("t0");
  12895. }
  12896. }
  12897. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12898. class ui_box_com1 extends fgui.GComponent {
  12899. static createInstance() {
  12900. return (fgui.UIPackage.createObject("game", "box_com1"));
  12901. }
  12902. onConstruct() {
  12903. this.n14 = (this.getChild("n14"));
  12904. this.n6 = (this.getChild("n6"));
  12905. this.t0 = this.getTransition("t0");
  12906. }
  12907. }
  12908. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12909. class ui_box_com2 extends fgui.GProgressBar {
  12910. static createInstance() {
  12911. return (fgui.UIPackage.createObject("game", "box_com2"));
  12912. }
  12913. onConstruct() {
  12914. this.bg0 = (this.getChild("bg0"));
  12915. this.bg = (this.getChild("bg"));
  12916. this.bar = (this.getChild("bar"));
  12917. this.n7 = (this.getChild("n7"));
  12918. this.n8 = (this.getChild("n8"));
  12919. this.n10 = (this.getChild("n10"));
  12920. this.n11 = (this.getChild("n11"));
  12921. this.n12 = (this.getChild("n12"));
  12922. }
  12923. }
  12924. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12925. class ui_box_com4 extends fgui.GComponent {
  12926. static createInstance() {
  12927. return (fgui.UIPackage.createObject("game", "box_com4"));
  12928. }
  12929. onConstruct() {
  12930. this.n8 = (this.getChild("n8"));
  12931. this.t0 = this.getTransition("t0");
  12932. }
  12933. }
  12934. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12935. class ui_box_com3 extends fgui.GComponent {
  12936. static createInstance() {
  12937. return (fgui.UIPackage.createObject("game", "box_com3"));
  12938. }
  12939. onConstruct() {
  12940. this.n2 = (this.getChild("n2"));
  12941. this.n3 = (this.getChild("n3"));
  12942. this.n4 = (this.getChild("n4"));
  12943. this.n5 = (this.getChild("n5"));
  12944. this.t0 = this.getTransition("t0");
  12945. this.t1 = this.getTransition("t1");
  12946. }
  12947. }
  12948. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12949. class ui_Component97 extends fgui.GComponent {
  12950. static createInstance() {
  12951. return (fgui.UIPackage.createObject("game", "Component97"));
  12952. }
  12953. onConstruct() {
  12954. this.c1 = this.getController("c1");
  12955. this.n46 = (this.getChild("n46"));
  12956. this.diamondNode = (this.getChild("diamondNode"));
  12957. this.coinNode = (this.getChild("coinNode"));
  12958. this.t0 = this.getTransition("t0");
  12959. }
  12960. }
  12961. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12962. class ui_Component98 extends fgui.GButton {
  12963. static createInstance() {
  12964. return (fgui.UIPackage.createObject("game", "Component98"));
  12965. }
  12966. onConstruct() {
  12967. this.n8 = (this.getChild("n8"));
  12968. this.n40 = (this.getChild("n40"));
  12969. }
  12970. }
  12971. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12972. class ui_Component28_11 extends fgui.GButton {
  12973. static createInstance() {
  12974. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12975. }
  12976. onConstruct() {
  12977. this.c1 = this.getController("c1");
  12978. this.n12 = (this.getChild("n12"));
  12979. this.n17 = (this.getChild("n17"));
  12980. this.n13 = (this.getChild("n13"));
  12981. this.diamondTxt = (this.getChild("diamondTxt"));
  12982. this.n15 = (this.getChild("n15"));
  12983. this.n16 = (this.getChild("n16"));
  12984. }
  12985. }
  12986. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12987. class ui_Component58_11 extends fgui.GComponent {
  12988. static createInstance() {
  12989. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12990. }
  12991. onConstruct() {
  12992. this.c1 = this.getController("c1");
  12993. this.n23 = (this.getChild("n23"));
  12994. this.n41 = (this.getChild("n41"));
  12995. this.myList = (this.getChild("myList"));
  12996. this.n_qiuGan = (this.getChild("n_qiuGan"));
  12997. this.n_daoju = (this.getChild("n_daoju"));
  12998. this.djList = (this.getChild("djList"));
  12999. this.t0 = this.getTransition("t0");
  13000. }
  13001. }
  13002. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13003. class ui_Component100 extends fgui.GComponent {
  13004. static createInstance() {
  13005. return (fgui.UIPackage.createObject("game", "Component100"));
  13006. }
  13007. onConstruct() {
  13008. this.c1 = this.getController("c1");
  13009. this.n75 = (this.getChild("n75"));
  13010. this.n76 = (this.getChild("n76"));
  13011. this.n80 = (this.getChild("n80"));
  13012. this.txt = (this.getChild("txt"));
  13013. this.spineRoot = (this.getChild("spineRoot"));
  13014. }
  13015. }
  13016. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13017. class ui_Component101 extends fgui.GComponent {
  13018. static createInstance() {
  13019. return (fgui.UIPackage.createObject("game", "Component101"));
  13020. }
  13021. onConstruct() {
  13022. this.c1 = this.getController("c1");
  13023. this.n36 = (this.getChild("n36"));
  13024. this.n35 = (this.getChild("n35"));
  13025. this.n33 = (this.getChild("n33"));
  13026. this.n34 = (this.getChild("n34"));
  13027. }
  13028. }
  13029. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13030. class ui_Component53 extends fgui.GComponent {
  13031. static createInstance() {
  13032. return (fgui.UIPackage.createObject("game", "Component53"));
  13033. }
  13034. onConstruct() {
  13035. this.n0 = (this.getChild("n0"));
  13036. this.n1 = (this.getChild("n1"));
  13037. this.n2 = (this.getChild("n2"));
  13038. this.n3 = (this.getChild("n3"));
  13039. this.n4 = (this.getChild("n4"));
  13040. this.n5 = (this.getChild("n5"));
  13041. this.n6 = (this.getChild("n6"));
  13042. this.n7 = (this.getChild("n7"));
  13043. this.n8 = (this.getChild("n8"));
  13044. this.n9 = (this.getChild("n9"));
  13045. this.n10 = (this.getChild("n10"));
  13046. this.n11 = (this.getChild("n11"));
  13047. this.n12 = (this.getChild("n12"));
  13048. this.n13 = (this.getChild("n13"));
  13049. this.n14 = (this.getChild("n14"));
  13050. this.n15 = (this.getChild("n15"));
  13051. this.n16 = (this.getChild("n16"));
  13052. this.n19 = (this.getChild("n19"));
  13053. this.n20 = (this.getChild("n20"));
  13054. this.n21 = (this.getChild("n21"));
  13055. this.n22 = (this.getChild("n22"));
  13056. this.n23 = (this.getChild("n23"));
  13057. this.n24 = (this.getChild("n24"));
  13058. this.n25 = (this.getChild("n25"));
  13059. this.n26 = (this.getChild("n26"));
  13060. this.n27 = (this.getChild("n27"));
  13061. this.n28 = (this.getChild("n28"));
  13062. this.n29 = (this.getChild("n29"));
  13063. this.n30 = (this.getChild("n30"));
  13064. this.n31 = (this.getChild("n31"));
  13065. this.n32 = (this.getChild("n32"));
  13066. this.n33 = (this.getChild("n33"));
  13067. this.n34 = (this.getChild("n34"));
  13068. this.n35 = (this.getChild("n35"));
  13069. this.t0 = this.getTransition("t0");
  13070. }
  13071. }
  13072. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13073. class ui_Component58 extends fgui.GComponent {
  13074. static createInstance() {
  13075. return (fgui.UIPackage.createObject("game", "Component58"));
  13076. }
  13077. onConstruct() {
  13078. this.n23 = (this.getChild("n23"));
  13079. this.n41 = (this.getChild("n41"));
  13080. this.n8 = (this.getChild("n8"));
  13081. this.skillList = (this.getChild("skillList"));
  13082. this.t0 = this.getTransition("t0");
  13083. }
  13084. }
  13085. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13086. class ui_Component59 extends fgui.GComponent {
  13087. static createInstance() {
  13088. return (fgui.UIPackage.createObject("game", "Component59"));
  13089. }
  13090. onConstruct() {
  13091. this.n3 = (this.getChild("n3"));
  13092. this.msgTxt = (this.getChild("msgTxt"));
  13093. this.t0 = this.getTransition("t0");
  13094. }
  13095. }
  13096. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13097. class ui_RulerNode extends fgui.GComponent {
  13098. static createInstance() {
  13099. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13100. }
  13101. onConstruct() {
  13102. this.n6 = (this.getChild("n6"));
  13103. this.n4 = (this.getChild("n4"));
  13104. this.img1 = (this.getChild("img1"));
  13105. this.img2 = (this.getChild("img2"));
  13106. }
  13107. }
  13108. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13109. class ui_Component108 extends fgui.GComponent {
  13110. static createInstance() {
  13111. return (fgui.UIPackage.createObject("game", "Component108"));
  13112. }
  13113. onConstruct() {
  13114. this.n19 = (this.getChild("n19"));
  13115. this.t0 = this.getTransition("t0");
  13116. }
  13117. }
  13118. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13119. class ui_Component63 extends fgui.GComponent {
  13120. static createInstance() {
  13121. return (fgui.UIPackage.createObject("game", "Component63"));
  13122. }
  13123. onConstruct() {
  13124. this.n66 = (this.getChild("n66"));
  13125. this.n56 = (this.getChild("n56"));
  13126. this.n63 = (this.getChild("n63"));
  13127. this.n65 = (this.getChild("n65"));
  13128. this.t0 = this.getTransition("t0");
  13129. }
  13130. }
  13131. ui_Component63.URL = "ui://isxx5ak7h657452";
  13132. class ui_topNode extends fgui.GComponent {
  13133. static createInstance() {
  13134. return (fgui.UIPackage.createObject("game", "topNode"));
  13135. }
  13136. onConstruct() {
  13137. this.selfProgress = (this.getChild("selfProgress"));
  13138. this.aiProgress = (this.getChild("aiProgress"));
  13139. this.selfKuang = (this.getChild("selfKuang"));
  13140. this.aiKuang = (this.getChild("aiKuang"));
  13141. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13142. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13143. this.n33 = (this.getChild("n33"));
  13144. this.n34 = (this.getChild("n34"));
  13145. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13146. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13147. this.selfBallList = (this.getChild("selfBallList"));
  13148. this.aiBallList = (this.getChild("aiBallList"));
  13149. this.middleNode = (this.getChild("middleNode"));
  13150. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13151. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13152. this.scoreNode = (this.getChild("scoreNode"));
  13153. this.selfTips = (this.getChild("selfTips"));
  13154. this.aiTips = (this.getChild("aiTips"));
  13155. }
  13156. }
  13157. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13158. class ui_selfProgress extends fgui.GProgressBar {
  13159. static createInstance() {
  13160. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13161. }
  13162. onConstruct() {
  13163. this.n3 = (this.getChild("n3"));
  13164. this.bar = (this.getChild("bar"));
  13165. }
  13166. }
  13167. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13168. class ui_aiProgress extends fgui.GProgressBar {
  13169. static createInstance() {
  13170. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13171. }
  13172. onConstruct() {
  13173. this.n3 = (this.getChild("n3"));
  13174. this.bar = (this.getChild("bar"));
  13175. }
  13176. }
  13177. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13178. class ui_ballDisplay extends fgui.GComponent {
  13179. static createInstance() {
  13180. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13181. }
  13182. onConstruct() {
  13183. this.myImg = (this.getChild("myImg"));
  13184. }
  13185. }
  13186. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13187. class ui_moveNode extends fgui.GComponent {
  13188. static createInstance() {
  13189. return (fgui.UIPackage.createObject("game", "moveNode"));
  13190. }
  13191. onConstruct() {
  13192. this.n8 = (this.getChild("n8"));
  13193. this.finger = (this.getChild("finger"));
  13194. }
  13195. }
  13196. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13197. class ui_cancelBtn extends fgui.GButton {
  13198. static createInstance() {
  13199. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13200. }
  13201. onConstruct() {
  13202. this.c1 = this.getController("c1");
  13203. this.n0 = (this.getChild("n0"));
  13204. this.n1 = (this.getChild("n1"));
  13205. }
  13206. }
  13207. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13208. class ui_shareBtn extends fgui.GButton {
  13209. static createInstance() {
  13210. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13211. }
  13212. onConstruct() {
  13213. this.c1 = this.getController("c1");
  13214. this.n2 = (this.getChild("n2"));
  13215. this.n1 = (this.getChild("n1"));
  13216. this.n3 = (this.getChild("n3"));
  13217. this.n4 = (this.getChild("n4"));
  13218. this.n5 = (this.getChild("n5"));
  13219. this.n6 = (this.getChild("n6"));
  13220. }
  13221. }
  13222. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13223. class ui_share2Btn extends fgui.GButton {
  13224. static createInstance() {
  13225. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13226. }
  13227. onConstruct() {
  13228. this.n3 = (this.getChild("n3"));
  13229. }
  13230. }
  13231. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13232. class ui_rodMethodNode extends fgui.GComponent {
  13233. static createInstance() {
  13234. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13235. }
  13236. onConstruct() {
  13237. this.bg = (this.getChild("bg"));
  13238. this.dot = (this.getChild("dot"));
  13239. }
  13240. }
  13241. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13242. class ui_sureBtn extends fgui.GButton {
  13243. static createInstance() {
  13244. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13245. }
  13246. onConstruct() {
  13247. this.n2 = (this.getChild("n2"));
  13248. this.n1 = (this.getChild("n1"));
  13249. }
  13250. }
  13251. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13252. class ui_Component18 extends fgui.GComponent {
  13253. static createInstance() {
  13254. return (fgui.UIPackage.createObject("game", "Component18"));
  13255. }
  13256. onConstruct() {
  13257. this.c1 = this.getController("c1");
  13258. this.nameTxt = (this.getChild("nameTxt"));
  13259. this.headImg = (this.getChild("headImg"));
  13260. this.n24 = (this.getChild("n24"));
  13261. this.skillImg = (this.getChild("skillImg"));
  13262. this.skillTxt = (this.getChild("skillTxt"));
  13263. }
  13264. }
  13265. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  13266. class ui_Component45 extends fgui.GComponent {
  13267. static createInstance() {
  13268. return (fgui.UIPackage.createObject("game", "Component45"));
  13269. }
  13270. onConstruct() {
  13271. this.c1 = this.getController("c1");
  13272. this.n40 = (this.getChild("n40"));
  13273. this.n41 = (this.getChild("n41"));
  13274. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  13275. this.n42 = (this.getChild("n42"));
  13276. this.awardTxt = (this.getChild("awardTxt"));
  13277. this.n44 = (this.getChild("n44"));
  13278. this.t0 = this.getTransition("t0");
  13279. }
  13280. }
  13281. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  13282. class ui_emotionDisplay extends fgui.GButton {
  13283. static createInstance() {
  13284. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  13285. }
  13286. onConstruct() {
  13287. this.myIcon = (this.getChild("myIcon"));
  13288. }
  13289. }
  13290. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13291. class ui_Component49 extends fgui.GButton {
  13292. static createInstance() {
  13293. return (fgui.UIPackage.createObject("game", "Component49"));
  13294. }
  13295. onConstruct() {
  13296. this.n69 = (this.getChild("n69"));
  13297. this.n56 = (this.getChild("n56"));
  13298. }
  13299. }
  13300. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  13301. class ui_Component50 extends fgui.GButton {
  13302. static createInstance() {
  13303. return (fgui.UIPackage.createObject("game", "Component50"));
  13304. }
  13305. onConstruct() {
  13306. this.n54 = (this.getChild("n54"));
  13307. this.n65 = (this.getChild("n65"));
  13308. }
  13309. }
  13310. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  13311. class ui_Component51 extends fgui.GButton {
  13312. static createInstance() {
  13313. return (fgui.UIPackage.createObject("game", "Component51"));
  13314. }
  13315. onConstruct() {
  13316. this.c1 = this.getController("c1");
  13317. this.n51 = (this.getChild("n51"));
  13318. this.n54 = (this.getChild("n54"));
  13319. }
  13320. }
  13321. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13322. class ui_Button5 extends fgui.GButton {
  13323. static createInstance() {
  13324. return (fgui.UIPackage.createObject("game", "Button5"));
  13325. }
  13326. onConstruct() {
  13327. this.c1 = this.getController("c1");
  13328. this.n0 = (this.getChild("n0"));
  13329. this.n2 = (this.getChild("n2"));
  13330. }
  13331. }
  13332. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13333. class ui_Component124 extends fgui.GComponent {
  13334. static createInstance() {
  13335. return (fgui.UIPackage.createObject("game", "Component124"));
  13336. }
  13337. onConstruct() {
  13338. this.n22 = (this.getChild("n22"));
  13339. this.shareNode = (this.getChild("shareNode"));
  13340. }
  13341. }
  13342. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13343. class ui_Component125 extends fgui.GComponent {
  13344. static createInstance() {
  13345. return (fgui.UIPackage.createObject("game", "Component125"));
  13346. }
  13347. onConstruct() {
  13348. this.n29 = (this.getChild("n29"));
  13349. this.coinTxt = (this.getChild("coinTxt"));
  13350. }
  13351. }
  13352. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13353. class ui_Component52 extends fgui.GButton {
  13354. static createInstance() {
  13355. return (fgui.UIPackage.createObject("game", "Component52"));
  13356. }
  13357. onConstruct() {
  13358. this.n35 = (this.getChild("n35"));
  13359. this.n36 = (this.getChild("n36"));
  13360. }
  13361. }
  13362. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13363. class ui_drawBtn extends fgui.GButton {
  13364. static createInstance() {
  13365. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13366. }
  13367. onConstruct() {
  13368. this.c1 = this.getController("c1");
  13369. this.n2 = (this.getChild("n2"));
  13370. this.n1 = (this.getChild("n1"));
  13371. this.n5 = (this.getChild("n5"));
  13372. }
  13373. }
  13374. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13375. class ui_Component43 extends fgui.GButton {
  13376. static createInstance() {
  13377. return (fgui.UIPackage.createObject("game", "Component43"));
  13378. }
  13379. onConstruct() {
  13380. this.n49 = (this.getChild("n49"));
  13381. }
  13382. }
  13383. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13384. class ui_wordsDisplay extends fgui.GComponent {
  13385. static createInstance() {
  13386. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13387. }
  13388. onConstruct() {
  13389. this.txt = (this.getChild("txt"));
  13390. this.n63 = (this.getChild("n63"));
  13391. }
  13392. }
  13393. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13394. class ui_Component_phb extends fgui.GComponent {
  13395. static createInstance() {
  13396. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13397. }
  13398. onConstruct() {
  13399. this.n3 = (this.getChild("n3"));
  13400. this.n4 = (this.getChild("n4"));
  13401. }
  13402. }
  13403. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13404. class ui_Component3 extends fgui.GComponent {
  13405. static createInstance() {
  13406. return (fgui.UIPackage.createObject("game", "Component3"));
  13407. }
  13408. onConstruct() {
  13409. this.n26 = (this.getChild("n26"));
  13410. this.n24 = (this.getChild("n24"));
  13411. this.nameTxt = (this.getChild("nameTxt"));
  13412. this.headRoot = (this.getChild("headRoot"));
  13413. }
  13414. }
  13415. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13416. class ui_Component4 extends fgui.GComponent {
  13417. static createInstance() {
  13418. return (fgui.UIPackage.createObject("game", "Component4"));
  13419. }
  13420. onConstruct() {
  13421. this.headImg = (this.getChild("headImg"));
  13422. }
  13423. }
  13424. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13425. class ui_Component7 extends fgui.GButton {
  13426. static createInstance() {
  13427. return (fgui.UIPackage.createObject("game", "Component7"));
  13428. }
  13429. onConstruct() {
  13430. this.n17 = (this.getChild("n17"));
  13431. }
  13432. }
  13433. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13434. class ui_Component8 extends fgui.GButton {
  13435. static createInstance() {
  13436. return (fgui.UIPackage.createObject("game", "Component8"));
  13437. }
  13438. onConstruct() {
  13439. this.n19 = (this.getChild("n19"));
  13440. }
  13441. }
  13442. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13443. class ui_Component10 extends fgui.GButton {
  13444. static createInstance() {
  13445. return (fgui.UIPackage.createObject("game", "Component10"));
  13446. }
  13447. onConstruct() {
  13448. this.c1 = this.getController("c1");
  13449. this.n40 = (this.getChild("n40"));
  13450. }
  13451. }
  13452. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13453. class ui_Component11 extends fgui.GButton {
  13454. static createInstance() {
  13455. return (fgui.UIPackage.createObject("game", "Component11"));
  13456. }
  13457. onConstruct() {
  13458. this.n34 = (this.getChild("n34"));
  13459. }
  13460. }
  13461. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13462. class ui_Component12 extends fgui.GButton {
  13463. static createInstance() {
  13464. return (fgui.UIPackage.createObject("game", "Component12"));
  13465. }
  13466. onConstruct() {
  13467. this.n35 = (this.getChild("n35"));
  13468. }
  13469. }
  13470. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13471. class ui_Component13 extends fgui.GButton {
  13472. static createInstance() {
  13473. return (fgui.UIPackage.createObject("game", "Component13"));
  13474. }
  13475. onConstruct() {
  13476. this.n27 = (this.getChild("n27"));
  13477. this.n36 = (this.getChild("n36"));
  13478. }
  13479. }
  13480. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  13481. class ui_dh_js_tuowei extends fgui.GComponent {
  13482. static createInstance() {
  13483. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  13484. }
  13485. onConstruct() {
  13486. this.n19 = (this.getChild("n19"));
  13487. this.n18 = (this.getChild("n18"));
  13488. this.n0 = (this.getChild("n0"));
  13489. this.n3 = (this.getChild("n3"));
  13490. this.n4 = (this.getChild("n4"));
  13491. this.n5 = (this.getChild("n5"));
  13492. this.n6 = (this.getChild("n6"));
  13493. this.n8 = (this.getChild("n8"));
  13494. this.n9 = (this.getChild("n9"));
  13495. this.n10 = (this.getChild("n10"));
  13496. this.n11 = (this.getChild("n11"));
  13497. this.n12 = (this.getChild("n12"));
  13498. this.n13 = (this.getChild("n13"));
  13499. this.n14 = (this.getChild("n14"));
  13500. this.n15 = (this.getChild("n15"));
  13501. this.n20 = (this.getChild("n20"));
  13502. this.t0 = this.getTransition("t0");
  13503. this.t1 = this.getTransition("t1");
  13504. }
  13505. }
  13506. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  13507. class ui_dh_js_tw_g extends fgui.GComponent {
  13508. static createInstance() {
  13509. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  13510. }
  13511. onConstruct() {
  13512. this.n0 = (this.getChild("n0"));
  13513. this.n1 = (this.getChild("n1"));
  13514. this.t0 = this.getTransition("t0");
  13515. }
  13516. }
  13517. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  13518. class ui_dh_js_xingxing extends fgui.GComponent {
  13519. static createInstance() {
  13520. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  13521. }
  13522. onConstruct() {
  13523. this.n1 = (this.getChild("n1"));
  13524. this.n2 = (this.getChild("n2"));
  13525. this.n3 = (this.getChild("n3"));
  13526. this.n4 = (this.getChild("n4"));
  13527. this.n0 = (this.getChild("n0"));
  13528. this.t2 = this.getTransition("t2");
  13529. this.t1 = this.getTransition("t1");
  13530. }
  13531. }
  13532. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  13533. class ui_dh_zy_jiazai extends fgui.GComponent {
  13534. static createInstance() {
  13535. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  13536. }
  13537. onConstruct() {
  13538. this.c1 = this.getController("c1");
  13539. this.n0 = (this.getChild("n0"));
  13540. this.n1 = (this.getChild("n1"));
  13541. this.n2 = (this.getChild("n2"));
  13542. this.n4 = (this.getChild("n4"));
  13543. this.n5 = (this.getChild("n5"));
  13544. this.n6 = (this.getChild("n6"));
  13545. this.n8 = (this.getChild("n8"));
  13546. this.n7 = (this.getChild("n7"));
  13547. this.t0 = this.getTransition("t0");
  13548. }
  13549. }
  13550. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  13551. class ui_dh_js_xingxing2 extends fgui.GComponent {
  13552. static createInstance() {
  13553. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  13554. }
  13555. onConstruct() {
  13556. this.c1 = this.getController("c1");
  13557. this.n3 = (this.getChild("n3"));
  13558. this.n5 = (this.getChild("n5"));
  13559. this.n4 = (this.getChild("n4"));
  13560. this.n0 = (this.getChild("n0"));
  13561. this.n1 = (this.getChild("n1"));
  13562. this.n2 = (this.getChild("n2"));
  13563. }
  13564. }
  13565. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  13566. class ui_dh_js_tuowei2 extends fgui.GComponent {
  13567. static createInstance() {
  13568. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  13569. }
  13570. onConstruct() {
  13571. this.n19 = (this.getChild("n19"));
  13572. this.n21 = (this.getChild("n21"));
  13573. this.n0 = (this.getChild("n0"));
  13574. this.n3 = (this.getChild("n3"));
  13575. this.n4 = (this.getChild("n4"));
  13576. this.n5 = (this.getChild("n5"));
  13577. this.n6 = (this.getChild("n6"));
  13578. this.n8 = (this.getChild("n8"));
  13579. this.n9 = (this.getChild("n9"));
  13580. this.n10 = (this.getChild("n10"));
  13581. this.n11 = (this.getChild("n11"));
  13582. this.n12 = (this.getChild("n12"));
  13583. this.n13 = (this.getChild("n13"));
  13584. this.n14 = (this.getChild("n14"));
  13585. this.n15 = (this.getChild("n15"));
  13586. this.n23 = (this.getChild("n23"));
  13587. this.t0 = this.getTransition("t0");
  13588. this.t1 = this.getTransition("t1");
  13589. }
  13590. }
  13591. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  13592. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  13593. static createInstance() {
  13594. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  13595. }
  13596. onConstruct() {
  13597. this.n1 = (this.getChild("n1"));
  13598. this.n2 = (this.getChild("n2"));
  13599. this.t0 = this.getTransition("t0");
  13600. }
  13601. }
  13602. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  13603. class ui_dh_js_shibai_1 extends fgui.GComponent {
  13604. static createInstance() {
  13605. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  13606. }
  13607. onConstruct() {
  13608. this.n4 = (this.getChild("n4"));
  13609. this.n2 = (this.getChild("n2"));
  13610. this.n3 = (this.getChild("n3"));
  13611. this.idle = this.getTransition("idle");
  13612. this.attack = this.getTransition("attack");
  13613. }
  13614. }
  13615. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  13616. class ui_special extends fgui.GComponent {
  13617. static createInstance() {
  13618. return (fgui.UIPackage.createObject("game", "special"));
  13619. }
  13620. onConstruct() {
  13621. this.n18 = (this.getChild("n18"));
  13622. this.n19 = (this.getChild("n19"));
  13623. this.n20 = (this.getChild("n20"));
  13624. this.n21 = (this.getChild("n21"));
  13625. this.n22 = (this.getChild("n22"));
  13626. this.levelTxt = (this.getChild("levelTxt"));
  13627. this.n24 = (this.getChild("n24"));
  13628. this.n25 = (this.getChild("n25"));
  13629. this.t0 = this.getTransition("t0");
  13630. }
  13631. }
  13632. ui_special.URL = "ui://isxx5ak7j979v4i6";
  13633. class ui_Component145 extends fgui.GComponent {
  13634. static createInstance() {
  13635. return (fgui.UIPackage.createObject("game", "Component145"));
  13636. }
  13637. onConstruct() {
  13638. this.guanyuNode = (this.getChild("guanyuNode"));
  13639. }
  13640. }
  13641. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  13642. class ui_longBtn extends fgui.GButton {
  13643. static createInstance() {
  13644. return (fgui.UIPackage.createObject("game", "longBtn"));
  13645. }
  13646. onConstruct() {
  13647. this.c1 = this.getController("c1");
  13648. this.n2 = (this.getChild("n2"));
  13649. this.n1 = (this.getChild("n1"));
  13650. this.n4 = (this.getChild("n4"));
  13651. }
  13652. }
  13653. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  13654. class ui_Component146 extends fgui.GComponent {
  13655. static createInstance() {
  13656. return (fgui.UIPackage.createObject("game", "Component146"));
  13657. }
  13658. onConstruct() {
  13659. this.n89 = (this.getChild("n89"));
  13660. this.n90 = (this.getChild("n90"));
  13661. this.guideBtn = (this.getChild("guideBtn"));
  13662. }
  13663. }
  13664. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  13665. class ui_Component146_11 extends fgui.GComponent {
  13666. static createInstance() {
  13667. return (fgui.UIPackage.createObject("game", "Component146_11"));
  13668. }
  13669. onConstruct() {
  13670. this.n89 = (this.getChild("n89"));
  13671. this.n90 = (this.getChild("n90"));
  13672. this.guideBtn = (this.getChild("guideBtn"));
  13673. }
  13674. }
  13675. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  13676. class ui_Component111_1 extends fgui.GComponent {
  13677. static createInstance() {
  13678. return (fgui.UIPackage.createObject("game", "Component111_1"));
  13679. }
  13680. onConstruct() {
  13681. this.n68 = (this.getChild("n68"));
  13682. this.myMask = (this.getChild("myMask"));
  13683. }
  13684. }
  13685. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  13686. class ui_Component64_1 extends fgui.GComponent {
  13687. static createInstance() {
  13688. return (fgui.UIPackage.createObject("game", "Component64_1"));
  13689. }
  13690. onConstruct() {
  13691. this.n57 = (this.getChild("n57"));
  13692. this.n54 = (this.getChild("n54"));
  13693. this.n55 = (this.getChild("n55"));
  13694. this.n56 = (this.getChild("n56"));
  13695. this.t1 = this.getTransition("t1");
  13696. }
  13697. }
  13698. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  13699. class ui_ModeSelection_com123 extends fgui.GComponent {
  13700. static createInstance() {
  13701. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  13702. }
  13703. onConstruct() {
  13704. this.type1 = (this.getChild("type1"));
  13705. this.type2 = (this.getChild("type2"));
  13706. this.type3 = (this.getChild("type3"));
  13707. this.n38 = (this.getChild("n38"));
  13708. this.t0 = this.getTransition("t0");
  13709. }
  13710. }
  13711. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  13712. class ui_Component132_2 extends fgui.GComponent {
  13713. static createInstance() {
  13714. return (fgui.UIPackage.createObject("game", "Component132_2"));
  13715. }
  13716. onConstruct() {
  13717. this.n25 = (this.getChild("n25"));
  13718. this.n26 = (this.getChild("n26"));
  13719. this.n27 = (this.getChild("n27"));
  13720. this.t0 = this.getTransition("t0");
  13721. }
  13722. }
  13723. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  13724. class ui_UIPower$1 extends fgui.GComponent {
  13725. static createInstance() {
  13726. return (fgui.UIPackage.createObject("game", "UIPower"));
  13727. }
  13728. onConstruct() {
  13729. this.n11 = (this.getChild("n11"));
  13730. this.myNode = (this.getChild("myNode"));
  13731. this.t0 = this.getTransition("t0");
  13732. }
  13733. }
  13734. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  13735. class ui_Component133 extends fgui.GComponent {
  13736. static createInstance() {
  13737. return (fgui.UIPackage.createObject("game", "Component133"));
  13738. }
  13739. onConstruct() {
  13740. this.n29 = (this.getChild("n29"));
  13741. this.n30 = (this.getChild("n30"));
  13742. }
  13743. }
  13744. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  13745. class ui_Component134 extends fgui.GComponent {
  13746. static createInstance() {
  13747. return (fgui.UIPackage.createObject("game", "Component134"));
  13748. }
  13749. onConstruct() {
  13750. this.n30 = (this.getChild("n30"));
  13751. this.n31 = (this.getChild("n31"));
  13752. this.t0 = this.getTransition("t0");
  13753. }
  13754. }
  13755. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  13756. class ui_Component135 extends fgui.GComponent {
  13757. static createInstance() {
  13758. return (fgui.UIPackage.createObject("game", "Component135"));
  13759. }
  13760. onConstruct() {
  13761. this.n30 = (this.getChild("n30"));
  13762. this.t0 = this.getTransition("t0");
  13763. }
  13764. }
  13765. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  13766. class ui_Component137 extends fgui.GComponent {
  13767. static createInstance() {
  13768. return (fgui.UIPackage.createObject("game", "Component137"));
  13769. }
  13770. onConstruct() {
  13771. this.n28 = (this.getChild("n28"));
  13772. this.n29 = (this.getChild("n29"));
  13773. this.n30 = (this.getChild("n30"));
  13774. this.n32 = (this.getChild("n32"));
  13775. }
  13776. }
  13777. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  13778. class ui_dh_zuanshi extends fgui.GButton {
  13779. static createInstance() {
  13780. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  13781. }
  13782. onConstruct() {
  13783. this.n1 = (this.getChild("n1"));
  13784. this.n2 = (this.getChild("n2"));
  13785. this.n0 = (this.getChild("n0"));
  13786. this.n3 = (this.getChild("n3"));
  13787. this.n4 = (this.getChild("n4"));
  13788. }
  13789. }
  13790. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  13791. class ui_Component138 extends fgui.GComponent {
  13792. static createInstance() {
  13793. return (fgui.UIPackage.createObject("game", "Component138"));
  13794. }
  13795. onConstruct() {
  13796. this.n1 = (this.getChild("n1"));
  13797. this.n2 = (this.getChild("n2"));
  13798. this.t0 = this.getTransition("t0");
  13799. }
  13800. }
  13801. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  13802. class ui_Component139 extends fgui.GComponent {
  13803. static createInstance() {
  13804. return (fgui.UIPackage.createObject("game", "Component139"));
  13805. }
  13806. onConstruct() {
  13807. this.n0 = (this.getChild("n0"));
  13808. this.t0 = this.getTransition("t0");
  13809. }
  13810. }
  13811. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  13812. class ui_Component140 extends fgui.GComponent {
  13813. static createInstance() {
  13814. return (fgui.UIPackage.createObject("game", "Component140"));
  13815. }
  13816. onConstruct() {
  13817. this.n2 = (this.getChild("n2"));
  13818. this.n3 = (this.getChild("n3"));
  13819. this.t0 = this.getTransition("t0");
  13820. }
  13821. }
  13822. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  13823. class ui_Component141 extends fgui.GComponent {
  13824. static createInstance() {
  13825. return (fgui.UIPackage.createObject("game", "Component141"));
  13826. }
  13827. onConstruct() {
  13828. this.n0 = (this.getChild("n0"));
  13829. this.t0 = this.getTransition("t0");
  13830. }
  13831. }
  13832. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13833. class ui_powerNode extends fgui.GProgressBar {
  13834. static createInstance() {
  13835. return (fgui.UIPackage.createObject("game", "powerNode"));
  13836. }
  13837. onConstruct() {
  13838. this.n2 = (this.getChild("n2"));
  13839. this.bar_v = (this.getChild("bar_v"));
  13840. this.showImg = (this.getChild("showImg"));
  13841. this.n12 = (this.getChild("n12"));
  13842. }
  13843. }
  13844. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13845. class ui_dh_jingbi1 extends fgui.GComponent {
  13846. static createInstance() {
  13847. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13848. }
  13849. onConstruct() {
  13850. this.n0 = (this.getChild("n0"));
  13851. this.n1 = (this.getChild("n1"));
  13852. this.n2 = (this.getChild("n2"));
  13853. this.n3 = (this.getChild("n3"));
  13854. this.n4 = (this.getChild("n4"));
  13855. this.n5 = (this.getChild("n5"));
  13856. this.n6 = (this.getChild("n6"));
  13857. this.n8 = (this.getChild("n8"));
  13858. this.t0 = this.getTransition("t0");
  13859. }
  13860. }
  13861. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13862. class ui_Component94 extends fgui.GButton {
  13863. static createInstance() {
  13864. return (fgui.UIPackage.createObject("game", "Component94"));
  13865. }
  13866. onConstruct() {
  13867. this.n77 = (this.getChild("n77"));
  13868. }
  13869. }
  13870. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13871. class ui_Component95 extends fgui.GButton {
  13872. static createInstance() {
  13873. return (fgui.UIPackage.createObject("game", "Component95"));
  13874. }
  13875. onConstruct() {
  13876. this.n77 = (this.getChild("n77"));
  13877. }
  13878. }
  13879. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13880. class ui_Component126 extends fgui.GComponent {
  13881. static createInstance() {
  13882. return (fgui.UIPackage.createObject("game", "Component126"));
  13883. }
  13884. onConstruct() {
  13885. this.c1 = this.getController("c1");
  13886. this.normalBtn = (this.getChild("normalBtn"));
  13887. this.tripleBtn = (this.getChild("tripleBtn"));
  13888. }
  13889. }
  13890. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13891. class ui_Component60 extends fgui.GComponent {
  13892. static createInstance() {
  13893. return (fgui.UIPackage.createObject("game", "Component60"));
  13894. }
  13895. onConstruct() {
  13896. this.c1 = this.getController("c1");
  13897. this.n48 = (this.getChild("n48"));
  13898. this.womanTxt = (this.getChild("womanTxt"));
  13899. this.t0 = this.getTransition("t0");
  13900. }
  13901. }
  13902. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13903. class ui_Component98_3 extends fgui.GButton {
  13904. static createInstance() {
  13905. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13906. }
  13907. onConstruct() {
  13908. this.c1 = this.getController("c1");
  13909. this.n8 = (this.getChild("n8"));
  13910. this.n41 = (this.getChild("n41"));
  13911. this.n40 = (this.getChild("n40"));
  13912. }
  13913. }
  13914. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13915. class ui_ModeSelection_com1 extends fgui.GButton {
  13916. static createInstance() {
  13917. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13918. }
  13919. onConstruct() {
  13920. this.n34 = (this.getChild("n34"));
  13921. this.n36 = (this.getChild("n36"));
  13922. this.n22 = (this.getChild("n22"));
  13923. this.n20 = (this.getChild("n20"));
  13924. this.n23 = (this.getChild("n23"));
  13925. this.n24 = (this.getChild("n24"));
  13926. this.n26 = (this.getChild("n26"));
  13927. this.n33 = (this.getChild("n33"));
  13928. this.coinImg = (this.getChild("coinImg"));
  13929. this.need = (this.getChild("need"));
  13930. this.n35 = (this.getChild("n35"));
  13931. this.n29 = (this.getChild("n29"));
  13932. this.tipsTxt = (this.getChild("tipsTxt"));
  13933. this.n30 = (this.getChild("n30"));
  13934. this.peopleTxt = (this.getChild("peopleTxt"));
  13935. this.t0 = this.getTransition("t0");
  13936. }
  13937. }
  13938. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13939. class ui_ModeSelection_com2 extends fgui.GButton {
  13940. static createInstance() {
  13941. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13942. }
  13943. onConstruct() {
  13944. this.n36 = (this.getChild("n36"));
  13945. this.n34 = (this.getChild("n34"));
  13946. this.n22 = (this.getChild("n22"));
  13947. this.n20 = (this.getChild("n20"));
  13948. this.n23 = (this.getChild("n23"));
  13949. this.n24 = (this.getChild("n24"));
  13950. this.n26 = (this.getChild("n26"));
  13951. this.n33 = (this.getChild("n33"));
  13952. this.coinImg = (this.getChild("coinImg"));
  13953. this.need = (this.getChild("need"));
  13954. this.n35 = (this.getChild("n35"));
  13955. this.n29 = (this.getChild("n29"));
  13956. this.tipsTxt = (this.getChild("tipsTxt"));
  13957. this.n30 = (this.getChild("n30"));
  13958. this.peopleTxt = (this.getChild("peopleTxt"));
  13959. this.t0 = this.getTransition("t0");
  13960. }
  13961. }
  13962. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13963. class ui_ModeSelection_com3 extends fgui.GButton {
  13964. static createInstance() {
  13965. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13966. }
  13967. onConstruct() {
  13968. this.n34 = (this.getChild("n34"));
  13969. this.n36 = (this.getChild("n36"));
  13970. this.n22 = (this.getChild("n22"));
  13971. this.n20 = (this.getChild("n20"));
  13972. this.n23 = (this.getChild("n23"));
  13973. this.n24 = (this.getChild("n24"));
  13974. this.n26 = (this.getChild("n26"));
  13975. this.n33 = (this.getChild("n33"));
  13976. this.coinImg = (this.getChild("coinImg"));
  13977. this.need = (this.getChild("need"));
  13978. this.n35 = (this.getChild("n35"));
  13979. this.n29 = (this.getChild("n29"));
  13980. this.tipsTxt = (this.getChild("tipsTxt"));
  13981. this.n30 = (this.getChild("n30"));
  13982. this.peopleTxt = (this.getChild("peopleTxt"));
  13983. this.t0 = this.getTransition("t0");
  13984. }
  13985. }
  13986. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13987. class ui_Invitation_com1 extends fgui.GComponent {
  13988. static createInstance() {
  13989. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13990. }
  13991. onConstruct() {
  13992. this.n14 = (this.getChild("n14"));
  13993. this.n13 = (this.getChild("n13"));
  13994. this.n3 = (this.getChild("n3"));
  13995. this.n1 = (this.getChild("n1"));
  13996. this.n6 = (this.getChild("n6"));
  13997. this.n7 = (this.getChild("n7"));
  13998. this.enterBtn = (this.getChild("enterBtn"));
  13999. this.n11 = (this.getChild("n11"));
  14000. this.n12 = (this.getChild("n12"));
  14001. this.n15 = (this.getChild("n15"));
  14002. this.t0 = this.getTransition("t0");
  14003. this.t1 = this.getTransition("t1");
  14004. }
  14005. }
  14006. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14007. class ui_Component87_1 extends fgui.GComponent {
  14008. static createInstance() {
  14009. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14010. }
  14011. onConstruct() {
  14012. this.n74 = (this.getChild("n74"));
  14013. this.n73 = (this.getChild("n73"));
  14014. this.ballTxt = (this.getChild("ballTxt"));
  14015. this.n76 = (this.getChild("n76"));
  14016. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14017. this.levelTxt = (this.getChild("levelTxt"));
  14018. this.n87 = (this.getChild("n87"));
  14019. this.n84 = (this.getChild("n84"));
  14020. this.hpTxt = (this.getChild("hpTxt"));
  14021. this.n89 = (this.getChild("n89"));
  14022. this.tipsTxt = (this.getChild("tipsTxt"));
  14023. }
  14024. }
  14025. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14026. class ui_sqg1 extends fgui.GComponent {
  14027. static createInstance() {
  14028. return (fgui.UIPackage.createObject("game", "sqg1"));
  14029. }
  14030. onConstruct() {
  14031. this.n1 = (this.getChild("n1"));
  14032. this.n0 = (this.getChild("n0"));
  14033. }
  14034. }
  14035. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14036. class ui_sqg2 extends fgui.GComponent {
  14037. static createInstance() {
  14038. return (fgui.UIPackage.createObject("game", "sqg2"));
  14039. }
  14040. onConstruct() {
  14041. this.n1 = (this.getChild("n1"));
  14042. this.n0 = (this.getChild("n0"));
  14043. }
  14044. }
  14045. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14046. class ui_sqg3 extends fgui.GComponent {
  14047. static createInstance() {
  14048. return (fgui.UIPackage.createObject("game", "sqg3"));
  14049. }
  14050. onConstruct() {
  14051. this.n1 = (this.getChild("n1"));
  14052. this.n0 = (this.getChild("n0"));
  14053. }
  14054. }
  14055. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14056. class ui_sqg4 extends fgui.GComponent {
  14057. static createInstance() {
  14058. return (fgui.UIPackage.createObject("game", "sqg4"));
  14059. }
  14060. onConstruct() {
  14061. this.n1 = (this.getChild("n1"));
  14062. this.n0 = (this.getChild("n0"));
  14063. }
  14064. }
  14065. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14066. class ui_Component36 extends fgui.GButton {
  14067. static createInstance() {
  14068. return (fgui.UIPackage.createObject("game", "Component36"));
  14069. }
  14070. onConstruct() {
  14071. this.c1 = this.getController("c1");
  14072. this.n53 = (this.getChild("n53"));
  14073. this.n56 = (this.getChild("n56"));
  14074. }
  14075. }
  14076. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14077. class ui_Component37 extends fgui.GButton {
  14078. static createInstance() {
  14079. return (fgui.UIPackage.createObject("game", "Component37"));
  14080. }
  14081. onConstruct() {
  14082. this.c1 = this.getController("c1");
  14083. this.n52 = (this.getChild("n52"));
  14084. this.n54 = (this.getChild("n54"));
  14085. }
  14086. }
  14087. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14088. class ui_UISetting extends fgui.GComponent {
  14089. static createInstance() {
  14090. return (fgui.UIPackage.createObject("game", "UISetting"));
  14091. }
  14092. onConstruct() {
  14093. this.c1 = this.getController("c1");
  14094. this.n4 = (this.getChild("n4"));
  14095. this.soundBtn = (this.getChild("soundBtn"));
  14096. this.shakeBtn = (this.getChild("shakeBtn"));
  14097. this.clickNode = (this.getChild("clickNode"));
  14098. this.xyBtn = (this.getChild("xyBtn"));
  14099. }
  14100. }
  14101. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14102. class ui_Component39 extends fgui.GComponent {
  14103. static createInstance() {
  14104. return (fgui.UIPackage.createObject("game", "Component39"));
  14105. }
  14106. onConstruct() {
  14107. this.n5 = (this.getChild("n5"));
  14108. this.n6 = (this.getChild("n6"));
  14109. this.n7 = (this.getChild("n7"));
  14110. this.t0 = this.getTransition("t0");
  14111. }
  14112. }
  14113. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14114. class ui_Component40 extends fgui.GButton {
  14115. static createInstance() {
  14116. return (fgui.UIPackage.createObject("game", "Component40"));
  14117. }
  14118. onConstruct() {
  14119. this.n46 = (this.getChild("n46"));
  14120. this.n47 = (this.getChild("n47"));
  14121. }
  14122. }
  14123. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14124. class ui_Component41 extends fgui.GComponent {
  14125. static createInstance() {
  14126. return (fgui.UIPackage.createObject("game", "Component41"));
  14127. }
  14128. onConstruct() {
  14129. this.c1 = this.getController("c1");
  14130. this.n0 = (this.getChild("n0"));
  14131. this.titleTxt = (this.getChild("titleTxt"));
  14132. this.n2 = (this.getChild("n2"));
  14133. this.msgTips = (this.getChild("msgTips"));
  14134. this.numTxt = (this.getChild("numTxt"));
  14135. this.n18 = (this.getChild("n18"));
  14136. this.cancelBtn = (this.getChild("cancelBtn"));
  14137. this.videoBtn = (this.getChild("videoBtn"));
  14138. this.n10 = (this.getChild("n10"));
  14139. }
  14140. }
  14141. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14142. class ui_Component42 extends fgui.GComponent {
  14143. static createInstance() {
  14144. return (fgui.UIPackage.createObject("game", "Component42"));
  14145. }
  14146. onConstruct() {
  14147. this.c1 = this.getController("c1");
  14148. this.n1 = (this.getChild("n1"));
  14149. this.n2 = (this.getChild("n2"));
  14150. this.n3 = (this.getChild("n3"));
  14151. this.tipsTxt = (this.getChild("tipsTxt"));
  14152. this.cancelBtn = (this.getChild("cancelBtn"));
  14153. this.sureBtn = (this.getChild("sureBtn"));
  14154. this.n11 = (this.getChild("n11"));
  14155. this.n13 = (this.getChild("n13"));
  14156. this.n14 = (this.getChild("n14"));
  14157. this.womanTxt = (this.getChild("womanTxt"));
  14158. this.t0 = this.getTransition("t0");
  14159. }
  14160. }
  14161. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14162. class ui_dh_js_shengli extends fgui.GComponent {
  14163. static createInstance() {
  14164. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14165. }
  14166. onConstruct() {
  14167. this.n3 = (this.getChild("n3"));
  14168. this.n4 = (this.getChild("n4"));
  14169. this.n1 = (this.getChild("n1"));
  14170. this.n2 = (this.getChild("n2"));
  14171. this.n5 = (this.getChild("n5"));
  14172. this.n6 = (this.getChild("n6"));
  14173. this.n7 = (this.getChild("n7"));
  14174. this.n8 = (this.getChild("n8"));
  14175. this.attack = this.getTransition("attack");
  14176. this.idle = this.getTransition("idle");
  14177. }
  14178. }
  14179. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14180. class ui_dh_js_shengli_g extends fgui.GComponent {
  14181. static createInstance() {
  14182. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14183. }
  14184. onConstruct() {
  14185. this.n3 = (this.getChild("n3"));
  14186. this.n1 = (this.getChild("n1"));
  14187. this.t0 = this.getTransition("t0");
  14188. }
  14189. }
  14190. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  14191. class ui_dh_js_shibai extends fgui.GComponent {
  14192. static createInstance() {
  14193. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  14194. }
  14195. onConstruct() {
  14196. this.n0 = (this.getChild("n0"));
  14197. this.n1 = (this.getChild("n1"));
  14198. this.n2 = (this.getChild("n2"));
  14199. this.n3 = (this.getChild("n3"));
  14200. this.idle = this.getTransition("idle");
  14201. this.attack = this.getTransition("attack");
  14202. }
  14203. }
  14204. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  14205. class ui_dh_zy_ganfa extends fgui.GButton {
  14206. static createInstance() {
  14207. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  14208. }
  14209. onConstruct() {
  14210. this.n0 = (this.getChild("n0"));
  14211. }
  14212. }
  14213. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  14214. class ui_dh_zy_sc_guang extends fgui.GButton {
  14215. static createInstance() {
  14216. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  14217. }
  14218. onConstruct() {
  14219. this.n0 = (this.getChild("n0"));
  14220. this.n2 = (this.getChild("n2"));
  14221. }
  14222. }
  14223. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  14224. class ui_dh_zy_shangcheng extends fgui.GComponent {
  14225. static createInstance() {
  14226. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  14227. }
  14228. onConstruct() {
  14229. this.n0 = (this.getChild("n0"));
  14230. this.n3 = (this.getChild("n3"));
  14231. this.t0 = this.getTransition("t0");
  14232. }
  14233. }
  14234. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  14235. class ui_dh_zy_wanfa extends fgui.GButton {
  14236. static createInstance() {
  14237. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  14238. }
  14239. onConstruct() {
  14240. this.n0 = (this.getChild("n0"));
  14241. }
  14242. }
  14243. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  14244. class ui_Button_login extends fgui.GButton {
  14245. static createInstance() {
  14246. return (fgui.UIPackage.createObject("game", "Button_login"));
  14247. }
  14248. onConstruct() {
  14249. this.button = this.getController("button");
  14250. this.n5 = (this.getChild("n5"));
  14251. this.n3 = (this.getChild("n3"));
  14252. }
  14253. }
  14254. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  14255. class ui_Component53_1 extends fgui.GComponent {
  14256. static createInstance() {
  14257. return (fgui.UIPackage.createObject("game", "Component53_1"));
  14258. }
  14259. onConstruct() {
  14260. this.n0 = (this.getChild("n0"));
  14261. this.n1 = (this.getChild("n1"));
  14262. this.n2 = (this.getChild("n2"));
  14263. this.n3 = (this.getChild("n3"));
  14264. this.n4 = (this.getChild("n4"));
  14265. this.n5 = (this.getChild("n5"));
  14266. this.n6 = (this.getChild("n6"));
  14267. this.n7 = (this.getChild("n7"));
  14268. this.n8 = (this.getChild("n8"));
  14269. this.n9 = (this.getChild("n9"));
  14270. this.n10 = (this.getChild("n10"));
  14271. this.n11 = (this.getChild("n11"));
  14272. this.n12 = (this.getChild("n12"));
  14273. this.n13 = (this.getChild("n13"));
  14274. this.n14 = (this.getChild("n14"));
  14275. this.n15 = (this.getChild("n15"));
  14276. this.n16 = (this.getChild("n16"));
  14277. this.n19 = (this.getChild("n19"));
  14278. this.n20 = (this.getChild("n20"));
  14279. this.n21 = (this.getChild("n21"));
  14280. this.n22 = (this.getChild("n22"));
  14281. this.n23 = (this.getChild("n23"));
  14282. this.n24 = (this.getChild("n24"));
  14283. this.n25 = (this.getChild("n25"));
  14284. this.n26 = (this.getChild("n26"));
  14285. this.n27 = (this.getChild("n27"));
  14286. this.n28 = (this.getChild("n28"));
  14287. this.n29 = (this.getChild("n29"));
  14288. this.n30 = (this.getChild("n30"));
  14289. this.n31 = (this.getChild("n31"));
  14290. this.n32 = (this.getChild("n32"));
  14291. this.n33 = (this.getChild("n33"));
  14292. this.n34 = (this.getChild("n34"));
  14293. this.n35 = (this.getChild("n35"));
  14294. this.t0 = this.getTransition("t0");
  14295. }
  14296. }
  14297. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  14298. class ui_Component30 extends fgui.GComponent {
  14299. static createInstance() {
  14300. return (fgui.UIPackage.createObject("game", "Component30"));
  14301. }
  14302. onConstruct() {
  14303. this.c1 = this.getController("c1");
  14304. this.n46 = (this.getChild("n46"));
  14305. this.n47 = (this.getChild("n47"));
  14306. this.numTxt = (this.getChild("numTxt"));
  14307. this.n50 = (this.getChild("n50"));
  14308. this.n53 = (this.getChild("n53"));
  14309. this.n54 = (this.getChild("n54"));
  14310. this.n55 = (this.getChild("n55"));
  14311. this.n56 = (this.getChild("n56"));
  14312. }
  14313. }
  14314. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  14315. class ui_Component30_1 extends fgui.GComponent {
  14316. static createInstance() {
  14317. return (fgui.UIPackage.createObject("game", "Component30_1"));
  14318. }
  14319. onConstruct() {
  14320. this.c1 = this.getController("c1");
  14321. this.n46 = (this.getChild("n46"));
  14322. this.n47 = (this.getChild("n47"));
  14323. this.numTxt = (this.getChild("numTxt"));
  14324. this.n50 = (this.getChild("n50"));
  14325. this.n51 = (this.getChild("n51"));
  14326. this.n52 = (this.getChild("n52"));
  14327. this.n53 = (this.getChild("n53"));
  14328. this.n54 = (this.getChild("n54"));
  14329. }
  14330. }
  14331. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  14332. class ui_Component31 extends fgui.GComponent {
  14333. static createInstance() {
  14334. return (fgui.UIPackage.createObject("game", "Component31"));
  14335. }
  14336. onConstruct() {
  14337. this.n55 = (this.getChild("n55"));
  14338. this.n54 = (this.getChild("n54"));
  14339. this.conditionTxt = (this.getChild("conditionTxt"));
  14340. this.n57 = (this.getChild("n57"));
  14341. this.t0 = this.getTransition("t0");
  14342. }
  14343. }
  14344. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14345. class ui_Component32 extends fgui.GComponent {
  14346. static createInstance() {
  14347. return (fgui.UIPackage.createObject("game", "Component32"));
  14348. }
  14349. onConstruct() {
  14350. this.n5 = (this.getChild("n5"));
  14351. this.n6 = (this.getChild("n6"));
  14352. this.n7 = (this.getChild("n7"));
  14353. this.t0 = this.getTransition("t0");
  14354. }
  14355. }
  14356. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14357. class ui_AwardItem extends fgui.GComponent {
  14358. static createInstance() {
  14359. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14360. }
  14361. onConstruct() {
  14362. this.n9 = (this.getChild("n9"));
  14363. this.myIcon = (this.getChild("myIcon"));
  14364. this.numTxt = (this.getChild("numTxt"));
  14365. this.nameTxt = (this.getChild("nameTxt"));
  14366. this.n16 = (this.getChild("n16"));
  14367. this.n17 = (this.getChild("n17"));
  14368. }
  14369. }
  14370. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14371. class ui_ranking_com1 extends fgui.GButton {
  14372. static createInstance() {
  14373. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14374. }
  14375. onConstruct() {
  14376. this.c1 = this.getController("c1");
  14377. this.n49 = (this.getChild("n49"));
  14378. this.n18 = (this.getChild("n18"));
  14379. this.n46 = (this.getChild("n46"));
  14380. this.n48 = (this.getChild("n48"));
  14381. this.n50 = (this.getChild("n50"));
  14382. }
  14383. }
  14384. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14385. class ui_ranking_com2 extends fgui.GButton {
  14386. static createInstance() {
  14387. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14388. }
  14389. onConstruct() {
  14390. this.c1 = this.getController("c1");
  14391. this.n49 = (this.getChild("n49"));
  14392. this.n18 = (this.getChild("n18"));
  14393. this.n46 = (this.getChild("n46"));
  14394. this.n48 = (this.getChild("n48"));
  14395. this.n50 = (this.getChild("n50"));
  14396. }
  14397. }
  14398. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14399. class ui_ranking_com3 extends fgui.GComponent {
  14400. static createInstance() {
  14401. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14402. }
  14403. onConstruct() {
  14404. this.n17 = (this.getChild("n17"));
  14405. this.myIcon = (this.getChild("myIcon"));
  14406. }
  14407. }
  14408. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14409. class ui_ranking_com4 extends fgui.GComponent {
  14410. static createInstance() {
  14411. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14412. }
  14413. onConstruct() {
  14414. this.n16 = (this.getChild("n16"));
  14415. this.head = (this.getChild("head"));
  14416. }
  14417. }
  14418. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14419. class ui_ranking_com5 extends fgui.GComponent {
  14420. static createInstance() {
  14421. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14422. }
  14423. onConstruct() {
  14424. this.c1 = this.getController("c1");
  14425. this.c2 = this.getController("c2");
  14426. this.n2 = (this.getChild("n2"));
  14427. this.n3 = (this.getChild("n3"));
  14428. this.levelBtn = (this.getChild("levelBtn"));
  14429. this.starBtn = (this.getChild("starBtn"));
  14430. this.n23 = (this.getChild("n23"));
  14431. this.n24 = (this.getChild("n24"));
  14432. this.n25 = (this.getChild("n25"));
  14433. this.myList = (this.getChild("myList"));
  14434. this.selfNode = (this.getChild("selfNode"));
  14435. this.n9 = (this.getChild("n9"));
  14436. this.n12 = (this.getChild("n12"));
  14437. this.n13 = (this.getChild("n13"));
  14438. this.n14 = (this.getChild("n14"));
  14439. this.n39 = (this.getChild("n39"));
  14440. this.n41 = (this.getChild("n41"));
  14441. this.n42 = (this.getChild("n42"));
  14442. this.n45 = (this.getChild("n45"));
  14443. this.changeBtn = (this.getChild("changeBtn"));
  14444. this.closeBtn = (this.getChild("closeBtn"));
  14445. this.t0 = this.getTransition("t0");
  14446. }
  14447. }
  14448. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14449. class ui_RankItem extends fgui.GComponent {
  14450. static createInstance() {
  14451. return (fgui.UIPackage.createObject("game", "RankItem"));
  14452. }
  14453. onConstruct() {
  14454. this.n10 = (this.getChild("n10"));
  14455. this.n11 = (this.getChild("n11"));
  14456. this.rankTxt = (this.getChild("rankTxt"));
  14457. this.headNode = (this.getChild("headNode"));
  14458. this.nameTxt = (this.getChild("nameTxt"));
  14459. this.n19 = (this.getChild("n19"));
  14460. this.valueTxt = (this.getChild("valueTxt"));
  14461. this.img1 = (this.getChild("img1"));
  14462. this.img2 = (this.getChild("img2"));
  14463. this.img3 = (this.getChild("img3"));
  14464. }
  14465. }
  14466. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  14467. class ui_ranking_com9 extends fgui.GComponent {
  14468. static createInstance() {
  14469. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  14470. }
  14471. onConstruct() {
  14472. this.c1 = this.getController("c1");
  14473. this.n27 = (this.getChild("n27"));
  14474. this.n28 = (this.getChild("n28"));
  14475. this.headNode = (this.getChild("headNode"));
  14476. this.rankTxt = (this.getChild("rankTxt"));
  14477. this.nameTxt = (this.getChild("nameTxt"));
  14478. this.n34 = (this.getChild("n34"));
  14479. this.valueTxt = (this.getChild("valueTxt"));
  14480. this.n36 = (this.getChild("n36"));
  14481. this.n37 = (this.getChild("n37"));
  14482. this.n38 = (this.getChild("n38"));
  14483. this.n39 = (this.getChild("n39"));
  14484. this.n40 = (this.getChild("n40"));
  14485. }
  14486. }
  14487. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  14488. class ui_ranking_com10 extends fgui.GComponent {
  14489. static createInstance() {
  14490. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  14491. }
  14492. onConstruct() {
  14493. this.n23 = (this.getChild("n23"));
  14494. this.n24 = (this.getChild("n24"));
  14495. }
  14496. }
  14497. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  14498. class ui_ranking_com11 extends fgui.GComponent {
  14499. static createInstance() {
  14500. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  14501. }
  14502. onConstruct() {
  14503. this.n24 = (this.getChild("n24"));
  14504. this.n25 = (this.getChild("n25"));
  14505. this.t0 = this.getTransition("t0");
  14506. }
  14507. }
  14508. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  14509. class ui_ranking_com13 extends fgui.GButton {
  14510. static createInstance() {
  14511. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  14512. }
  14513. onConstruct() {
  14514. this.c1 = this.getController("c1");
  14515. this.n44 = (this.getChild("n44"));
  14516. this.n45 = (this.getChild("n45"));
  14517. this.n46 = (this.getChild("n46"));
  14518. }
  14519. }
  14520. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  14521. class ui_Component_dl_zc extends fgui.GButton {
  14522. static createInstance() {
  14523. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  14524. }
  14525. onConstruct() {
  14526. this.c1 = this.getController("c1");
  14527. this.n0 = (this.getChild("n0"));
  14528. }
  14529. }
  14530. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  14531. class ui_Component122 extends fgui.GComponent {
  14532. static createInstance() {
  14533. return (fgui.UIPackage.createObject("game", "Component122"));
  14534. }
  14535. onConstruct() {
  14536. this.gameNode3 = (this.getChild("gameNode3"));
  14537. }
  14538. }
  14539. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  14540. class ui_skillItem extends fgui.GComponent {
  14541. static createInstance() {
  14542. return (fgui.UIPackage.createObject("game", "skillItem"));
  14543. }
  14544. onConstruct() {
  14545. this.c1 = this.getController("c1");
  14546. this.n31 = (this.getChild("n31"));
  14547. this.n6 = (this.getChild("n6"));
  14548. this.skillImg = (this.getChild("skillImg"));
  14549. this.nameTxt = (this.getChild("nameTxt"));
  14550. this.levelTxt = (this.getChild("levelTxt"));
  14551. this.n28 = (this.getChild("n28"));
  14552. this.describeTxt = (this.getChild("describeTxt"));
  14553. this.n32 = (this.getChild("n32"));
  14554. this.mutiBtn = (this.getChild("mutiBtn"));
  14555. this.tryNode = (this.getChild("tryNode"));
  14556. this.normalBtn = (this.getChild("normalBtn"));
  14557. this.startBtn = (this.getChild("startBtn"));
  14558. this.n42 = (this.getChild("n42"));
  14559. this.n43 = (this.getChild("n43"));
  14560. this.n44 = (this.getChild("n44"));
  14561. }
  14562. }
  14563. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  14564. class ui_Component26 extends fgui.GButton {
  14565. static createInstance() {
  14566. return (fgui.UIPackage.createObject("game", "Component26"));
  14567. }
  14568. onConstruct() {
  14569. this.n11 = (this.getChild("n11"));
  14570. this.n30 = (this.getChild("n30"));
  14571. this.n34 = (this.getChild("n34"));
  14572. }
  14573. }
  14574. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  14575. class ui_Component28 extends fgui.GButton {
  14576. static createInstance() {
  14577. return (fgui.UIPackage.createObject("game", "Component28"));
  14578. }
  14579. onConstruct() {
  14580. this.n12 = (this.getChild("n12"));
  14581. this.n31 = (this.getChild("n31"));
  14582. this.curTxt = (this.getChild("curTxt"));
  14583. this.n33 = (this.getChild("n33"));
  14584. }
  14585. }
  14586. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  14587. class ui_Component1302 extends fgui.GComponent {
  14588. static createInstance() {
  14589. return (fgui.UIPackage.createObject("game", "Component1302"));
  14590. }
  14591. onConstruct() {
  14592. this.n2 = (this.getChild("n2"));
  14593. this.n3 = (this.getChild("n3"));
  14594. }
  14595. }
  14596. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  14597. class ui_Component113 extends fgui.GComponent {
  14598. static createInstance() {
  14599. return (fgui.UIPackage.createObject("game", "Component113"));
  14600. }
  14601. onConstruct() {
  14602. this.n85 = (this.getChild("n85"));
  14603. this.n86 = (this.getChild("n86"));
  14604. this.n77 = (this.getChild("n77"));
  14605. this.n79 = (this.getChild("n79"));
  14606. this.n80 = (this.getChild("n80"));
  14607. this.n81 = (this.getChild("n81"));
  14608. this.n82 = (this.getChild("n82"));
  14609. this.n84 = (this.getChild("n84"));
  14610. this.n87 = (this.getChild("n87"));
  14611. this.t0 = this.getTransition("t0");
  14612. }
  14613. }
  14614. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  14615. class ui_Component114 extends fgui.GComponent {
  14616. static createInstance() {
  14617. return (fgui.UIPackage.createObject("game", "Component114"));
  14618. }
  14619. onConstruct() {
  14620. this.n77 = (this.getChild("n77"));
  14621. this.t0 = this.getTransition("t0");
  14622. }
  14623. }
  14624. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  14625. class ui_Component115 extends fgui.GComponent {
  14626. static createInstance() {
  14627. return (fgui.UIPackage.createObject("game", "Component115"));
  14628. }
  14629. onConstruct() {
  14630. this.n83 = (this.getChild("n83"));
  14631. this.fingerNode = (this.getChild("fingerNode"));
  14632. this.n84 = (this.getChild("n84"));
  14633. }
  14634. }
  14635. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  14636. class ui_Component117 extends fgui.GComponent {
  14637. static createInstance() {
  14638. return (fgui.UIPackage.createObject("game", "Component117"));
  14639. }
  14640. onConstruct() {
  14641. this.n87 = (this.getChild("n87"));
  14642. this.n88 = (this.getChild("n88"));
  14643. this.n84 = (this.getChild("n84"));
  14644. this.n85 = (this.getChild("n85"));
  14645. this.n86 = (this.getChild("n86"));
  14646. this.t0 = this.getTransition("t0");
  14647. }
  14648. }
  14649. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  14650. class ui_Component98_1 extends fgui.GButton {
  14651. static createInstance() {
  14652. return (fgui.UIPackage.createObject("game", "Component98_1"));
  14653. }
  14654. onConstruct() {
  14655. this.c1 = this.getController("c1");
  14656. this.n8 = (this.getChild("n8"));
  14657. this.n41 = (this.getChild("n41"));
  14658. this.n40 = (this.getChild("n40"));
  14659. }
  14660. }
  14661. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  14662. class ui_Component61 extends fgui.GComponent {
  14663. static createInstance() {
  14664. return (fgui.UIPackage.createObject("game", "Component61"));
  14665. }
  14666. onConstruct() {
  14667. this.n14 = (this.getChild("n14"));
  14668. this.n6 = (this.getChild("n6"));
  14669. this.t0 = this.getTransition("t0");
  14670. }
  14671. }
  14672. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  14673. class ui_Component62 extends fgui.GComponent {
  14674. static createInstance() {
  14675. return (fgui.UIPackage.createObject("game", "Component62"));
  14676. }
  14677. onConstruct() {
  14678. this.n66 = (this.getChild("n66"));
  14679. this.n56 = (this.getChild("n56"));
  14680. this.n63 = (this.getChild("n63"));
  14681. this.n65 = (this.getChild("n65"));
  14682. this.t0 = this.getTransition("t0");
  14683. }
  14684. }
  14685. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  14686. class ui_d3Root extends fgui.GComponent {
  14687. static createInstance() {
  14688. return (fgui.UIPackage.createObject("game", "d3Root"));
  14689. }
  14690. onConstruct() {
  14691. }
  14692. }
  14693. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  14694. class ui_d2Root extends fgui.GComponent {
  14695. static createInstance() {
  14696. return (fgui.UIPackage.createObject("game", "d2Root"));
  14697. }
  14698. onConstruct() {
  14699. }
  14700. }
  14701. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  14702. class ui_ballNode extends fgui.GComponent {
  14703. static createInstance() {
  14704. return (fgui.UIPackage.createObject("game", "ballNode"));
  14705. }
  14706. onConstruct() {
  14707. }
  14708. }
  14709. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  14710. class ui_border extends fgui.GComponent {
  14711. static createInstance() {
  14712. return (fgui.UIPackage.createObject("game", "border"));
  14713. }
  14714. onConstruct() {
  14715. this.bar1 = (this.getChild("bar1"));
  14716. this.bar2 = (this.getChild("bar2"));
  14717. this.bar3 = (this.getChild("bar3"));
  14718. this.bar4 = (this.getChild("bar4"));
  14719. this.bar5 = (this.getChild("bar5"));
  14720. this.bar6 = (this.getChild("bar6"));
  14721. this.circle1 = (this.getChild("circle1"));
  14722. this.circle2 = (this.getChild("circle2"));
  14723. this.circle3 = (this.getChild("circle3"));
  14724. this.circle4 = (this.getChild("circle4"));
  14725. this.circle5 = (this.getChild("circle5"));
  14726. this.circle6 = (this.getChild("circle6"));
  14727. this.n28 = (this.getChild("n28"));
  14728. }
  14729. }
  14730. ui_border.URL = "ui://isxx5ak7sdh33qq";
  14731. class ui_Component41_2 extends fgui.GComponent {
  14732. static createInstance() {
  14733. return (fgui.UIPackage.createObject("game", "Component41_2"));
  14734. }
  14735. onConstruct() {
  14736. this.c1 = this.getController("c1");
  14737. this.n0 = (this.getChild("n0"));
  14738. this.n2 = (this.getChild("n2"));
  14739. this.n19 = (this.getChild("n19"));
  14740. this.cancelBtn = (this.getChild("cancelBtn"));
  14741. this.videoBtn = (this.getChild("videoBtn"));
  14742. this.n9 = (this.getChild("n9"));
  14743. this.n22 = (this.getChild("n22"));
  14744. this.tipsTxt = (this.getChild("tipsTxt"));
  14745. this.n23 = (this.getChild("n23"));
  14746. this.n24 = (this.getChild("n24"));
  14747. this.n26 = (this.getChild("n26"));
  14748. this.n27 = (this.getChild("n27"));
  14749. this.titleTxt = (this.getChild("titleTxt"));
  14750. }
  14751. }
  14752. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  14753. class ui_Component41_1 extends fgui.GComponent {
  14754. static createInstance() {
  14755. return (fgui.UIPackage.createObject("game", "Component41_1"));
  14756. }
  14757. onConstruct() {
  14758. this.c1 = this.getController("c1");
  14759. this.n0 = (this.getChild("n0"));
  14760. this.n2 = (this.getChild("n2"));
  14761. this.cancelBtn = (this.getChild("cancelBtn"));
  14762. this.videoBtn = (this.getChild("videoBtn"));
  14763. this.n27 = (this.getChild("n27"));
  14764. this.n30 = (this.getChild("n30"));
  14765. this.n31 = (this.getChild("n31"));
  14766. this.n32 = (this.getChild("n32"));
  14767. this.n33 = (this.getChild("n33"));
  14768. this.n34 = (this.getChild("n34"));
  14769. this.n35 = (this.getChild("n35"));
  14770. this.n36 = (this.getChild("n36"));
  14771. this.n1 = (this.getChild("n1"));
  14772. this.n37 = (this.getChild("n37"));
  14773. this.t0 = this.getTransition("t0");
  14774. this.t1 = this.getTransition("t1");
  14775. this.t2 = this.getTransition("t2");
  14776. this.t3 = this.getTransition("t3");
  14777. }
  14778. }
  14779. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  14780. class ui_againBtn extends fgui.GButton {
  14781. static createInstance() {
  14782. return (fgui.UIPackage.createObject("game", "againBtn"));
  14783. }
  14784. onConstruct() {
  14785. this.n2 = (this.getChild("n2"));
  14786. this.n1 = (this.getChild("n1"));
  14787. this.n5 = (this.getChild("n5"));
  14788. }
  14789. }
  14790. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  14791. class ui_Component118 extends fgui.GButton {
  14792. static createInstance() {
  14793. return (fgui.UIPackage.createObject("game", "Component118"));
  14794. }
  14795. onConstruct() {
  14796. this.c1 = this.getController("c1");
  14797. this.n14 = (this.getChild("n14"));
  14798. this.n9 = (this.getChild("n9"));
  14799. this.n10 = (this.getChild("n10"));
  14800. this.diamondTxt = (this.getChild("diamondTxt"));
  14801. this.n13 = (this.getChild("n13"));
  14802. this.n15 = (this.getChild("n15"));
  14803. }
  14804. }
  14805. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  14806. class ui_Component119 extends fgui.GComponent {
  14807. static createInstance() {
  14808. return (fgui.UIPackage.createObject("game", "Component119"));
  14809. }
  14810. onConstruct() {
  14811. this.n1 = (this.getChild("n1"));
  14812. this.n2 = (this.getChild("n2"));
  14813. this.n13 = (this.getChild("n13"));
  14814. this.n6 = (this.getChild("n6"));
  14815. this.screenNode = (this.getChild("screenNode"));
  14816. this.n15 = (this.getChild("n15"));
  14817. this.closeBtn = (this.getChild("closeBtn"));
  14818. this.share2Btn = (this.getChild("share2Btn"));
  14819. this.shareBtn = (this.getChild("shareBtn"));
  14820. this.tipsNode = (this.getChild("tipsNode"));
  14821. this.awardNode = (this.getChild("awardNode"));
  14822. }
  14823. }
  14824. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  14825. class ui_daoJuDisplay extends fgui.GComponent {
  14826. static createInstance() {
  14827. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  14828. }
  14829. onConstruct() {
  14830. this.n6 = (this.getChild("n6"));
  14831. this.n2 = (this.getChild("n2"));
  14832. this.n3 = (this.getChild("n3"));
  14833. this.n4 = (this.getChild("n4"));
  14834. this.n_jiaGe = (this.getChild("n_jiaGe"));
  14835. this.n_zuanShi = (this.getChild("n_zuanShi"));
  14836. this.eftZuanShi = (this.getChild("eftZuanShi"));
  14837. }
  14838. }
  14839. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  14840. class ui_Component132_1 extends fgui.GComponent {
  14841. static createInstance() {
  14842. return (fgui.UIPackage.createObject("game", "Component132_1"));
  14843. }
  14844. onConstruct() {
  14845. this.n25 = (this.getChild("n25"));
  14846. this.n26 = (this.getChild("n26"));
  14847. this.n27 = (this.getChild("n27"));
  14848. this.t0 = this.getTransition("t0");
  14849. }
  14850. }
  14851. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  14852. class ui_SecretaryDisplay extends fgui.GComponent {
  14853. static createInstance() {
  14854. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  14855. }
  14856. onConstruct() {
  14857. this.n2 = (this.getChild("n2"));
  14858. this.levelTxt = (this.getChild("levelTxt"));
  14859. this.n4 = (this.getChild("n4"));
  14860. this.secretary = (this.getChild("secretary"));
  14861. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14862. this.n16 = (this.getChild("n16"));
  14863. this.n37 = (this.getChild("n37"));
  14864. this.n41 = (this.getChild("n41"));
  14865. this.n14 = (this.getChild("n14"));
  14866. this.n17 = (this.getChild("n17"));
  14867. this.heightTxt = (this.getChild("heightTxt"));
  14868. this.n46 = (this.getChild("n46"));
  14869. this.n36 = (this.getChild("n36"));
  14870. this.n38 = (this.getChild("n38"));
  14871. this.foodTxt = (this.getChild("foodTxt"));
  14872. this.n47 = (this.getChild("n47"));
  14873. this.n40 = (this.getChild("n40"));
  14874. this.n42 = (this.getChild("n42"));
  14875. this.historyTxt = (this.getChild("historyTxt"));
  14876. this.n48 = (this.getChild("n48"));
  14877. this.nameImg = (this.getChild("nameImg"));
  14878. this.n12 = (this.getChild("n12"));
  14879. this.n49 = (this.getChild("n49"));
  14880. this.t0 = this.getTransition("t0");
  14881. }
  14882. }
  14883. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14884. class ui_BallRodDisplay extends fgui.GComponent {
  14885. static createInstance() {
  14886. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14887. }
  14888. onConstruct() {
  14889. this.c1 = this.getController("c1");
  14890. this.n31 = (this.getChild("n31"));
  14891. this.n6 = (this.getChild("n6"));
  14892. this.nameTxt = (this.getChild("nameTxt"));
  14893. this.rodImg = (this.getChild("rodImg"));
  14894. this.levelNode = (this.getChild("levelNode"));
  14895. this.eftRod = (this.getChild("eftRod"));
  14896. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14897. }
  14898. }
  14899. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14900. class ui_Component111_11 extends fgui.GComponent {
  14901. static createInstance() {
  14902. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14903. }
  14904. onConstruct() {
  14905. this.n68 = (this.getChild("n68"));
  14906. this.n69 = (this.getChild("n69"));
  14907. }
  14908. }
  14909. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14910. class ui_Component112 extends fgui.GComponent {
  14911. static createInstance() {
  14912. return (fgui.UIPackage.createObject("game", "Component112"));
  14913. }
  14914. onConstruct() {
  14915. this.n68 = (this.getChild("n68"));
  14916. this.n70 = (this.getChild("n70"));
  14917. this.myMask = (this.getChild("myMask"));
  14918. }
  14919. }
  14920. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14921. class ui_Component111 extends fgui.GComponent {
  14922. static createInstance() {
  14923. return (fgui.UIPackage.createObject("game", "Component111"));
  14924. }
  14925. onConstruct() {
  14926. this.n68 = (this.getChild("n68"));
  14927. this.myMask = (this.getChild("myMask"));
  14928. }
  14929. }
  14930. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14931. class ui_Component144 extends fgui.GButton {
  14932. static createInstance() {
  14933. return (fgui.UIPackage.createObject("game", "Component144"));
  14934. }
  14935. onConstruct() {
  14936. this.n8 = (this.getChild("n8"));
  14937. }
  14938. }
  14939. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14940. class ui_Sign_com2 extends fgui.GComponent {
  14941. static createInstance() {
  14942. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14943. }
  14944. onConstruct() {
  14945. this.n0 = (this.getChild("n0"));
  14946. this.n1 = (this.getChild("n1"));
  14947. this.t0 = this.getTransition("t0");
  14948. }
  14949. }
  14950. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14951. class ui_Sign_guang extends fgui.GComponent {
  14952. static createInstance() {
  14953. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14954. }
  14955. onConstruct() {
  14956. this.n1 = (this.getChild("n1"));
  14957. this.n2 = (this.getChild("n2"));
  14958. this.n3 = (this.getChild("n3"));
  14959. this.n4 = (this.getChild("n4"));
  14960. this.n5 = (this.getChild("n5"));
  14961. this.n6 = (this.getChild("n6"));
  14962. this.n8 = (this.getChild("n8"));
  14963. }
  14964. }
  14965. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14966. class ui_SignMax extends fgui.GComponent {
  14967. static createInstance() {
  14968. return (fgui.UIPackage.createObject("game", "SignMax"));
  14969. }
  14970. onConstruct() {
  14971. this.c1 = this.getController("c1");
  14972. this.n7 = (this.getChild("n7"));
  14973. this.n15 = (this.getChild("n15"));
  14974. this.n8 = (this.getChild("n8"));
  14975. this.titleTxt = (this.getChild("titleTxt"));
  14976. this.myIcon1 = (this.getChild("myIcon1"));
  14977. this.numTxt1 = (this.getChild("numTxt1"));
  14978. this.myIcon2 = (this.getChild("myIcon2"));
  14979. this.n20 = (this.getChild("n20"));
  14980. this.n17 = (this.getChild("n17"));
  14981. this.numTxt2 = (this.getChild("numTxt2"));
  14982. this.n12 = (this.getChild("n12"));
  14983. this.n13 = (this.getChild("n13"));
  14984. this.n21 = (this.getChild("n21"));
  14985. this.n14 = (this.getChild("n14"));
  14986. }
  14987. }
  14988. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14989. class ui_Sign_com2_1 extends fgui.GComponent {
  14990. static createInstance() {
  14991. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14992. }
  14993. onConstruct() {
  14994. this.n0 = (this.getChild("n0"));
  14995. this.n1 = (this.getChild("n1"));
  14996. this.t0 = this.getTransition("t0");
  14997. }
  14998. }
  14999. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15000. class ui_Sign_com5 extends fgui.GComponent {
  15001. static createInstance() {
  15002. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15003. }
  15004. onConstruct() {
  15005. this.n3 = (this.getChild("n3"));
  15006. this.n29 = (this.getChild("n29"));
  15007. this.n4 = (this.getChild("n4"));
  15008. this.day1 = (this.getChild("day1"));
  15009. this.day2 = (this.getChild("day2"));
  15010. this.day3 = (this.getChild("day3"));
  15011. this.day4 = (this.getChild("day4"));
  15012. this.day5 = (this.getChild("day5"));
  15013. this.day6 = (this.getChild("day6"));
  15014. this.day7 = (this.getChild("day7"));
  15015. this.t0 = this.getTransition("t0");
  15016. }
  15017. }
  15018. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15019. class ui_Sign_com8 extends fgui.GComponent {
  15020. static createInstance() {
  15021. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15022. }
  15023. onConstruct() {
  15024. this.n48 = (this.getChild("n48"));
  15025. this.womanTxt = (this.getChild("womanTxt"));
  15026. this.t0 = this.getTransition("t0");
  15027. }
  15028. }
  15029. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15030. class ui_Sign_com6 extends fgui.GComponent {
  15031. static createInstance() {
  15032. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15033. }
  15034. onConstruct() {
  15035. this.n2 = (this.getChild("n2"));
  15036. this.n3 = (this.getChild("n3"));
  15037. this.t0 = this.getTransition("t0");
  15038. }
  15039. }
  15040. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15041. class ui_Sign_com7 extends fgui.GComponent {
  15042. static createInstance() {
  15043. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15044. }
  15045. onConstruct() {
  15046. this.n29 = (this.getChild("n29"));
  15047. this.n2 = (this.getChild("n2"));
  15048. }
  15049. }
  15050. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15051. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15052. static createInstance() {
  15053. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15054. }
  15055. onConstruct() {
  15056. this.n5 = (this.getChild("n5"));
  15057. this.n4 = (this.getChild("n4"));
  15058. this.t0 = this.getTransition("t0");
  15059. }
  15060. }
  15061. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15062. class ui_UITurntable_com2 extends fgui.GComponent {
  15063. static createInstance() {
  15064. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15065. }
  15066. onConstruct() {
  15067. this.c1 = this.getController("c1");
  15068. this.n4 = (this.getChild("n4"));
  15069. this.n6 = (this.getChild("n6"));
  15070. this.n10 = (this.getChild("n10"));
  15071. this.n11 = (this.getChild("n11"));
  15072. this.n12 = (this.getChild("n12"));
  15073. this.n13 = (this.getChild("n13"));
  15074. this.n14 = (this.getChild("n14"));
  15075. this.n15 = (this.getChild("n15"));
  15076. this.n16 = (this.getChild("n16"));
  15077. this.n17 = (this.getChild("n17"));
  15078. this.n18 = (this.getChild("n18"));
  15079. this.n19 = (this.getChild("n19"));
  15080. this.n20 = (this.getChild("n20"));
  15081. this.n21 = (this.getChild("n21"));
  15082. this.n22 = (this.getChild("n22"));
  15083. this.n23 = (this.getChild("n23"));
  15084. this.n24 = (this.getChild("n24"));
  15085. this.n25 = (this.getChild("n25"));
  15086. this.n26 = (this.getChild("n26"));
  15087. this.n27 = (this.getChild("n27"));
  15088. this.n28 = (this.getChild("n28"));
  15089. this.n29 = (this.getChild("n29"));
  15090. this.n30 = (this.getChild("n30"));
  15091. this.n31 = (this.getChild("n31"));
  15092. this.n32 = (this.getChild("n32"));
  15093. this.n33 = (this.getChild("n33"));
  15094. }
  15095. }
  15096. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15097. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15098. static createInstance() {
  15099. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15100. }
  15101. onConstruct() {
  15102. this.n5 = (this.getChild("n5"));
  15103. this.n4 = (this.getChild("n4"));
  15104. this.t0 = this.getTransition("t0");
  15105. }
  15106. }
  15107. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15108. class ui_UITurntable_com5 extends fgui.GComponent {
  15109. static createInstance() {
  15110. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15111. }
  15112. onConstruct() {
  15113. this.flashNode = (this.getChild("flashNode"));
  15114. this.rotNode = (this.getChild("rotNode"));
  15115. this.n3 = (this.getChild("n3"));
  15116. this.n21 = (this.getChild("n21"));
  15117. this.t0 = this.getTransition("t0");
  15118. }
  15119. }
  15120. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15121. class ui_UITurntable_com7 extends fgui.GComponent {
  15122. static createInstance() {
  15123. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15124. }
  15125. onConstruct() {
  15126. this.n2 = (this.getChild("n2"));
  15127. this.n35 = (this.getChild("n35"));
  15128. this.img1 = (this.getChild("img1"));
  15129. this.img2 = (this.getChild("img2"));
  15130. this.img3 = (this.getChild("img3"));
  15131. this.img4 = (this.getChild("img4"));
  15132. this.img6 = (this.getChild("img6"));
  15133. this.img5 = (this.getChild("img5"));
  15134. this.txt1 = (this.getChild("txt1"));
  15135. this.txt2 = (this.getChild("txt2"));
  15136. this.txt3 = (this.getChild("txt3"));
  15137. this.txt4 = (this.getChild("txt4"));
  15138. this.txt5 = (this.getChild("txt5"));
  15139. this.txt6 = (this.getChild("txt6"));
  15140. }
  15141. }
  15142. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15143. class ui_UITurntable_com9 extends fgui.GComponent {
  15144. static createInstance() {
  15145. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15146. }
  15147. onConstruct() {
  15148. this.n38 = (this.getChild("n38"));
  15149. this.n39 = (this.getChild("n39"));
  15150. }
  15151. }
  15152. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15153. class ui_UITurntable_com10 extends fgui.GComponent {
  15154. static createInstance() {
  15155. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15156. }
  15157. onConstruct() {
  15158. this.n39 = (this.getChild("n39"));
  15159. this.n40 = (this.getChild("n40"));
  15160. this.t0 = this.getTransition("t0");
  15161. }
  15162. }
  15163. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15164. class ui_UITurntable_com11 extends fgui.GComponent {
  15165. static createInstance() {
  15166. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15167. }
  15168. onConstruct() {
  15169. this.n38 = (this.getChild("n38"));
  15170. this.n39 = (this.getChild("n39"));
  15171. this.n40 = (this.getChild("n40"));
  15172. this.t0 = this.getTransition("t0");
  15173. }
  15174. }
  15175. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15176. class ui_UITurntable_com12 extends fgui.GComponent {
  15177. static createInstance() {
  15178. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  15179. }
  15180. onConstruct() {
  15181. this.n43 = (this.getChild("n43"));
  15182. this.barNode = (this.getChild("barNode"));
  15183. this.tipsTxt = (this.getChild("tipsTxt"));
  15184. this.n45 = (this.getChild("n45"));
  15185. this.boxBtn = (this.getChild("boxBtn"));
  15186. }
  15187. }
  15188. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  15189. class ui_UITurntable_com1 extends fgui.GButton {
  15190. static createInstance() {
  15191. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  15192. }
  15193. onConstruct() {
  15194. this.n41 = (this.getChild("n41"));
  15195. this.n42 = (this.getChild("n42"));
  15196. this.t0 = this.getTransition("t0");
  15197. }
  15198. }
  15199. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  15200. class ui_UITurntable_com3 extends fgui.GComponent {
  15201. static createInstance() {
  15202. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  15203. }
  15204. onConstruct() {
  15205. this.n48 = (this.getChild("n48"));
  15206. this.womanTxt = (this.getChild("womanTxt"));
  15207. this.t0 = this.getTransition("t0");
  15208. }
  15209. }
  15210. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  15211. class ui_cancelBtn2 extends fgui.GButton {
  15212. static createInstance() {
  15213. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  15214. }
  15215. onConstruct() {
  15216. this.c1 = this.getController("c1");
  15217. this.n0 = (this.getChild("n0"));
  15218. this.n1 = (this.getChild("n1"));
  15219. this.n2 = (this.getChild("n2"));
  15220. this.n3 = (this.getChild("n3"));
  15221. this.n4 = (this.getChild("n4"));
  15222. this.n5 = (this.getChild("n5"));
  15223. this.n6 = (this.getChild("n6"));
  15224. this.n7 = (this.getChild("n7"));
  15225. this.n8 = (this.getChild("n8"));
  15226. this.powerEft = (this.getChild("powerEft"));
  15227. }
  15228. }
  15229. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  15230. class ui_shareBtn2 extends fgui.GButton {
  15231. static createInstance() {
  15232. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  15233. }
  15234. onConstruct() {
  15235. this.c1 = this.getController("c1");
  15236. this.n2 = (this.getChild("n2"));
  15237. this.n24 = (this.getChild("n24"));
  15238. this.n1 = (this.getChild("n1"));
  15239. this.n3 = (this.getChild("n3"));
  15240. this.n23 = (this.getChild("n23"));
  15241. this.n4 = (this.getChild("n4"));
  15242. this.n5 = (this.getChild("n5"));
  15243. this.n6 = (this.getChild("n6"));
  15244. this.n20 = (this.getChild("n20"));
  15245. this.n21 = (this.getChild("n21"));
  15246. this.n22 = (this.getChild("n22"));
  15247. this.powerEft = (this.getChild("powerEft"));
  15248. }
  15249. }
  15250. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  15251. class ui_UIMoney extends fgui.GComponent {
  15252. static createInstance() {
  15253. return (fgui.UIPackage.createObject("game", "UIMoney"));
  15254. }
  15255. onConstruct() {
  15256. this.c1 = this.getController("c1");
  15257. this.n4 = (this.getChild("n4"));
  15258. this.coinImg = (this.getChild("coinImg"));
  15259. this.addCoinBtn = (this.getChild("addCoinBtn"));
  15260. this.coinTxt = (this.getChild("coinTxt"));
  15261. this.n7 = (this.getChild("n7"));
  15262. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  15263. this.diamondTxt = (this.getChild("diamondTxt"));
  15264. this.diamondImg = (this.getChild("diamondImg"));
  15265. this.n12 = (this.getChild("n12"));
  15266. this.powerImg = (this.getChild("powerImg"));
  15267. this.addPowerBtn = (this.getChild("addPowerBtn"));
  15268. this.powerTxt = (this.getChild("powerTxt"));
  15269. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  15270. }
  15271. }
  15272. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  15273. class ui_backBtn extends fgui.GButton {
  15274. static createInstance() {
  15275. return (fgui.UIPackage.createObject("game", "backBtn"));
  15276. }
  15277. onConstruct() {
  15278. this.n0 = (this.getChild("n0"));
  15279. this.t0 = this.getTransition("t0");
  15280. this.t1 = this.getTransition("t1");
  15281. }
  15282. }
  15283. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  15284. class ui_MoneyBtn extends fgui.GButton {
  15285. static createInstance() {
  15286. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  15287. }
  15288. onConstruct() {
  15289. this.button = this.getController("button");
  15290. this.n0 = (this.getChild("n0"));
  15291. }
  15292. }
  15293. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  15294. class ui_UIMoneyBtn extends fgui.GComponent {
  15295. static createInstance() {
  15296. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  15297. }
  15298. onConstruct() {
  15299. this.n1 = (this.getChild("n1"));
  15300. this.closeBtn = (this.getChild("closeBtn"));
  15301. }
  15302. }
  15303. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  15304. class ui_Component64 extends fgui.GComponent {
  15305. static createInstance() {
  15306. return (fgui.UIPackage.createObject("game", "Component64"));
  15307. }
  15308. onConstruct() {
  15309. this.n57 = (this.getChild("n57"));
  15310. this.n54 = (this.getChild("n54"));
  15311. this.n55 = (this.getChild("n55"));
  15312. this.n56 = (this.getChild("n56"));
  15313. this.t1 = this.getTransition("t1");
  15314. }
  15315. }
  15316. ui_Component64.URL = "ui://isxx5ak7wp26456";
  15317. class ui_Component41_3 extends fgui.GComponent {
  15318. static createInstance() {
  15319. return (fgui.UIPackage.createObject("game", "Component41_3"));
  15320. }
  15321. onConstruct() {
  15322. this.c1 = this.getController("c1");
  15323. this.n0 = (this.getChild("n0"));
  15324. this.n2 = (this.getChild("n2"));
  15325. this.cancelBtn = (this.getChild("cancelBtn"));
  15326. this.videoBtn = (this.getChild("videoBtn"));
  15327. this.n9 = (this.getChild("n9"));
  15328. this.n24 = (this.getChild("n24"));
  15329. this.n27 = (this.getChild("n27"));
  15330. this.titleTxt = (this.getChild("titleTxt"));
  15331. this.n28 = (this.getChild("n28"));
  15332. this.t0 = this.getTransition("t0");
  15333. }
  15334. }
  15335. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  15336. class ui_dh_zs_4 extends fgui.GComponent {
  15337. static createInstance() {
  15338. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  15339. }
  15340. onConstruct() {
  15341. this.n1 = (this.getChild("n1"));
  15342. this.n2 = (this.getChild("n2"));
  15343. this.n3 = (this.getChild("n3"));
  15344. this.n4 = (this.getChild("n4"));
  15345. this.n5 = (this.getChild("n5"));
  15346. this.n6 = (this.getChild("n6"));
  15347. this.n8 = (this.getChild("n8"));
  15348. this.t0 = this.getTransition("t0");
  15349. }
  15350. }
  15351. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  15352. class ui_Component71_1 extends fgui.GButton {
  15353. static createInstance() {
  15354. return (fgui.UIPackage.createObject("game", "Component71_1"));
  15355. }
  15356. onConstruct() {
  15357. this.n17 = (this.getChild("n17"));
  15358. this.t0 = this.getTransition("t0");
  15359. }
  15360. }
  15361. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  15362. class ui_Component83 extends fgui.GComponent {
  15363. static createInstance() {
  15364. return (fgui.UIPackage.createObject("game", "Component83"));
  15365. }
  15366. onConstruct() {
  15367. this.c1 = this.getController("c1");
  15368. this.n17 = (this.getChild("n17"));
  15369. this.n19 = (this.getChild("n19"));
  15370. this.n20 = (this.getChild("n20"));
  15371. }
  15372. }
  15373. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15374. class ui_Component84 extends fgui.GComponent {
  15375. static createInstance() {
  15376. return (fgui.UIPackage.createObject("game", "Component84"));
  15377. }
  15378. onConstruct() {
  15379. this.c1 = this.getController("c1");
  15380. this.n4 = (this.getChild("n4"));
  15381. this.n22 = (this.getChild("n22"));
  15382. this.n23 = (this.getChild("n23"));
  15383. this.numTxt = (this.getChild("numTxt"));
  15384. this.n25 = (this.getChild("n25"));
  15385. this.n26 = (this.getChild("n26"));
  15386. }
  15387. }
  15388. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15389. class ui_Component84_1 extends fgui.GComponent {
  15390. static createInstance() {
  15391. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15392. }
  15393. onConstruct() {
  15394. this.c1 = this.getController("c1");
  15395. this.n4 = (this.getChild("n4"));
  15396. this.n22 = (this.getChild("n22"));
  15397. this.n23 = (this.getChild("n23"));
  15398. this.numTxt = (this.getChild("numTxt"));
  15399. this.n25 = (this.getChild("n25"));
  15400. this.n26 = (this.getChild("n26"));
  15401. }
  15402. }
  15403. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15404. class ui_Component85 extends fgui.GComponent {
  15405. static createInstance() {
  15406. return (fgui.UIPackage.createObject("game", "Component85"));
  15407. }
  15408. onConstruct() {
  15409. this.n1 = (this.getChild("n1"));
  15410. this.n6 = (this.getChild("n6"));
  15411. this.n2 = (this.getChild("n2"));
  15412. this.n3 = (this.getChild("n3"));
  15413. this.levelTxt = (this.getChild("levelTxt"));
  15414. this.n10 = (this.getChild("n10"));
  15415. this.n11 = (this.getChild("n11"));
  15416. this.n12 = (this.getChild("n12"));
  15417. this.n13 = (this.getChild("n13"));
  15418. this.n14 = (this.getChild("n14"));
  15419. this.modeNode = (this.getChild("modeNode"));
  15420. this.n18 = (this.getChild("n18"));
  15421. this.conditionTxt = (this.getChild("conditionTxt"));
  15422. this.diamondNode = (this.getChild("diamondNode"));
  15423. this.coinNode = (this.getChild("coinNode"));
  15424. this.startBtn = (this.getChild("startBtn"));
  15425. this.n28 = (this.getChild("n28"));
  15426. this.displayRoot = (this.getChild("displayRoot"));
  15427. this.t0 = this.getTransition("t0");
  15428. }
  15429. }
  15430. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15431. class ui_Component86 extends fgui.GButton {
  15432. static createInstance() {
  15433. return (fgui.UIPackage.createObject("game", "Component86"));
  15434. }
  15435. onConstruct() {
  15436. this.n15 = (this.getChild("n15"));
  15437. this.t0 = this.getTransition("t0");
  15438. }
  15439. }
  15440. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  15441. class ui_Component87 extends fgui.GComponent {
  15442. static createInstance() {
  15443. return (fgui.UIPackage.createObject("game", "Component87"));
  15444. }
  15445. onConstruct() {
  15446. this.n66 = (this.getChild("n66"));
  15447. this.myProgress = (this.getChild("myProgress"));
  15448. this.starAni = (this.getChild("starAni"));
  15449. this.hpTxt = (this.getChild("hpTxt"));
  15450. this.n74 = (this.getChild("n74"));
  15451. this.n73 = (this.getChild("n73"));
  15452. this.ballTxt = (this.getChild("ballTxt"));
  15453. this.n76 = (this.getChild("n76"));
  15454. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15455. this.levelTxt = (this.getChild("levelTxt"));
  15456. this.star1 = (this.getChild("star1"));
  15457. this.star2 = (this.getChild("star2"));
  15458. this.star3 = (this.getChild("star3"));
  15459. }
  15460. }
  15461. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  15462. class ui_Component88 extends fgui.GProgressBar {
  15463. static createInstance() {
  15464. return (fgui.UIPackage.createObject("game", "Component88"));
  15465. }
  15466. onConstruct() {
  15467. this.n68 = (this.getChild("n68"));
  15468. this.bar = (this.getChild("bar"));
  15469. }
  15470. }
  15471. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  15472. class ui_Component89 extends fgui.GComponent {
  15473. static createInstance() {
  15474. return (fgui.UIPackage.createObject("game", "Component89"));
  15475. }
  15476. onConstruct() {
  15477. this.c1 = this.getController("c1");
  15478. this.n71 = (this.getChild("n71"));
  15479. this.n72 = (this.getChild("n72"));
  15480. }
  15481. }
  15482. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  15483. class ui_Component90 extends fgui.GComponent {
  15484. static createInstance() {
  15485. return (fgui.UIPackage.createObject("game", "Component90"));
  15486. }
  15487. onConstruct() {
  15488. this.c1 = this.getController("c1");
  15489. this.n64 = (this.getChild("n64"));
  15490. this.n65 = (this.getChild("n65"));
  15491. this.n66 = (this.getChild("n66"));
  15492. this.t0 = this.getTransition("t0");
  15493. }
  15494. }
  15495. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  15496. class ui_Component127 extends fgui.GButton {
  15497. static createInstance() {
  15498. return (fgui.UIPackage.createObject("game", "Component127"));
  15499. }
  15500. onConstruct() {
  15501. this.n5 = (this.getChild("n5"));
  15502. }
  15503. }
  15504. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  15505. class gameBinder {
  15506. static bindAll() {
  15507. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  15508. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  15509. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  15510. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  15511. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  15512. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  15513. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  15514. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  15515. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  15516. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  15517. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  15518. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  15519. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  15520. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  15521. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  15522. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  15523. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  15524. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  15525. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  15526. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  15527. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  15528. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  15529. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  15530. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  15531. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  15532. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  15533. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  15534. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  15535. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  15536. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  15537. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  15538. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  15539. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  15540. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  15541. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  15542. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  15543. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  15544. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  15545. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  15546. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  15547. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  15548. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  15549. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  15550. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  15551. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  15552. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  15553. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  15554. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  15555. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  15556. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  15557. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  15558. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  15559. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  15560. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  15561. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  15562. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  15563. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  15564. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  15565. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  15566. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  15567. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  15568. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  15569. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  15570. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  15571. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  15572. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  15573. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  15574. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  15575. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  15576. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  15577. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  15578. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  15579. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  15580. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  15581. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  15582. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  15583. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  15584. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  15585. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  15586. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  15587. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  15588. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  15589. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  15590. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  15591. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  15592. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  15593. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  15594. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  15595. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  15596. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  15597. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  15598. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  15599. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  15600. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  15601. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  15602. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  15603. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  15604. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  15605. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  15606. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  15607. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  15608. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  15609. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  15610. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  15611. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  15612. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  15613. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  15614. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  15615. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  15616. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  15617. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  15618. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  15619. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  15620. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  15621. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  15622. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  15623. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  15624. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  15625. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  15626. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  15627. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  15628. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  15629. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  15630. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  15631. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  15632. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  15633. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  15634. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  15635. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  15636. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  15637. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  15638. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  15639. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  15640. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  15641. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  15642. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  15643. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  15644. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  15645. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  15646. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  15647. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  15648. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  15649. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  15650. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  15651. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  15652. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  15653. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  15654. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  15655. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  15656. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  15657. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  15658. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  15659. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  15660. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  15661. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  15662. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  15663. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  15664. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  15665. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  15666. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  15667. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  15668. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  15669. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  15670. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  15671. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  15672. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  15673. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  15674. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  15675. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  15676. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  15677. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  15678. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  15679. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  15680. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  15681. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  15682. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  15683. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  15684. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  15685. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  15686. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  15687. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  15688. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  15689. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  15690. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  15691. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  15692. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  15693. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  15694. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  15695. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  15696. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  15697. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  15698. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  15699. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  15700. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  15701. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  15702. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  15703. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  15704. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  15705. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  15706. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  15707. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  15708. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  15709. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  15710. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  15711. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  15712. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  15713. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  15714. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  15715. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  15716. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  15717. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  15718. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  15719. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  15720. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  15721. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  15722. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  15723. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  15724. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  15725. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  15726. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  15727. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  15728. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  15729. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  15730. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  15731. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  15732. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  15733. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  15734. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  15735. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  15736. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  15737. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  15738. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  15739. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  15740. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  15741. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  15742. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  15743. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  15744. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  15745. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  15746. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  15747. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  15748. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  15749. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  15750. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  15751. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  15752. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  15753. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  15754. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  15755. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  15756. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  15757. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  15758. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  15759. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  15760. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  15761. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  15762. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  15763. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  15764. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  15765. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  15766. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  15767. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  15768. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  15769. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  15770. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  15771. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  15772. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  15773. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  15774. }
  15775. }
  15776. class ui_btn6 extends fgui.GButton {
  15777. static createInstance() {
  15778. return (fgui.UIPackage.createObject("loading", "btn6"));
  15779. }
  15780. onConstruct() {
  15781. this.n6 = (this.getChild("n6"));
  15782. this.n1 = (this.getChild("n1"));
  15783. }
  15784. }
  15785. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  15786. class ui_xyItem extends fgui.GComponent {
  15787. static createInstance() {
  15788. return (fgui.UIPackage.createObject("loading", "xyItem"));
  15789. }
  15790. onConstruct() {
  15791. this.xyItem = (this.getChild("xyItem"));
  15792. }
  15793. }
  15794. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  15795. class ui_loadinfo extends fgui.GProgressBar {
  15796. static createInstance() {
  15797. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  15798. }
  15799. onConstruct() {
  15800. this.bg = (this.getChild("bg"));
  15801. this.bar = (this.getChild("bar"));
  15802. this.title = (this.getChild("title"));
  15803. this.ani = (this.getChild("ani"));
  15804. }
  15805. }
  15806. ui_loadinfo.URL = "ui://37nctnhwis36c";
  15807. class ui_xyNode extends fgui.GComponent {
  15808. static createInstance() {
  15809. return (fgui.UIPackage.createObject("loading", "xyNode"));
  15810. }
  15811. onConstruct() {
  15812. this.n0 = (this.getChild("n0"));
  15813. this.btnYes = (this.getChild("btnYes"));
  15814. this.btnNo = (this.getChild("btnNo"));
  15815. this.btnKnown = (this.getChild("btnKnown"));
  15816. this.btnSure = (this.getChild("btnSure"));
  15817. this.txtWelcom = (this.getChild("txtWelcom"));
  15818. this.txtXy = (this.getChild("txtXy"));
  15819. this.n75 = (this.getChild("n75"));
  15820. this.btnXy1 = (this.getChild("btnXy1"));
  15821. this.btnXy3 = (this.getChild("btnXy3"));
  15822. this.btnXy2 = (this.getChild("btnXy2"));
  15823. this.n74 = (this.getChild("n74"));
  15824. this.xy1 = (this.getChild("xy1"));
  15825. this.txtTitle = (this.getChild("txtTitle"));
  15826. this.btnBack = (this.getChild("btnBack"));
  15827. this.xyList = (this.getChild("xyList"));
  15828. this.xy2 = (this.getChild("xy2"));
  15829. this.xyNode = (this.getChild("xyNode"));
  15830. }
  15831. }
  15832. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  15833. class ui_ageNode extends fgui.GComponent {
  15834. static createInstance() {
  15835. return (fgui.UIPackage.createObject("loading", "ageNode"));
  15836. }
  15837. onConstruct() {
  15838. this.n3 = (this.getChild("n3"));
  15839. this.n7 = (this.getChild("n7"));
  15840. this.n4 = (this.getChild("n4"));
  15841. this.btnAge = (this.getChild("btnAge"));
  15842. this.ageNode = (this.getChild("ageNode"));
  15843. }
  15844. }
  15845. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  15846. class ui_rnNode extends fgui.GComponent {
  15847. static createInstance() {
  15848. return (fgui.UIPackage.createObject("loading", "rnNode"));
  15849. }
  15850. onConstruct() {
  15851. this.n28 = (this.getChild("n28"));
  15852. this.n30 = (this.getChild("n30"));
  15853. this.n33 = (this.getChild("n33"));
  15854. this.rn1 = (this.getChild("rn1"));
  15855. this.n40 = (this.getChild("n40"));
  15856. this.n41 = (this.getChild("n41"));
  15857. this.rn3 = (this.getChild("rn3"));
  15858. this.n37 = (this.getChild("n37"));
  15859. this.n39 = (this.getChild("n39"));
  15860. this.rn2 = (this.getChild("rn2"));
  15861. this.n47 = (this.getChild("n47"));
  15862. this.n49 = (this.getChild("n49"));
  15863. this.n44 = (this.getChild("n44"));
  15864. this.inputCode = (this.getChild("inputCode"));
  15865. this.inputName = (this.getChild("inputName"));
  15866. this.n48 = (this.getChild("n48"));
  15867. this.n50 = (this.getChild("n50"));
  15868. this.rn4 = (this.getChild("rn4"));
  15869. this.btnCheck = (this.getChild("btnCheck"));
  15870. this.btnExit = (this.getChild("btnExit"));
  15871. this.btnDone = (this.getChild("btnDone"));
  15872. this.rnNode = (this.getChild("rnNode"));
  15873. }
  15874. }
  15875. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15876. class ui_tipNode extends fgui.GComponent {
  15877. static createInstance() {
  15878. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15879. }
  15880. onConstruct() {
  15881. this.bg = (this.getChild("bg"));
  15882. this.n55 = (this.getChild("n55"));
  15883. this.n56 = (this.getChild("n56"));
  15884. this.tipNode = (this.getChild("tipNode"));
  15885. }
  15886. }
  15887. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15888. class ui_fcmNode extends fgui.GComponent {
  15889. static createInstance() {
  15890. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15891. }
  15892. onConstruct() {
  15893. this.n63 = (this.getChild("n63"));
  15894. this.n62 = (this.getChild("n62"));
  15895. this.btnRn = (this.getChild("btnRn"));
  15896. this.n61 = (this.getChild("n61"));
  15897. this.n58 = (this.getChild("n58"));
  15898. this.fcmNode = (this.getChild("fcmNode"));
  15899. }
  15900. }
  15901. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15902. class ui_msgNode extends fgui.GComponent {
  15903. static createInstance() {
  15904. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15905. }
  15906. onConstruct() {
  15907. this.n69 = (this.getChild("n69"));
  15908. this.txtMsg = (this.getChild("txtMsg"));
  15909. this.msgNode = (this.getChild("msgNode"));
  15910. }
  15911. }
  15912. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15913. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15914. static createInstance() {
  15915. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15916. }
  15917. onConstruct() {
  15918. this.n1 = (this.getChild("n1"));
  15919. this.n13 = (this.getChild("n13"));
  15920. this.n14 = (this.getChild("n14"));
  15921. this.n15 = (this.getChild("n15"));
  15922. this.n3 = (this.getChild("n3"));
  15923. this.n4 = (this.getChild("n4"));
  15924. this.n5 = (this.getChild("n5"));
  15925. this.n6 = (this.getChild("n6"));
  15926. this.n7 = (this.getChild("n7"));
  15927. this.n8 = (this.getChild("n8"));
  15928. this.n9 = (this.getChild("n9"));
  15929. this.n10 = (this.getChild("n10"));
  15930. this.n12 = (this.getChild("n12"));
  15931. this.n11 = (this.getChild("n11"));
  15932. this.n16 = (this.getChild("n16"));
  15933. this.n17 = (this.getChild("n17"));
  15934. this.n18 = (this.getChild("n18"));
  15935. this.n20 = (this.getChild("n20"));
  15936. this.n21 = (this.getChild("n21"));
  15937. this.t0 = this.getTransition("t0");
  15938. }
  15939. }
  15940. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15941. class ui_btn5 extends fgui.GButton {
  15942. static createInstance() {
  15943. return (fgui.UIPackage.createObject("loading", "btn5"));
  15944. }
  15945. onConstruct() {
  15946. this.n9 = (this.getChild("n9"));
  15947. this.n1 = (this.getChild("n1"));
  15948. }
  15949. }
  15950. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15951. class ui_UILoading extends fgui.GComponent {
  15952. static createInstance() {
  15953. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15954. }
  15955. onConstruct() {
  15956. this.n12 = (this.getChild("n12"));
  15957. this.loadinfo = (this.getChild("loadinfo"));
  15958. this.n13 = (this.getChild("n13"));
  15959. this.txtLoad = (this.getChild("txtLoad"));
  15960. this.n18 = (this.getChild("n18"));
  15961. }
  15962. }
  15963. ui_UILoading.URL = "ui://37nctnhwphc33";
  15964. class ui_AgeItem extends fgui.GComponent {
  15965. static createInstance() {
  15966. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15967. }
  15968. onConstruct() {
  15969. this.txtAge = (this.getChild("txtAge"));
  15970. }
  15971. }
  15972. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15973. class ui_btn1 extends fgui.GButton {
  15974. static createInstance() {
  15975. return (fgui.UIPackage.createObject("loading", "btn1"));
  15976. }
  15977. onConstruct() {
  15978. this.n6 = (this.getChild("n6"));
  15979. this.n1 = (this.getChild("n1"));
  15980. }
  15981. }
  15982. ui_btn1.URL = "ui://37nctnhwxe622p";
  15983. class ui_btn3 extends fgui.GButton {
  15984. static createInstance() {
  15985. return (fgui.UIPackage.createObject("loading", "btn3"));
  15986. }
  15987. onConstruct() {
  15988. this.n9 = (this.getChild("n9"));
  15989. this.n1 = (this.getChild("n1"));
  15990. }
  15991. }
  15992. ui_btn3.URL = "ui://37nctnhwxe622s";
  15993. class ui_btn2 extends fgui.GButton {
  15994. static createInstance() {
  15995. return (fgui.UIPackage.createObject("loading", "btn2"));
  15996. }
  15997. onConstruct() {
  15998. this.n6 = (this.getChild("n6"));
  15999. this.n1 = (this.getChild("n1"));
  16000. }
  16001. }
  16002. ui_btn2.URL = "ui://37nctnhwxe622t";
  16003. class ui_btnBack extends fgui.GButton {
  16004. static createInstance() {
  16005. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16006. }
  16007. onConstruct() {
  16008. this.n6 = (this.getChild("n6"));
  16009. this.n7 = (this.getChild("n7"));
  16010. }
  16011. }
  16012. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16013. class ui_btnXy1 extends fgui.GButton {
  16014. static createInstance() {
  16015. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16016. }
  16017. onConstruct() {
  16018. this.n1 = (this.getChild("n1"));
  16019. }
  16020. }
  16021. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16022. class ui_btnXy2 extends fgui.GButton {
  16023. static createInstance() {
  16024. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16025. }
  16026. onConstruct() {
  16027. this.n1 = (this.getChild("n1"));
  16028. }
  16029. }
  16030. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16031. class ui_btnXy3 extends fgui.GButton {
  16032. static createInstance() {
  16033. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16034. }
  16035. onConstruct() {
  16036. this.n1 = (this.getChild("n1"));
  16037. }
  16038. }
  16039. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16040. class ui_btn4 extends fgui.GButton {
  16041. static createInstance() {
  16042. return (fgui.UIPackage.createObject("loading", "btn4"));
  16043. }
  16044. onConstruct() {
  16045. this.n9 = (this.getChild("n9"));
  16046. this.n1 = (this.getChild("n1"));
  16047. }
  16048. }
  16049. ui_btn4.URL = "ui://37nctnhwxe622z";
  16050. class loadingBinder {
  16051. static bindAll() {
  16052. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16053. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16054. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16055. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16056. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16057. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16058. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16059. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16060. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16061. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16062. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16063. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16064. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16065. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16066. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16067. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16068. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16069. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16070. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16071. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16072. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16073. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16074. }
  16075. }
  16076. class UIMgr {
  16077. constructor() {
  16078. this._stage = null;
  16079. this._uiList = [];
  16080. this._showList = [];
  16081. this._bindPkgList = [];
  16082. this.uiIndex = 0;
  16083. }
  16084. static get inst() {
  16085. if (UIMgr._inst == null) {
  16086. UIMgr._inst = new UIMgr();
  16087. }
  16088. return UIMgr._inst;
  16089. }
  16090. setStage(s) {
  16091. if (this._stage) {
  16092. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16093. return;
  16094. }
  16095. this._stage = s;
  16096. }
  16097. clearTempData() {
  16098. console.log('zh:clearTempData start');
  16099. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16100. console.log('zh:clearTempData end');
  16101. }
  16102. init() {
  16103. this.setStage(Laya.stage);
  16104. fairygui.UIConfig.defaultFont = "微软雅黑";
  16105. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16106. fairygui.UIConfig.packageFileExtension = "obj";
  16107. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16108. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16109. fairygui.GRoot.inst.width = Laya.stage.width;
  16110. fairygui.GRoot.inst.height = Laya.stage.height;
  16111. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16112. }
  16113. addAllUpdate() {
  16114. this.uiIndex = 0;
  16115. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16116. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16117. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16118. }
  16119. }
  16120. }
  16121. bindFUI(pkgname) {
  16122. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16123. return;
  16124. }
  16125. switch (pkgname) {
  16126. case fguiRes.loading:
  16127. fairygui.UIPackage.addPackage(pkgname);
  16128. loadingBinder.bindAll();
  16129. this._bindPkgList.push(pkgname);
  16130. break;
  16131. case fguiRes.game:
  16132. fairygui.UIPackage.addPackage(pkgname);
  16133. gameBinder.bindAll();
  16134. this._bindPkgList.push(pkgname);
  16135. break;
  16136. default:
  16137. break;
  16138. }
  16139. }
  16140. Show(cls, ...param) {
  16141. let nameStr = cls.uiName;
  16142. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16143. let temp = this._uiList[i];
  16144. let str = temp.className;
  16145. if (str == nameStr) {
  16146. if (temp.isMuti) {
  16147. if (temp.isHide) {
  16148. temp.show(...param);
  16149. this._uiList.splice(i, 1);
  16150. this._uiList.push(temp);
  16151. return temp;
  16152. }
  16153. }
  16154. else {
  16155. temp.show(...param);
  16156. this._uiList.splice(i, 1);
  16157. this._uiList.push(temp);
  16158. return temp;
  16159. }
  16160. }
  16161. }
  16162. let ui = new cls();
  16163. ui.className = nameStr;
  16164. this._showUI(ui, param);
  16165. return ui;
  16166. }
  16167. destroyUI(ui) {
  16168. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16169. let temp = this._uiList[i].className;
  16170. if (temp == ui.className) {
  16171. this._uiList.splice(i, 1);
  16172. break;
  16173. }
  16174. }
  16175. this.checkUIState();
  16176. }
  16177. _showUI(ui, param) {
  16178. this._uiList.push(ui);
  16179. ui.show(...param);
  16180. }
  16181. Hide(uiClass) {
  16182. let ui = this.getUI(uiClass);
  16183. if (ui && !ui.isHide) {
  16184. ui.hide();
  16185. }
  16186. }
  16187. getUI(ui) {
  16188. let nameStr = ui.uiName;
  16189. for (let index = 0; index < this._uiList.length; index++) {
  16190. let temp = this._uiList[index];
  16191. if (temp.className == nameStr) {
  16192. return temp;
  16193. }
  16194. }
  16195. return null;
  16196. }
  16197. isShow(cls) {
  16198. for (var i of this._uiList) {
  16199. if (i instanceof cls) {
  16200. return i.isShowing;
  16201. }
  16202. }
  16203. return false;
  16204. }
  16205. showUINum() {
  16206. let num = 0;
  16207. for (var i of this._uiList) {
  16208. if (i.isShowing) {
  16209. num++;
  16210. }
  16211. }
  16212. return num;
  16213. }
  16214. checkUIState() {
  16215. Laya.timer.clear(this, this._uiCheck);
  16216. Laya.timer.once(400, this, this._uiCheck);
  16217. }
  16218. _uiCheck() {
  16219. let showList = [];
  16220. for (var i of this._uiList) {
  16221. if (!i.isHide) {
  16222. showList.push(i);
  16223. }
  16224. }
  16225. for (let index = 0; index < showList.length; index++) {
  16226. if (index == showList.length - 1) {
  16227. showList[index].checkActive(true);
  16228. }
  16229. else {
  16230. showList[index].checkActive(false);
  16231. }
  16232. }
  16233. }
  16234. showTip(msg, time = 600, size = 30) {
  16235. }
  16236. }
  16237. class UIShowList {
  16238. }
  16239. class SoundMgr {
  16240. constructor() {
  16241. this.soundMax = 4;
  16242. this.isLoad = false;
  16243. this.soundMap = {};
  16244. this.isSound = true;
  16245. this.openShake = true;
  16246. SoundMgr._instance = this;
  16247. }
  16248. static getInstance() {
  16249. if (!this._instance) {
  16250. this._instance = new SoundMgr();
  16251. }
  16252. return this._instance;
  16253. }
  16254. init() {
  16255. console.log('zh:sm init 1');
  16256. Laya.SoundManager.autoReleaseSound = true;
  16257. Laya.SoundManager.autoStopMusic = true;
  16258. Laya.SoundManager.musicVolume = 0.3;
  16259. Laya.SoundManager.soundVolume = 0.5;
  16260. this.musicPlayed = false;
  16261. this.audioUrl = "asset/sound/ogg/";
  16262. console.log('zh:sm init 2');
  16263. console.log('zh:dev type ');
  16264. if (Laya.Browser.onAndroid) {
  16265. console.log('zh:dev type android');
  16266. this.audioUrl = "asset/sound/ogg/";
  16267. this.isLoad = true;
  16268. }
  16269. else {
  16270. console.log('zh:dev type not android');
  16271. this.audioUrl = "asset/sound/mp3/";
  16272. this.isLoad = true;
  16273. }
  16274. }
  16275. onSetting(isS) {
  16276. this.isSound = isS;
  16277. this.mute(!this.isSound);
  16278. }
  16279. clearCount() {
  16280. for (var key in this.soundMap) {
  16281. delete this.soundMap[key];
  16282. }
  16283. }
  16284. playMusic(path, loop = 0) {
  16285. console.log('zh:playMusic 1 PATH=' + path);
  16286. this.musicPath = path;
  16287. if (!this.isLoad) {
  16288. return;
  16289. }
  16290. if (!path || path == "") {
  16291. return;
  16292. }
  16293. if (!this.isSound) {
  16294. return;
  16295. }
  16296. this.musicPlayed = true;
  16297. let url = this.getUrl(path);
  16298. if (!Laya.Browser.onAndroid) {
  16299. Laya.loader.load(url, Laya.Handler.create(this, () => {
  16300. this.play(url, loop);
  16301. }));
  16302. }
  16303. else {
  16304. this.play(url, loop);
  16305. }
  16306. }
  16307. play(url, loop) {
  16308. Laya.SoundManager.playMusic(url, loop);
  16309. }
  16310. getUrl(path) {
  16311. let url = this.audioUrl + path;
  16312. if (Laya.Browser.onAndroid) {
  16313. url += ".ogg";
  16314. }
  16315. else {
  16316. url += ".mp3";
  16317. }
  16318. return url;
  16319. }
  16320. pauseMusic(pause) {
  16321. if (pause) {
  16322. this.mute(true);
  16323. }
  16324. else if (this.isSound)
  16325. this.mute(false);
  16326. }
  16327. stopMusic() {
  16328. Laya.SoundManager.stopMusic();
  16329. if (Moyu.isNeedPlatAudio) {
  16330. Moyu.stopMusic();
  16331. }
  16332. }
  16333. mute(mute) {
  16334. if (Moyu.isNeedPlatAudio) {
  16335. Moyu.pauseMusic(mute);
  16336. }
  16337. else {
  16338. Laya.SoundManager.musicMuted = mute;
  16339. if (!mute && !this.musicPlayed && this.musicPath) {
  16340. this.playMusic(this.musicPath);
  16341. }
  16342. }
  16343. }
  16344. stopSound(path) {
  16345. let url = this.getUrl(path);
  16346. Laya.SoundManager.stopSound(url);
  16347. }
  16348. playSound(path, loop = 1, soundMax = this.soundMax) {
  16349. if (!this.isLoad)
  16350. return;
  16351. if (!this.isSound)
  16352. return;
  16353. if (!path || path == "")
  16354. return;
  16355. let url = this.getUrl(path);
  16356. if (Moyu.isNeedPlatAudio) {
  16357. Moyu.playSound(path, loop == 0);
  16358. }
  16359. else {
  16360. let count = 1;
  16361. if (this.soundMap[path])
  16362. count = this.soundMap[path] + 1;
  16363. if (count > soundMax)
  16364. return;
  16365. this.soundMap[path] = count;
  16366. Laya.SoundManager.playSound(url, loop);
  16367. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  16368. }
  16369. }
  16370. removePath(path) {
  16371. if (this.soundMap[path]) {
  16372. let count = this.soundMap[path];
  16373. count--;
  16374. if (count < 1)
  16375. delete this.soundMap[path];
  16376. else
  16377. this.soundMap[path] = count;
  16378. }
  16379. }
  16380. playBtnSound() {
  16381. this.playSound("btn");
  16382. }
  16383. playGetSound() {
  16384. }
  16385. playCloseUISound() {
  16386. }
  16387. }
  16388. SoundMgr._instance = null;
  16389. var Handler$1 = Laya.Handler;
  16390. var EResType;
  16391. (function (EResType) {
  16392. EResType[EResType["none"] = 0] = "none";
  16393. EResType[EResType["nromal"] = 1] = "nromal";
  16394. EResType[EResType["td"] = 2] = "td";
  16395. EResType[EResType["sk"] = 3] = "sk";
  16396. })(EResType || (EResType = {}));
  16397. class CResLoader {
  16398. constructor(doneCall, proCall) {
  16399. this.completrCall = doneCall;
  16400. this.progressCall = proCall;
  16401. this.progressHander = new Handler$1(this, this.onProgress);
  16402. this.tdResMap = {};
  16403. }
  16404. load(resList) {
  16405. this.resCount = 0;
  16406. this.loadCount = 0;
  16407. for (let i = 0; i < resList.length; i++) {
  16408. let path = resList[i];
  16409. if (!path)
  16410. continue;
  16411. this.resCount++;
  16412. let type = this.getResType(path);
  16413. if (type == EResType.nromal)
  16414. this.loadNromal(path);
  16415. else if (type == EResType.td)
  16416. this.loadTd(path);
  16417. }
  16418. }
  16419. getRes(path) {
  16420. let type = this.getResType(path);
  16421. if (type == EResType.nromal)
  16422. return Laya.loader.getRes(path);
  16423. else if (type == EResType.td) {
  16424. let res = this.tdResMap[path];
  16425. if (res)
  16426. return res.clone();
  16427. return null;
  16428. }
  16429. }
  16430. destroy() {
  16431. this.progressHander.clear();
  16432. this.progressHander = null;
  16433. }
  16434. clearRes(path) {
  16435. let type = this.getResType(path);
  16436. if (type == EResType.nromal)
  16437. Laya.loader.clearRes(path);
  16438. else if (type == EResType.td) {
  16439. let obj = this.tdResMap[path];
  16440. if (obj)
  16441. obj.destroy();
  16442. delete this.tdResMap[path];
  16443. }
  16444. }
  16445. getResType(path) {
  16446. let exs = this.getExtension(path);
  16447. if (exs == "sk")
  16448. return EResType.sk;
  16449. if (exs == "ls" || exs == "lh" || exs == "lm")
  16450. return EResType.td;
  16451. else
  16452. return EResType.nromal;
  16453. }
  16454. getExtension(res) {
  16455. var index = res.lastIndexOf(".");
  16456. return res.substr(index + 1);
  16457. }
  16458. loadNromal(path) {
  16459. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  16460. if (res) {
  16461. this.onLoad();
  16462. }
  16463. else
  16464. console.log("load res fail:" + path);
  16465. }), this.progressHander);
  16466. }
  16467. loadSk() {
  16468. }
  16469. loadTd(path) {
  16470. if (this.tdResMap[path]) {
  16471. this.onLoad();
  16472. return;
  16473. }
  16474. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  16475. if (res) {
  16476. this.tdResMap[path] = res;
  16477. this.onLoad();
  16478. }
  16479. else
  16480. console.log("load res fail:" + path);
  16481. }));
  16482. }
  16483. onLoad() {
  16484. this.loadCount++;
  16485. this.onProgress(1);
  16486. if (this.loadCount >= this.resCount) {
  16487. this.completrCall.run();
  16488. }
  16489. }
  16490. onProgress(pro) {
  16491. let progress = (this.loadCount + pro) / this.resCount;
  16492. this.progressCall.runWith(progress);
  16493. }
  16494. }
  16495. var Handler$2 = Laya.Handler;
  16496. class ResInfo {
  16497. constructor() {
  16498. this.index = 0;
  16499. }
  16500. }
  16501. class ResMgr {
  16502. constructor() {
  16503. this.resList = [];
  16504. this.doneList = [];
  16505. this.resMap = {};
  16506. this.currentLoad = null;
  16507. this.completeHandler = new Handler$2(this, this.onComplete);
  16508. this.progressHandler = new Handler$2(this, this.onProgress);
  16509. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  16510. }
  16511. static getInstance() {
  16512. if (ResMgr._instance == null) {
  16513. ResMgr._instance = new ResMgr();
  16514. }
  16515. return ResMgr._instance;
  16516. }
  16517. loadList(list, completeHandler, progressHandler) {
  16518. if (list.length < 1) {
  16519. completeHandler.run();
  16520. return;
  16521. }
  16522. let info = this.getResInfo();
  16523. info.resList = list;
  16524. info.completeHandler = completeHandler;
  16525. info.progressHandler = progressHandler;
  16526. this.resList.push(info);
  16527. this.startLoad();
  16528. }
  16529. loadFguiRes(list, completeHandler, progressHandler) {
  16530. Laya.loader.load(list, completeHandler, progressHandler);
  16531. }
  16532. loadAny(list, completeHandler, progressHandler) {
  16533. Laya.loader.load(list, completeHandler, progressHandler);
  16534. }
  16535. load(path, completeHandler, progressHandler) {
  16536. let count = this.resMap[path];
  16537. if (count && count > 0) {
  16538. if (completeHandler)
  16539. completeHandler.run();
  16540. }
  16541. else
  16542. this.loadList([path], completeHandler, progressHandler);
  16543. }
  16544. getRes(path) {
  16545. let res = this.resMap[path];
  16546. if (!res)
  16547. this.showLog("资源不存在:" + path);
  16548. else
  16549. return this.loader.getRes(path);
  16550. }
  16551. clearList(list, force = false) {
  16552. if (!list || list.length < 1)
  16553. return;
  16554. let cr = () => {
  16555. for (const k in list) {
  16556. let v = list[k];
  16557. if (!v)
  16558. continue;
  16559. if (force) {
  16560. this.loader.clearRes(v);
  16561. delete this.resMap[v];
  16562. }
  16563. else {
  16564. let count = this.resMap[v];
  16565. if (count && count > 1) {
  16566. count--;
  16567. this.resMap[v] = count;
  16568. }
  16569. else {
  16570. this.loader.clearRes(v);
  16571. delete this.resMap[v];
  16572. }
  16573. }
  16574. }
  16575. if (!window.hasOwnProperty("ks"))
  16576. Laya.Resource.destroyUnusedResources();
  16577. };
  16578. Laya.timer.clearAll(this);
  16579. Laya.timer.once(2000, this, cr);
  16580. }
  16581. clear3D() {
  16582. for (const k in this.loader.tdResMap) {
  16583. this.loader.clearRes(k);
  16584. if (this.resMap[k])
  16585. delete this.resMap[k];
  16586. }
  16587. if (!window.hasOwnProperty("ks"))
  16588. Laya.Resource.destroyUnusedResources();
  16589. }
  16590. clear(path, force = false) {
  16591. this.clearList([path], force);
  16592. }
  16593. getResInfo() {
  16594. if (this.doneList.length > 0)
  16595. return this.doneList.pop();
  16596. else
  16597. return new ResInfo();
  16598. }
  16599. startLoad() {
  16600. if (this.currentLoad)
  16601. return;
  16602. this.currentLoad = this.resList.pop();
  16603. if (this.currentLoad) {
  16604. this.loader.load(this.currentLoad.resList);
  16605. }
  16606. }
  16607. onComplete() {
  16608. if (!this.currentLoad)
  16609. return;
  16610. for (const k in this.currentLoad.resList) {
  16611. let v = this.currentLoad.resList[k];
  16612. let count = this.resMap[v];
  16613. if (count)
  16614. count++;
  16615. else
  16616. count = 1;
  16617. this.resMap[v] = count;
  16618. }
  16619. if (this.currentLoad.completeHandler)
  16620. this.currentLoad.completeHandler.run();
  16621. this.doneList.push(this.currentLoad);
  16622. this.currentLoad = null;
  16623. this.startLoad();
  16624. }
  16625. onProgress(pro) {
  16626. if (!this.currentLoad)
  16627. return;
  16628. if (this.currentLoad.progressHandler)
  16629. this.currentLoad.progressHandler.runWith(pro);
  16630. }
  16631. showLog(str, ...args) {
  16632. console.log("[ResLoader] " + str);
  16633. }
  16634. }
  16635. ResMgr._instance = null;
  16636. class EventMgr extends Laya.EventDispatcher {
  16637. }
  16638. let eventMgr = new EventMgr();
  16639. /*! *****************************************************************************
  16640. Copyright (c) Microsoft Corporation. All rights reserved.
  16641. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  16642. this file except in compliance with the License. You may obtain a copy of the
  16643. License at http://www.apache.org/licenses/LICENSE-2.0
  16644. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16645. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  16646. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  16647. MERCHANTABLITY OR NON-INFRINGEMENT.
  16648. See the Apache Version 2.0 License for specific language governing permissions
  16649. and limitations under the License.
  16650. ***************************************************************************** */
  16651. /* global Reflect, Promise */
  16652. var extendStatics = function(d, b) {
  16653. extendStatics = Object.setPrototypeOf ||
  16654. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16655. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16656. return extendStatics(d, b);
  16657. };
  16658. function __extends(d, b) {
  16659. extendStatics(d, b);
  16660. function __() { this.constructor = d; }
  16661. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16662. }
  16663. var __assign = function() {
  16664. __assign = Object.assign || function __assign(t) {
  16665. for (var s, i = 1, n = arguments.length; i < n; i++) {
  16666. s = arguments[i];
  16667. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  16668. }
  16669. return t;
  16670. };
  16671. return __assign.apply(this, arguments);
  16672. };
  16673. function __rest(s, e) {
  16674. var t = {};
  16675. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  16676. t[p] = s[p];
  16677. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  16678. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  16679. t[p[i]] = s[p[i]];
  16680. return t;
  16681. }
  16682. function __decorate(decorators, target, key, desc) {
  16683. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  16684. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  16685. 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;
  16686. return c > 3 && r && Object.defineProperty(target, key, r), r;
  16687. }
  16688. function __param(paramIndex, decorator) {
  16689. return function (target, key) { decorator(target, key, paramIndex); }
  16690. }
  16691. function __metadata(metadataKey, metadataValue) {
  16692. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  16693. }
  16694. function __awaiter(thisArg, _arguments, P, generator) {
  16695. return new (P || (P = Promise))(function (resolve, reject) {
  16696. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  16697. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  16698. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  16699. step((generator = generator.apply(thisArg, _arguments || [])).next());
  16700. });
  16701. }
  16702. function __generator(thisArg, body) {
  16703. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  16704. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  16705. function verb(n) { return function (v) { return step([n, v]); }; }
  16706. function step(op) {
  16707. if (f) throw new TypeError("Generator is already executing.");
  16708. while (_) try {
  16709. 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;
  16710. if (y = 0, t) op = [op[0] & 2, t.value];
  16711. switch (op[0]) {
  16712. case 0: case 1: t = op; break;
  16713. case 4: _.label++; return { value: op[1], done: false };
  16714. case 5: _.label++; y = op[1]; op = [0]; continue;
  16715. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  16716. default:
  16717. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  16718. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  16719. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  16720. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  16721. if (t[2]) _.ops.pop();
  16722. _.trys.pop(); continue;
  16723. }
  16724. op = body.call(thisArg, _);
  16725. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  16726. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  16727. }
  16728. }
  16729. function __exportStar(m, exports) {
  16730. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  16731. }
  16732. function __values(o) {
  16733. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  16734. if (m) return m.call(o);
  16735. return {
  16736. next: function () {
  16737. if (o && i >= o.length) o = void 0;
  16738. return { value: o && o[i++], done: !o };
  16739. }
  16740. };
  16741. }
  16742. function __read(o, n) {
  16743. var m = typeof Symbol === "function" && o[Symbol.iterator];
  16744. if (!m) return o;
  16745. var i = m.call(o), r, ar = [], e;
  16746. try {
  16747. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  16748. }
  16749. catch (error) { e = { error: error }; }
  16750. finally {
  16751. try {
  16752. if (r && !r.done && (m = i["return"])) m.call(i);
  16753. }
  16754. finally { if (e) throw e.error; }
  16755. }
  16756. return ar;
  16757. }
  16758. function __spread() {
  16759. for (var ar = [], i = 0; i < arguments.length; i++)
  16760. ar = ar.concat(__read(arguments[i]));
  16761. return ar;
  16762. }
  16763. function __await(v) {
  16764. return this instanceof __await ? (this.v = v, this) : new __await(v);
  16765. }
  16766. function __asyncGenerator(thisArg, _arguments, generator) {
  16767. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  16768. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  16769. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  16770. 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); }); }; }
  16771. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  16772. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  16773. function fulfill(value) { resume("next", value); }
  16774. function reject(value) { resume("throw", value); }
  16775. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  16776. }
  16777. function __asyncDelegator(o) {
  16778. var i, p;
  16779. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  16780. 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; }
  16781. }
  16782. function __asyncValues(o) {
  16783. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  16784. var m = o[Symbol.asyncIterator], i;
  16785. 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);
  16786. 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); }); }; }
  16787. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  16788. }
  16789. function __makeTemplateObject(cooked, raw) {
  16790. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  16791. return cooked;
  16792. };
  16793. function __importStar(mod) {
  16794. if (mod && mod.__esModule) return mod;
  16795. var result = {};
  16796. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  16797. result.default = mod;
  16798. return result;
  16799. }
  16800. function __importDefault(mod) {
  16801. return (mod && mod.__esModule) ? mod : { default: mod };
  16802. }
  16803. class CustomAlert {
  16804. static show(title, content, buttons) {
  16805. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  16806. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  16807. return;
  16808. }
  16809. const bg = new Laya.Box();
  16810. bg.alpha = 0;
  16811. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  16812. Laya.stage.addChild(bg);
  16813. Laya.Tween.to(bg, { alpha: 1 }, 200);
  16814. const panel = new Laya.Box();
  16815. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  16816. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  16817. bg.addChild(panel);
  16818. const titleText = new Laya.Text();
  16819. titleText.text = title;
  16820. titleText.fontSize = 32;
  16821. titleText.color = "#333333";
  16822. titleText.bold = true;
  16823. titleText.pos(20, 20);
  16824. titleText.width = 360;
  16825. titleText.align = "center";
  16826. panel.addChild(titleText);
  16827. const contentText = new Laya.Text();
  16828. contentText.text = content;
  16829. contentText.fontSize = 21;
  16830. contentText.color = "#555555";
  16831. contentText.pos(20, 70);
  16832. contentText.width = 360;
  16833. contentText.wordWrap = true;
  16834. contentText.align = "center";
  16835. panel.addChild(contentText);
  16836. const buttonContainer = new Laya.Box();
  16837. buttonContainer.pos(20, 160);
  16838. panel.addChild(buttonContainer);
  16839. const btnWidth = 120;
  16840. const spacing = 30;
  16841. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  16842. buttons.forEach((btn, index) => {
  16843. const button = new Laya.Button();
  16844. button.label = btn.label;
  16845. button.size(btnWidth, 40);
  16846. button.labelSize = 22;
  16847. button.pos(index * (btnWidth + spacing), 0);
  16848. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  16849. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  16850. button.on(Laya.Event.MOUSE_OVER, this, () => {
  16851. button.alpha = 0.9;
  16852. });
  16853. button.on(Laya.Event.MOUSE_OUT, this, () => {
  16854. button.alpha = 1;
  16855. });
  16856. button.on(Laya.Event.CLICK, this, () => {
  16857. btn.handler();
  16858. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  16859. bg.removeSelf();
  16860. }));
  16861. });
  16862. buttonContainer.addChild(button);
  16863. });
  16864. buttonContainer.x = (panel.width - totalWidth) / 2;
  16865. }
  16866. }
  16867. class ConfigMgr {
  16868. constructor() {
  16869. this.httpReqCount = 4;
  16870. this.httpReqOkCount = 0;
  16871. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  16872. try {
  16873. this.httpReqOkCount = 0;
  16874. let reqData = JSON.stringify({
  16875. gameName: "TQ",
  16876. gameUserName: "zhangSan"
  16877. });
  16878. console.log('zh:第1个请求');
  16879. const classicCfg = yield this.sendPostAsync('getClassicCfg', reqData);
  16880. this.classicCfg = classicCfg;
  16881. this.httpReqOkCount++;
  16882. console.log('zh:第2个请求');
  16883. const levelCfg = yield this.sendPostAsync('getLevelCfg', reqData);
  16884. this.levelCfg = levelCfg;
  16885. this.httpReqOkCount++;
  16886. console.log('zh:第3个请求');
  16887. const placeBallCfg = yield this.sendPostAsync('getPlaceBallCfg', reqData);
  16888. this.placeBallCfg = placeBallCfg;
  16889. this.httpReqOkCount++;
  16890. console.log('zh:第4个请求npc');
  16891. const npc = yield this.sendPostAsync('getNpc', reqData);
  16892. this.npcJson = npc.Data;
  16893. this.httpReqOkCount++;
  16894. console.log('zh:所有配置加载完成');
  16895. }
  16896. catch (error) {
  16897. console.error('请求失败:', error);
  16898. }
  16899. finally {
  16900. if (this.httpReqCount > this.httpReqOkCount) {
  16901. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  16902. {
  16903. label: "Okay", handler: () => {
  16904. console.log("zh:好的知道了");
  16905. JSBridgeUtils.instance.exitAndCloseGame();
  16906. }
  16907. }
  16908. ]);
  16909. }
  16910. }
  16911. });
  16912. this.sendPostAsync = (action, reqData) => {
  16913. return new Promise((resolve, reject) => {
  16914. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  16915. try {
  16916. let code = res.code;
  16917. if (code == 200) {
  16918. const parsedData = JSON.parse(res.msg);
  16919. resolve(parsedData);
  16920. }
  16921. else {
  16922. console.log(`zh:res = ${JSON.stringify(res)}`);
  16923. reject(new Error(`Request failed with code: ${code}`));
  16924. }
  16925. }
  16926. catch (error) {
  16927. console.error(`error=${error}`);
  16928. alert("Please check your network connection.");
  16929. reject(error);
  16930. }
  16931. finally {
  16932. console.log(`zh:${action}`);
  16933. }
  16934. });
  16935. });
  16936. };
  16937. }
  16938. static getInstance() {
  16939. if (!this._instance) {
  16940. this._instance = new ConfigMgr();
  16941. }
  16942. return this._instance;
  16943. }
  16944. init() {
  16945. this.getConfigFromServer();
  16946. }
  16947. test() {
  16948. let reqData = JSON.stringify({
  16949. gameName: "TQ",
  16950. gameUserName: "zhangSan"
  16951. });
  16952. xGame.httpMgr.sendPost2025('getClassicCfg', reqData, (res) => {
  16953. console.log('zh:1s');
  16954. try {
  16955. let code = res.code;
  16956. let data = res.data;
  16957. if (code == 200) {
  16958. const parsedData = JSON.parse(data);
  16959. this.classicCfg = parsedData;
  16960. }
  16961. else {
  16962. console.log('zh:res = ' + JSON.stringify(res));
  16963. }
  16964. }
  16965. catch (error) {
  16966. console.log('error=' + error);
  16967. alert("Please check your network connection.");
  16968. }
  16969. finally {
  16970. console.log('zh:1');
  16971. }
  16972. });
  16973. }
  16974. getUserInfoByIndex(index) {
  16975. return this.npcJson[index];
  16976. }
  16977. getRandomUserInfo() {
  16978. let index = xGame.tools.random(0, this.npcJson.length);
  16979. let rs = this.npcJson[index];
  16980. return rs;
  16981. }
  16982. getMaxBigMoveLength() {
  16983. return Object.keys(this.levelCfg).length;
  16984. }
  16985. getBigMoveLevelByIndex(index) {
  16986. let cfg = this.levelCfg;
  16987. cfg = cfg[index];
  16988. return cfg;
  16989. }
  16990. getRandomClassicLevel() {
  16991. let cfg = this.classicCfg;
  16992. let num = Object.keys(cfg).length;
  16993. let rand = xGame.common.randomNum(1, num);
  16994. return cfg[rand];
  16995. }
  16996. getPlaceBallByLevel(level) {
  16997. return this.placeBallCfg[level];
  16998. }
  16999. getMaxPlaceBall() {
  17000. return Object.keys(this.placeBallCfg).length;
  17001. }
  17002. }
  17003. class PoolD3Mgr {
  17004. constructor() {
  17005. this.pool = {};
  17006. }
  17007. static get ins() {
  17008. return this._ins || (this._ins = new PoolD3Mgr);
  17009. }
  17010. createList(key, prefab, parent) {
  17011. if (!this.pool[key]) {
  17012. this.pool[key] = {};
  17013. this.pool[key].prefab = prefab;
  17014. this.pool[key].list = [];
  17015. this.pool[key].parent = parent;
  17016. }
  17017. }
  17018. getItem(key) {
  17019. if (!this.pool[key]) {
  17020. return;
  17021. }
  17022. let temp;
  17023. if (this.pool[key].list.length > 0) {
  17024. temp = this.pool[key].list.pop();
  17025. }
  17026. else {
  17027. temp = this.pool[key].prefab.clone();
  17028. if (this.pool[key].parent) {
  17029. this.pool[key].parent.addChild(temp);
  17030. }
  17031. }
  17032. temp.active = true;
  17033. return temp;
  17034. }
  17035. putItem(key, obj) {
  17036. if (!this.pool[key]) {
  17037. return;
  17038. }
  17039. obj.active = false;
  17040. this.pool[key].list.push(obj);
  17041. }
  17042. }
  17043. let context$1 = context;
  17044. let uiMgr = UIMgr.inst;
  17045. let soundMgr = SoundMgr.getInstance();
  17046. let resMgr = ResMgr.getInstance();
  17047. let httpMgr = HttpMgr.getInstance();
  17048. let common = Common.getInstance();
  17049. let cfgMgr = ConfigMgr.getInstance();
  17050. let poolD3Mgr = PoolD3Mgr.ins;
  17051. let d3TexUrl = "res/d3Res/";
  17052. let d3ModeUrl = "res/unityRes/";
  17053. function setStageSize(view) {
  17054. if (view.width) {
  17055. view.width = Laya.stage.width;
  17056. view.height = Laya.stage.height;
  17057. }
  17058. }
  17059. function filledBg(view) {
  17060. let wh = Laya.stage.height / Laya.stage.width;
  17061. if (wh > 16 / 9) {
  17062. view.height = Laya.stage.height;
  17063. view.width = Laya.stage.height / 1334 * 750;
  17064. }
  17065. else {
  17066. view.width = Laya.stage.width;
  17067. view.height = Laya.stage.width / 750 * 1334;
  17068. }
  17069. }
  17070. function setNotch(view) {
  17071. if (view.height) {
  17072. view.y += context$1.notchHeight;
  17073. }
  17074. }
  17075. function showTip(str) {
  17076. uiMgr.Show(UIMsg, str);
  17077. }
  17078. function log(...args) {
  17079. console.log(args);
  17080. }
  17081. let xGame = {
  17082. context: context$1,
  17083. eventMgr,
  17084. resMgr,
  17085. uiMgr,
  17086. soundMgr,
  17087. define,
  17088. tools,
  17089. httpMgr,
  17090. d3TexUrl,
  17091. d3ModeUrl,
  17092. common,
  17093. cfgMgr,
  17094. poolD3Mgr,
  17095. setStageSize,
  17096. filledBg,
  17097. setNotch,
  17098. showTip,
  17099. log,
  17100. };
  17101. window["xGame"] = xGame;
  17102. let dataName = 'tBall_';
  17103. class UserData {
  17104. constructor() {
  17105. this.userId = "";
  17106. this.isAgree = false;
  17107. this.coinNum = 0;
  17108. this.gemNum = 0;
  17109. this.sound = true;
  17110. this.vibration = true;
  17111. this.currentDate = 0;
  17112. this.createTime = 0;
  17113. this.awardTime = 0;
  17114. this.roleId = 1;
  17115. this.roleList = [];
  17116. this.roleAds = [];
  17117. this.dressId = 101;
  17118. this.itemId = 201;
  17119. this.bigSkills = [1, 1, 1, 1, 1];
  17120. this.coin = 4000;
  17121. this.diamond = 0;
  17122. this.skillSuccessTimes = 0;
  17123. this.skillGuide = 0;
  17124. this.skillAccTimes = 0;
  17125. this.placeBallData = [];
  17126. this.shareDiamondTimes = 0;
  17127. this.dailyVideoShareTimes = 0;
  17128. this.secretary = [1, 0];
  17129. this.curSecretary = 0;
  17130. this.ballRod = [1, 0, 0, 0, 0, 1];
  17131. this.curBallRod = 5;
  17132. this.signData = 0;
  17133. this.signTime = 0;
  17134. this.drawTimes = 0;
  17135. this.drawAwardTimes = 0;
  17136. this.dailyfreeDrawTimes = 1;
  17137. this.power = 5;
  17138. this.powerTime = 0;
  17139. this.challengeTimes = 0;
  17140. this.extraSign = 0;
  17141. this.classicTimes = 0;
  17142. this.guideHelpLine = 0;
  17143. this.newUser = true;
  17144. this.rootBallFoul = 0;
  17145. this.timeoutFoul = 0;
  17146. this.roleList = [1];
  17147. }
  17148. saveData() {
  17149. let data = {};
  17150. for (let k in this) {
  17151. data[k.toString()] = this[k];
  17152. }
  17153. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17154. }
  17155. getData() {
  17156. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  17157. if (ld) {
  17158. let localData = JSON.parse(ld);
  17159. if (localData) {
  17160. for (let k in this) {
  17161. let key = k.toString();
  17162. let data = localData[key];
  17163. if (data != undefined) {
  17164. this[k] = data;
  17165. }
  17166. }
  17167. }
  17168. }
  17169. }
  17170. }
  17171. class ItemData {
  17172. constructor() {
  17173. this.itemList = {};
  17174. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  17175. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  17176. }
  17177. saveData() {
  17178. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  17179. }
  17180. getData() {
  17181. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  17182. if (ld) {
  17183. let localData = JSON.parse(ld);
  17184. if (localData) {
  17185. this.itemList = localData;
  17186. }
  17187. }
  17188. }
  17189. }
  17190. class GameData {
  17191. constructor() {
  17192. this.curLevel = 0;
  17193. this.gameType = 1;
  17194. this.signIdx = 0;
  17195. this.signMax = 0;
  17196. this.rotaryTime = 0;
  17197. this.rotaryCount = 0;
  17198. this.rotaryList = [];
  17199. this.diyCount = 3;
  17200. this.awardIdx = 0;
  17201. this.shareNum = 2;
  17202. this.rankWeek = 0;
  17203. this.rankScore = 0;
  17204. this.gameCount = 0;
  17205. this.trySkill = -1;
  17206. this.tryTime = 0;
  17207. }
  17208. saveData() {
  17209. let data = {};
  17210. for (let k in this) {
  17211. data[k.toString()] = this[k];
  17212. }
  17213. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  17214. }
  17215. getData() {
  17216. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  17217. if (ld) {
  17218. let localData = JSON.parse(ld);
  17219. if (localData) {
  17220. for (let k in this) {
  17221. let key = k.toString();
  17222. let data = localData[key];
  17223. if (data != undefined) {
  17224. this[k] = data;
  17225. }
  17226. }
  17227. }
  17228. }
  17229. }
  17230. }
  17231. class Diy2025GameData {
  17232. constructor() {
  17233. this.challengeMode_overLev = 0;
  17234. this.xszyForClassic = false;
  17235. this.xszyForChallenge = false;
  17236. }
  17237. saveData() {
  17238. let data = {};
  17239. for (let k in this) {
  17240. data[k.toString()] = this[k];
  17241. }
  17242. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  17243. }
  17244. getData() {
  17245. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  17246. if (ld) {
  17247. let localData = JSON.parse(ld);
  17248. if (localData) {
  17249. for (let k in this) {
  17250. let key = k.toString();
  17251. let data = localData[key];
  17252. if (data != undefined) {
  17253. this[k] = data;
  17254. }
  17255. }
  17256. }
  17257. }
  17258. }
  17259. }
  17260. class DataMgr {
  17261. static Init() {
  17262. this.userData = new UserData();
  17263. this.gameData = new GameData();
  17264. this.itemData = new ItemData();
  17265. this.diyGameData = new Diy2025GameData();
  17266. this.userData.getData();
  17267. this.gameData.getData();
  17268. this.itemData.getData();
  17269. this.diyGameData.getData();
  17270. this.roleId = this.userData.roleId;
  17271. this.resetUse();
  17272. }
  17273. static isNewDay() {
  17274. Moyu.isNewDay(this, (isnew) => {
  17275. xGame.common.isNewDay = isnew;
  17276. if (!isnew)
  17277. return;
  17278. DataMgr.setShareDiamondTimes(0, false);
  17279. DataMgr.setDailyVideoShareTimes(0, false);
  17280. DataMgr.setDailyfreeDrawTimes(1);
  17281. DataMgr.setExtraSign(0);
  17282. });
  17283. }
  17284. static deletData() {
  17285. Laya.LocalStorage.clear();
  17286. }
  17287. static upRankData() {
  17288. let num = xGame.common.getAllStarNum();
  17289. if (num > 0)
  17290. Moyu.upRankData(xGame.common.curRankID, num);
  17291. }
  17292. static addItem(id, count = 1) {
  17293. let v = this.itemData.itemList[id];
  17294. if (!v)
  17295. v = { id: id, count: count, adnum: 0, active: true };
  17296. else {
  17297. if (v.active) {
  17298. v.count += count;
  17299. }
  17300. else {
  17301. v.count = count;
  17302. v.active = true;
  17303. }
  17304. }
  17305. this.itemData.itemList[id] = v;
  17306. xGame.soundMgr.playGetSound();
  17307. this.saveItemData();
  17308. }
  17309. static hasItem(id) {
  17310. let v = this.itemData.itemList[id];
  17311. if (v && v.active)
  17312. return true;
  17313. return false;
  17314. }
  17315. static getItem(id) {
  17316. let v = this.itemData.itemList[id];
  17317. return v;
  17318. }
  17319. static getItemCount(id) {
  17320. let v = this.itemData.itemList[id];
  17321. if (v && v.active)
  17322. return v.count;
  17323. return 0;
  17324. }
  17325. static getItemAd(id) {
  17326. let v = this.itemData.itemList[id];
  17327. if (v) {
  17328. return v.adnum;
  17329. }
  17330. return 0;
  17331. }
  17332. static onItemAd(id, num = 1) {
  17333. let v = this.itemData.itemList[id];
  17334. if (!v)
  17335. v = { id: id, count: 1, adnum: num, active: false };
  17336. else
  17337. v.adnum += num;
  17338. this.itemData.itemList[id] = v;
  17339. this.saveItemData();
  17340. }
  17341. static costItem(id, count) {
  17342. let v = this.itemData.itemList[id];
  17343. if (v && v.active) {
  17344. if (v.count < count)
  17345. return false;
  17346. else {
  17347. v.count -= count;
  17348. this.itemData.itemList[id] = v;
  17349. return true;
  17350. }
  17351. }
  17352. return false;
  17353. }
  17354. static resetUse() {
  17355. this.dressId = this.userData.dressId;
  17356. this.itemId = this.userData.itemId;
  17357. }
  17358. static passLevel() {
  17359. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  17360. this.gameData.curLevel++;
  17361. this.curLevel = this.gameData.curLevel;
  17362. this.saveGameData();
  17363. }
  17364. static useRole(id) {
  17365. this.roleId = id;
  17366. if (this.hasRole(id)) {
  17367. this.userData.roleId = id;
  17368. this.saveUserData();
  17369. }
  17370. }
  17371. static addRole(id) {
  17372. if (this.hasRole(id))
  17373. return;
  17374. this.userData.roleList.push(id);
  17375. this.saveUserData();
  17376. }
  17377. static hasRole(id) {
  17378. return this.userData.roleList.indexOf(id) >= 0;
  17379. }
  17380. static gemEnough(num) {
  17381. return this.userData.gemNum >= num;
  17382. }
  17383. static roleHasAd(id) {
  17384. let count = this.userData.roleAds[id];
  17385. if (count != undefined && count >= 0)
  17386. return true;
  17387. else
  17388. return false;
  17389. }
  17390. static saveUserData(time = 500, event, arg) {
  17391. if (this.userSaving)
  17392. return;
  17393. this.userSaving = true;
  17394. Laya.timer.once(time, this, () => {
  17395. this.userSaving = false;
  17396. this.userData.saveData();
  17397. if (event)
  17398. xGame.eventMgr.event(event, arg);
  17399. });
  17400. }
  17401. static saveGameData() {
  17402. if (this.gameSaving)
  17403. return;
  17404. this.gameSaving = true;
  17405. Laya.timer.once(1000, this, () => {
  17406. this.gameSaving = false;
  17407. this.gameData.saveData();
  17408. });
  17409. }
  17410. static saveItemData() {
  17411. let fun = () => {
  17412. this.itemData.saveData();
  17413. };
  17414. Laya.timer.clear(this, fun);
  17415. Laya.timer.once(500, this, fun);
  17416. }
  17417. static saveData() {
  17418. this.saveUserData();
  17419. this.saveGameData();
  17420. }
  17421. static getBigSkillList() {
  17422. return this.userData.bigSkills;
  17423. }
  17424. static getBigSkillByIndex(index) {
  17425. return this.userData.bigSkills[index];
  17426. }
  17427. static setBigSkill(index, val, addUp = true) {
  17428. if (addUp) {
  17429. this.userData.bigSkills[index] += val;
  17430. }
  17431. else {
  17432. this.userData.bigSkills[index] = val;
  17433. }
  17434. this.saveUserData();
  17435. }
  17436. static coinEnough(need) {
  17437. if (typeof need != "number") {
  17438. console.error("金币格式错误");
  17439. return;
  17440. }
  17441. return this.userData.coin >= need;
  17442. }
  17443. static setCoin(val) {
  17444. if (typeof val != "number") {
  17445. return;
  17446. }
  17447. this.userData.coin += val;
  17448. this.saveUserData();
  17449. xGame.eventMgr.event(COIN_CHANGE);
  17450. }
  17451. static getCoin() {
  17452. return this.userData.coin;
  17453. }
  17454. static diamondEnough(need) {
  17455. if (typeof need != "number") {
  17456. console.error("金币格式错误");
  17457. return;
  17458. }
  17459. return this.userData.diamond >= need;
  17460. }
  17461. static setDiamond(val) {
  17462. if (typeof val != "number") {
  17463. return;
  17464. }
  17465. this.userData.diamond += val;
  17466. this.saveUserData();
  17467. xGame.eventMgr.event(DIAMOND_CHANGE);
  17468. }
  17469. static getDiamond() {
  17470. return this.userData.diamond;
  17471. }
  17472. static getSkillSuccessTimes() {
  17473. return this.userData.skillSuccessTimes;
  17474. }
  17475. static setSkillSuccessTimes(val, addUp = true) {
  17476. if (addUp)
  17477. this.userData.skillSuccessTimes += val;
  17478. else
  17479. this.userData.skillSuccessTimes = val;
  17480. this.saveUserData();
  17481. }
  17482. static getSkillAccTimes() {
  17483. return this.userData.skillAccTimes;
  17484. }
  17485. static setSkillAccTimes(val) {
  17486. this.userData.skillAccTimes += val;
  17487. this.saveUserData();
  17488. }
  17489. static getSkillGuide() {
  17490. if (!xGame.common.openGuide) {
  17491. return 1;
  17492. }
  17493. return this.userData.skillGuide;
  17494. }
  17495. static setSkillGuide(val) {
  17496. this.userData.skillGuide = val;
  17497. this.saveUserData();
  17498. }
  17499. static getPlaceBallLevelList() {
  17500. return this.userData.placeBallData;
  17501. }
  17502. static getPlaceBallLevel(level) {
  17503. let arr = this.userData.placeBallData;
  17504. let index = level - 1;
  17505. let out;
  17506. if (arr[index]) {
  17507. out = arr[index];
  17508. }
  17509. else {
  17510. let max = arr.length;
  17511. if (max == index) {
  17512. out = {
  17513. star: 0,
  17514. play: true,
  17515. isCur: true,
  17516. getAward: false
  17517. };
  17518. }
  17519. else {
  17520. out = {
  17521. star: 0,
  17522. play: false,
  17523. getAward: false
  17524. };
  17525. }
  17526. }
  17527. return out;
  17528. }
  17529. static setPlaceBallLevel(level, star) {
  17530. let arr = this.userData.placeBallData;
  17531. let index = level - 1;
  17532. if (arr[index]) {
  17533. arr[index].star = Math.max(arr[index].star, star);
  17534. }
  17535. else {
  17536. let max = arr.length;
  17537. if (max == index) {
  17538. arr.push({
  17539. star: star,
  17540. play: true,
  17541. getAward: false
  17542. });
  17543. }
  17544. else {
  17545. console.error("关卡存储出错");
  17546. }
  17547. }
  17548. this.saveUserData();
  17549. }
  17550. static setPlaceBallAward(level) {
  17551. let arr = this.userData.placeBallData;
  17552. let index = level - 1;
  17553. if (arr[index]) {
  17554. arr[index].getAward = true;
  17555. }
  17556. this.saveUserData();
  17557. }
  17558. static getShareDiamondTimes() {
  17559. return this.userData.shareDiamondTimes;
  17560. }
  17561. static setShareDiamondTimes(val, addUp = true) {
  17562. if (addUp) {
  17563. this.userData.shareDiamondTimes += val;
  17564. }
  17565. else {
  17566. this.userData.shareDiamondTimes = val;
  17567. }
  17568. this.saveUserData();
  17569. }
  17570. static getDailyVideoShareTimes() {
  17571. return this.userData.dailyVideoShareTimes;
  17572. }
  17573. static setDailyVideoShareTimes(val, addUp = true) {
  17574. if (addUp) {
  17575. this.userData.dailyVideoShareTimes += val;
  17576. }
  17577. else {
  17578. this.userData.dailyVideoShareTimes = val;
  17579. }
  17580. this.saveUserData();
  17581. }
  17582. static getSecretary(index) {
  17583. return this.userData.secretary[index];
  17584. }
  17585. static setSecretary(index, val) {
  17586. this.userData.secretary[index] = val;
  17587. this.saveUserData();
  17588. }
  17589. static getCurSecretary() {
  17590. return this.userData.curSecretary;
  17591. }
  17592. static setCurSecretary(index) {
  17593. this.userData.curSecretary = index;
  17594. this.saveUserData();
  17595. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  17596. }
  17597. static getBallRod(index) {
  17598. return this.userData.ballRod[index];
  17599. }
  17600. static setBallRod(index, val) {
  17601. this.userData.ballRod[index] = val;
  17602. this.saveUserData();
  17603. }
  17604. static getCurBallRod() {
  17605. return this.userData.curBallRod;
  17606. }
  17607. static setCurBallRod(index) {
  17608. this.userData.curBallRod = index;
  17609. this.saveUserData();
  17610. }
  17611. static setSignData(val) {
  17612. this.userData.signData = val;
  17613. this.saveUserData();
  17614. }
  17615. static getSignData() {
  17616. return this.userData.signData;
  17617. }
  17618. static setSignTime(val) {
  17619. this.userData.signTime = val;
  17620. this.saveUserData();
  17621. }
  17622. static getSignTime() {
  17623. return this.userData.signTime;
  17624. }
  17625. static getDrawTimes() {
  17626. return this.userData.drawTimes;
  17627. }
  17628. static setDrawTimes(val, addUp = true) {
  17629. if (addUp) {
  17630. this.userData.drawTimes += val;
  17631. }
  17632. else {
  17633. this.userData.drawTimes = val;
  17634. }
  17635. this.saveUserData();
  17636. }
  17637. static getDrawAwardTimes() {
  17638. return this.userData.drawAwardTimes;
  17639. }
  17640. static setDrawAwardTimes(val) {
  17641. this.userData.drawAwardTimes = val;
  17642. this.saveUserData();
  17643. }
  17644. static getDailyfreeDrawTimes() {
  17645. return this.userData.dailyfreeDrawTimes;
  17646. }
  17647. static setDailyfreeDrawTimes(val) {
  17648. this.userData.dailyfreeDrawTimes = val;
  17649. this.saveUserData();
  17650. }
  17651. static setPower(val, addUp = true) {
  17652. if (addUp)
  17653. this.userData.power += val;
  17654. else
  17655. this.userData.power = val;
  17656. if (this.userData.power >= xGame.common.maxPower) {
  17657. this.userData.power = xGame.common.maxPower;
  17658. }
  17659. xGame.eventMgr.event(POWER_CHANGE, val);
  17660. this.saveUserData();
  17661. }
  17662. static getPower() {
  17663. return this.userData.power;
  17664. }
  17665. static setPowerTime(val) {
  17666. this.userData.powerTime = val;
  17667. this.saveUserData();
  17668. }
  17669. static getPowerTime() {
  17670. return this.userData.powerTime;
  17671. }
  17672. static powerEnough() {
  17673. return this.getPower() > 0;
  17674. }
  17675. static getChallengeTimes() {
  17676. return this.userData.challengeTimes;
  17677. }
  17678. static setChallengeTimes(val) {
  17679. this.userData.challengeTimes += val;
  17680. this.saveUserData();
  17681. }
  17682. static getExtraSign() {
  17683. return this.userData.extraSign;
  17684. }
  17685. static setExtraSign(val) {
  17686. this.userData.extraSign = val;
  17687. this.saveUserData();
  17688. }
  17689. static getClassicTimes() {
  17690. return this.userData.classicTimes;
  17691. }
  17692. static setClassicTimes() {
  17693. this.userData.classicTimes += 1;
  17694. this.saveUserData();
  17695. }
  17696. static getGuideHelpLine() {
  17697. return this.userData.guideHelpLine;
  17698. }
  17699. static setGuideHelpLine() {
  17700. this.userData.guideHelpLine = 1;
  17701. this.saveUserData();
  17702. }
  17703. static getNewUser() {
  17704. return this.userData.newUser;
  17705. }
  17706. static setNewUser() {
  17707. this.userData.newUser = false;
  17708. this.saveUserData();
  17709. }
  17710. static getRootBallFoul() {
  17711. return this.userData.rootBallFoul;
  17712. }
  17713. static setRootBallFoul() {
  17714. this.userData.rootBallFoul = 1;
  17715. this.saveUserData();
  17716. }
  17717. static getTimeoutFoul() {
  17718. return this.userData.timeoutFoul;
  17719. }
  17720. static setTimeoutFoul() {
  17721. this.userData.timeoutFoul = 1;
  17722. this.saveUserData();
  17723. }
  17724. static saveDiyGameData() {
  17725. if (this.diyGameSaving)
  17726. return;
  17727. this.diyGameSaving = true;
  17728. Laya.timer.once(500, this, () => {
  17729. this.diyGameSaving = false;
  17730. this.diyGameData.saveData();
  17731. });
  17732. }
  17733. static getChallengeMode_overLev() {
  17734. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  17735. return this.challengeMode_overLev;
  17736. }
  17737. static setChallengeMode_overLev(levNum) {
  17738. this.diyGameData.challengeMode_overLev = levNum;
  17739. this.saveDiyGameData();
  17740. }
  17741. }
  17742. DataMgr.isNewUser = false;
  17743. DataMgr.fristEnter = true;
  17744. DataMgr.levelType = 0;
  17745. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  17746. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  17747. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  17748. DataMgr.challengeMode_overLev = 0;
  17749. DataMgr.xszyForClassic = false;
  17750. DataMgr.xszyForChallenge = false;
  17751. DataMgr.awardId = 0;
  17752. DataMgr.awardCoin = 0;
  17753. DataMgr.sceneId = -1;
  17754. DataMgr.tryId = 0;
  17755. DataMgr.curLevel = 1;
  17756. DataMgr.vipLevel = 0;
  17757. DataMgr.maxLevel = 0;
  17758. DataMgr.awardRatio = 1;
  17759. DataMgr.gameList = [];
  17760. DataMgr.rankList = [];
  17761. DataMgr.recoverTime = 480000;
  17762. DataMgr.minScore = 0;
  17763. DataMgr.rankDis = 0;
  17764. DataMgr.userSaving = false;
  17765. DataMgr.gameSaving = false;
  17766. DataMgr.diyGameSaving = false;
  17767. class D3Tween extends Laya.Script3D {
  17768. constructor() {
  17769. super();
  17770. this.isInited = false;
  17771. }
  17772. ;
  17773. init() {
  17774. if (this.isInited)
  17775. return;
  17776. this.isInited = true;
  17777. this.gameObj = this.owner;
  17778. this.transform = this.gameObj.transform;
  17779. }
  17780. get rotX() {
  17781. return this.transform.localRotationEulerX;
  17782. }
  17783. set rotX(v) {
  17784. this.transform.localRotationEulerX = v;
  17785. }
  17786. get rotY() {
  17787. return this.transform.localRotationEulerY;
  17788. }
  17789. set rotY(v) {
  17790. this.transform.localRotationEulerY = v;
  17791. }
  17792. get rotZ() {
  17793. return this.transform.localRotationEulerZ;
  17794. }
  17795. set rotZ(v) {
  17796. this.transform.localRotationEulerZ = v;
  17797. }
  17798. get posX() {
  17799. return this.transform.localPositionX;
  17800. }
  17801. set posX(v) {
  17802. this.transform.localPositionX = v;
  17803. }
  17804. get posY() {
  17805. return this.transform.localPositionY;
  17806. }
  17807. set posY(v) {
  17808. this.transform.localPositionY = v;
  17809. }
  17810. get posZ() {
  17811. return this.transform.localPositionZ;
  17812. }
  17813. set posZ(v) {
  17814. this.transform.localPositionZ = v;
  17815. }
  17816. get rotation() {
  17817. return this.transform.localRotation;
  17818. }
  17819. set rotation(v) {
  17820. this.transform.localRotation = v;
  17821. }
  17822. }
  17823. class D2Hole extends Laya.Script {
  17824. constructor() { super(); }
  17825. onTriggerEnter(collider) {
  17826. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  17827. return;
  17828. }
  17829. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  17830. if (collider.owner["mySrc"].isRunSkillAni) {
  17831. return;
  17832. }
  17833. if (collider.owner["mySrc"].number != 0) {
  17834. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  17835. }
  17836. xGame.common.ballColliHole(collider);
  17837. xGame.common.recoverCameraView();
  17838. }
  17839. }
  17840. }
  17841. class Table extends Laya.Script3D {
  17842. constructor() {
  17843. super();
  17844. this.isSetBorder = false;
  17845. this.inited = false;
  17846. }
  17847. ;
  17848. onAwake() {
  17849. this.init();
  17850. }
  17851. init() {
  17852. if (this.inited)
  17853. return;
  17854. this.inited = true;
  17855. this.gameObj = this.owner;
  17856. this.border = this.gameObj.getChildByName("border");
  17857. }
  17858. setBorderPos() {
  17859. if (this.isSetBorder)
  17860. return;
  17861. this.isSetBorder = true;
  17862. let ui = xGame.common.gameUI.ui;
  17863. let bar1 = this.border.getChildByName("bar1");
  17864. let bar2 = this.border.getChildByName("bar2");
  17865. let bar3 = this.border.getChildByName("bar3");
  17866. let bar4 = this.border.getChildByName("bar4");
  17867. let bar5 = this.border.getChildByName("bar5");
  17868. let bar6 = this.border.getChildByName("bar6");
  17869. this.setInfo(bar1, ui.border.bar1, "box");
  17870. this.setInfo(bar2, ui.border.bar2, "box");
  17871. this.setInfo(bar3, ui.border.bar3, "box");
  17872. this.setInfo(bar4, ui.border.bar4, "box");
  17873. this.setInfo(bar5, ui.border.bar5, "box");
  17874. this.setInfo(bar6, ui.border.bar6, "box");
  17875. let circle1 = this.border.getChildByName("circle1");
  17876. let circle2 = this.border.getChildByName("circle2");
  17877. let circle3 = this.border.getChildByName("circle3");
  17878. let circle4 = this.border.getChildByName("circle4");
  17879. let circle5 = this.border.getChildByName("circle5");
  17880. let circle6 = this.border.getChildByName("circle6");
  17881. this.setInfo(circle1, ui.border.circle1, "circle");
  17882. this.setInfo(circle2, ui.border.circle2, "circle");
  17883. this.setInfo(circle3, ui.border.circle3, "circle");
  17884. this.setInfo(circle4, ui.border.circle4, "circle");
  17885. this.setInfo(circle5, ui.border.circle5, "circle");
  17886. this.setInfo(circle6, ui.border.circle6, "circle");
  17887. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  17888. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  17889. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  17890. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  17891. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  17892. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  17893. let arr = xGame.common.gameMgr.holePosList;
  17894. xGame.common.gameMgr.posObj = {
  17895. "1": arr[0],
  17896. "3": arr[2],
  17897. "4": arr[3],
  17898. "6": arr[5]
  17899. };
  17900. }
  17901. initHolePos(x, y) {
  17902. if (x < 300)
  17903. x += 25;
  17904. else if (x > 1000)
  17905. x -= 25;
  17906. else if (y > 200)
  17907. y -= 10;
  17908. else
  17909. y += 10;
  17910. if (y < 200)
  17911. y += 30;
  17912. else if (y > 500)
  17913. y -= 30;
  17914. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  17915. }
  17916. setInfo(d3Obj, d2Obj, type) {
  17917. let ui = xGame.common.gameUI.ui;
  17918. let sprite = new Laya.Sprite();
  17919. ui.border.displayObject.addChild(sprite);
  17920. let colli = xGame.common.getCollider(type);
  17921. sprite.addComponentIntance(colli);
  17922. let rigy = xGame.common.getRigbody();
  17923. rigy.type = "static";
  17924. sprite.addComponentIntance(rigy);
  17925. let d3Pos = d3Obj.transform.position;
  17926. xGame.common.pos3to2Convert(d3Pos);
  17927. let scaleX = d3Obj.transform.localScaleX;
  17928. let scaleZ = d3Obj.transform.localScaleZ;
  17929. let width = xGame.common.scale3to2Convert(scaleZ);
  17930. let height = xGame.common.scale3to2Convert(scaleX);
  17931. sprite.pivotX = width / 2;
  17932. sprite.pivotY = height / 2;
  17933. sprite.x = d3Pos.x;
  17934. sprite.y = d3Pos.y;
  17935. sprite.width = width;
  17936. sprite.height = height;
  17937. d2Obj.x = d3Pos.x;
  17938. d2Obj.y = d3Pos.y;
  17939. d2Obj.width = width;
  17940. d2Obj.height = height;
  17941. if (type == "box") {
  17942. colli.width = width;
  17943. colli.height = height;
  17944. colli.isSensor = false;
  17945. colli.label = "border";
  17946. }
  17947. else {
  17948. colli.radius = width / 2;
  17949. colli.isSensor = true;
  17950. colli.label = "hole";
  17951. sprite.addComponent(D2Hole);
  17952. }
  17953. }
  17954. }
  17955. class D3World extends Laya.Script3D {
  17956. constructor() {
  17957. super();
  17958. this.loadNum = 0;
  17959. this.setLoadNum = 7;
  17960. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  17961. }
  17962. onAwake() {
  17963. }
  17964. loadScene() {
  17965. this.scene = this.owner;
  17966. let url = `res/unityRes/root.lh`;
  17967. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  17968. this.scene.addChild(prefab);
  17969. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  17970. this.putCameraInfo();
  17971. this.camera.enableHDR = false;
  17972. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  17973. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  17974. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  17975. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  17976. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  17977. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  17978. this.knife.active = false;
  17979. this.loadD3Obj();
  17980. }));
  17981. }
  17982. putCameraInfo() {
  17983. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  17984. this.cameraObj = new cameraType();
  17985. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  17986. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  17987. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  17988. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  17989. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  17990. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  17991. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  17992. this.visitAngleChild.init();
  17993. this.visitRootObj.posX = this.visitAngleChild.posX;
  17994. this.visitRootObj.posY = this.visitAngleChild.posY;
  17995. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  17996. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  17997. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  17998. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  17999. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  18000. xGame.common.showOneCamera("mainCamera");
  18001. }
  18002. loadD3Obj() {
  18003. this.loadTable();
  18004. this.loadRoom();
  18005. this.loadInHoleParticial();
  18006. this.loadIceParticial();
  18007. this.loadHitParticial();
  18008. this.loadFireworksParticial();
  18009. this.loadBall();
  18010. }
  18011. loadInHoleParticial() {
  18012. this.loadD3Res("inHoleEft", "", (prefab) => {
  18013. prefab.addComponent(Partical);
  18014. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  18015. });
  18016. }
  18017. loadIceParticial() {
  18018. this.loadD3Res("iceEft", "", (prefab) => {
  18019. prefab.addComponent(Partical);
  18020. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  18021. });
  18022. }
  18023. loadHitParticial() {
  18024. this.loadD3Res("hitEft", "", (prefab) => {
  18025. prefab.addComponent(Partical);
  18026. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  18027. });
  18028. }
  18029. loadFireworksParticial() {
  18030. this.loadD3Res("fireworksEft", "", (prefab) => {
  18031. prefab.addComponent(Partical);
  18032. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  18033. });
  18034. }
  18035. loadBall(index = 1) {
  18036. this.loadD3Res("ball", index, (prefab) => {
  18037. this.ballPrefab = prefab;
  18038. this.ballPrefab.addComponent(Ball);
  18039. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  18040. });
  18041. }
  18042. loadTable(index = 1) {
  18043. this.loadD3Res("table", index, (prefab) => {
  18044. this.tableSrc = prefab.addComponent(Table);
  18045. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  18046. this.d3Hand.init();
  18047. this.tableRoot.addChild(prefab);
  18048. });
  18049. }
  18050. loadRoom(index = 1) {
  18051. this.loadD3Res("room", index, (prefab) => {
  18052. this.roomRoot.addChild(prefab);
  18053. });
  18054. }
  18055. loadD3Res(type, index, callback) {
  18056. let url = `res/unityRes/${type}${index}.lh`;
  18057. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  18058. callback && callback(prefab);
  18059. this.checkResLoad();
  18060. }));
  18061. }
  18062. checkResLoad() {
  18063. this.loadNum++;
  18064. if (this.loadNum >= this.setLoadNum) {
  18065. xGame.eventMgr.event(D3RES_LOADED);
  18066. }
  18067. }
  18068. prePlayEft() {
  18069. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  18070. eft.transform.localPositionX = 0;
  18071. eft.transform.localPositionY = -5;
  18072. eft.transform.localPositionZ = 0;
  18073. eft.active = true;
  18074. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  18075. ice.transform.localPositionX = 0;
  18076. ice.transform.localPositionY = -5;
  18077. ice.transform.localPositionZ = 0;
  18078. ice.active = true;
  18079. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  18080. hit.transform.localPositionX = 0;
  18081. hit.transform.localPositionY = -5;
  18082. hit.transform.localPositionZ = 0;
  18083. hit.active = true;
  18084. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  18085. fireworks.transform.localPositionX = 0;
  18086. fireworks.transform.localPositionY = -5;
  18087. fireworks.transform.localPositionZ = 0;
  18088. fireworks.active = true;
  18089. }
  18090. }
  18091. class cameraType {
  18092. }
  18093. class MoyuMgr$1 {
  18094. static initMoyu() {
  18095. this.moyuView = new MoyuView$1();
  18096. Laya.stage.addChild(this.moyuView.ui.displayObject);
  18097. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  18098. this.moyuView.ui.displayObject.zOrder = 1000;
  18099. this.moyuView.init();
  18100. this.moyuView.showTip(true);
  18101. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  18102. window['XApk'] = this;
  18103. }
  18104. static showAge(show) {
  18105. if (this.moyuView)
  18106. this.moyuView.showAge(show);
  18107. }
  18108. static onPlatMsg(idx) {
  18109. if (!MoyuMgr$1.moyuView)
  18110. return;
  18111. if (idx == '0') {
  18112. MoyuMgr$1.moyuView.showTip(false);
  18113. }
  18114. }
  18115. static showAgree(call) {
  18116. if (this.moyuView)
  18117. this.moyuView.showAgree(call);
  18118. else
  18119. call && call();
  18120. }
  18121. static showXy(type = 1) {
  18122. if (this.moyuView)
  18123. this.moyuView.showXy(type);
  18124. }
  18125. }
  18126. MoyuMgr$1.isAdvise = false;
  18127. class MoyuView$1 {
  18128. constructor() {
  18129. this.ysxyNum = 1;
  18130. this.ysJson = null;
  18131. this.ui = ui_UIMoyu.createInstance();
  18132. }
  18133. init() {
  18134. this.ui.mainBg.visible = false;
  18135. this.ui.xyNode.visible = false;
  18136. this.ui.ageNode.visible = false;
  18137. this.ui.tipNode.visible = false;
  18138. this.ui.rnNode.visible = false;
  18139. this.ui.fcmNode.visible = false;
  18140. this.ui.ageTip.visible = false;
  18141. this.ui.msgNode.visible = false;
  18142. this.ui.visible = false;
  18143. this.ui.xyNode.xyList.setVirtual();
  18144. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  18145. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  18146. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  18147. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  18148. this.ui.xyNode.btnKnown.visible = false;
  18149. this.ui.xyNode.xy1.visible = false;
  18150. this.ui.xyNode.xy2.visible = false;
  18151. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  18152. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  18153. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  18154. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  18155. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  18156. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  18157. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  18158. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  18159. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  18160. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  18161. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  18162. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  18163. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  18164. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  18165. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  18166. this.ysxyNum = 2;
  18167. }
  18168. }
  18169. onClick(obj) {
  18170. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18171. switch (obj) {
  18172. case this.ui.ageTip:
  18173. if (Moyu.isTTApk) {
  18174. this.ui.ageNode.visible = true;
  18175. this.ui.mainBg.visible = true;
  18176. }
  18177. break;
  18178. case this.ui.tipNode:
  18179. this.showTip(false);
  18180. break;
  18181. case this.ui.ageNode.btnAge:
  18182. this.ui.ageNode.visible = false;
  18183. this.ui.mainBg.visible = false;
  18184. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  18185. this.ui.visible = false;
  18186. break;
  18187. case this.ui.xyNode.btnXy3:
  18188. case this.ui.xyNode.btnXy1:
  18189. this.loadXy(1);
  18190. break;
  18191. case this.ui.xyNode.btnXy2:
  18192. this.loadXy(2);
  18193. break;
  18194. case this.ui.xyNode.btnBack:
  18195. this.ui.xyNode.xy1.visible = true;
  18196. this.ui.xyNode.xy2.visible = false;
  18197. break;
  18198. case this.ui.xyNode.btnKnown:
  18199. this.ui.xyNode.visible = false;
  18200. this.ui.mainBg.visible = false;
  18201. this.ui.visible = false;
  18202. break;
  18203. case this.ui.rnNode.btnCheck:
  18204. this.check();
  18205. break;
  18206. case this.ui.rnNode.btnExit:
  18207. case this.ui.xyNode.btnNo:
  18208. this.ysxyNum--;
  18209. if (this.ysxyNum > 0)
  18210. this.showMsg("Refuse to quit the game once again");
  18211. else {
  18212. Moyu.userAgree(false);
  18213. Moyu.exit();
  18214. }
  18215. break;
  18216. case this.ui.xyNode.btnSure:
  18217. case this.ui.xyNode.btnYes:
  18218. DataMgr.userData.isAgree = true;
  18219. DataMgr.saveUserData();
  18220. this.onAgree();
  18221. break;
  18222. case this.ui.rnNode.btnDone:
  18223. this.ui.rnNode.visible = false;
  18224. this.ui.visible = false;
  18225. break;
  18226. case this.ui.fcmNode.btnRn:
  18227. this.showRn();
  18228. break;
  18229. }
  18230. }
  18231. showTip(show) {
  18232. if (!Moyu.isVVApk && !Moyu.isOPApk)
  18233. return;
  18234. if (show) {
  18235. MoyuMgr$1.isAdvise = true;
  18236. this.ui.visible = true;
  18237. this.ui.tipNode.visible = true;
  18238. this.ui.tipNode.alpha = 1;
  18239. Laya.timer.once(1000, this, this.showTip, [false]);
  18240. }
  18241. else {
  18242. this.ui.tipNode.alpha = 1;
  18243. this.ui.tipNode.visible = true;
  18244. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  18245. this.ui.tipNode.visible = false;
  18246. MoyuMgr$1.isAdvise = false;
  18247. }), 1000);
  18248. }
  18249. }
  18250. showAge(show, px = 0, py = 0) {
  18251. if (Moyu.platType > 10 && !Moyu.isIos) {
  18252. this.ui.ageTip.x = px;
  18253. this.ui.ageTip.y = py;
  18254. this.ui.ageTip.visible = show;
  18255. if (show)
  18256. this.ui.visible = true;
  18257. }
  18258. }
  18259. showAgree(call) {
  18260. this.agreeCall = call;
  18261. this.onAgree();
  18262. return;
  18263. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  18264. this.showXy(0);
  18265. }
  18266. else
  18267. this.onAgree();
  18268. }
  18269. onAgree() {
  18270. if (!this.ui.ageNode.visible)
  18271. this.ui.visible = false;
  18272. this.ui.xyNode.visible = false;
  18273. Moyu.userAgree(true);
  18274. this.showAge(false);
  18275. this.agreeCall && this.agreeCall();
  18276. this.showRn();
  18277. }
  18278. showMsg(txt) {
  18279. this.ui.msgNode.txtMsg.text = txt;
  18280. this.ui.msgNode.visible = true;
  18281. this.ui.msgNode.alpha = 1;
  18282. this.ui.visible = true;
  18283. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  18284. this.ui.msgNode.visible = false;
  18285. }), 2500, true);
  18286. }
  18287. showRn() {
  18288. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18289. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  18290. this.ui.rnNode.rn1.visible = true;
  18291. this.ui.rnNode.rn2.visible = false;
  18292. this.ui.rnNode.rn3.visible = false;
  18293. this.ui.rnNode.rn4.visible = false;
  18294. this.ui.rnNode.visible = true;
  18295. this.ui.mainBg.visible = true;
  18296. this.ui.rnNode.btnDone.visible = false;
  18297. this.ui.rnNode.btnExit.visible = true;
  18298. this.ui.rnNode.btnCheck.visible = true;
  18299. this.ui.fcmNode.visible = false;
  18300. this.ui.visible = true;
  18301. return;
  18302. }
  18303. }
  18304. this.showFcm();
  18305. }
  18306. showFcm() {
  18307. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18308. Moyu.initFCM(true);
  18309. if (Moyu.gameTime < 1)
  18310. this.fcmLoop();
  18311. else if (Moyu.gameTime < 999)
  18312. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  18313. }
  18314. }
  18315. fcmLoop() {
  18316. if (Moyu.gameTime < 1) {
  18317. this.ui.rnNode.visible = false;
  18318. this.ui.fcmNode.visible = true;
  18319. this.ui.mainBg.visible = true;
  18320. this.ui.visible = true;
  18321. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  18322. Laya.timer.clear(this.ui, this.fcmLoop);
  18323. }
  18324. }
  18325. check() {
  18326. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  18327. this.ui.rnNode.rn1.visible = false;
  18328. this.ui.rnNode.rn2.visible = false;
  18329. this.ui.rnNode.rn4.visible = true;
  18330. }
  18331. else if (this.ui.rnNode.rn4.visible) {
  18332. let name = this.ui.rnNode.inputName.text;
  18333. let code = this.ui.rnNode.inputCode.text;
  18334. if (code && code.length == 18) {
  18335. this.ui.rnNode.rn1.visible = false;
  18336. this.ui.rnNode.rn4.visible = false;
  18337. Moyu.authenticate(name, code, (res) => {
  18338. this.ui.rnNode.rn2.visible = !res;
  18339. this.ui.rnNode.rn3.visible = res;
  18340. this.ui.rnNode.btnDone.visible = res;
  18341. this.ui.rnNode.btnExit.visible = !res;
  18342. this.ui.rnNode.btnCheck.visible = !res;
  18343. if (res)
  18344. this.showFcm();
  18345. });
  18346. }
  18347. else
  18348. this.showMsg("信息填写不完整");
  18349. }
  18350. }
  18351. loadXy(type = 0) {
  18352. this.ui.xyNode.xy1.visible = false;
  18353. this.ui.xyNode.xy2.visible = true;
  18354. this.ui.xyNode.xyList.scrollToView(0);
  18355. if (type == 1) {
  18356. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  18357. }
  18358. else if (type == 2) {
  18359. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  18360. }
  18361. }
  18362. showXy(type = 0) {
  18363. this.xyBtn();
  18364. if (type == 0) {
  18365. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  18366. this.ui.xyNode.btnSure.visible = true;
  18367. }
  18368. else {
  18369. this.ui.xyNode.btnYes.visible = true;
  18370. this.ui.xyNode.btnNo.visible = true;
  18371. }
  18372. }
  18373. else {
  18374. this.ui.xyNode.btnKnown.visible = true;
  18375. this.ui.mainBg.visible = true;
  18376. }
  18377. this.ui.xyNode.xy1.visible = true;
  18378. this.ui.xyNode.xy2.visible = false;
  18379. this.ui.xyNode.visible = true;
  18380. this.ui.visible = true;
  18381. }
  18382. xyBtn() {
  18383. this.ui.xyNode.btnSure.visible = false;
  18384. this.ui.xyNode.btnYes.visible = false;
  18385. this.ui.xyNode.btnNo.visible = false;
  18386. this.ui.xyNode.btnKnown.visible = false;
  18387. {
  18388. this.ui.xyNode.btnXy3.visible = false;
  18389. this.ui.xyNode.btnXy2.visible = true;
  18390. this.ui.xyNode.btnXy1.visible = true;
  18391. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  18392. }
  18393. }
  18394. createXY(json) {
  18395. this.ysJson = json.content;
  18396. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  18397. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  18398. this.ui.xyNode.xy2.visible = true;
  18399. }
  18400. renderListItem(idx, cell) {
  18401. let xy = this.ysJson[idx];
  18402. cell.height = xy.line * 30;
  18403. cell.xyItem.text = xy.text;
  18404. }
  18405. onDestroy() {
  18406. this.agreeCall = null;
  18407. }
  18408. }
  18409. class UILoading extends UIBase {
  18410. constructor() {
  18411. super();
  18412. this.accTime = 0;
  18413. this.curNum = 0;
  18414. this.rate = 1;
  18415. this.loadSubOk = false;
  18416. this.loadResOK = false;
  18417. this.openLoading = true;
  18418. this.beginLoadRes = false;
  18419. this.finishD2 = false;
  18420. this.finishD3 = false;
  18421. }
  18422. onConstructor() {
  18423. this.ui = ui_UILoading.createInstance();
  18424. this.contentPane = this.ui;
  18425. this.isEject = false;
  18426. this._initUI();
  18427. this._addEvent();
  18428. }
  18429. _initUI() {
  18430. MoyuMgr$1.initMoyu();
  18431. }
  18432. _addEvent() {
  18433. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  18434. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  18435. }
  18436. show() {
  18437. super.show();
  18438. console.log('zh:加载分包资源');
  18439. loadSubRes(this.subResProgress.bind(this));
  18440. this.ui.txtLoad.text = "Loading...";
  18441. }
  18442. subResProgress(pro, finish) {
  18443. this.curNum = pro;
  18444. if (finish) {
  18445. this.curNum = 1;
  18446. this.loadSubOk = true;
  18447. }
  18448. }
  18449. laodD3Res() {
  18450. let scene3D = new Laya.Scene3D();
  18451. xGame.common.d3Scene = scene3D;
  18452. xGame.common.d3World = scene3D.addComponent(D3World);
  18453. xGame.common.d3World.loadScene();
  18454. }
  18455. loadD2Res() {
  18456. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  18457. this.finishD2 = true;
  18458. this.checkLoadAll();
  18459. this.curNum = 1;
  18460. }), Laya.Handler.create(this, (pro) => {
  18461. this.curNum = pro;
  18462. }, null, false));
  18463. }
  18464. d3ResFinish() {
  18465. this.finishD3 = true;
  18466. this.checkLoadAll();
  18467. }
  18468. checkLoadAll() {
  18469. if (this.finishD2 && this.finishD3) {
  18470. this.loadResOK = true;
  18471. }
  18472. }
  18473. loadRes() {
  18474. this.laodD3Res();
  18475. this.loadD2Res();
  18476. }
  18477. myUpdate(dt) {
  18478. if (!this.openLoading)
  18479. return;
  18480. this.accTime += dt * this.rate;
  18481. if (this.accTime >= this.curNum)
  18482. this.accTime = this.curNum;
  18483. this.ui.loadinfo.value = this.accTime * 100;
  18484. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  18485. if (!this.beginLoadRes) {
  18486. this.beginLoadRes = true;
  18487. this.ui.txtLoad.text = "Loading...";
  18488. this.curNum = 0;
  18489. this.accTime = 0;
  18490. this.loadRes();
  18491. }
  18492. if (this.loadResOK) {
  18493. this.openLoading = false;
  18494. Laya.timer.once(300, this, () => {
  18495. xGame.common.d3Scene.active = false;
  18496. MoyuMgr$1.showAgree(enterGame);
  18497. });
  18498. }
  18499. }
  18500. }
  18501. release() {
  18502. }
  18503. hide() {
  18504. super.hide();
  18505. this.release();
  18506. }
  18507. onClose() {
  18508. this.hide();
  18509. }
  18510. }
  18511. UILoading.uiName = "UILoading";
  18512. class UIRepentProp$1 extends UIBase {
  18513. constructor() {
  18514. super();
  18515. this.viewType = 0;
  18516. this.regretType = 0;
  18517. }
  18518. onConstructor() {
  18519. this.ui = ui_UIRepentProp.createInstance();
  18520. this.contentPane = this.ui;
  18521. this.isEject = false;
  18522. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  18523. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  18524. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  18525. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  18526. }
  18527. show(viewType, regretType, callback) {
  18528. PlatMgr.showInsert(true);
  18529. this.viewType = viewType;
  18530. this.regretType = regretType;
  18531. this.callback = callback;
  18532. super.show();
  18533. this.ui.t0.play();
  18534. this.ui.c1.selectedIndex = this.viewType;
  18535. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  18536. if (this.viewType == 0) {
  18537. let guide = DataMgr.getGuideHelpLine();
  18538. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  18539. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  18540. }
  18541. xGame.common.gameMgr.gamePause = true;
  18542. }
  18543. hideSelf() {
  18544. xGame.common.gameMgr.gamePause = false;
  18545. this.callback && this.callback(false);
  18546. this.hide();
  18547. }
  18548. videoRegret() {
  18549. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  18550. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  18551. }
  18552. else {
  18553. console.log('zh:AD 失败,直接发放奖励');
  18554. this.qjff_AD_for_UIrepentProp_videoRegret();
  18555. }
  18556. }
  18557. qjff_AD_for_UIrepentProp_videoRegret() {
  18558. this.callback && this.callback(true);
  18559. this.hideSelf();
  18560. }
  18561. videoAddHelpLine() {
  18562. let guide = DataMgr.getGuideHelpLine();
  18563. if (guide == 0) {
  18564. this.callback && this.callback(true);
  18565. this.hideSelf();
  18566. DataMgr.setGuideHelpLine();
  18567. xGame.common.gameUI.ui.guideNode.visible = false;
  18568. }
  18569. else {
  18570. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  18571. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  18572. }
  18573. else {
  18574. console.log('zh:AD 失败,直接发放奖励');
  18575. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  18576. }
  18577. }
  18578. }
  18579. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  18580. this.callback && this.callback(true);
  18581. this.hideSelf();
  18582. }
  18583. }
  18584. UIRepentProp$1.uiName = "UIRepentProp";
  18585. class UIRodMethod$1 extends UIBase {
  18586. constructor() {
  18587. super();
  18588. this.isPressd = false;
  18589. }
  18590. onConstructor() {
  18591. this.ui = ui_UIRodMethod.createInstance();
  18592. this.contentPane = this.ui;
  18593. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  18594. this.moveDir = new Laya.Vector2();
  18595. this.moveDest = new Laya.Vector2();
  18596. this.centerPos = new Laya.Vector2();
  18597. xGame.common.uiRodMethod = this;
  18598. }
  18599. show() {
  18600. super.show();
  18601. xGame.common.gameMgr.gamePause = true;
  18602. this.openPressDotEvent();
  18603. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  18604. this.centerPos.x = this.ui.white.x;
  18605. this.centerPos.y = this.ui.white.y;
  18606. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  18607. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  18608. this.setDot();
  18609. }
  18610. setDot() {
  18611. this.ui.dot.x = this.moveDest.x;
  18612. this.ui.dot.y = this.moveDest.y;
  18613. }
  18614. closeSelf() {
  18615. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  18616. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  18617. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  18618. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  18619. xGame.common.gameMgr.gamePause = false;
  18620. this.hide();
  18621. }
  18622. openPressDotEvent() {
  18623. this.closePressDotEvent();
  18624. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18625. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18626. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18627. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18628. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18629. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18630. }
  18631. closePressDotEvent() {
  18632. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18633. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18634. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18635. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18636. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18637. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18638. }
  18639. onDown(e) {
  18640. if (e.type == Laya.Event.MOUSE_DOWN)
  18641. this.isPressd = true;
  18642. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  18643. this.isPressd = false;
  18644. if (!this.isPressd)
  18645. return;
  18646. this.moveDest.x = e.stageX;
  18647. this.moveDest.y = e.stageY;
  18648. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  18649. if (dis > 6724) {
  18650. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  18651. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  18652. }
  18653. this.setDot();
  18654. }
  18655. resetRod() {
  18656. this.ui.dot.x = this.ui.white.x;
  18657. this.ui.dot.y = this.ui.white.y;
  18658. this.gameRod.dot.x = this.gameRod.bg.x;
  18659. this.gameRod.dot.y = this.gameRod.bg.y;
  18660. xGame.common.rodOffest.x = 0;
  18661. xGame.common.rodOffest.y = 0;
  18662. }
  18663. }
  18664. UIRodMethod$1.uiName = "UIRodMethod";
  18665. class UIMsg$1 extends UIBase {
  18666. constructor() {
  18667. super();
  18668. }
  18669. onConstructor() {
  18670. this.ui = ui_UIMsg.createInstance();
  18671. this.contentPane = this.ui;
  18672. this.isEject = false;
  18673. this.isMuti = true;
  18674. }
  18675. show(msg, callback) {
  18676. super.show();
  18677. this.ui.tipsNode.msgTxt.text = msg;
  18678. this.ui.alpha = 1;
  18679. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  18680. this.hide();
  18681. callback && callback();
  18682. }), 1000);
  18683. }
  18684. }
  18685. UIMsg$1.uiName = "UIMsg";
  18686. class UITips$1 extends UIBase {
  18687. constructor() {
  18688. super();
  18689. this.type = 0;
  18690. }
  18691. onConstructor() {
  18692. this.ui = ui_UITips.createInstance();
  18693. this.contentPane = this.ui;
  18694. this.isEject = false;
  18695. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  18696. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  18697. }
  18698. show(tipsTxt, womanTxt, type) {
  18699. super.show();
  18700. this.ui.t0.play();
  18701. this.ui.myNode.tipsTxt.text = tipsTxt;
  18702. this.ui.myNode.womanTxt.text = womanTxt;
  18703. PlatMgr.showInsert(true);
  18704. this.ui.myNode.c1.selectedIndex = type;
  18705. this.type = type;
  18706. switch (this.type) {
  18707. case TipsType.exitGame:
  18708. xGame.common.gameMgr.gamePause = true;
  18709. break;
  18710. case TipsType.foul:
  18711. Laya.timer.once(200, this, () => {
  18712. xGame.common.gameMgr.gamePause = true;
  18713. });
  18714. break;
  18715. default:
  18716. break;
  18717. }
  18718. }
  18719. clickLeftBtn() {
  18720. this.hide();
  18721. xGame.common.gameMgr.gamePause = false;
  18722. switch (this.type) {
  18723. case TipsType.exitGame:
  18724. break;
  18725. case TipsType.foul:
  18726. break;
  18727. default:
  18728. break;
  18729. }
  18730. }
  18731. clickRightBtn() {
  18732. this.hide();
  18733. switch (this.type) {
  18734. case TipsType.exitGame:
  18735. xGame.eventMgr.event(RESET_GAME);
  18736. xGame.uiMgr.Show(UIMain$1);
  18737. Moyu.recordEnd(this, null);
  18738. xGame.common.longHelpLine = false;
  18739. break;
  18740. case TipsType.foul:
  18741. xGame.common.gameMgr.gamePause = false;
  18742. Laya.timer.clearAll(this);
  18743. break;
  18744. default:
  18745. break;
  18746. }
  18747. }
  18748. }
  18749. UITips$1.uiName = "UITips";
  18750. class UIGame$1 extends UIBase {
  18751. constructor() {
  18752. super();
  18753. this.powerNum = 0;
  18754. this.isD3Inited = false;
  18755. this.isPrePlay = false;
  18756. this.isMoveRod = false;
  18757. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  18758. this.rulerDis = 20;
  18759. this.rulerOffset = 0;
  18760. }
  18761. onConstructor() {
  18762. this.ui = ui_UIGame.createInstance();
  18763. this.contentPane = this.ui;
  18764. this.ui.x += xGame.common.sysOffestNum;
  18765. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  18766. this.isEject = false;
  18767. xGame.common.gameUI = this;
  18768. this.initSelf();
  18769. }
  18770. isTurnSelf() {
  18771. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  18772. return true;
  18773. }
  18774. }
  18775. initSelf() {
  18776. let topUI = this.ui.topNode;
  18777. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  18778. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  18779. this.barInfo = {};
  18780. this.barInfo.curY = 0;
  18781. this.barInfo.height = this.ui.powerNode.height;
  18782. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  18783. this.barInfo.powerStartY = this.ui.powerNode.y;
  18784. xGame.common.aiPlayer = new AIPlayer();
  18785. xGame.common.gameMgr = new GameMgr();
  18786. xGame.common.skillMgr = new SkillMgr();
  18787. xGame.common.wordsMgr = new WordsMgr();
  18788. xGame.common.talkMgr = new TalkMgr();
  18789. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  18790. console.log("加载经典模式表情文件chenggon !");
  18791. });
  18792. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  18793. console.log("挑战模式奖励模式spine加载成功!");
  18794. });
  18795. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  18796. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  18797. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  18798. this.addUIClick(this.ui.returnBtn, this.returnHome);
  18799. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  18800. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  18801. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  18802. }
  18803. getGanZiImg() {
  18804. let index = DataMgr.getCurBallRod();
  18805. let data = cfgTable.ballrodData[index + 1];
  18806. let gan_url = xGame.common.getGameIconUrl(data.img);
  18807. console.log('zh:getGanZiImg gan_url==' + gan_url);
  18808. this.ui.powerNode.showImg.url = gan_url;
  18809. console.log('zh:修改杆子图标O K');
  18810. }
  18811. returnHome() {
  18812. let tips = "Are you sure to exit the game?";
  18813. let woman = "Boss, why don't you play for a while longer?";
  18814. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  18815. }
  18816. addRodMethodClick() {
  18817. if (this.isTurnSelf()) {
  18818. xGame.uiMgr.Show(UIRodMethod$1);
  18819. }
  18820. }
  18821. clickHelpLineBtn(force = false) {
  18822. if (!this.isTurnSelf())
  18823. return;
  18824. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  18825. if (success) {
  18826. xGame.common.longHelpLine = true;
  18827. xGame.common.d2World.getHelpLine();
  18828. Moyu.sendDataEvent("guideNum");
  18829. }
  18830. else {
  18831. }
  18832. });
  18833. }
  18834. renderSelfDisplayBalls(index, target) {
  18835. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  18836. target.myImg.url = xGame.common.getGameIconUrl(str);
  18837. }
  18838. renderAIDisplayBalls(index, target) {
  18839. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  18840. target.myImg.url = xGame.common.getGameIconUrl(str);
  18841. ;
  18842. }
  18843. updateMode() {
  18844. if (xGame.common.gameMode == GameMode.classic) {
  18845. this.ui.topNode.scoreNode.visible = false;
  18846. }
  18847. else if (xGame.common.gameMode == GameMode.bigMove) {
  18848. this.ui.topNode.scoreNode.visible = true;
  18849. }
  18850. }
  18851. show() {
  18852. super.show();
  18853. console.log("zh:uigame show AADD");
  18854. this.ui.alpha = 0;
  18855. this.updateSelf();
  18856. xGame.common.gameMgr.gamePause = false;
  18857. xGame.common.gameUI.ui.blackAni.visible = false;
  18858. xGame.common.gameUI.ui.whiteAni.visible = false;
  18859. this.ui.powerEft.visible = false;
  18860. this.ui.colorNode.visible = false;
  18861. this.updateHead();
  18862. let curUse = DataMgr.getCurBallRod();
  18863. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  18864. this.getGanZiImg();
  18865. }
  18866. updateSelf() {
  18867. if (xGame.common.gameMode == GameMode.classic) {
  18868. this.ui.c1.selectedIndex = 0;
  18869. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  18870. this.ui.topNode.middleNode.visible = true;
  18871. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  18872. }
  18873. else if (xGame.common.gameMode == GameMode.bigMove) {
  18874. this.ui.c1.selectedIndex = 0;
  18875. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  18876. this.ui.topNode.middleNode.visible = false;
  18877. let max = xGame.cfgMgr.getMaxBigMoveLength();
  18878. let rand = xGame.common.randomNum(1, max);
  18879. let guide = DataMgr.getSkillGuide();
  18880. if (guide == 0)
  18881. rand = 1;
  18882. xGame.common.bigMoveLevelIndex = rand;
  18883. }
  18884. else if (xGame.common.gameMode == GameMode.placeBall) {
  18885. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18886. this.ui.c1.selectedIndex = 1 + data.type;
  18887. this.ui.alpha = 1;
  18888. this.startGame();
  18889. }
  18890. this.updateMode();
  18891. this.initD3world();
  18892. this.initD2world();
  18893. }
  18894. startGame() {
  18895. this.ui.snowNode.visible = Math.random() <= 0.1;
  18896. this.ui.d2Node.visible = false;
  18897. xGame.common.d3World.d3Hand.gameObj.active = false;
  18898. xGame.common.d3World.tableSrc.init();
  18899. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18900. this.cameraViewChange(() => {
  18901. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  18902. switch (xGame.common.gameMode) {
  18903. case GameMode.classic:
  18904. xGame.common.d3World.d3Hand.gameObj.active = true;
  18905. this.playPutBallD3Ani();
  18906. break;
  18907. case GameMode.bigMove:
  18908. this.enterGame();
  18909. Laya.timer.once(500, this, () => {
  18910. this.ui.topNode.middleNode.visible = true;
  18911. this.ui.topNode.middleNode.t0.play();
  18912. });
  18913. break;
  18914. case GameMode.placeBall:
  18915. this.enterGame();
  18916. break;
  18917. default:
  18918. break;
  18919. }
  18920. });
  18921. PlatMgr.showBanner(false);
  18922. }
  18923. enterGame() {
  18924. this.ui.d2Node.visible = true;
  18925. xGame.common.d3World.d3Hand.gameObj.active = false;
  18926. xGame.common.showOneCamera("mainCamera");
  18927. Moyu.recordGame(30, true);
  18928. if (!this.isPrePlay) {
  18929. this.isPrePlay = true;
  18930. xGame.common.d3World.prePlayEft();
  18931. }
  18932. xGame.common.gameMgr.gameReady();
  18933. this.openAllEvent();
  18934. this.ui.snowNode.visible = false;
  18935. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  18936. this.ui.helpBtn.visible = condition;
  18937. }
  18938. showHelpLineGuide() {
  18939. let longGuide = DataMgr.getGuideHelpLine();
  18940. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  18941. this.ui.helpBtn.visible = true;
  18942. this.ui.guideNode.visible = true;
  18943. }
  18944. }
  18945. setTurnAlpha(alpha) {
  18946. this.ui.keduNode.alpha = alpha;
  18947. this.ui.ganNode.alpha = alpha;
  18948. this.ui.rodMethodNode.alpha = alpha;
  18949. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  18950. }
  18951. cameraViewChange(callback) {
  18952. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18953. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  18954. xGame.common.showOneCamera("visitAngle");
  18955. cameraSrc.localRotationEulerY = 180;
  18956. cameraSrc.localRotationEulerZ = 0;
  18957. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  18958. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  18959. callback && callback();
  18960. }));
  18961. }));
  18962. }
  18963. playPutBallD3Ani() {
  18964. xGame.common.showOneCamera("mainCamera");
  18965. let handSrc = xGame.common.d3World.d3Hand;
  18966. handSrc.gameObj.active = true;
  18967. handSrc.transform.localPositionZ = 3;
  18968. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  18969. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  18970. handSrc.gameObj.active = false;
  18971. this.enterGame();
  18972. }), 400);
  18973. }));
  18974. }
  18975. updateHead() {
  18976. let user = Moyu.getUserInfo();
  18977. this.ui.topNode.selfNameTxt.text = user.nickName;
  18978. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  18979. let aiData = xGame.cfgMgr.getRandomUserInfo();
  18980. if (DataMgr.getSkillGuide() < 1) {
  18981. this.ui.topNode.aiNameTxt.text = 'billiards';
  18982. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  18983. }
  18984. else {
  18985. this.ui.topNode.aiNameTxt.text = aiData.name;
  18986. let randNo = Math.floor(Math.random() * 10) + 1;
  18987. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  18988. }
  18989. }
  18990. initD2world() {
  18991. let node = this.ui.d2Root.displayObject;
  18992. let src = node.getComponent(D2World);
  18993. if (!src) {
  18994. xGame.common.d2World = node.addComponent(D2World);
  18995. }
  18996. xGame.common.d2World.initSelf();
  18997. }
  18998. initD3world() {
  18999. if (this.isD3Inited)
  19000. return;
  19001. this.isD3Inited = true;
  19002. let scene3D = xGame.common.d3Scene;
  19003. this.ui.d3Root.displayObject.addChild(scene3D);
  19004. scene3D.active = true;
  19005. xGame.common.d3World.tableSrc.setBorderPos();
  19006. }
  19007. onRootMove(e) {
  19008. let rootBall = xGame.common.d2World.rootBall;
  19009. this.ui.moveNode.x = e.x;
  19010. this.ui.moveNode.y = e.y;
  19011. rootBall.gameObj.x = e.x;
  19012. rootBall.gameObj.y = e.y;
  19013. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  19014. }
  19015. aiRootMove(move) {
  19016. if (move)
  19017. this.hideBallUI();
  19018. else {
  19019. this.showBallUI();
  19020. xGame.common.d2World.getHelpLine();
  19021. }
  19022. }
  19023. aiForce(type, force = 0) {
  19024. this.pressTarget = PressType.powerNode;
  19025. if (type == 1)
  19026. this.onEventUp({ force: true });
  19027. else if (type == 2)
  19028. this.onEventMove({ stageY: force, force: true });
  19029. }
  19030. onEventPress(e) {
  19031. if (e.stopPropagation)
  19032. e.stopPropagation();
  19033. if (!this.isTurnSelf())
  19034. return;
  19035. let target = e.target;
  19036. switch (target) {
  19037. case this.ui.myPowerNode.displayObject:
  19038. this.pressTarget = PressType.powerNode;
  19039. this.barInfo.curY = e.stageY;
  19040. this.updateBarInfo();
  19041. break;
  19042. case this.ui.moveNode.displayObject:
  19043. this.pressTarget = PressType.moveNode;
  19044. this.hideBallUI();
  19045. this.eventObj.curX = this.ui.moveNode.x;
  19046. this.eventObj.curY = this.ui.moveNode.y;
  19047. this.ui.moveNode.finger.visible = false;
  19048. this.eventObj.lastX = e.stageX;
  19049. this.eventObj.lastY = e.stageY;
  19050. break;
  19051. case this.ui.rulerClickNode.displayObject:
  19052. this.pressTarget = PressType.rulerNode;
  19053. this.eventObj.lastY = e.stageY;
  19054. break;
  19055. case this.ui.d2Root.displayObject:
  19056. this.pressTarget = PressType.d2Root;
  19057. this.eventObj.lastX = e.stageX;
  19058. this.eventObj.lastY = e.stageY;
  19059. this.eventObj.starX = e.stageX;
  19060. this.eventObj.starY = e.stageY;
  19061. this.eventObj.curX = 0;
  19062. this.eventObj.curY = 0;
  19063. xGame.common.d2World.d2Gan.setGanLastInfo();
  19064. this.rulerOffset = 0;
  19065. break;
  19066. default:
  19067. break;
  19068. }
  19069. }
  19070. onEventMove(e) {
  19071. if (e.stopPropagation)
  19072. e.stopPropagation();
  19073. if (e && e.force) {
  19074. }
  19075. else {
  19076. if (!this.isTurnSelf())
  19077. return;
  19078. }
  19079. switch (this.pressTarget) {
  19080. case PressType.powerNode:
  19081. this.barInfo.curY = e.stageY;
  19082. this.updateBarInfo();
  19083. this.isMoveRod = true;
  19084. break;
  19085. case PressType.moveNode:
  19086. let rootBall = xGame.common.d2World.rootBall;
  19087. let radius = rootBall.gameObj.width / 2;
  19088. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  19089. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  19090. let border = xGame.common.d2World.borderRect;
  19091. if (curX <= border.x + radius)
  19092. curX = border.x + radius;
  19093. else if (curX >= border.x + border.width - radius)
  19094. curX = border.x + border.width - radius;
  19095. if (curY <= border.y + radius)
  19096. curY = border.y + radius;
  19097. else if (curY >= border.y + border.height - radius)
  19098. curY = border.y + border.height - radius;
  19099. if (xGame.common.gameMgr.isOpenBall) {
  19100. if (curX >= border.x + border.openBallW - radius)
  19101. curX = border.x + border.openBallW - radius;
  19102. }
  19103. this.ui.moveNode.x = curX;
  19104. this.ui.moveNode.y = curY;
  19105. rootBall.gameObj.x = curX;
  19106. rootBall.gameObj.y = curY;
  19107. rootBall.d3BallSrc.setTransPos(curX, curY);
  19108. this.isMoveRod = true;
  19109. break;
  19110. case PressType.rulerNode:
  19111. let yy = e.stageY - this.eventObj.lastY;
  19112. this.eventObj.lastY = e.stageY;
  19113. let ruler1 = this.ui.rulerNode.img1;
  19114. let ruler2 = this.ui.rulerNode.img2;
  19115. ruler1.y += yy;
  19116. ruler2.y += yy;
  19117. this.rulerOffset += yy;
  19118. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  19119. this.rulerOffset = 0;
  19120. xGame.soundMgr.playSound("inch", 1, 10);
  19121. }
  19122. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  19123. let h = ruler1.height;
  19124. this.checkGuide();
  19125. this.isMoveRod = true;
  19126. if (ruler1.y >= h) {
  19127. ruler1.y = -h;
  19128. ruler2.y = 0;
  19129. return;
  19130. }
  19131. else if (ruler1.y <= -h) {
  19132. ruler1.y = h;
  19133. ruler2.y = 0;
  19134. return;
  19135. }
  19136. if (ruler2.y >= h) {
  19137. ruler2.y = -h;
  19138. ruler1.y = 0;
  19139. return;
  19140. }
  19141. else if (ruler2.y <= -h) {
  19142. ruler2.y = h;
  19143. ruler1.y = 0;
  19144. return;
  19145. }
  19146. break;
  19147. case PressType.d2Root:
  19148. this.eventObj.curX = e.stageX;
  19149. this.eventObj.curY = e.stageY;
  19150. let offset = this.checkRodMoveDir();
  19151. xGame.common.d2World.d2Gan.rotateSelf(offset);
  19152. this.eventObj.lastX = e.stageX;
  19153. this.eventObj.lastY = e.stageY;
  19154. break;
  19155. default:
  19156. break;
  19157. }
  19158. }
  19159. onEventUp(e) {
  19160. if (e.stopPropagation)
  19161. e.stopPropagation();
  19162. if (e && e.force) {
  19163. }
  19164. else {
  19165. if (!this.isTurnSelf())
  19166. return;
  19167. }
  19168. switch (this.pressTarget) {
  19169. case PressType.powerNode:
  19170. this.ui.powerNode.value = 0;
  19171. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19172. this.ui.powerTxt.text = "";
  19173. if (this.powerNum > 0) {
  19174. xGame.eventMgr.event(BALL_SHOOT);
  19175. xGame.common.d2World.shoot(this.powerNum);
  19176. xGame.common.d2World.d2Gan.shoot();
  19177. xGame.common.d2World.d2HelpLine.shoot();
  19178. this.finishGuide();
  19179. this.ui.powerEft.visible = false;
  19180. this.ui.colorNode.visible = false;
  19181. let ganStr = "";
  19182. if (this.powerNum <= 30) {
  19183. ganStr = "gan_30";
  19184. }
  19185. else if (this.powerNum <= 60) {
  19186. ganStr = "gan_50";
  19187. }
  19188. else {
  19189. ganStr = "gan_80";
  19190. }
  19191. xGame.soundMgr.playSound(ganStr);
  19192. }
  19193. break;
  19194. case PressType.moveNode:
  19195. let rootBall = xGame.common.d2World.rootBall;
  19196. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  19197. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  19198. let isIntersect = this.judgeBallIntersect();
  19199. if (isIntersect) {
  19200. this.ui.moveNode.x = lastX;
  19201. this.ui.moveNode.y = lastY;
  19202. rootBall.gameObj.x = lastX;
  19203. rootBall.gameObj.y = lastY;
  19204. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  19205. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  19206. }
  19207. else {
  19208. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  19209. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  19210. }
  19211. this.showBallUI();
  19212. this.ui.moveNode.finger.visible = true;
  19213. xGame.common.d2World.getHelpLine();
  19214. break;
  19215. case PressType.rulerNode:
  19216. break;
  19217. case PressType.d2Root:
  19218. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  19219. if (dis <= 25) {
  19220. this.moveToClickDot(e);
  19221. }
  19222. break;
  19223. default:
  19224. break;
  19225. }
  19226. this.pressTarget = -1;
  19227. }
  19228. checkGuide() {
  19229. let guide = DataMgr.getSkillGuide();
  19230. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  19231. xGame.common.guideStep++;
  19232. xGame.common.gameUI.ui.guide2.visible = false;
  19233. xGame.common.gameUI.ui.guide3.visible = true;
  19234. }
  19235. }
  19236. finishGuide() {
  19237. let guide = DataMgr.getSkillGuide();
  19238. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  19239. xGame.common.guideStep = 10;
  19240. this.closeAllGuide();
  19241. console.log('zh: 新手引导完毕');
  19242. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  19243. }
  19244. }
  19245. closeAllGuide() {
  19246. xGame.common.gameUI.ui.guide1.visible = false;
  19247. xGame.common.gameUI.ui.guide2.visible = false;
  19248. xGame.common.gameUI.ui.guide3.visible = false;
  19249. }
  19250. updateBarInfo() {
  19251. let star = this.ui.powerNode.y;
  19252. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  19253. if (rate >= 1)
  19254. rate = 1;
  19255. if (rate <= 0)
  19256. rate = 0;
  19257. this.powerNum = Math.ceil(rate * 100);
  19258. this.ui.powerNode.value = this.powerNum;
  19259. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  19260. this.ui.colorNode.value = this.powerNum;
  19261. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  19262. this.ui.powerEft.visible = this.powerNum != 0;
  19263. this.ui.colorNode.visible = this.powerNum != 0;
  19264. this.ui.powerTxt.text = this.powerNum + "";
  19265. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  19266. }
  19267. forceCancel() {
  19268. this.ui.powerNode.value = 0;
  19269. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19270. this.ui.powerTxt.text = "";
  19271. }
  19272. checkRodMoveDir() {
  19273. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  19274. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  19275. if (tempX >= 0 && tempY <= 0) {
  19276. return this.checkDir();
  19277. }
  19278. else if (tempX < 0 && tempY < 0) {
  19279. return this.checkDir(1, -1);
  19280. }
  19281. else if (tempX < 0 && tempY > 0) {
  19282. return this.checkDir(-1, -1);
  19283. }
  19284. else {
  19285. return this.checkDir(-1, 1);
  19286. }
  19287. }
  19288. checkDir(flagX = 1, flagY = 1) {
  19289. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  19290. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  19291. if (offsetY == 0) {
  19292. return offsetX * flagX;
  19293. }
  19294. if (offsetX == 0) {
  19295. return offsetY * flagY;
  19296. }
  19297. let angle = offsetY / offsetX;
  19298. if (Math.abs(angle) >= 1) {
  19299. return offsetY * flagY;
  19300. }
  19301. else {
  19302. return offsetX * flagX;
  19303. }
  19304. }
  19305. judgeBallIntersect() {
  19306. let rootBall = xGame.common.d2World.rootBall;
  19307. let ballArr = xGame.common.d2World.ballArr;
  19308. let radius = rootBall.gameObj.width / 2;
  19309. let temp;
  19310. let isIntersect = false;
  19311. for (let index = 0; index < ballArr.length; index++) {
  19312. temp = ballArr[index];
  19313. if (temp.number == rootBall.number)
  19314. continue;
  19315. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  19316. if (isIntersect) {
  19317. break;
  19318. }
  19319. }
  19320. return isIntersect;
  19321. }
  19322. hideBallUI() {
  19323. let d2Gan = xGame.common.d2World.d2Gan;
  19324. if (!d2Gan.ui.isDisposed)
  19325. d2Gan.ui.visible = false;
  19326. let d2Help = xGame.common.d2World.d2HelpLine;
  19327. if (!d2Help.ui.isDisposed)
  19328. d2Help.ui.visible = false;
  19329. let rootBall = xGame.common.d2World.rootBall;
  19330. if (!rootBall.destroyed) {
  19331. rootBall.gameObj.active = false;
  19332. }
  19333. }
  19334. showBallUI() {
  19335. let d2Gan = xGame.common.d2World.d2Gan;
  19336. if (!d2Gan.ui.isDisposed)
  19337. d2Gan.ui.visible = true;
  19338. let d2Help = xGame.common.d2World.d2HelpLine;
  19339. if (!d2Help.ui.isDisposed)
  19340. d2Help.ui.visible = true;
  19341. let rootBall = xGame.common.d2World.rootBall;
  19342. if (!rootBall.destroyed) {
  19343. rootBall.gameObj.active = true;
  19344. }
  19345. }
  19346. moveToClickDot(e) {
  19347. if (!this.isMoveRod && !xGame.common.clickedBall) {
  19348. let root = xGame.common.d2World.rootBall.gameObj;
  19349. let xx = e.stageX - xGame.common.sysOffestNum;
  19350. let yy = e.stageY;
  19351. let x = xx - root.x;
  19352. let y = yy - root.y;
  19353. let angle = xGame.common.getfguiRotation(x, y);
  19354. xGame.common.d2World.d2Gan.ui.rotation = angle;
  19355. xGame.common.d2World.getHelpLine();
  19356. }
  19357. this.isMoveRod = false;
  19358. xGame.common.clickedBall = false;
  19359. }
  19360. openAllEvent() {
  19361. this.closeAllEvent();
  19362. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19363. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19364. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19365. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19366. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19367. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19368. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19369. }
  19370. closeAllEvent() {
  19371. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19372. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19373. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19374. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19375. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19376. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19377. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19378. }
  19379. resetGame() {
  19380. this.closeAllEvent();
  19381. this.hideBallUI();
  19382. xGame.common.gameMgr.gamePause = true;
  19383. }
  19384. }
  19385. UIGame$1.uiName = "UIGame";
  19386. class UIAddCoin$1 extends UIBase {
  19387. constructor() {
  19388. super();
  19389. this.coinNum = 2000;
  19390. }
  19391. onConstructor() {
  19392. this.ui = ui_UIAddCoin.createInstance();
  19393. this.contentPane = this.ui;
  19394. this.isEject = false;
  19395. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19396. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  19397. }
  19398. show() {
  19399. super.show();
  19400. this.ui.t0.play();
  19401. }
  19402. videoAddCoin() {
  19403. console.log('zh:qjff_AD_for_UIAddCoin');
  19404. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  19405. }
  19406. else {
  19407. console.log('zh:AD 失败,直接发放奖励');
  19408. this.qjff_AD_for_UIAddCoin();
  19409. }
  19410. }
  19411. qjff_AD_for_UIAddCoin() {
  19412. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  19413. this.hide();
  19414. }
  19415. }
  19416. UIAddCoin$1.uiName = "UIAddCoin";
  19417. class UIInvitation$1 extends UIBase {
  19418. constructor() {
  19419. super();
  19420. }
  19421. onConstructor() {
  19422. this.ui = ui_UIInvitation.createInstance();
  19423. this.contentPane = this.ui;
  19424. this.isEject = false;
  19425. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  19426. }
  19427. show() {
  19428. super.show();
  19429. }
  19430. enterGame() {
  19431. xGame.common.gameMode = GameMode.classic;
  19432. DataMgr.setChallengeTimes(1);
  19433. xGame.common.passAwardCoin = 2000;
  19434. let need = xGame.common.classicNiceNeddCoin;
  19435. if (DataMgr.coinEnough(need)) {
  19436. DataMgr.setCoin(-need);
  19437. xGame.eventMgr.event(RESTART_GAME, true);
  19438. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  19439. }
  19440. else {
  19441. xGame.eventMgr.event(RESTART_GAME, true);
  19442. }
  19443. this.hide();
  19444. }
  19445. hide() {
  19446. super.hide();
  19447. }
  19448. }
  19449. UIInvitation$1.uiName = "UIInvitation";
  19450. class UIPower$1 extends UIBase {
  19451. constructor() {
  19452. super();
  19453. }
  19454. onConstructor() {
  19455. this.ui = ui_UIPower.createInstance();
  19456. this.contentPane = this.ui;
  19457. this.isEject = false;
  19458. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19459. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  19460. }
  19461. show() {
  19462. super.show();
  19463. this.ui.t0.play();
  19464. }
  19465. videoGetPower() {
  19466. console.log('zh:qjff_AD_for_uipower');
  19467. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  19468. }
  19469. else {
  19470. console.log('zh:AD 失败,直接发放奖励');
  19471. this.qjff_AD_for_uipower();
  19472. }
  19473. }
  19474. qjff_AD_for_uipower() {
  19475. DataMgr.setPower(xGame.common.videoPower, true);
  19476. xGame.eventMgr.event(POWER_TIME);
  19477. this.hide();
  19478. }
  19479. }
  19480. UIPower$1.uiName = "UIPower";
  19481. class UIGameEnd$1 extends UIBase {
  19482. constructor() {
  19483. super();
  19484. this.success = false;
  19485. this.awardCoinNum = 1000;
  19486. this.awardDiamondNum = 10;
  19487. }
  19488. onConstructor() {
  19489. this.ui = ui_UIGameEnd.createInstance();
  19490. this.contentPane = this.ui;
  19491. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  19492. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  19493. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  19494. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19495. this.ui.talkNode.visible = false;
  19496. if (Moyu.isKs)
  19497. this.ui.closeNode.closeBtn.x += 100;
  19498. }
  19499. updateType() {
  19500. switch (xGame.common.gameMode) {
  19501. case GameMode.classic:
  19502. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19503. this.ui.coinNode.visible = this.success;
  19504. if (!this.success) {
  19505. Laya.timer.once(500, this, () => {
  19506. xGame.uiMgr.Show(UIAddCoin$1);
  19507. });
  19508. }
  19509. else {
  19510. this.logEventForClassic_win();
  19511. }
  19512. this.logEventForClassic_complete();
  19513. this.ui.isGetAward.visible = false;
  19514. this.ui.leftBtn.c1.selectedIndex = 3;
  19515. this.ui.rightBtn.c1.selectedIndex = 0;
  19516. this.moneyNode.ui.c1.selectedIndex = 1;
  19517. break;
  19518. case GameMode.bigMove:
  19519. console.log('zh:招法模式 aaaaaa bigMove');
  19520. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19521. this.ui.coinNode.visible = this.success;
  19522. if (xGame.common.gameMode == GameMode.bigMove) {
  19523. if (this.success) {
  19524. DataMgr.setSkillSuccessTimes(1, true);
  19525. DataMgr.setSkillAccTimes(1);
  19526. }
  19527. else {
  19528. DataMgr.setSkillSuccessTimes(0, false);
  19529. }
  19530. }
  19531. this.logEventForRod_complete_N();
  19532. if (!this.success) {
  19533. Laya.timer.once(500, this, () => {
  19534. xGame.uiMgr.Show(UIAddCoin$1);
  19535. });
  19536. }
  19537. else {
  19538. this.logEventForRod_win();
  19539. }
  19540. this.ui.isGetAward.visible = false;
  19541. this.ui.leftBtn.c1.selectedIndex = 3;
  19542. this.ui.rightBtn.c1.selectedIndex = 0;
  19543. this.moneyNode.ui.c1.selectedIndex = 1;
  19544. break;
  19545. case GameMode.placeBall:
  19546. this.ui.coinNode.visible = false;
  19547. if (this.success) {
  19548. if (xGame.common.placeBallStarNum == 3) {
  19549. this.ui.c1.selectedIndex = 2;
  19550. }
  19551. else {
  19552. this.ui.c1.selectedIndex = 3;
  19553. }
  19554. let level = xGame.common.placeBallCurLevel;
  19555. if (level > 59) {
  19556. this.logEventForChallenge_level_complete(level);
  19557. }
  19558. else {
  19559. this.logEventForChallenge_level_N(level);
  19560. }
  19561. }
  19562. else {
  19563. this.ui.c1.selectedIndex = 4;
  19564. }
  19565. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19566. if (cfg.type == PlaceBallType.challenge) {
  19567. this.ui.c1.selectedIndex = 2;
  19568. }
  19569. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  19570. this.updatePlaceBallBtn();
  19571. this.updatePlaceBallStarNum();
  19572. this.updatePlaceBallAwardState();
  19573. this.moneyNode.ui.c1.selectedIndex = 2;
  19574. this.moneyNode.checkPowerTime();
  19575. this.moneyNode.powerChange();
  19576. DataMgr.upRankData();
  19577. break;
  19578. default:
  19579. break;
  19580. }
  19581. }
  19582. logEventForRod_complete_N() {
  19583. let gfmsIdx = xGame.common.curPlayerSkillType;
  19584. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  19585. let gfmc = 'Skyfall Shot';
  19586. if (gfmsIdx == 0) {
  19587. gfmc = 'Skyfall Shot';
  19588. }
  19589. if (gfmsIdx == 1) {
  19590. gfmc = 'Surging break';
  19591. }
  19592. if (gfmsIdx == 2) {
  19593. gfmc = 'Frost Lock';
  19594. }
  19595. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19596. console.log('zh:logEventForRod_complete_N level = ' + level);
  19597. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  19598. let jsonStr = {
  19599. "count": 0,
  19600. "name": gfmc
  19601. };
  19602. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19603. const d = LocalStorageManager.getItem(keyStr);
  19604. jsonStr.count = d.count + 1;
  19605. LocalStorageManager.setItem(keyStr, jsonStr);
  19606. }
  19607. else {
  19608. LocalStorageManager.setItem(keyStr, jsonStr);
  19609. }
  19610. const d2 = LocalStorageManager.getItem(keyStr);
  19611. let count = d2.count;
  19612. console.log('zh:logEventForRod_complete_N count = ' + count);
  19613. if (count % 5 == 0) {
  19614. const reqStr = JSON.stringify(jsonStr);
  19615. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  19616. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  19617. }
  19618. }
  19619. logEventForRod_win() {
  19620. console.log('zh:logEventForRod_win,胜利');
  19621. let gfmsIdx = xGame.common.curPlayerSkillType;
  19622. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  19623. let gfmc = 'Skyfall Shot';
  19624. if (gfmsIdx == 0) {
  19625. gfmc = 'Skyfall Shot';
  19626. }
  19627. if (gfmsIdx == 1) {
  19628. gfmc = 'Surging break';
  19629. }
  19630. if (gfmsIdx == 2) {
  19631. gfmc = 'Frost Lock';
  19632. }
  19633. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19634. console.log('zh:logEventForRod_win level = ' + level);
  19635. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  19636. let jsonStr = {
  19637. "count": 1,
  19638. "name": gfmc + ' Lev' + level
  19639. };
  19640. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19641. const d = LocalStorageManager.getItem(keyStr);
  19642. jsonStr.count = d.count + 1;
  19643. LocalStorageManager.setItem(keyStr, jsonStr);
  19644. }
  19645. else {
  19646. LocalStorageManager.setItem(keyStr, jsonStr);
  19647. }
  19648. const reqStr = JSON.stringify(jsonStr);
  19649. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  19650. }
  19651. logEventForClassic_win() {
  19652. console.log('zh:logEventForClassic_win,胜利');
  19653. let rtype = xGame.common.classicRoomType;
  19654. let msmc = '';
  19655. if (rtype == 1) {
  19656. msmc = 'beginner';
  19657. }
  19658. if (rtype == 2) {
  19659. msmc = 'expert';
  19660. }
  19661. if (rtype == 3) {
  19662. msmc = 'master';
  19663. }
  19664. let keyStr = 'sjmd_classic_win_' + rtype;
  19665. let jsonStr = {
  19666. "difficulty": msmc,
  19667. "classic_count": 1,
  19668. "difficulty_count": 1
  19669. };
  19670. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19671. const d = LocalStorageManager.getItem(keyStr);
  19672. jsonStr.classic_count = d.classic_count + 1;
  19673. jsonStr.difficulty_count = d.difficulty_count + 1;
  19674. LocalStorageManager.setItem(keyStr, jsonStr);
  19675. }
  19676. else {
  19677. LocalStorageManager.setItem(keyStr, jsonStr);
  19678. }
  19679. const reqStr = JSON.stringify(jsonStr);
  19680. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  19681. }
  19682. logEventForClassic_complete() {
  19683. console.log('zh:logEventForClassic_complete,胜利');
  19684. let rtype = xGame.common.classicRoomType;
  19685. let msmc = '';
  19686. if (rtype == 1) {
  19687. msmc = 'beginner';
  19688. }
  19689. if (rtype == 2) {
  19690. msmc = 'expert';
  19691. }
  19692. if (rtype == 3) {
  19693. msmc = 'master';
  19694. }
  19695. let keyStr = 'sjmd_classic_complete_' + rtype;
  19696. let jsonStr = {
  19697. "msmc": msmc,
  19698. "count": 0
  19699. };
  19700. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19701. const d = LocalStorageManager.getItem(keyStr);
  19702. jsonStr.count = d.count + 1;
  19703. LocalStorageManager.setItem(keyStr, jsonStr);
  19704. }
  19705. else {
  19706. LocalStorageManager.setItem(keyStr, jsonStr);
  19707. }
  19708. if (jsonStr.count % 5 == 0) {
  19709. const reqStr = JSON.stringify(jsonStr);
  19710. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  19711. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  19712. }
  19713. }
  19714. updatePlaceBallBtn() {
  19715. this.ui.leftBtn.c1.selectedIndex = 5;
  19716. if (this.success) {
  19717. this.ui.rightBtn.c1.selectedIndex = 14;
  19718. }
  19719. else {
  19720. if (xGame.common.placeBallStarNum == 3) {
  19721. this.ui.rightBtn.c1.selectedIndex = 14;
  19722. }
  19723. else {
  19724. this.ui.rightBtn.c1.selectedIndex = 1;
  19725. }
  19726. }
  19727. }
  19728. updatePlaceBallStarNum() {
  19729. let starNum = xGame.common.placeBallStarNum;
  19730. if (starNum == 0)
  19731. this.ui.starNumNode.c1.selectedIndex = 3;
  19732. else {
  19733. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  19734. }
  19735. }
  19736. updatePlaceBallAwardState() {
  19737. let level = xGame.common.placeBallCurLevel;
  19738. let starNum = xGame.common.placeBallStarNum;
  19739. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19740. let data = cfgTable.placeballData[level].award;
  19741. let cfg = cfgTable.placeballData[level];
  19742. this.awardDiamondNum = data[1];
  19743. this.awardCoinNum = data[0];
  19744. if (cfg.type == PlaceBallType.challenge) {
  19745. this.awardDiamondNum = 0;
  19746. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19747. }
  19748. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  19749. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  19750. if (cfg.type == PlaceBallType.challenge) {
  19751. this.ui.awardNode.coinNode.visible = true;
  19752. }
  19753. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  19754. this.ui.awardNode.diamondNode.x = 265;
  19755. this.ui.awardNode.coinNode.x = 354;
  19756. }
  19757. else {
  19758. this.ui.awardNode.diamondNode.x = 291;
  19759. this.ui.awardNode.coinNode.x = 291;
  19760. }
  19761. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  19762. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  19763. if (this.awardCoinNum == 0) {
  19764. this.ui.awardNode.coinNode.numTxt.text = "";
  19765. }
  19766. if (getAward) {
  19767. this.ui.isGetAward.visible = true;
  19768. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  19769. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  19770. }
  19771. else {
  19772. this.ui.isGetAward.visible = false;
  19773. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  19774. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  19775. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  19776. }
  19777. else {
  19778. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  19779. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  19780. }
  19781. }
  19782. }
  19783. show(success) {
  19784. super.show();
  19785. xGame.eventMgr.event(RESET_GAME);
  19786. this.success = success;
  19787. Laya.timer.clearAll(this);
  19788. this.playSecretaryAni();
  19789. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  19790. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  19791. offsetTime = Math.floor(offsetTime / 1000);
  19792. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  19793. this.updateType();
  19794. Laya.timer.once(200, this, () => {
  19795. this.addAward(() => {
  19796. this.updateType();
  19797. Laya.timer.once(500, this, () => {
  19798. this.showChallengeLevel();
  19799. });
  19800. });
  19801. });
  19802. if (this.success) {
  19803. JSBridgeUtils.instance.showInternAd('gameend_success');
  19804. console.log('zh:game end 成功');
  19805. xGame.soundMgr.playSound('slots_roll01');
  19806. xGame.soundMgr.playSound("s_win");
  19807. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19808. this.diyGameDataUtilForGameWin();
  19809. }
  19810. else {
  19811. JSBridgeUtils.instance.showInternAd('gameend_faill');
  19812. console.log('zh:game end失败');
  19813. xGame.soundMgr.playSound('matchwin01');
  19814. xGame.soundMgr.playSound("s_lose");
  19815. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19816. }
  19817. let challengeNum = DataMgr.getChallengeTimes();
  19818. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  19819. DataMgr.setChallengeTimes(1);
  19820. }
  19821. if (this.success && xGame.common.gameMode == GameMode.classic) {
  19822. DataMgr.setClassicTimes();
  19823. }
  19824. }
  19825. diyGameDataUtilForGameWin() {
  19826. console.log('zh: DiyGameDataUtilForGameWin diy ');
  19827. switch (xGame.common.gameMode) {
  19828. case GameMode.classic:
  19829. console.log('zh:DiyGameDataUtilForGameWin 111');
  19830. case GameMode.bigMove:
  19831. console.log('zh:DiyGameDataUtilForGameWin 222');
  19832. this.restartGame();
  19833. break;
  19834. case GameMode.placeBall:
  19835. console.log('zh:DiyGameDataUtilForGameWin 333');
  19836. var level = xGame.common.placeBallCurLevel;
  19837. console.log('zh:练习模式 联系了多少LEV=' + level);
  19838. let db_over_lev = DataMgr.getChallengeMode_overLev();
  19839. if (level > db_over_lev) {
  19840. DataMgr.setChallengeMode_overLev(level);
  19841. }
  19842. break;
  19843. default:
  19844. console.log('zh:DiyGameDataUtilForGameWin 444');
  19845. break;
  19846. }
  19847. }
  19848. showChallengeLevel() {
  19849. if (DataMgr.getChallengeTimes() != 0)
  19850. return;
  19851. let skill = DataMgr.getSkillAccTimes();
  19852. let put = DataMgr.getPlaceBallLevelList().length;
  19853. if (skill >= 3 || put >= 5) {
  19854. xGame.uiMgr.Show(UIInvitation$1);
  19855. this.hide();
  19856. }
  19857. }
  19858. addAward(callback) {
  19859. if (!this.success) {
  19860. callback && callback();
  19861. return;
  19862. }
  19863. switch (xGame.common.gameMode) {
  19864. case GameMode.classic:
  19865. this.awardCoinNum = xGame.common.passAwardCoin;
  19866. this.awardDiamondNum = 0;
  19867. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19868. break;
  19869. case GameMode.bigMove:
  19870. this.awardCoinNum = xGame.common.passAwardCoin;
  19871. this.awardDiamondNum = 0;
  19872. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19873. callback && callback();
  19874. break;
  19875. case GameMode.placeBall:
  19876. let level = xGame.common.placeBallCurLevel;
  19877. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  19878. if (xGame.common.placeBallStarNum != 3) {
  19879. callback && callback();
  19880. return;
  19881. }
  19882. else {
  19883. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19884. if (getAward) {
  19885. callback && callback();
  19886. return;
  19887. }
  19888. }
  19889. let cfg = cfgTable.placeballData[level];
  19890. let data = cfgTable.placeballData[level].award;
  19891. this.awardCoinNum = data[0];
  19892. this.awardDiamondNum = data[1];
  19893. if (cfg.type == PlaceBallType.challenge) {
  19894. this.awardDiamondNum = 0;
  19895. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19896. }
  19897. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  19898. let diamondAward;
  19899. if (this.awardDiamondNum > 0) {
  19900. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  19901. xGame.common.getAward([diamondAward, coinAward], callback);
  19902. }
  19903. else {
  19904. xGame.common.getAward([coinAward], callback);
  19905. }
  19906. if (cfg.type == PlaceBallType.normal) {
  19907. DataMgr.setPlaceBallAward(level);
  19908. }
  19909. break;
  19910. default:
  19911. break;
  19912. }
  19913. }
  19914. playSecretaryAni_old() {
  19915. let parent = this.ui.secretary.displayObject;
  19916. parent.destroyChildren();
  19917. let xx = this.ui.secretary.width / 2;
  19918. let yy = this.ui.secretary.height;
  19919. let scale = xGame.common.getSecretaryScale();
  19920. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19921. if (this.success) {
  19922. let rand = Math.random() <= 0.5 ? 2 : 3;
  19923. xGame.common.secretary.play(data, rand, false, parent, () => {
  19924. xGame.common.secretary.play(data, 1, true, parent);
  19925. });
  19926. }
  19927. else {
  19928. xGame.common.secretary.play(data, 0, true, parent);
  19929. }
  19930. }
  19931. playSecretaryAni() {
  19932. let parent = this.ui.secretary.displayObject;
  19933. parent.destroyChildren();
  19934. let xx = this.ui.secretary.width / 2;
  19935. let yy = this.ui.secretary.height;
  19936. let scale = xGame.common.getSecretaryScale();
  19937. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19938. if (this.success) {
  19939. let rand = 0;
  19940. xGame.common.secretary.play(data, 0, true, parent);
  19941. }
  19942. else {
  19943. xGame.common.secretary.play(data, 0, true, parent);
  19944. }
  19945. }
  19946. restartGame() {
  19947. switch (xGame.common.gameMode) {
  19948. case GameMode.classic:
  19949. xGame.eventMgr.event(RESTART_GAME);
  19950. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19951. break;
  19952. case GameMode.bigMove:
  19953. this.hide();
  19954. xGame.eventMgr.event(RESTART_GAME);
  19955. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19956. break;
  19957. default:
  19958. break;
  19959. }
  19960. }
  19961. hide() {
  19962. super.hide();
  19963. xGame.common.stopGirlPop(this.ui.talkNode);
  19964. PlatMgr.showBanner(false);
  19965. }
  19966. returnHome() {
  19967. this.hide();
  19968. let showFailWords = !this.success;
  19969. xGame.uiMgr.Show(UIMain$1, showFailWords);
  19970. }
  19971. clickLeftBtn() {
  19972. switch (xGame.common.gameMode) {
  19973. case GameMode.classic:
  19974. case GameMode.bigMove:
  19975. this.returnHome();
  19976. break;
  19977. case GameMode.placeBall:
  19978. let level = xGame.common.placeBallCurLevel;
  19979. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  19980. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19981. break;
  19982. default:
  19983. break;
  19984. }
  19985. }
  19986. powerStartPlaceBallLevel(level, btn) {
  19987. if (DataMgr.powerEnough()) {
  19988. btn.touchable = false;
  19989. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  19990. btn.touchable = true;
  19991. DataMgr.setPower(-1);
  19992. xGame.eventMgr.event(POWER_TIME);
  19993. this.startPlaceBallLevel(level);
  19994. this.logEventForChallenge_level_start(level);
  19995. }));
  19996. }
  19997. else {
  19998. xGame.uiMgr.Show(UIPower$1, 0);
  19999. }
  20000. }
  20001. clickRightBtn() {
  20002. switch (xGame.common.gameMode) {
  20003. case GameMode.classic:
  20004. console.log('zh:clickRightBtn 111');
  20005. case GameMode.bigMove:
  20006. console.log('zh:clickRightBtn 222');
  20007. this.restartGame();
  20008. break;
  20009. case GameMode.placeBall:
  20010. console.log('zh:clickRightBtn 333');
  20011. let level = xGame.common.placeBallCurLevel;
  20012. let data = DataMgr.getPlaceBallLevel(level);
  20013. let curPss = data.play && !data.isCur;
  20014. if (curPss) {
  20015. console.log('zh:clickRightBtn 333-111');
  20016. console.log('zh:当前LV=' + level);
  20017. if (level == 60) {
  20018. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  20019. Laya.timer.once(3000, this, () => {
  20020. this.returnHome();
  20021. });
  20022. }
  20023. else {
  20024. let lev = level + 1;
  20025. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  20026. }
  20027. }
  20028. else {
  20029. console.log('zh:clickRightBtn 333-000');
  20030. Moyu.sendDataEvent("placeBallNextLevel");
  20031. console.log('zh:qjff_AD_for_uiGameEnd');
  20032. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  20033. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  20034. }
  20035. else {
  20036. console.log('zh:AD 失败,直接发放奖励');
  20037. this.qjff_AD_for_uiGameEnd(level);
  20038. }
  20039. }
  20040. break;
  20041. default:
  20042. console.log('zh:clickRightBtn 444');
  20043. break;
  20044. }
  20045. }
  20046. logEventForChallenge_level_start(level) {
  20047. let keyStr = 'sjmd_challenge_level_start';
  20048. let jsonStr = {
  20049. "count": 0,
  20050. "gold_balance ": DataMgr.getCoin(),
  20051. "level": level,
  20052. "diamond_balance ": DataMgr.getDiamond()
  20053. };
  20054. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20055. const d = LocalStorageManager.getItem(keyStr);
  20056. if (level > d.level) {
  20057. jsonStr.count = d.count + 1;
  20058. LocalStorageManager.setItem(keyStr, jsonStr);
  20059. }
  20060. else {
  20061. }
  20062. }
  20063. else {
  20064. LocalStorageManager.setItem(keyStr, jsonStr);
  20065. }
  20066. const reqStr = JSON.stringify(jsonStr);
  20067. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20068. }
  20069. qjff_AD_for_uiGameEnd(level) {
  20070. DataMgr.setPlaceBallLevel(level, 1);
  20071. this.startPlaceBallLevel(level + 1);
  20072. }
  20073. startPlaceBallLevel(level) {
  20074. xGame.common.gameMode = GameMode.placeBall;
  20075. xGame.common.placeBallCurLevel = level;
  20076. xGame.uiMgr.Show(UIGame$1);
  20077. this.hide();
  20078. }
  20079. logEventForChallenge_level_complete(level) {
  20080. let keyStr = 'sjmd_challenge_level_complete';
  20081. let jsonStr = {
  20082. "count": 1,
  20083. "gold_balance ": DataMgr.getCoin(),
  20084. "level": level,
  20085. "diamond_balance ": DataMgr.getDiamond()
  20086. };
  20087. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20088. const d = LocalStorageManager.getItem(keyStr);
  20089. jsonStr.count = d.count + 1;
  20090. LocalStorageManager.setItem(keyStr, jsonStr);
  20091. }
  20092. else {
  20093. LocalStorageManager.setItem(keyStr, jsonStr);
  20094. }
  20095. const reqStr = JSON.stringify(jsonStr);
  20096. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  20097. }
  20098. logEventForChallenge_level_N(level) {
  20099. console.log('zh:logEventForChallenge_level_N ' + level);
  20100. let keyStr = 'sjmd_challenge_level_N';
  20101. if (LocalStorageManager.hasKey(keyStr)) {
  20102. let lev = LocalStorageManager.getItem(keyStr);
  20103. if (level > lev) {
  20104. LocalStorageManager.setItem(keyStr, level);
  20105. }
  20106. if ((level) % 5 == 0) {
  20107. console.log('zh:每5关上报1次');
  20108. let sjmc = 'challenge_level_' + level;
  20109. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  20110. let sjmcForFirebase = 'challenge_level_' + level;
  20111. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  20112. }
  20113. else {
  20114. console.log('zh:5 no 上报');
  20115. }
  20116. }
  20117. else {
  20118. LocalStorageManager.setItem(keyStr, level);
  20119. }
  20120. }
  20121. }
  20122. UIGameEnd$1.uiName = "UIGameEnd";
  20123. class ShowItem$1 {
  20124. constructor() {
  20125. this.ui = ui_ShowItem.createInstance();
  20126. }
  20127. destroySelf() {
  20128. if (!this.ui.isDisposed) {
  20129. this.ui.removeFromParent();
  20130. this.ui.dispose();
  20131. }
  20132. }
  20133. setParent(parent) {
  20134. parent.addChild(this.ui);
  20135. }
  20136. setPos(x, y) {
  20137. this.ui.x = x;
  20138. this.ui.y = y;
  20139. }
  20140. setUrl(index) {
  20141. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  20142. }
  20143. }
  20144. class UILevelProp$1 extends UIBase {
  20145. constructor() {
  20146. super();
  20147. this.firstPos = 385;
  20148. this.secondPos = 467;
  20149. this.showItemArr = [];
  20150. }
  20151. onFontLoaded() {
  20152. try {
  20153. this.ui.myNode.conditionTxt.font = "arial";
  20154. console.log("zh: onFontLoaded 设置arial字体成功");
  20155. }
  20156. catch (error) {
  20157. console.log("zh: constructor onFontLoaded加载arial字体失败");
  20158. }
  20159. }
  20160. onConstructor() {
  20161. this.ui = ui_UILevelProp.createInstance();
  20162. this.contentPane = this.ui;
  20163. this.isEject = false;
  20164. this.addUIClick(this.ui.closeBtn, this.hide);
  20165. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20166. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  20167. }
  20168. show(level) {
  20169. super.show();
  20170. this.ui.t1.play();
  20171. this.level = level;
  20172. this.data = cfgTable.placeballData[this.level];
  20173. this.updateSelf();
  20174. this.showPreView();
  20175. this.moneyNode.ui.c1.selectedIndex = 2;
  20176. this.moneyNode.checkPowerTime();
  20177. this.moneyNode.powerChange();
  20178. }
  20179. showPreView() {
  20180. let item;
  20181. let data;
  20182. for (let index = 0; index < this.showItemArr.length; index++) {
  20183. item = this.showItemArr[index];
  20184. item.destroySelf();
  20185. }
  20186. this.showItemArr = [];
  20187. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  20188. for (const key in cfgData) {
  20189. data = cfgData[key];
  20190. item = new ShowItem$1();
  20191. item.setParent(this.ui.myNode.displayRoot);
  20192. item.setPos(data.x, data.y);
  20193. item.setUrl(data.value);
  20194. this.showItemArr.push(item);
  20195. }
  20196. }
  20197. updateSelf() {
  20198. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  20199. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  20200. if (this.data.ball == -1) {
  20201. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  20202. }
  20203. else {
  20204. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  20205. }
  20206. let localData = DataMgr.getPlaceBallLevel(this.level);
  20207. let getAward = localData.getAward;
  20208. let cfg = cfgTable.placeballData[this.level];
  20209. let coin = this.data.award[0];
  20210. let diamond = this.data.award[1];
  20211. if (cfg.type == PlaceBallType.challenge) {
  20212. diamond = 0;
  20213. coin = 100;
  20214. }
  20215. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  20216. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  20217. this.ui.myNode.coinNode.numTxt.text = coin + "";
  20218. if (cfg.type == PlaceBallType.challenge) {
  20219. this.ui.myNode.coinNode.numTxt.text = "";
  20220. }
  20221. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  20222. if (coin > 0 && diamond > 0) {
  20223. this.ui.myNode.diamondNode.x = 385;
  20224. this.ui.myNode.coinNode.x = 467;
  20225. }
  20226. else {
  20227. this.ui.myNode.diamondNode.x = 385;
  20228. this.ui.myNode.coinNode.x = 385;
  20229. }
  20230. if (!getAward) {
  20231. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  20232. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  20233. }
  20234. else {
  20235. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  20236. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  20237. }
  20238. }
  20239. startGame() {
  20240. if (DataMgr.powerEnough()) {
  20241. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  20242. this.ui.myNode.startBtn.touchable = false;
  20243. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20244. console.log('zh:startGame ');
  20245. this.ui.myNode.startBtn.touchable = true;
  20246. DataMgr.setPower(-1);
  20247. xGame.eventMgr.event(POWER_TIME);
  20248. xGame.common.gameMode = GameMode.placeBall;
  20249. xGame.common.placeBallCurLevel = this.level;
  20250. xGame.uiMgr.Show(UIGame$1);
  20251. this.logEventForChallenge_level_start(this.level);
  20252. xGame.uiMgr.Hide(UILevelDisplay$1);
  20253. xGame.uiMgr.Hide(UIMain$1);
  20254. this.hide();
  20255. }));
  20256. }
  20257. else {
  20258. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  20259. xGame.uiMgr.Show(UIPower$1);
  20260. }
  20261. }
  20262. logEventForChallenge_level_start(level) {
  20263. let keyStr = 'sjmd_challenge_level_start';
  20264. let jsonStr = {
  20265. "count": 1,
  20266. "gold_balance ": DataMgr.getCoin(),
  20267. "level": level,
  20268. "diamond_balance ": DataMgr.getDiamond()
  20269. };
  20270. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20271. const d = LocalStorageManager.getItem(keyStr);
  20272. if (level > d.level) {
  20273. jsonStr.count = d.count + 1;
  20274. LocalStorageManager.setItem(keyStr, jsonStr);
  20275. }
  20276. else {
  20277. }
  20278. }
  20279. else {
  20280. LocalStorageManager.setItem(keyStr, jsonStr);
  20281. }
  20282. const reqStr = JSON.stringify(jsonStr);
  20283. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20284. }
  20285. hide() {
  20286. super.hide();
  20287. }
  20288. }
  20289. UILevelProp$1.uiName = "UILevelProp";
  20290. class PutBallLevelDisplay$1 {
  20291. constructor(ui, index) {
  20292. this.index = 0;
  20293. this.ui = ui;
  20294. this.index = index;
  20295. this.ui.onClick(this, this.clickSelf);
  20296. this.updateSelf();
  20297. this.ui.levelTxt.text = (this.index + 1) + "";
  20298. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  20299. this.ui.special.levelTxt.text = (this.index + 1) + "";
  20300. }
  20301. updateSelf() {
  20302. let level = this.index + 1;
  20303. this.data = DataMgr.getPlaceBallLevel(level);
  20304. this.ui.starNode.c1.selectedIndex = this.data.star;
  20305. let isChallenge = cfgTable.placeballData[level].type;
  20306. if (this.data.isCur) {
  20307. if (isChallenge) {
  20308. this.ui.c1.selectedIndex = 5;
  20309. }
  20310. else {
  20311. this.ui.c1.selectedIndex = 2;
  20312. }
  20313. }
  20314. else {
  20315. if (this.data.play) {
  20316. if (this.data.star == 3) {
  20317. this.ui.c1.selectedIndex = 0;
  20318. }
  20319. else {
  20320. this.ui.c1.selectedIndex = 1;
  20321. }
  20322. }
  20323. else {
  20324. if (isChallenge) {
  20325. this.ui.c1.selectedIndex = 4;
  20326. }
  20327. else {
  20328. this.ui.c1.selectedIndex = 3;
  20329. }
  20330. }
  20331. }
  20332. }
  20333. clickSelf() {
  20334. if (!this.data.play)
  20335. return;
  20336. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20337. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  20338. }
  20339. }
  20340. class UILevelDisplay$1 extends UIBase {
  20341. constructor() {
  20342. super();
  20343. }
  20344. onConstructor() {
  20345. this.ui = ui_UILevelDisplay.createInstance();
  20346. this.contentPane = this.ui;
  20347. this.isEject = false;
  20348. this.myList = this.ui.myNode.myList;
  20349. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  20350. this.levelItemArr = [];
  20351. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  20352. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  20353. this.myList.numItems = levelNum;
  20354. if (Moyu.isKs)
  20355. this.ui.closeNode.closeBtn.x += 100;
  20356. }
  20357. levelItemRender(index, target) {
  20358. let item = new PutBallLevelDisplay$1(target, index);
  20359. this.levelItemArr.push(item);
  20360. }
  20361. show() {
  20362. super.show();
  20363. this.updateLevel();
  20364. this.scrollToPlace();
  20365. }
  20366. updateLevel() {
  20367. let temp;
  20368. for (let index = 0; index < this.levelItemArr.length; index++) {
  20369. temp = this.levelItemArr[index];
  20370. temp.updateSelf();
  20371. }
  20372. }
  20373. scrollToPlace() {
  20374. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  20375. let passArr = DataMgr.getPlaceBallLevelList();
  20376. let offest = passArr.length;
  20377. if (offest >= maxNum - 1)
  20378. offest = maxNum - 1;
  20379. this.myList.scrollToView(offest, true, true);
  20380. }
  20381. hide() {
  20382. super.hide();
  20383. }
  20384. }
  20385. UILevelDisplay$1.uiName = "UILevelDisplay";
  20386. class UIMatching$1 extends UIBase {
  20387. constructor() {
  20388. super();
  20389. }
  20390. onConstructor() {
  20391. this.ui = ui_UIMatching.createInstance();
  20392. this.contentPane = this.ui;
  20393. this.isEject = false;
  20394. }
  20395. show(callback) {
  20396. super.show();
  20397. PlatMgr.showBanner(true);
  20398. this.callback = callback;
  20399. let user = Moyu.getUserInfo();
  20400. if (!this.selfPot) {
  20401. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  20402. }
  20403. if (!this.aiPot) {
  20404. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  20405. }
  20406. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  20407. this.ui.selfHead.nameTxt.text = user.nickName;
  20408. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  20409. this.ui.aiHead.nameTxt.text = "???";
  20410. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  20411. this.ui.selfHead.c1.selectedIndex = 0;
  20412. this.ui.aiHead.c1.selectedIndex = 0;
  20413. this.ui.selfHead.x = this.selfPot.x;
  20414. this.ui.selfHead.y = this.selfPot.y;
  20415. this.ui.aiHead.x = this.aiPot.x;
  20416. this.ui.aiHead.y = this.aiPot.y;
  20417. switch (xGame.common.gameMode) {
  20418. case GameMode.classic:
  20419. break;
  20420. case GameMode.bigMove:
  20421. this.initSkillData();
  20422. break;
  20423. default:
  20424. break;
  20425. }
  20426. this.ui.t1.play(Laya.Handler.create(this, () => {
  20427. this.ui.t2.play(Laya.Handler.create(this, () => {
  20428. switch (xGame.common.gameMode) {
  20429. case GameMode.classic:
  20430. this.waitingPeople();
  20431. break;
  20432. case GameMode.bigMove:
  20433. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  20434. break;
  20435. default:
  20436. break;
  20437. }
  20438. }));
  20439. }));
  20440. }
  20441. initSkillData() {
  20442. this.skillSelectData = [];
  20443. let skillUrl = xGame.common.skillIconList;
  20444. let skillName = xGame.common.skillNameList;
  20445. let skillLevel = DataMgr.getBigSkillList();
  20446. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  20447. for (let index = 0; index < 5; index++) {
  20448. let obj = {};
  20449. obj.skillImg = skillUrl[index];
  20450. obj.skillName = skillName[index];
  20451. obj.skillType = skillType[index];
  20452. obj.skillLevel = skillLevel[index];
  20453. this.skillSelectData.push(obj);
  20454. }
  20455. }
  20456. getAISkillLevel(myLevel) {
  20457. let video = xGame.common.upSkillLevel;
  20458. let aiLevel;
  20459. let temp;
  20460. if (video) {
  20461. temp = xGame.common.randomNum(-2, -1);
  20462. }
  20463. else {
  20464. if (myLevel <= 5) {
  20465. temp = xGame.common.randomNum(1, 3);
  20466. }
  20467. else if (myLevel <= 9) {
  20468. temp = xGame.common.randomNum(-2, 1);
  20469. }
  20470. else {
  20471. temp = xGame.common.randomNum(-4, 0);
  20472. }
  20473. }
  20474. aiLevel = temp + myLevel;
  20475. if (aiLevel <= 1)
  20476. aiLevel = 1;
  20477. if (aiLevel >= 10)
  20478. aiLevel = 10;
  20479. return aiLevel;
  20480. }
  20481. getAISkillType() {
  20482. return xGame.common.randomNum(1, 4);
  20483. let successTimes = DataMgr.getSkillSuccessTimes();
  20484. let info = cfgTable.aiskillData[successTimes];
  20485. if (!info) {
  20486. let max = Object.keys(cfgTable.aiskillData).length - 1;
  20487. info = cfgTable.aiskillData[max];
  20488. }
  20489. let dataArr = info.skillselect;
  20490. let myCfg = {};
  20491. for (let index = 0; index < dataArr.length; index++) {
  20492. let temp = dataArr[index].split('-');
  20493. myCfg[temp[0]] = {};
  20494. myCfg[temp[0]].id = parseInt(temp[0]);
  20495. myCfg[temp[0]].weight = parseInt(temp[1]);
  20496. }
  20497. let aiCfg = xGame.common.initWeight(myCfg);
  20498. let curData = xGame.common.getRandomWeightData(aiCfg);
  20499. return parseInt(curData.id);
  20500. }
  20501. getAISkillData(index) {
  20502. let myLevel = this.skillSelectData[index].skillLevel;
  20503. let aiLevel = this.getAISkillLevel(myLevel);
  20504. let aiType = this.getAISkillType() - 1;
  20505. return { aiLevel, aiType } = { aiLevel, aiType };
  20506. }
  20507. skillSelectFinish(index) {
  20508. let aiInfo = this.getAISkillData(index);
  20509. xGame.common.gameMgr.selfCurSkill = index;
  20510. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  20511. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  20512. this.ui.selfHead.c1.selectedIndex = 1;
  20513. this.ui.aiHead.c1.selectedIndex = 1;
  20514. let myData = this.skillSelectData[index];
  20515. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  20516. let guide = DataMgr.getSkillGuide();
  20517. if (guide == 0) {
  20518. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  20519. }
  20520. else {
  20521. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  20522. }
  20523. let aiData = this.skillSelectData[aiInfo.aiType];
  20524. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  20525. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  20526. this.waitingPeople();
  20527. }
  20528. waitingPeople() {
  20529. let time = xGame.common.randomNum(1000, 3000);
  20530. time += 1000;
  20531. Laya.timer.once(time, this, () => {
  20532. this.matchingSuccess();
  20533. });
  20534. }
  20535. matchingSuccess() {
  20536. let gameUI = xGame.common.gameUI;
  20537. let name = gameUI.ui.topNode.aiNameTxt.text;
  20538. let url = gameUI.ui.topNode.aiHeadLoader.url;
  20539. this.ui.aiHead.nameTxt.text = name;
  20540. this.ui.aiHead.headImg.url = url;
  20541. name = gameUI.ui.topNode.selfNameTxt.text;
  20542. url = gameUI.ui.topNode.selfHeadLoader.url;
  20543. this.ui.selfHead.nameTxt.text = name;
  20544. this.ui.selfHead.headImg.url = url;
  20545. this.ui.t3.play(Laya.Handler.create(this, () => {
  20546. this.callback && this.callback();
  20547. this.ui.t4.play(Laya.Handler.create(this, () => {
  20548. this.destroySelf();
  20549. }));
  20550. }));
  20551. }
  20552. destroySelf() {
  20553. this.callback = null;
  20554. this.skillSelectData = null;
  20555. this.selfPot = null;
  20556. this.aiPot = null;
  20557. if (!this.ui.isDisposed) {
  20558. this.ui.removeFromParent();
  20559. this.ui.dispose();
  20560. }
  20561. xGame.uiMgr.destroyUI(this);
  20562. }
  20563. }
  20564. UIMatching$1.uiName = "UIMatching";
  20565. class SkillDisplay$1 {
  20566. constructor(ui, data, uiIndex) {
  20567. this.starX = 0;
  20568. this.starY = 0;
  20569. this.index = 0;
  20570. this.ui = ui;
  20571. this.data = data;
  20572. this.index = uiIndex;
  20573. this.initSelf();
  20574. console.log('zh:SkillDisplay constructor this.skillData=', data);
  20575. }
  20576. initSelf() {
  20577. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  20578. this.ui.nameTxt.text = this.data.name;
  20579. this.ui.describeTxt.text = this.data.describe;
  20580. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  20581. this.ui.startBtn.onClick(this, this.startGame);
  20582. this.updateSelf();
  20583. }
  20584. updateSelf() {
  20585. this.checkTry();
  20586. let level = DataMgr.getBigSkillByIndex(this.index);
  20587. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  20588. }
  20589. checkTry() {
  20590. let index = this.index;
  20591. let level = DataMgr.getBigSkillByIndex(index);
  20592. if (level == null) {
  20593. DataMgr.setBigSkill(index, 1, false);
  20594. level = 1;
  20595. }
  20596. this.ui.levelTxt.text = "LV." + level;
  20597. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  20598. this.ui.tryNode.visible = true;
  20599. else
  20600. this.ui.tryNode.visible = false;
  20601. }
  20602. clickAddLevel() {
  20603. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20604. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  20605. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  20606. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  20607. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20608. }
  20609. else {
  20610. console.log('zh:AD 失败,直接发放奖励');
  20611. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20612. }
  20613. }
  20614. qjff_AD_for_skilldisplay_clickAddLevel() {
  20615. DataMgr.setBigSkill(this.data.index, 1);
  20616. this.updateSelf();
  20617. xGame.common.upSkillLevel = true;
  20618. }
  20619. startGame() {
  20620. console.log('zh:rod skill startgame');
  20621. if (this.data.index == 3) {
  20622. alert('Coming soon!');
  20623. return;
  20624. }
  20625. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20626. let needCoin = xGame.common.bigMoveNeedCoin;
  20627. xGame.common.passAwardCoin = 2000;
  20628. let guide = DataMgr.getSkillGuide();
  20629. console.log('zh:startGame guide=' + guide);
  20630. xGame.common.temSelfLevel = 0;
  20631. if (guide == 0) {
  20632. needCoin = 0;
  20633. xGame.common.temSelfLevel = 100;
  20634. }
  20635. if (DataMgr.coinEnough(needCoin)) {
  20636. DataMgr.setCoin(-needCoin);
  20637. xGame.common.curPlayerSkillType = this.index;
  20638. if (guide == 0)
  20639. xGame.common.curPlayerSkillType = 0;
  20640. console.log('zh: skilldisplay 1');
  20641. xGame.uiMgr.Show(UIGame$1);
  20642. xGame.uiMgr.Hide(UIMain$1);
  20643. xGame.uiMgr.Show(UIMatching$1, () => {
  20644. xGame.common.gameUI.ui.alpha = 1;
  20645. xGame.common.gameUI.startGame();
  20646. xGame.uiMgr.Hide(UISkill$1);
  20647. });
  20648. this.logEventForRod_start();
  20649. }
  20650. else {
  20651. console.log('zh: skilldisplay 2');
  20652. xGame.uiMgr.Show(UIAddProp$1, 0);
  20653. Moyu.sendDataEvent("AddCoinVideo");
  20654. }
  20655. }
  20656. logEventForRod_start() {
  20657. let gfmsIdx = xGame.common.curPlayerSkillType;
  20658. console.log('zh:选择的技能=' + gfmsIdx);
  20659. let gfmc = 'Skyfall Shot';
  20660. if (gfmsIdx == 0) {
  20661. gfmc = 'Skyfall Shot';
  20662. }
  20663. if (gfmsIdx == 1) {
  20664. gfmc = 'Surging break';
  20665. }
  20666. if (gfmsIdx == 2) {
  20667. gfmc = 'Frost Lock';
  20668. }
  20669. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20670. let jsonStr = {
  20671. "count": 0,
  20672. "name": gfmc
  20673. };
  20674. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20675. const d = LocalStorageManager.getItem(keyStr);
  20676. jsonStr.count = d.count + 1;
  20677. LocalStorageManager.setItem(keyStr, jsonStr);
  20678. }
  20679. else {
  20680. LocalStorageManager.setItem(keyStr, jsonStr);
  20681. }
  20682. const reqStr = JSON.stringify(jsonStr);
  20683. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  20684. }
  20685. }
  20686. class UISkill$1 extends UIBase {
  20687. constructor() {
  20688. super();
  20689. this.skillData = [];
  20690. }
  20691. onConstructor() {
  20692. this.ui = ui_UISkill.createInstance();
  20693. this.contentPane = this.ui;
  20694. this.isEject = false;
  20695. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20696. this.initSkillData();
  20697. console.log('zh:aaaaaa1111111111');
  20698. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  20699. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  20700. console.log('zh:aaaaaa22222222');
  20701. this.displayList = [];
  20702. this.ui.skillNode.skillList.numItems = 3;
  20703. this.addUIClick(this.ui, this.interuptSecretary);
  20704. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  20705. this.ui.talkNode.visible = false;
  20706. if (Moyu.isKs)
  20707. this.ui.closeNode.closeBtn.x += 100;
  20708. }
  20709. show() {
  20710. super.show();
  20711. this.playSecretaryIdle();
  20712. this.moneyNode.ui.c1.selectedIndex = 1;
  20713. Laya.timer.clearAll(this);
  20714. xGame.soundMgr.playSound("s_start");
  20715. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20716. let guide = DataMgr.getSkillGuide();
  20717. this.ui.guideNode.visible = guide == 0;
  20718. let item = this.getSkillItemByUIIndex(0);
  20719. if (guide == 0) {
  20720. item.ui.c1.selectedIndex = 1;
  20721. }
  20722. else {
  20723. item.ui.c1.selectedIndex = 0;
  20724. }
  20725. this.ui.guideNode.guideBtn.visible = guide == 0;
  20726. for (let index = 0; index < this.displayList.length; index++) {
  20727. this.displayList[index].checkTry();
  20728. }
  20729. }
  20730. getSkillItemByUIIndex(cur) {
  20731. for (let index = 0; index < this.displayList.length; index++) {
  20732. if (this.displayList[index].index == cur) {
  20733. return this.displayList[index];
  20734. }
  20735. }
  20736. }
  20737. enterGuideLevel() {
  20738. let item = this.getSkillItemByUIIndex(0);
  20739. item.startGame();
  20740. if (DataMgr.getNewUser())
  20741. Moyu.sendDataEvent("gameStart1");
  20742. }
  20743. initSkillData() {
  20744. this.skillData = [];
  20745. let nameList = xGame.common.skillNameList;
  20746. let iconList = xGame.common.skillIconList;
  20747. let describeList = [
  20748. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  20749. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  20750. "The power of frost descends—freezing the flow and taking full control of the game!"
  20751. ];
  20752. console.log('zh:initSkillData 111111111');
  20753. let data;
  20754. for (let index = 0; index < nameList.length; index++) {
  20755. data = {};
  20756. data.name = nameList[index];
  20757. data.icon = iconList[index];
  20758. data.describe = describeList[index];
  20759. data.index = index;
  20760. this.skillData.push(data);
  20761. }
  20762. }
  20763. updateSkillItem(index, target) {
  20764. if (this.displayList[index] == null) {
  20765. let uiIndex;
  20766. switch (index) {
  20767. case 0:
  20768. uiIndex = 1;
  20769. break;
  20770. case 1:
  20771. uiIndex = 0;
  20772. break;
  20773. case 2:
  20774. uiIndex = 2;
  20775. break;
  20776. case 3:
  20777. uiIndex = 3;
  20778. break;
  20779. default:
  20780. break;
  20781. }
  20782. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  20783. this.displayList.push(temp);
  20784. }
  20785. }
  20786. playSecretaryIdle() {
  20787. let parent = this.ui.secretary.displayObject;
  20788. parent.destroyChildren();
  20789. let xx = this.ui.secretary.width / 2;
  20790. let yy = this.ui.secretary.height;
  20791. let scale = xGame.common.getSecretaryScale();
  20792. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20793. xGame.common.secretary.play(data, 0, true, parent);
  20794. }
  20795. returnUIMain() {
  20796. this.hide();
  20797. xGame.common.stopGirlPop(this.ui.talkNode);
  20798. xGame.uiMgr.Show(UIMain$1);
  20799. }
  20800. interuptSecretary() {
  20801. Laya.timer.clearAll(this);
  20802. this.playSecretaryRandomSound();
  20803. }
  20804. playSecretaryRandomSound() {
  20805. if (this.isHide)
  20806. return;
  20807. let time = xGame.common.randomNum(45000, 60000);
  20808. Laya.timer.once(time, this, () => {
  20809. if (this.isHide)
  20810. return;
  20811. let index = xGame.common.randomNum(4, 7);
  20812. xGame.soundMgr.playSound("s_main0" + index);
  20813. let words = 1;
  20814. switch (index) {
  20815. case 4:
  20816. words = 5;
  20817. break;
  20818. case 5:
  20819. words = 3;
  20820. break;
  20821. case 6:
  20822. words = 6;
  20823. break;
  20824. case 7:
  20825. words = 7;
  20826. break;
  20827. default:
  20828. break;
  20829. }
  20830. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20831. this.playSecretaryRandomSound();
  20832. });
  20833. }
  20834. }
  20835. UISkill$1.uiName = "UISkill";
  20836. class UIAddProp$1 extends UIBase {
  20837. constructor() {
  20838. super();
  20839. this.curType = "";
  20840. }
  20841. onConstructor() {
  20842. this.ui = ui_UIAddProp.createInstance();
  20843. this.contentPane = this.ui;
  20844. this.isEject = false;
  20845. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  20846. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  20847. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  20848. this.updateUI();
  20849. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  20850. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  20851. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  20852. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  20853. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  20854. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  20855. }
  20856. show(type) {
  20857. super.show();
  20858. this.curType = type == 0 ? "coin" : "diamond";
  20859. this.switchBtn("");
  20860. this.ui.t0.play();
  20861. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  20862. PlatMgr.showInsert(true);
  20863. }
  20864. closeSelf() {
  20865. this.hide();
  20866. }
  20867. updateUI() {
  20868. let data = cfgTable.moneyData;
  20869. let temp;
  20870. let obj;
  20871. for (const key in data) {
  20872. temp = data[key];
  20873. obj = this.ui.myNode["node" + key];
  20874. if (parseInt(key) <= 2) {
  20875. obj.diamondTxt.text = "+" + temp.num;
  20876. }
  20877. else {
  20878. obj.coinTxt.text = temp.num;
  20879. obj.diamondTxt.text = temp.get.split('_')[1];
  20880. }
  20881. }
  20882. this.updateDiamondShare();
  20883. }
  20884. updateDiamondShare() {
  20885. let data = DataMgr.getShareDiamondTimes();
  20886. if (data >= xGame.common.maxShareDiamondTimes) {
  20887. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  20888. this.ui.myNode.node1.touchable = false;
  20889. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20890. }
  20891. else {
  20892. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  20893. this.ui.myNode.node1.touchable = true;
  20894. }
  20895. }
  20896. switchBtn(type) {
  20897. if (type == "")
  20898. type = this.curType;
  20899. else {
  20900. if (this.curType == type) {
  20901. return;
  20902. }
  20903. else {
  20904. this.curType = type;
  20905. }
  20906. }
  20907. if (type == "coin") {
  20908. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  20909. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  20910. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  20911. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  20912. this.ui.myNode.c1.selectedIndex = 0;
  20913. }
  20914. else {
  20915. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  20916. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  20917. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  20918. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  20919. this.ui.myNode.c1.selectedIndex = 1;
  20920. }
  20921. }
  20922. convertCoin(index) {
  20923. let data = cfgTable.moneyData[index];
  20924. let coinNum = data.num;
  20925. let str = data.get.split('_')[1];
  20926. let needDiamond = parseInt(str);
  20927. if (DataMgr.diamondEnough(needDiamond)) {
  20928. DataMgr.setDiamond(-needDiamond);
  20929. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  20930. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  20931. }
  20932. else {
  20933. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  20934. this.switchBtn("diamond");
  20935. }
  20936. }
  20937. videoGetDiamond() {
  20938. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  20939. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  20940. }
  20941. else {
  20942. console.log('zh:AD 失败,直接发放奖励');
  20943. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  20944. }
  20945. }
  20946. qjff_AD_for_uiAddProp_videoGetDiamond() {
  20947. let num = cfgTable.moneyData[2].num;
  20948. xGame.common.playObjFlyAnim(num, Prop.diamond);
  20949. this.closeSelf();
  20950. }
  20951. videoGetCoin() {
  20952. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  20953. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  20954. }
  20955. else {
  20956. console.log('zh:AD 失败,直接发放奖励');
  20957. this.qjff_AD_for_uiAddProp_videoGetCoin();
  20958. }
  20959. }
  20960. qjff_AD_for_uiAddProp_videoGetCoin() {
  20961. xGame.common.playObjFlyAnim(2000, Prop.coin);
  20962. this.closeSelf();
  20963. }
  20964. shareGetDiamond() {
  20965. let times = DataMgr.getShareDiamondTimes();
  20966. if (times >= xGame.common.maxShareDiamondTimes) {
  20967. console.log('zh: 233333333333 maxShareDiamondTimes');
  20968. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20969. }
  20970. else {
  20971. console.log('zh:33333333333333ad');
  20972. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  20973. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  20974. }
  20975. else {
  20976. console.log('zh:AD 失败,直接发放奖励');
  20977. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  20978. }
  20979. }
  20980. }
  20981. qjff_AD_for_uiAddProp_shareGetDiamond() {
  20982. let diamond = xGame.common.randomNum(50, 100);
  20983. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  20984. DataMgr.setShareDiamondTimes(1);
  20985. this.updateDiamondShare();
  20986. }
  20987. openPutBallView() {
  20988. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  20989. let skill = xGame.uiMgr.getUI(UISkill$1);
  20990. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  20991. let uigame = xGame.uiMgr.getUI(UIGame$1);
  20992. if (end && !end.isHide) {
  20993. xGame.uiMgr.Hide(UIGameEnd$1);
  20994. xGame.uiMgr.Show(UIMain$1);
  20995. }
  20996. if (skill && !skill.isHide)
  20997. xGame.uiMgr.Hide(UISkill$1);
  20998. if (uigame && !uigame.isHide)
  20999. xGame.uiMgr.Hide(UIGame$1);
  21000. if (level && !level.isHide) {
  21001. }
  21002. else {
  21003. xGame.uiMgr.Show(UILevelDisplay$1);
  21004. }
  21005. this.closeSelf();
  21006. }
  21007. }
  21008. UIAddProp$1.uiName = "UIAddProp";
  21009. class MoneyNode$1 {
  21010. constructor(ui) {
  21011. this.leftTime = 0;
  21012. this.ui = ui;
  21013. this.ui.addCoinBtn.onClick(this, this.addCoin);
  21014. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  21015. this.ui.addPowerBtn.onClick(this, this.addPower);
  21016. this.ui.c1.selectedIndex = 1;
  21017. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  21018. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  21019. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  21020. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  21021. this.coinChange();
  21022. this.diamondChange();
  21023. this.powerChange();
  21024. }
  21025. addPower() {
  21026. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21027. xGame.uiMgr.Show(UIPower$1);
  21028. }
  21029. powerChange() {
  21030. let powerNum = DataMgr.getPower();
  21031. this.ui.powerTxt.text = powerNum + "";
  21032. }
  21033. checkPowerTime() {
  21034. let cur = new Date().getTime();
  21035. let last = DataMgr.getPowerTime();
  21036. if (last == 0) {
  21037. last = cur;
  21038. DataMgr.setPowerTime(cur);
  21039. }
  21040. let power = DataMgr.getPower();
  21041. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  21042. Laya.timer.clearAll(this);
  21043. if (power >= xGame.common.natureMaxPower) {
  21044. this.ui.powerTimeTxt.text = "";
  21045. DataMgr.setPowerTime(cur);
  21046. return;
  21047. }
  21048. if (power + offset >= xGame.common.natureMaxPower) {
  21049. DataMgr.setPower(xGame.common.natureMaxPower, false);
  21050. this.ui.powerTimeTxt.text = "";
  21051. DataMgr.setPowerTime(cur);
  21052. }
  21053. else {
  21054. if (offset > 0) {
  21055. DataMgr.setPower(offset);
  21056. DataMgr.setPowerTime(cur);
  21057. }
  21058. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  21059. this.leftTime = xGame.common.powerRecoverNum - time;
  21060. if (this.leftTime <= 0)
  21061. this.leftTime = 0;
  21062. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21063. Laya.timer.loop(1000, this, this.updatePowerTime);
  21064. }
  21065. }
  21066. updatePowerTime() {
  21067. this.leftTime -= 1;
  21068. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21069. if (this.leftTime <= 0) {
  21070. this.checkPowerTime();
  21071. }
  21072. }
  21073. coinChange() {
  21074. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  21075. }
  21076. diamondChange() {
  21077. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  21078. }
  21079. addCoin() {
  21080. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21081. Moyu.sendDataEvent("AddCoinBtn");
  21082. xGame.uiMgr.Show(UIAddProp$1, 0);
  21083. }
  21084. addDiamond() {
  21085. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21086. Moyu.sendDataEvent("AddDiamondBtn");
  21087. xGame.uiMgr.Show(UIAddProp$1, 1);
  21088. }
  21089. }
  21090. class SettingNode$1 {
  21091. constructor(ui) {
  21092. this.showSetting = false;
  21093. this.openSound = true;
  21094. this.openShake = true;
  21095. this.ui = ui;
  21096. this.ui.soundBtn.onClick(this, this.switchSound);
  21097. this.ui.shakeBtn.onClick(this, this.switchShake);
  21098. this.ui.xyBtn.onClick(this, this.onXy);
  21099. this.ui.clickNode.onClick(this, this.changeSetting);
  21100. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  21101. this.ui.xyBtn.visible = false;
  21102. this.ui.shakeBtn.visible = false;
  21103. }
  21104. changeSetting() {
  21105. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21106. this.showSetting = !this.showSetting;
  21107. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  21108. }
  21109. switchSound() {
  21110. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21111. this.openSound = !this.openSound;
  21112. Moyu.onSetting(this.openSound, this.openShake);
  21113. xGame.soundMgr.onSetting(this.openSound);
  21114. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  21115. }
  21116. switchShake() {
  21117. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21118. this.openShake = !this.openShake;
  21119. Moyu.onSetting(this.openSound, this.openShake);
  21120. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  21121. }
  21122. onXy() {
  21123. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21124. MoyuMgr$1.showXy(1);
  21125. }
  21126. }
  21127. class UIDraw$1 extends UIBase {
  21128. constructor() {
  21129. super();
  21130. this.curKey = 0;
  21131. }
  21132. onConstructor() {
  21133. this.ui = ui_UIDraw.createInstance();
  21134. this.contentPane = this.ui;
  21135. this.isEject = false;
  21136. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21137. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21138. this.addUIClick(this.ui.drawBtn, this.startDraw);
  21139. this.initDraw();
  21140. this.initUI();
  21141. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21142. if (Moyu.isKs)
  21143. this.ui.closeNode.closeBtn.x += 100;
  21144. }
  21145. show() {
  21146. super.show();
  21147. this.ui.t0.play();
  21148. this.playSecretaryIdle();
  21149. this.updateDraw();
  21150. this.checkFree();
  21151. if (PlatMgr.bannerDelay > 0) {
  21152. this.ui.closeNode.closeBtn.visible = false;
  21153. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  21154. this.ui.closeNode.closeBtn.visible = true;
  21155. });
  21156. }
  21157. PlatMgr.showRateBanner();
  21158. }
  21159. hide() {
  21160. Laya.timer.clearAll(this);
  21161. super.hide();
  21162. }
  21163. checkFree() {
  21164. let isFree = DataMgr.getDailyfreeDrawTimes();
  21165. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  21166. }
  21167. initDraw() {
  21168. this.drawObj = [];
  21169. let data = cfgTable.drawData;
  21170. let temp;
  21171. let weight = 0;
  21172. for (const key in data) {
  21173. temp = data[key];
  21174. weight += temp.weight;
  21175. this.drawObj.push(weight);
  21176. }
  21177. this.allWeight = weight;
  21178. }
  21179. initUI() {
  21180. let data = cfgTable.drawData;
  21181. let temp;
  21182. let img;
  21183. let txt;
  21184. for (const key in data) {
  21185. temp = data[key];
  21186. img = this.ui.myNode.rotNode["img" + key];
  21187. txt = this.ui.myNode.rotNode["txt" + key];
  21188. img.url = xGame.common.getGameIconUrl(temp.icon);
  21189. txt.visible = true;
  21190. if (temp.award > 2) {
  21191. img.rotation = 0;
  21192. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  21193. }
  21194. else {
  21195. img.rotation = temp.rotation;
  21196. txt.text = temp.num;
  21197. }
  21198. }
  21199. }
  21200. getCurkey() {
  21201. let rand = Math.random() * this.allWeight;
  21202. let temp;
  21203. for (let index = 0; index < this.drawObj.length - 1; index++) {
  21204. temp = this.drawObj[index];
  21205. if (index == 0) {
  21206. if (rand < temp) {
  21207. return index + 1;
  21208. }
  21209. }
  21210. else {
  21211. if (rand >= temp && rand < this.drawObj[index + 1]) {
  21212. return index + 1;
  21213. }
  21214. }
  21215. }
  21216. return 2;
  21217. }
  21218. startDraw() {
  21219. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  21220. if (freeTimes > 0) {
  21221. this.beginDraw();
  21222. DataMgr.setDailyfreeDrawTimes(0);
  21223. this.checkFree();
  21224. }
  21225. else {
  21226. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  21227. }
  21228. else {
  21229. console.log('zh:AD 失败,直接发放奖励');
  21230. this.qjff_chouJiang();
  21231. }
  21232. }
  21233. }
  21234. qjff_chouJiang() {
  21235. this.beginDraw();
  21236. }
  21237. beginDraw() {
  21238. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  21239. this.ui.drawBtn.touchable = false;
  21240. this.curKey = this.getCurkey();
  21241. console.log("当前key", this.curKey);
  21242. let cell = 60;
  21243. let lap = 3;
  21244. let angle = cell * (this.curKey - 1) + lap * 360;
  21245. let target = this.ui.myNode.rotNode;
  21246. target.rotation = 0;
  21247. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  21248. console.log("旋转完成");
  21249. this.ui.drawBtn.touchable = true;
  21250. this.getAward();
  21251. }));
  21252. }
  21253. getAward() {
  21254. let data = cfgTable.drawData[this.curKey];
  21255. let temp = new AwardType();
  21256. temp.type = data.award;
  21257. temp.num = data.num;
  21258. xGame.common.getAward([temp], () => {
  21259. DataMgr.setDrawTimes(1);
  21260. this.updateDraw();
  21261. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21262. });
  21263. }
  21264. updateDraw() {
  21265. let drawTimes = DataMgr.getDrawTimes();
  21266. let awardTimes = DataMgr.getDrawAwardTimes();
  21267. if (Math.floor(drawTimes / 3) > awardTimes) {
  21268. this.ui.extraNode.boxBtn.t0.play(null, -1);
  21269. this.ui.extraNode.boxBtn.touchable = true;
  21270. this.ui.extraNode.tipsTxt.text = "3/3";
  21271. this.ui.extraNode.barNode.width = 265;
  21272. this.getExtraAward();
  21273. }
  21274. else {
  21275. this.ui.extraNode.boxBtn.t0.stop();
  21276. this.ui.extraNode.boxBtn.touchable = false;
  21277. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  21278. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  21279. }
  21280. let data = cfgTable.drawData[1];
  21281. if (awardTimes == 0) {
  21282. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  21283. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  21284. this.ui.myNode.rotNode.img1.rotation = 0;
  21285. }
  21286. else {
  21287. let award = data.nextid;
  21288. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  21289. this.ui.myNode.rotNode.txt1.text = award[1];
  21290. this.ui.myNode.rotNode.img1.rotation = 0;
  21291. }
  21292. }
  21293. getExtraAward() {
  21294. let drawTimes = DataMgr.getDrawTimes();
  21295. let awardTimes = DataMgr.getDrawAwardTimes();
  21296. let data = cfgTable.drawData[1];
  21297. let award = new AwardType();
  21298. if (awardTimes == 0) {
  21299. award.num = data.num;
  21300. award.type = data.award;
  21301. xGame.common.getAward([award], () => {
  21302. let all = Math.floor(drawTimes / 3);
  21303. DataMgr.setDrawAwardTimes(all);
  21304. this.updateDraw();
  21305. });
  21306. }
  21307. else {
  21308. award.num = parseInt(data.nextid[1]);
  21309. award.type = parseInt(data.nextid[0]);
  21310. xGame.common.getAward([award], () => {
  21311. let all = Math.floor(drawTimes / 3);
  21312. DataMgr.setDrawAwardTimes(all);
  21313. this.updateDraw();
  21314. });
  21315. }
  21316. }
  21317. closeSelf() {
  21318. this.hide();
  21319. }
  21320. playSecretaryIdle() {
  21321. let parent = this.ui.secretary.displayObject;
  21322. parent.destroyChildren();
  21323. let xx = this.ui.secretary.width / 2;
  21324. let yy = this.ui.secretary.height;
  21325. let scale = xGame.common.getSecretaryScale();
  21326. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21327. xGame.common.secretary.play(data, 0, true, parent);
  21328. }
  21329. }
  21330. UIDraw$1.uiName = "UIDraw";
  21331. class UIRanking$1 extends UIBase {
  21332. constructor() {
  21333. super();
  21334. this.showSelf = true;
  21335. this.rankType = 1;
  21336. this.rankList = [];
  21337. this.topX = 10;
  21338. this.myIndex = this.topX + 1;
  21339. this.myStar = 0;
  21340. }
  21341. onConstructor() {
  21342. this.ui = ui_UIRanking.createInstance();
  21343. this.contentPane = this.ui;
  21344. this.isEject = false;
  21345. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  21346. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  21347. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  21348. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  21349. this.ui.myNode.myList.setVirtual();
  21350. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  21351. }
  21352. show() {
  21353. super.show();
  21354. this.getPaiHangBangDataFormJosnFile();
  21355. this.updateSelf();
  21356. let self = Moyu.getUserInfo();
  21357. if (!self.isAuth) {
  21358. Moyu.initUser(this, () => {
  21359. DataMgr.upRankData();
  21360. });
  21361. }
  21362. }
  21363. getPaiHangBangDataFormJosnFile() {
  21364. const rankingList = cfgTable.paiHangBangData.list;
  21365. this.updateItemData(rankingList);
  21366. }
  21367. updateSelfItem() {
  21368. console.log('zh:Moyu.platType =' + Moyu.platType);
  21369. let self = Moyu.getUserInfo();
  21370. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  21371. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  21372. if (this.myIndex > this.topX) {
  21373. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  21374. }
  21375. else {
  21376. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  21377. }
  21378. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  21379. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  21380. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  21381. }
  21382. updateItemData(data) {
  21383. this.myStar = xGame.common.getAllStarNum();
  21384. if (this.rankList.length < 2) {
  21385. this.rankList = data;
  21386. let self = Moyu.getUserInfo();
  21387. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  21388. self.headIcon = self.headIcon;
  21389. for (let i = 0; i < data.length; i++) {
  21390. let data = this.rankList[i];
  21391. if (data.userId == self.userId) {
  21392. this.rankList.splice(i, 1);
  21393. break;
  21394. }
  21395. }
  21396. for (let i = 0; i < data.length; i++) {
  21397. let data = this.rankList[i];
  21398. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  21399. this.myIndex = i + 1;
  21400. let user = { headIcon: self.headIcon, nickName: "myself" };
  21401. let ud = { user: user, data: {} };
  21402. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  21403. console.log('zh:Moyu.platType = ' + Moyu.platType);
  21404. if (Moyu.platType < 11) {
  21405. user.headIcon = self.headIcon;
  21406. user.nickName = self.nickName;
  21407. }
  21408. this.rankList.splice(i, 0, md);
  21409. break;
  21410. }
  21411. }
  21412. }
  21413. this.updateSelfItem();
  21414. this.ui.myNode.myList.numItems = this.rankList.length;
  21415. }
  21416. updateItemUI(index, obj) {
  21417. let data = this.rankList[index];
  21418. let userData = JSON.parse(data.userData).user;
  21419. obj.nameTxt.text = userData.nickName.toString();
  21420. obj.valueTxt.text = data.rankScore;
  21421. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  21422. obj.rankTxt.text = index + 1;
  21423. switch (index) {
  21424. case 0:
  21425. this.setImg(obj, 1, 0, 0);
  21426. obj.rankTxt.color = "#FFC047";
  21427. break;
  21428. case 1:
  21429. this.setImg(obj, 0, 1, 0);
  21430. obj.rankTxt.color = "#ACACAC";
  21431. break;
  21432. case 2:
  21433. this.setImg(obj, 0, 0, 1);
  21434. obj.rankTxt.color = "#D09672";
  21435. break;
  21436. default:
  21437. this.setImg(obj, 0, 0, 0);
  21438. obj.rankTxt.color = "#496FAB";
  21439. break;
  21440. }
  21441. }
  21442. setImg(obj, a, b, c) {
  21443. obj.img1.visible = a ? true : false;
  21444. obj.img2.visible = b ? true : false;
  21445. obj.img3.visible = c ? true : false;
  21446. }
  21447. changeList(type) {
  21448. this.rankType = type;
  21449. this.updateSelf();
  21450. }
  21451. changeSelfNode() {
  21452. this.showSelf = !this.showSelf;
  21453. this.updateSelf();
  21454. }
  21455. updateSelf() {
  21456. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  21457. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  21458. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21459. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  21460. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21461. }
  21462. }
  21463. UIRanking$1.uiName = "UIRanking";
  21464. class UISecretary$1 extends UIBase {
  21465. constructor() {
  21466. super();
  21467. this.curIndex = 1;
  21468. }
  21469. onConstructor() {
  21470. this.ui = ui_UISecretary.createInstance();
  21471. this.contentPane = this.ui;
  21472. this.isEject = false;
  21473. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21474. this.nodeObj = { left: null, right: null, cur: null };
  21475. this.nodeObj.cur = this.ui.myNode.gameNode3;
  21476. }
  21477. show() {
  21478. super.show();
  21479. this.ui.t0.play();
  21480. this.updateData();
  21481. }
  21482. addSecretarySpine(node, spineName) {
  21483. if (spineName == "mishu") {
  21484. if (this.secretarySpine1) {
  21485. node.displayObject.destroyChildren();
  21486. this.playWoman(this.secretarySpine1, node.displayObject);
  21487. }
  21488. else {
  21489. let spine1 = new SpineMgr("mishu", () => {
  21490. this.secretarySpine1 = spine1;
  21491. this.playWoman(this.secretarySpine1, node.displayObject);
  21492. });
  21493. }
  21494. }
  21495. else {
  21496. if (this.secretarySpine2) {
  21497. node.displayObject.destroyChildren();
  21498. this.playWoman(this.secretarySpine2, node.displayObject);
  21499. }
  21500. else {
  21501. let spine2 = new SpineMgr("xiaomishu2", () => {
  21502. this.secretarySpine2 = spine2;
  21503. this.playWoman(this.secretarySpine2, node.displayObject);
  21504. });
  21505. }
  21506. }
  21507. }
  21508. playWoman(node, parent) {
  21509. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  21510. let yy = this.ui.myNode.gameNode3.secretary.height;
  21511. let scale = 1.5;
  21512. if (node == this.secretarySpine2) {
  21513. scale = 1.2;
  21514. }
  21515. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21516. node.play(data, 0, true, parent);
  21517. }
  21518. turnLeft() {
  21519. this.curIndex--;
  21520. if (this.curIndex < 1) {
  21521. this.curIndex = 2;
  21522. }
  21523. let left = this.nodeObj.left;
  21524. let right = this.nodeObj.right;
  21525. let cur = this.nodeObj.cur;
  21526. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21527. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21528. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21529. this.updateData();
  21530. }));
  21531. this.ui.myNode.setChildIndex(right, 2);
  21532. this.nodeObj.left = cur;
  21533. this.nodeObj.right = left;
  21534. this.nodeObj.cur = right;
  21535. }
  21536. turnRight() {
  21537. this.curIndex++;
  21538. if (this.curIndex > 2) {
  21539. this.curIndex = 1;
  21540. }
  21541. let left = this.nodeObj.left;
  21542. let right = this.nodeObj.right;
  21543. let cur = this.nodeObj.cur;
  21544. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21545. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21546. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21547. this.updateData();
  21548. }));
  21549. this.ui.myNode.setChildIndex(left, 2);
  21550. this.nodeObj.left = right;
  21551. this.nodeObj.right = cur;
  21552. this.nodeObj.cur = left;
  21553. }
  21554. updateData() {
  21555. console.log('zh: updateData FFFFFFFFFF');
  21556. let data = cfgTable.secretaryshopData;
  21557. let children = this.ui.myNode._children;
  21558. let temp;
  21559. let curData;
  21560. for (let index = 0; index < children.length; index++) {
  21561. temp = children[index];
  21562. curData = data[1];
  21563. temp.heightTxt.text = curData.height;
  21564. temp.foodTxt.text = curData.food;
  21565. temp.historyTxt.text = curData.history;
  21566. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  21567. this.addSecretarySpine(temp.secretary, curData.spine);
  21568. let womanIndex = curData.id - 1;
  21569. let getWoman = DataMgr.getSecretary(womanIndex);
  21570. let curUse = DataMgr.getCurSecretary();
  21571. if (getWoman) {
  21572. if (curUse == womanIndex) {
  21573. temp.purchaseBtn.c1.selectedIndex = 1;
  21574. }
  21575. else {
  21576. temp.purchaseBtn.c1.selectedIndex = 2;
  21577. }
  21578. }
  21579. else {
  21580. temp.purchaseBtn.c1.selectedIndex = 0;
  21581. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  21582. }
  21583. temp.purchaseBtn.visible = false;
  21584. }
  21585. }
  21586. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  21587. console.log('zh: 点击了clickSecretary ');
  21588. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21589. if (getWoman) {
  21590. if (curUse != womanIndex) {
  21591. console.log();
  21592. DataMgr.setCurSecretary(womanIndex);
  21593. this.updateData();
  21594. }
  21595. }
  21596. else {
  21597. console.log('zh:点击购买了');
  21598. let need = needDiamond;
  21599. if (DataMgr.diamondEnough(need)) {
  21600. DataMgr.setDiamond(-need);
  21601. DataMgr.setSecretary(womanIndex, 1);
  21602. DataMgr.setCurSecretary(womanIndex);
  21603. this.updateData();
  21604. }
  21605. else {
  21606. xGame.uiMgr.Show(UIAddProp$1, 1);
  21607. }
  21608. }
  21609. }
  21610. closeSelf() {
  21611. this.hide();
  21612. }
  21613. }
  21614. UISecretary$1.uiName = "UISecretary";
  21615. class BallRodDisplay$1 {
  21616. constructor(ui, index) {
  21617. this.index = 0;
  21618. this.uiIndex = 0;
  21619. this.ui = ui;
  21620. this.index = index;
  21621. this.initData();
  21622. }
  21623. initData() {
  21624. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  21625. let data = cfgTable.ballrodData[this.index + 1];
  21626. this.ui.nameTxt.text = data.name;
  21627. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  21628. this.ui.levelNode.c1.selectedIndex = data.quality;
  21629. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  21630. if (data.spine) {
  21631. this.mySpine = new SpineMgr(data.spine, () => {
  21632. let xx = 150;
  21633. let yy = 70;
  21634. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  21635. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  21636. });
  21637. }
  21638. }
  21639. updateSelf() {
  21640. console.log('zh:updateSelf -------------- ');
  21641. let get = DataMgr.getBallRod(this.index);
  21642. if (get == null)
  21643. get = 1;
  21644. let curUse = DataMgr.getCurBallRod();
  21645. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  21646. if (get) {
  21647. if (curUse == this.index) {
  21648. this.ui.purchaseBtn.c1.selectedIndex = 0;
  21649. }
  21650. else {
  21651. this.ui.purchaseBtn.c1.selectedIndex = 1;
  21652. }
  21653. }
  21654. else {
  21655. this.ui.purchaseBtn.c1.selectedIndex = 2;
  21656. }
  21657. }
  21658. buyBallRod() {
  21659. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21660. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  21661. switch (selectedIndex) {
  21662. case 0:
  21663. break;
  21664. case 1:
  21665. console.log('zh:点击了 USE THIS');
  21666. DataMgr.setCurBallRod(this.index);
  21667. let curUse = DataMgr.getCurBallRod();
  21668. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  21669. let ui = xGame.uiMgr.getUI(UIShop$1);
  21670. ui.updateBallRod();
  21671. break;
  21672. case 2:
  21673. let data = cfgTable.ballrodData[this.index + 1];
  21674. let need = data.price;
  21675. if (DataMgr.diamondEnough(need)) {
  21676. DataMgr.setDiamond(-need);
  21677. DataMgr.setBallRod(this.index, 1);
  21678. DataMgr.setCurBallRod(this.index);
  21679. let ui = xGame.uiMgr.getUI(UIShop$1);
  21680. ui.updateBallRod();
  21681. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  21682. }
  21683. else {
  21684. xGame.uiMgr.Show(UIAddProp$1, 1);
  21685. }
  21686. break;
  21687. default:
  21688. break;
  21689. }
  21690. }
  21691. logEventForGouMaiGan(qiuGanName) {
  21692. const ev = {
  21693. value: qiuGanName
  21694. };
  21695. const jsonStr = JSON.stringify(ev);
  21696. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  21697. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  21698. }
  21699. }
  21700. class UIShop$1 extends UIBase {
  21701. constructor() {
  21702. super();
  21703. this.itemNums = 0;
  21704. this.curType = "";
  21705. }
  21706. onConstructor() {
  21707. this.ui = ui_UIShop.createInstance();
  21708. this.contentPane = this.ui;
  21709. this.isEject = false;
  21710. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21711. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21712. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  21713. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  21714. this.addUIClick(this.ui, this.interuptSecretary);
  21715. console.log('zh:this.renderBallRodthis.renderBallRodthis.renderBallRodthis.renderBallRod = ' + this.renderBallRod);
  21716. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  21717. this.ballRodArr = [];
  21718. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  21719. this.ui.myNode.myList.numItems = this.itemNums;
  21720. }
  21721. show(type) {
  21722. super.show();
  21723. console.log('zh:show type = ' + type);
  21724. this.curType = type == 0 ? "qiugan" : "daoju";
  21725. this.switchBtn("qiugan");
  21726. this.playSecretaryIdle();
  21727. this.updateBallRod();
  21728. }
  21729. test123() {
  21730. console.log('zh:test123 ');
  21731. }
  21732. switchBtn(type) {
  21733. console.log('zh:1111切換 sel type=' + type);
  21734. if (type == "") {
  21735. type = this.curType;
  21736. }
  21737. else {
  21738. if (this.curType == type) {
  21739. return;
  21740. }
  21741. else {
  21742. this.curType = type;
  21743. }
  21744. }
  21745. if (type == "qiugan") {
  21746. console.log('zh:qg sel');
  21747. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  21748. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  21749. this.ui.myNode.myList.visible = true;
  21750. this.ui.myNode.djList.visible = false;
  21751. }
  21752. else {
  21753. console.log('zh:dj sel');
  21754. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  21755. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  21756. this.ui.myNode.myList.visible = false;
  21757. this.ui.myNode.djList.visible = true;
  21758. }
  21759. }
  21760. updateBallRod() {
  21761. for (let index = 0; index < this.ballRodArr.length; index++) {
  21762. this.ballRodArr[index].updateSelf();
  21763. }
  21764. }
  21765. renderBallRod(sort, obj) {
  21766. let index = this.getIndexBySort(sort + 1) - 1;
  21767. let ballRod = new BallRodDisplay$1(obj, index);
  21768. this.ballRodArr.push(ballRod);
  21769. }
  21770. getIndexBySort(sort) {
  21771. let object = cfgTable.ballrodData;
  21772. for (const key in object) {
  21773. if (object[key].sort == sort) {
  21774. return parseInt(key);
  21775. }
  21776. }
  21777. }
  21778. playSecretaryIdle() {
  21779. let parent = this.ui.secretary.displayObject;
  21780. parent.destroyChildren();
  21781. let xx = this.ui.secretary.width / 2;
  21782. let yy = this.ui.secretary.height;
  21783. let scale = xGame.common.getSecretaryScale();
  21784. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21785. xGame.common.secretary.play(data, 0, true, parent);
  21786. }
  21787. interuptSecretary() {
  21788. Laya.timer.clearAll(this);
  21789. this.playSecretaryRandomSound();
  21790. }
  21791. playSecretaryRandomSound() {
  21792. if (this.isHide)
  21793. return;
  21794. let time = xGame.common.randomNum(45000, 60000);
  21795. Laya.timer.once(time, this, () => {
  21796. if (this.isHide)
  21797. return;
  21798. let index = xGame.common.randomNum(4, 7);
  21799. xGame.soundMgr.playSound("s_main0" + index);
  21800. let words = 1;
  21801. switch (index) {
  21802. case 4:
  21803. words = 5;
  21804. break;
  21805. case 5:
  21806. words = 3;
  21807. break;
  21808. case 6:
  21809. words = 6;
  21810. break;
  21811. case 7:
  21812. words = 7;
  21813. break;
  21814. default:
  21815. break;
  21816. }
  21817. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21818. this.playSecretaryRandomSound();
  21819. });
  21820. }
  21821. closeSelf() {
  21822. this.hide();
  21823. }
  21824. }
  21825. UIShop$1.uiName = "UIShop";
  21826. class SignMax$1 {
  21827. constructor(ui) {
  21828. this.ui = ui;
  21829. }
  21830. updateSelf(index, sameDay, curDayIndex) {
  21831. let data = cfgTable.signData[index + 1];
  21832. this.ui.titleTxt.text = data.title;
  21833. let arr1 = data.award[0].split('-');
  21834. let arr2 = data.award[1].split('-');
  21835. let num1 = parseInt(arr1[1]);
  21836. let num2 = parseInt(arr2[1]);
  21837. this.ui.numTxt1.text = num1 + "";
  21838. this.ui.numTxt2.text = num2 + "";
  21839. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  21840. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  21841. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  21842. this.ui.numTxt1.visible = false;
  21843. }
  21844. else {
  21845. this.ui.numTxt1.visible = true;
  21846. }
  21847. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  21848. this.ui.numTxt2.visible = false;
  21849. }
  21850. else {
  21851. this.ui.numTxt2.visible = true;
  21852. }
  21853. if (index < curDayIndex) {
  21854. this.ui.c1.selectedIndex = 1;
  21855. }
  21856. else if (index == curDayIndex) {
  21857. if (sameDay) {
  21858. this.ui.c1.selectedIndex = 2;
  21859. }
  21860. else {
  21861. this.ui.c1.selectedIndex = 2;
  21862. }
  21863. }
  21864. else {
  21865. this.ui.c1.selectedIndex = 0;
  21866. }
  21867. }
  21868. }
  21869. class SignNormal$1 {
  21870. constructor(ui) {
  21871. this.ui = ui;
  21872. }
  21873. updateSelf(index, sameDay, curDayIndex) {
  21874. let data = cfgTable.signData[index + 1];
  21875. this.ui.titleTxt.text = data.title;
  21876. let arr = data.award[0].split('-');
  21877. let type = parseInt(arr[0]);
  21878. let num = parseInt(arr[1]);
  21879. this.ui.numTxt.text = num + "";
  21880. if (type > 2) {
  21881. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  21882. this.ui.myIcon.rotation = 0;
  21883. }
  21884. else {
  21885. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  21886. this.ui.myIcon.rotation = 0;
  21887. }
  21888. if (xGame.common.signAwardContainsRod(data.award)) {
  21889. this.ui.numTxt.visible = false;
  21890. }
  21891. else {
  21892. this.ui.numTxt.visible = true;
  21893. }
  21894. if (index < curDayIndex) {
  21895. this.ui.c1.selectedIndex = 1;
  21896. }
  21897. else if (index == curDayIndex) {
  21898. if (sameDay) {
  21899. this.ui.c1.selectedIndex = 2;
  21900. }
  21901. else {
  21902. this.ui.c1.selectedIndex = 2;
  21903. }
  21904. }
  21905. else {
  21906. this.ui.c1.selectedIndex = 0;
  21907. }
  21908. }
  21909. }
  21910. class UISign$1 extends UIBase {
  21911. constructor() {
  21912. super();
  21913. this.curDayIndex = 0;
  21914. this.starX = 0;
  21915. }
  21916. onConstructor() {
  21917. this.ui = ui_UISign.createInstance();
  21918. this.contentPane = this.ui;
  21919. this.isEject = false;
  21920. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21921. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21922. this.initSignItem();
  21923. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  21924. this.addUIClick(this.ui.againBtn, this.againGetAward);
  21925. }
  21926. show() {
  21927. super.show();
  21928. this.ui.t0.play();
  21929. this.playSecretaryIdle();
  21930. this.updateSign();
  21931. }
  21932. initSignItem() {
  21933. this.signArr = [];
  21934. for (let index = 0; index < 6; index++) {
  21935. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  21936. this.signArr.push(temp);
  21937. }
  21938. this.signMax = new SignMax$1(this.ui.myNode.day7);
  21939. if (Moyu.isKs)
  21940. this.ui.closeNode.closeBtn.x += 100;
  21941. }
  21942. updateSign() {
  21943. let sameDay = xGame.common.judgeSameDay();
  21944. let max = 7;
  21945. this.curDayIndex = DataMgr.getSignData();
  21946. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  21947. this.curDayIndex = 0;
  21948. if (!sameDay) {
  21949. this.ui.normalBtn.visible = true;
  21950. this.ui.tipsNode.visible = false;
  21951. this.ui.againBtn.visible = false;
  21952. }
  21953. else {
  21954. this.ui.normalBtn.visible = false;
  21955. let again = DataMgr.getExtraSign();
  21956. let isCurrency = false;
  21957. let index = this.curDayIndex;
  21958. if (index == 0)
  21959. index = 7;
  21960. let award = cfgTable.signData[index].award;
  21961. let num = award[0].split("-")[0];
  21962. if (num == "1" || num == "2")
  21963. isCurrency = true;
  21964. let showAgain = again == 0 && isCurrency;
  21965. this.ui.againBtn.visible = showAgain;
  21966. this.ui.tipsNode.visible = !showAgain;
  21967. }
  21968. for (let index = 0; index < this.signArr.length; index++) {
  21969. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  21970. }
  21971. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  21972. }
  21973. playSecretaryIdle() {
  21974. let parent = this.ui.secretary.displayObject;
  21975. parent.destroyChildren();
  21976. let xx = this.ui.secretary.width / 2;
  21977. let yy = this.ui.secretary.height;
  21978. let scale = xGame.common.getSecretaryScale();
  21979. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21980. xGame.common.secretary.play(data, 0, true, parent);
  21981. }
  21982. closeSelf() {
  21983. this.hide();
  21984. }
  21985. normalGetAward() {
  21986. let sameDay = xGame.common.judgeSameDay();
  21987. if (!sameDay) {
  21988. let award = cfgTable.signData[this.curDayIndex + 1].award;
  21989. let temp;
  21990. let type;
  21991. let num;
  21992. let arr = [];
  21993. for (let index = 0; index < award.length; index++) {
  21994. temp = award[index].split("-");
  21995. type = parseInt(temp[0]);
  21996. num = parseInt(temp[1]);
  21997. let awardType = new AwardType();
  21998. awardType.num = num;
  21999. awardType.type = type;
  22000. arr.push(awardType);
  22001. }
  22002. xGame.common.getAward(arr, (watchVideo) => {
  22003. this.curDayIndex++;
  22004. if (this.curDayIndex > 7)
  22005. this.curDayIndex = 0;
  22006. DataMgr.setSignData(this.curDayIndex);
  22007. DataMgr.setSignTime(new Date().getTime());
  22008. if (watchVideo) {
  22009. DataMgr.setExtraSign(1);
  22010. Moyu.sendDataEvent("signIn1");
  22011. }
  22012. this.updateSign();
  22013. });
  22014. }
  22015. }
  22016. againGetAward() {
  22017. Moyu.sendDataEvent("signIn2");
  22018. console.log('zh:qjff_AD_for_uisign');
  22019. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  22020. }
  22021. else {
  22022. console.log('zh:AD 失败,直接发放奖励');
  22023. this.qjff_AD_for_uisign();
  22024. }
  22025. }
  22026. qjff_AD_for_uisign() {
  22027. let index = this.curDayIndex;
  22028. if (index == 0)
  22029. index = 7;
  22030. let award = cfgTable.signData[index].award;
  22031. let temp;
  22032. let type;
  22033. let num;
  22034. for (let index = 0; index < award.length; index++) {
  22035. temp = award[index].split("-");
  22036. type = parseInt(temp[0]);
  22037. num = parseInt(temp[1]) * 3;
  22038. xGame.common.playObjFlyAnim(num, type);
  22039. }
  22040. DataMgr.setExtraSign(1);
  22041. this.updateSign();
  22042. }
  22043. }
  22044. UISign$1.uiName = "UISign";
  22045. class UIModeSelection$1 extends UIBase {
  22046. constructor() {
  22047. super();
  22048. }
  22049. onConstructor() {
  22050. this.ui = ui_UIModeSelection.createInstance();
  22051. this.contentPane = this.ui;
  22052. this.isEject = false;
  22053. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  22054. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  22055. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  22056. this.addUIClick(this.ui.closeBtn, this.hide);
  22057. this.peopleArr = [65, 990, 580];
  22058. this.peopleOffest = [5, 10, 10];
  22059. }
  22060. show(callback) {
  22061. this.updateSelf();
  22062. super.show();
  22063. this.ui.t0.play();
  22064. this.callback = callback;
  22065. }
  22066. updateSelf() {
  22067. let cfg = cfgTable.modeselectData;
  22068. for (let index = 1; index <= 3; index++) {
  22069. let node = this.ui.myNode["type" + index];
  22070. node.need.text = cfg[index].need;
  22071. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  22072. node.peopleTxt.text = this.getRandPeople(index - 1);
  22073. }
  22074. }
  22075. enterGame(type) {
  22076. console.log('zh: 进入经典模式 type: ' + type);
  22077. xGame.common.classicRoomType = type;
  22078. let cfg = cfgTable.modeselectData[type];
  22079. let need = cfg.need;
  22080. xGame.common.passAwardCoin = cfg.award;
  22081. if (DataMgr.coinEnough(need)) {
  22082. DataMgr.setCoin(-need);
  22083. this.ui.myNode["type" + type].t0.play();
  22084. Laya.timer.once(200, this, () => {
  22085. this.callback && this.callback();
  22086. });
  22087. this.logEventForClassic_start();
  22088. }
  22089. else {
  22090. Moyu.sendDataEvent("AddCoinVideo");
  22091. xGame.uiMgr.Show(UIAddProp$1, 0);
  22092. }
  22093. }
  22094. getRandPeople(index) {
  22095. let rand = this.peopleOffest[index];
  22096. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  22097. }
  22098. logEventForClassic_start() {
  22099. let rtype = xGame.common.classicRoomType;
  22100. let msmc = '';
  22101. if (rtype == 1) {
  22102. msmc = 'beginner';
  22103. }
  22104. if (rtype == 2) {
  22105. msmc = 'expert';
  22106. }
  22107. if (rtype == 3) {
  22108. msmc = 'master';
  22109. }
  22110. let keyStr = 'sjmd_classic_start_' + rtype;
  22111. let jsonStr = {
  22112. "difficulty": msmc,
  22113. "classic_count": 1,
  22114. "difficulty_count": 1
  22115. };
  22116. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22117. const d = LocalStorageManager.getItem(keyStr);
  22118. jsonStr.classic_count = d.classic_count + 1;
  22119. jsonStr.difficulty_count = d.difficulty_count + 1;
  22120. LocalStorageManager.setItem(keyStr, jsonStr);
  22121. }
  22122. else {
  22123. LocalStorageManager.setItem(keyStr, jsonStr);
  22124. }
  22125. const reqStr = JSON.stringify(jsonStr);
  22126. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  22127. }
  22128. }
  22129. UIModeSelection$1.uiName = "UIModeSelection";
  22130. class UILogin$1 extends UIBase {
  22131. constructor() {
  22132. super();
  22133. }
  22134. onConstructor() {
  22135. this.ui = ui_UILogin.createInstance();
  22136. this.contentPane = this.ui;
  22137. this.isEject = false;
  22138. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22139. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  22140. this.addUIClick(this.ui.btn_login, this.userLogin);
  22141. }
  22142. show() {
  22143. super.show();
  22144. this.x = (Laya.stage.width - this.width) / 2;
  22145. this.y = (Laya.stage.height - this.height) / 2;
  22146. }
  22147. closeSelf() {
  22148. this.hide();
  22149. }
  22150. userLogin() {
  22151. let ua = this.ui.txt_ua.text;
  22152. let up = this.ui.txt_up.text;
  22153. if (ua && up) {
  22154. let reqData = JSON.stringify({
  22155. username: ua.trim(),
  22156. password: up.trim(),
  22157. fromMark: 'app_game'
  22158. });
  22159. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  22160. try {
  22161. console.log('zh:res = ' + JSON.stringify(res));
  22162. let code = res.code;
  22163. let msg = res.msg;
  22164. if (code == 200) {
  22165. let keyStr = 'userInfo';
  22166. let jsonStr = {
  22167. "username": res.username,
  22168. "token": res.token
  22169. };
  22170. LocalStorageManager.setItem(keyStr, jsonStr);
  22171. xGame.uiMgr.Show(UIMsg$1, msg);
  22172. this.closeSelf();
  22173. }
  22174. else {
  22175. xGame.uiMgr.Show(UIMsg$1, msg);
  22176. }
  22177. }
  22178. catch (error) {
  22179. console.log('error=' + error);
  22180. alert(error);
  22181. }
  22182. finally {
  22183. }
  22184. });
  22185. }
  22186. else {
  22187. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22188. }
  22189. }
  22190. gotoRegPage() {
  22191. this.closeSelf();
  22192. xGame.uiMgr.Show(UIReg$1);
  22193. }
  22194. }
  22195. UILogin$1.uiName = "UILogin";
  22196. class UIReg$1 extends UIBase {
  22197. constructor() {
  22198. super();
  22199. }
  22200. onConstructor() {
  22201. this.ui = ui_UIReg.createInstance();
  22202. this.contentPane = this.ui;
  22203. this.isEject = false;
  22204. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22205. this.addUIClick(this.ui.btn_reg, this.regUser);
  22206. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  22207. }
  22208. show() {
  22209. super.show();
  22210. this.x = (Laya.stage.width - this.width) / 2;
  22211. this.y = (Laya.stage.height - this.height) / 2;
  22212. }
  22213. closeSelf() {
  22214. this.hide();
  22215. }
  22216. regUser() {
  22217. this.ui.lab_tip.visible = false;
  22218. let ua = this.ui.txt_ua.text;
  22219. let up1 = this.ui.txt_up1.text;
  22220. let up2 = this.ui.txt_up2.text;
  22221. if (ua && up1 && up2 && up1 == up2) {
  22222. let reqData = JSON.stringify({
  22223. username: ua.trim(),
  22224. password: up1.trim(),
  22225. fromMark: 'app_game'
  22226. });
  22227. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  22228. try {
  22229. console.log('zh:res = ' + JSON.stringify(res));
  22230. let code = res.code;
  22231. let msg = res.msg;
  22232. xGame.uiMgr.Show(UIMsg$1, msg);
  22233. if (code == 200) {
  22234. this.ui.lab_tip.color = "#FFFFFF";
  22235. xGame.uiMgr.Show(UIMsg$1, msg);
  22236. this.closeSelf();
  22237. }
  22238. else {
  22239. this.ui.lab_tip.color = "#FF0000";
  22240. xGame.uiMgr.Show(UIMsg$1, msg);
  22241. }
  22242. }
  22243. catch (error) {
  22244. console.log('error=' + error);
  22245. alert(error);
  22246. }
  22247. finally {
  22248. }
  22249. });
  22250. }
  22251. else {
  22252. if (up1 != up2) {
  22253. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  22254. }
  22255. else {
  22256. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22257. }
  22258. }
  22259. }
  22260. gotoLogin() {
  22261. this.closeSelf();
  22262. xGame.uiMgr.Show(UILogin$1);
  22263. }
  22264. }
  22265. UIReg$1.uiName = "UIReg";
  22266. class UITry$1 extends UIBase {
  22267. constructor() {
  22268. super();
  22269. this.closeTime = 0;
  22270. this.closeNum = 0;
  22271. this.skillUrl = xGame.common.skillIconList;
  22272. }
  22273. onConstructor() {
  22274. this.ui = ui_UITry.createInstance();
  22275. this.contentPane = this.ui;
  22276. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  22277. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  22278. }
  22279. show() {
  22280. super.show();
  22281. this.closeNum = 0;
  22282. this.closeTime = 15;
  22283. this.ui.t0.play();
  22284. PlatMgr.showRateBanner();
  22285. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22286. Laya.timer.loop(1000, this, this.updateTime);
  22287. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  22288. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  22289. xGame.common.gameMgr.gamePause = true;
  22290. }
  22291. updateTime() {
  22292. if (this.closeTime > 1) {
  22293. this.closeTime--;
  22294. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22295. }
  22296. else
  22297. this.hide();
  22298. }
  22299. hide() {
  22300. Laya.timer.clearAll(this);
  22301. Moyu.showBannerAd(false);
  22302. super.hide();
  22303. xGame.common.gameMgr.gamePause = false;
  22304. }
  22305. onTry() {
  22306. console.log('zh:qjff_AD_for_uitry');
  22307. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  22308. }
  22309. else {
  22310. console.log('zh:AD 失败,直接发放奖励');
  22311. this.qjff_AD_for_uitry();
  22312. }
  22313. }
  22314. qjff_AD_for_uitry() {
  22315. let select = xGame.common.curPlayerSkillType;
  22316. DataMgr.gameData.trySkill = select;
  22317. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  22318. DataMgr.saveGameData();
  22319. DataMgr.setBigSkill(select, 1);
  22320. xGame.showTip("Trial Successful");
  22321. this.hide();
  22322. }
  22323. onCancel() {
  22324. if (this.closeNum > 0) {
  22325. this.closeNum--;
  22326. if (this.closeNum < 2)
  22327. this.hide();
  22328. return;
  22329. }
  22330. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  22331. this.onTry();
  22332. }
  22333. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  22334. this.closeNum = 3;
  22335. }
  22336. else
  22337. this.hide();
  22338. }
  22339. }
  22340. UITry$1.uiName = "UITry";
  22341. class UIGetAward$1 extends UIBase {
  22342. constructor() {
  22343. super();
  22344. this.showTriple = true;
  22345. }
  22346. onConstructor() {
  22347. this.ui = ui_UIGetAward.createInstance();
  22348. this.contentPane = this.ui;
  22349. this.isEject = false;
  22350. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  22351. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  22352. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  22353. }
  22354. show(arr, showTriple, callback) {
  22355. super.show();
  22356. this.ui.t0.play();
  22357. this.ui.eftNode.visible = true;
  22358. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  22359. this.ui.eftNode.visible = false;
  22360. }), 1, 0, 0, 0.9);
  22361. this.awardArr = arr;
  22362. this.showTriple = showTriple;
  22363. this.callback = callback;
  22364. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  22365. this.ui.myList.numItems = arr.length;
  22366. xGame.soundMgr.playSound("getaward");
  22367. }
  22368. updateSelf(index, obj) {
  22369. let temp = this.awardArr[index];
  22370. let icon = this.getIcon(temp.type);
  22371. let str = icon;
  22372. if (temp.type > 2) {
  22373. str = "s" + icon;
  22374. }
  22375. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  22376. obj.myIcon.rotation = 0;
  22377. obj.numTxt.text = temp.num + "";
  22378. obj.numTxt.visible = temp.type > 2 ? false : true;
  22379. obj.nameTxt.text = this.getNameStr(temp.type);
  22380. }
  22381. renderItem(index, obj) {
  22382. this.updateSelf(index, obj);
  22383. }
  22384. tripleGetAward() {
  22385. console.log('zh:qjff_AD_for_uigetAward');
  22386. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  22387. }
  22388. else {
  22389. console.log('zh:AD 失败,直接发放奖励');
  22390. this.qjff_AD_for_uigetAward();
  22391. }
  22392. }
  22393. qjff_AD_for_uigetAward() {
  22394. this.getAward(3);
  22395. }
  22396. normalGetAward() {
  22397. if (PlatMgr.isMisVideo())
  22398. this.tripleGetAward();
  22399. else
  22400. this.getAward();
  22401. }
  22402. getAward(times = 1) {
  22403. this.hide();
  22404. for (let index = 0; index < this.awardArr.length; index++) {
  22405. this.awardArr[index].num *= times;
  22406. }
  22407. this.callback && this.callback(times != 1);
  22408. }
  22409. getIcon(type) {
  22410. switch (type) {
  22411. case Prop.diamond:
  22412. return "ty_zs";
  22413. case Prop.coin:
  22414. return "ty_jb";
  22415. case Prop.gan1:
  22416. return "qg1";
  22417. case Prop.gan2:
  22418. return "qg2";
  22419. case Prop.gan3:
  22420. return "qg3";
  22421. case Prop.gan4:
  22422. return "qg4";
  22423. default:
  22424. break;
  22425. }
  22426. }
  22427. getNameStr(type) {
  22428. switch (type) {
  22429. case Prop.diamond:
  22430. return "Diamond";
  22431. case Prop.coin:
  22432. return "Coins";
  22433. case Prop.gan1:
  22434. case Prop.gan2:
  22435. case Prop.gan3:
  22436. case Prop.gan4:
  22437. return cfgTable.ballrodData[type - 1].name;
  22438. default:
  22439. break;
  22440. }
  22441. }
  22442. }
  22443. UIGetAward$1.uiName = "UIGetAward";
  22444. class UIBox$1 extends UIBase {
  22445. constructor() {
  22446. super();
  22447. this.boxNum = 0;
  22448. this.boxMax = 10;
  22449. this.inAd = false;
  22450. this.isClose = false;
  22451. }
  22452. onConstructor() {
  22453. this.ui = ui_UIBox.createInstance();
  22454. this.contentPane = this.ui;
  22455. this.isEject = false;
  22456. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  22457. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  22458. Laya.timer.loop(1000, this, this.update);
  22459. }
  22460. update() {
  22461. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  22462. this.boxNum -= 1;
  22463. this.upBar();
  22464. }
  22465. }
  22466. upBar() {
  22467. if (this.boxNum > this.boxMax)
  22468. this.boxNum = this.boxMax;
  22469. this.ui.bar.value = this.boxNum * 10;
  22470. }
  22471. show() {
  22472. super.show();
  22473. this.isClose = false;
  22474. this.boxNum = 0;
  22475. this.inAd = false;
  22476. this.upBar();
  22477. this.ui.t0.play();
  22478. this.ui.closeBtn.visible = false;
  22479. Laya.timer.once(3000, this, () => {
  22480. this.ui.closeBtn.visible = true;
  22481. this.ui.bar.alpha = 1;
  22482. });
  22483. Laya.timer.once(500, this, () => {
  22484. this.ui.t1.play();
  22485. });
  22486. }
  22487. hide() {
  22488. Laya.timer.clearAll(this);
  22489. Moyu.showBannerAd(false);
  22490. super.hide();
  22491. }
  22492. onOpenBox() {
  22493. this.boxNum++;
  22494. if (this.boxNum < this.boxMax) {
  22495. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  22496. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  22497. }
  22498. }
  22499. else if (this.boxNum == this.boxMax) {
  22500. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  22501. this.ui.openBtn.c1.selectedIndex = 13;
  22502. this.inAd = true;
  22503. }
  22504. else
  22505. this.getAward();
  22506. }
  22507. else if (this.inAd) {
  22508. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  22509. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  22510. }
  22511. else {
  22512. console.log('zh:AD 失败,直接发放奖励');
  22513. this.qjff_AD_for_UIBOX_onOpenBox();
  22514. }
  22515. }
  22516. this.upBar();
  22517. }
  22518. qjff_AD_for_UIBOX_onOpenBox() {
  22519. this.getAward();
  22520. }
  22521. onCloseBox() {
  22522. if (this.isClose)
  22523. this.hide();
  22524. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  22525. this.isClose = true;
  22526. PlatMgr.showBanner(true, 0, 3000);
  22527. }
  22528. else
  22529. this.hide();
  22530. }
  22531. getAward() {
  22532. let str = "";
  22533. if (Math.random() < 0.5) {
  22534. let max = Moyu.isLegal ? 500 : 2500;
  22535. let num = xGame.tools.random(max, 500 + max);
  22536. DataMgr.setCoin(num);
  22537. str = "金币x" + num;
  22538. }
  22539. else {
  22540. let max = Moyu.isLegal ? 10 : 30;
  22541. let num = xGame.tools.random(max, 30 + max);
  22542. DataMgr.setDiamond(num);
  22543. str = "钻石x" + num;
  22544. }
  22545. xGame.showTip("恭喜获得-" + str);
  22546. this.hide();
  22547. }
  22548. }
  22549. UIBox$1.uiName = "UIBox";
  22550. class UIMain$1 extends UIBase {
  22551. constructor() {
  22552. super();
  22553. this.firstEnter = true;
  22554. }
  22555. nativeCallJs(msg) {
  22556. let t = msg;
  22557. console.log("zh: nativeCallJs 奖励开始发放:", t);
  22558. switch (t) {
  22559. case 'qjff_chouJiang':
  22560. let dui = xGame.uiMgr.getUI(UIDraw$1);
  22561. dui.qjff_chouJiang();
  22562. break;
  22563. case 'qjff_AD_for_uisign':
  22564. let dui2 = xGame.uiMgr.getUI(UISign$1);
  22565. dui2.qjff_AD_for_uisign();
  22566. break;
  22567. case 'qjff_AD_for_uitry':
  22568. let dui3 = xGame.uiMgr.getUI(UITry$1);
  22569. dui3.qjff_AD_for_uitry();
  22570. break;
  22571. case 'qjff_AD_for_uipower':
  22572. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  22573. dui4.qjff_AD_for_uipower();
  22574. break;
  22575. case 'qjff_AD_for_uigetAward':
  22576. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  22577. dui5.qjff_AD_for_uigetAward();
  22578. break;
  22579. case 'qjff_AD_for_uiGameEnd':
  22580. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  22581. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  22582. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  22583. break;
  22584. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  22585. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  22586. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  22587. break;
  22588. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  22589. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  22590. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  22591. break;
  22592. case 'qjff_AD_for_UIrepentProp_videoRegret':
  22593. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  22594. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  22595. break;
  22596. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  22597. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  22598. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  22599. break;
  22600. case 'qjff_AD_for_UIBOX_onOpenBox':
  22601. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  22602. dui11.qjff_AD_for_UIBOX_onOpenBox();
  22603. break;
  22604. case 'qjff_AD_for_UIAddCoin':
  22605. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  22606. dui12.qjff_AD_for_UIAddCoin();
  22607. break;
  22608. case '111a':
  22609. let dui14 = xGame.uiMgr.getUI(UISign$1);
  22610. dui14.qjff_AD_for_uisign();
  22611. break;
  22612. case '222a':
  22613. let dui15 = xGame.uiMgr.getUI(UISign$1);
  22614. dui15.qjff_AD_for_uisign();
  22615. break;
  22616. case '333a':
  22617. let dui16 = xGame.uiMgr.getUI(UISign$1);
  22618. dui16.qjff_AD_for_uisign();
  22619. break;
  22620. default:
  22621. console.log('zh:未知的方法名字' + t);
  22622. break;
  22623. }
  22624. }
  22625. onConstructor() {
  22626. console.log('zh: UIMain onConstructor');
  22627. this.ui = ui_UIMain.createInstance();
  22628. this.contentPane = this.ui;
  22629. this.isEject = false;
  22630. this.addEvent();
  22631. this.addClickSpine();
  22632. this.settingNode = new SettingNode$1(this.ui.settingNode);
  22633. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22634. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  22635. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  22636. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  22637. let curUse = DataMgr.getCurSecretary();
  22638. this.changeSecretary(curUse);
  22639. this.ui.talkNode.visible = false;
  22640. let guide = DataMgr.getSkillGuide();
  22641. if (xGame.common.isNewDay && guide == 1) {
  22642. xGame.common.isNewDay = false;
  22643. xGame.soundMgr.playSound("s_main01");
  22644. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22645. console.log("zh:播放小秘书每天语音");
  22646. }
  22647. this.onGetUserInfo();
  22648. this.ui.n83.visible = false;
  22649. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  22650. const d = LocalStorageManager.getItem(keyForLoginInfo);
  22651. let ua = d.username;
  22652. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  22653. }
  22654. this.c_btn_for_user();
  22655. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  22656. }
  22657. Logout() {
  22658. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  22659. LocalStorageManager.removeItem(keyForLoginInfo);
  22660. this.freshUser();
  22661. }
  22662. }
  22663. gotoLogin() {
  22664. xGame.uiMgr.Show(UILogin$1);
  22665. }
  22666. gotoRegUser() {
  22667. xGame.uiMgr.Show(UIReg$1);
  22668. }
  22669. c_btn_for_user() {
  22670. this.ui.n_Logout.visible = false;
  22671. this.ui.n_dengLu.visible = false;
  22672. this.ui.n_zhuCe.visible = false;
  22673. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  22674. this.ui.n_Logout.visible = true;
  22675. }
  22676. else {
  22677. this.ui.n_dengLu.visible = true;
  22678. }
  22679. }
  22680. changeSecretary(curUse) {
  22681. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  22682. xGame.common.secretary && xGame.common.secretary.dispose();
  22683. this.addSecretarySpine(name);
  22684. }
  22685. addSecretarySpine(name) {
  22686. let spine = new SpineMgr(name, () => {
  22687. this.playSecretaryIdle();
  22688. });
  22689. xGame.common.secretary = spine;
  22690. }
  22691. addClickSpine() {
  22692. let clickSpine = new SpineMgr("dianji", () => {
  22693. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  22694. let parent = Laya.stage;
  22695. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  22696. clickSpine.play(data, 0, false, parent, (spine) => {
  22697. spine.destroy(true);
  22698. });
  22699. });
  22700. });
  22701. }
  22702. addEvent() {
  22703. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  22704. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  22705. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  22706. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  22707. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  22708. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  22709. this.addUIClick(this.ui, this.interuptSecretary);
  22710. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  22711. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  22712. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  22713. this.addUIClick(this.ui.shopBtn, this.openShopView);
  22714. this.addUIClick(this.ui.signBtn, this.openSignView);
  22715. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  22716. this.addUIClick(this.ui.rankBtn, this.openRanking);
  22717. this.addUIClick(this.ui.n_Logout, this.Logout);
  22718. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  22719. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  22720. }
  22721. show(showFailWords) {
  22722. super.show();
  22723. this.moneyNode.ui.c1.selectedIndex = 1;
  22724. this.playSecretaryIdle();
  22725. xGame.soundMgr.playMusic("caromhall01", 0);
  22726. Laya.timer.clearAll(this);
  22727. this.playSecretaryRandomSound();
  22728. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  22729. if (showFailWords) {
  22730. console.log('zh:uimain.ts ');
  22731. setTimeout(() => {
  22732. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  22733. let words = -1;
  22734. if (str == "s_main02") {
  22735. words = 2;
  22736. }
  22737. else {
  22738. words = 3;
  22739. }
  22740. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22741. xGame.soundMgr.playSound(str);
  22742. }, 300);
  22743. }
  22744. this.showGuide();
  22745. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  22746. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  22747. let guide = DataMgr.getSkillGuide();
  22748. if (guide == 1) {
  22749. let randTime = xGame.common.randomNum(300, 800);
  22750. if (this.firstEnter) {
  22751. console.log("zh: firstEnter");
  22752. this.firstEnter = false;
  22753. randTime += 900;
  22754. }
  22755. else {
  22756. console.log("zh: no firstEnter");
  22757. }
  22758. Laya.timer.once(randTime, this, () => {
  22759. xGame.common.autoPopUIView();
  22760. });
  22761. }
  22762. }
  22763. checkActive(show) {
  22764. }
  22765. showGuide() {
  22766. let guide = DataMgr.getSkillGuide();
  22767. this.ui.guideBtn.visible = guide == 0;
  22768. this.ui.enterGuide.visible = false;
  22769. this.ui.secretaryGuide.visible = guide == 0;
  22770. if (guide == 0) {
  22771. console.log("zh:显示引导");
  22772. xGame.soundMgr.playSound("s_guide");
  22773. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22774. }
  22775. else {
  22776. console.log("zh:不需要显示引导");
  22777. }
  22778. }
  22779. ensureSecretary() {
  22780. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  22781. this.ui.secretaryGuide.visible = false;
  22782. this.ui.enterGuide.visible = true;
  22783. this.ui.wordsNode.t0.play();
  22784. if (DataMgr.getNewUser())
  22785. Moyu.sendDataEvent("gameReady");
  22786. }
  22787. playSecretaryIdle() {
  22788. let parent = this.ui.secretary.displayObject;
  22789. parent.destroyChildren();
  22790. let xx = this.ui.secretary.width / 2;
  22791. let yy = this.ui.secretary.height;
  22792. let scale = xGame.common.getSecretaryScale();
  22793. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22794. console.log("zh:playSecretaryIdle", data);
  22795. xGame.common.secretary.play(data, 0, true, parent);
  22796. }
  22797. startGame(type) {
  22798. xGame.common.gameMode = type;
  22799. Moyu.sendDataEvent("PlayGame", { type: type });
  22800. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  22801. switch (xGame.common.gameMode) {
  22802. case GameMode.classic:
  22803. console.log('zh:进入经典模式111111111');
  22804. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  22805. let db_over_lev = DataMgr.getChallengeMode_overLev();
  22806. console.log('zh:classic db_over_lev=', db_over_lev);
  22807. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  22808. console.log('zh:判断是否可以玩该模式classic =NO');
  22809. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  22810. xGame.uiMgr.Show(UIMsg$1, tipStr);
  22811. return;
  22812. }
  22813. else {
  22814. console.log('zh:可以玩该模式classic 66666666666666');
  22815. this.beginGame();
  22816. }
  22817. }
  22818. else {
  22819. console.log('zh:不需要判断是否可以玩该classic');
  22820. let challengeTimes = DataMgr.getChallengeTimes();
  22821. if (challengeTimes == 0) {
  22822. xGame.uiMgr.Show(UIInvitation$1);
  22823. }
  22824. else {
  22825. this.beginGame();
  22826. }
  22827. break;
  22828. }
  22829. case GameMode.bigMove:
  22830. console.error('zh:bigMove check');
  22831. let guide = DataMgr.getSkillGuide();
  22832. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  22833. let db_over_lev = DataMgr.getChallengeMode_overLev();
  22834. console.log('zh:bigMove db_over_lev=', db_over_lev);
  22835. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  22836. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  22837. xGame.uiMgr.Show(UIMsg$1, tipStr);
  22838. return;
  22839. }
  22840. else {
  22841. console.log('zh:可以玩该模式 bigMove');
  22842. this.beginGame();
  22843. if (DataMgr.getNewUser())
  22844. Moyu.sendDataEvent("gameStart0");
  22845. }
  22846. }
  22847. else {
  22848. this.beginGame();
  22849. if (DataMgr.getNewUser())
  22850. Moyu.sendDataEvent("gameStart0");
  22851. }
  22852. break;
  22853. default:
  22854. console.error('zh:未知错误!!!!');
  22855. break;
  22856. }
  22857. }
  22858. beginGame(isNice = false) {
  22859. console.log('zh:beginGame ');
  22860. let guide = DataMgr.getSkillGuide();
  22861. if (guide == 1) {
  22862. console.log('zh:非新手引导,showInternAd ');
  22863. JSBridgeUtils.instance.showInternAd('beginGame');
  22864. }
  22865. else {
  22866. console.log('zh:新手引导,不显示AD ');
  22867. }
  22868. console.log('zh:beginGame 2 go');
  22869. if (xGame.common.gameMode == GameMode.classic) {
  22870. if (isNice) {
  22871. this.enterClassic();
  22872. }
  22873. else {
  22874. xGame.uiMgr.Show(UIModeSelection$1, () => {
  22875. console.log('zh:BBBBBBBBBBBBBBB');
  22876. this.enterClassic();
  22877. });
  22878. }
  22879. }
  22880. else if (xGame.common.gameMode == GameMode.bigMove) {
  22881. this.ui.enterGuide.visible = false;
  22882. xGame.uiMgr.Show(UISkill$1);
  22883. }
  22884. }
  22885. enterClassic() {
  22886. xGame.uiMgr.Show(UIGame$1);
  22887. xGame.uiMgr.Show(UIMatching$1, () => {
  22888. if (!this.isHide)
  22889. this.hide();
  22890. xGame.common.gameUI.ui.alpha = 1;
  22891. xGame.common.gameUI.startGame();
  22892. xGame.uiMgr.Hide(UIGameEnd$1);
  22893. });
  22894. }
  22895. startGlobal() {
  22896. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  22897. }
  22898. startWeekly() {
  22899. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  22900. }
  22901. zhouSaiMonth() {
  22902. console.log('zh: zhouSaiMonth 被调用');
  22903. }
  22904. startPlaceBall() {
  22905. xGame.uiMgr.Show(UILevelDisplay$1);
  22906. }
  22907. hide() {
  22908. console.log('zh:uimain hide ...');
  22909. super.hide();
  22910. xGame.common.stopGirlPop(this.ui.talkNode);
  22911. }
  22912. onGetUserInfo(force = false) {
  22913. if (Moyu.isWx) {
  22914. let info = Moyu.getSystemInfo();
  22915. if (info)
  22916. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  22917. }
  22918. else {
  22919. Moyu.initUser(this, this.freshUser, force);
  22920. }
  22921. this.freshUser();
  22922. }
  22923. freshUser() {
  22924. let user = Moyu.getUserInfo();
  22925. if (!user.isAuth) {
  22926. user.headIcon = 'res/ty_touxiang.png';
  22927. }
  22928. else {
  22929. DataMgr.upRankData();
  22930. }
  22931. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  22932. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  22933. let keyStr = keyForLoginInfo;
  22934. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22935. const d = LocalStorageManager.getItem(keyStr);
  22936. let ua = d.username;
  22937. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  22938. }
  22939. else {
  22940. }
  22941. this.c_btn_for_user();
  22942. }
  22943. interuptSecretary() {
  22944. Laya.timer.clearAll(this);
  22945. this.playSecretaryRandomSound();
  22946. }
  22947. playSecretaryRandomSound() {
  22948. if (this.isHide)
  22949. return;
  22950. let time = xGame.common.randomNum(45000, 60000);
  22951. Laya.timer.once(time, this, () => {
  22952. if (this.isHide)
  22953. return;
  22954. let index = xGame.common.randomNum(4, 7);
  22955. xGame.soundMgr.playSound("s_main0" + index);
  22956. let words = 1;
  22957. switch (index) {
  22958. case 4:
  22959. words = 5;
  22960. break;
  22961. case 5:
  22962. words = 3;
  22963. break;
  22964. case 6:
  22965. words = 6;
  22966. break;
  22967. case 7:
  22968. words = 7;
  22969. break;
  22970. default:
  22971. break;
  22972. }
  22973. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22974. this.playSecretaryRandomSound();
  22975. });
  22976. }
  22977. openSecretaryView() {
  22978. xGame.uiMgr.Show(UISecretary$1);
  22979. Moyu.sendDataEvent("secretary");
  22980. }
  22981. openShopView() {
  22982. xGame.uiMgr.Show(UIShop$1, 0);
  22983. }
  22984. openSignView() {
  22985. xGame.uiMgr.Show(UISign$1);
  22986. }
  22987. openDrawView() {
  22988. xGame.uiMgr.Show(UIDraw$1);
  22989. }
  22990. openRanking() {
  22991. console.log('zh:phb openRanking');
  22992. xGame.uiMgr.Show(UIRanking$1);
  22993. Moyu.sendDataEvent("rankingList");
  22994. }
  22995. }
  22996. UIMain$1.uiName = "UIMain";
  22997. function InitShader() {
  22998. }
  22999. function appInit() {
  23000. xGame.context.init(getLoadingResList(), initCallback);
  23001. }
  23002. function getLoadingResList() {
  23003. return [
  23004. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  23005. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  23006. ];
  23007. }
  23008. function getGameResList() {
  23009. return [
  23010. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  23011. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  23012. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  23013. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  23014. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  23015. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  23016. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  23017. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  23018. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  23019. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  23020. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  23021. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  23022. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  23023. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  23024. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  23025. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  23026. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  23027. ];
  23028. }
  23029. function initCallback() {
  23030. window["DataMgr"] = DataMgr;
  23031. DataMgr.Init();
  23032. Moyu.init(getPlat(), this, () => {
  23033. DataMgr.isNewDay();
  23034. PlatMgr.initConfig();
  23035. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  23036. }, true);
  23037. console.log('zh:开始sm init1 start');
  23038. xGame.soundMgr.init();
  23039. console.log('zh:开始sm init1 end');
  23040. xGame.uiMgr.init();
  23041. xGame.uiMgr.clearTempData();
  23042. xGame.uiMgr.bindFUI(fguiRes.loading);
  23043. xGame.uiMgr.Show(UILoading);
  23044. }
  23045. function loadSubRes(callback) {
  23046. var tab = ["asset", "res", "spine"];
  23047. let subDone = 0;
  23048. for (var i = 0; i < tab.length; i++) {
  23049. let sub = tab[i];
  23050. Moyu.loadSubRes(sub, (pro) => {
  23051. callback && callback(pro, false);
  23052. }).then(() => {
  23053. subDone++;
  23054. if (subDone >= tab.length)
  23055. callback && callback(1, true);
  23056. });
  23057. }
  23058. }
  23059. function enterGame() {
  23060. xGame.cfgMgr.init();
  23061. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  23062. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  23063. xGame.uiMgr.Hide(UILoading);
  23064. fgui.UIPackage.removePackage(fguiRes.loading);
  23065. xGame.uiMgr.bindFUI(fguiRes.game);
  23066. xGame.uiMgr.Show(UIMain$1);
  23067. if (DataMgr.getNewUser())
  23068. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  23069. }
  23070. function getPlat() {
  23071. let cfg = new MoyuCfg();
  23072. cfg.plat = MoyuPlat.web;
  23073. cfg.myId = 180;
  23074. cfg.myKey = '8848a885774230a4';
  23075. cfg.version = 0;
  23076. if (window.hasOwnProperty("gamebox")) {
  23077. cfg.plat = MoyuPlat.f399;
  23078. cfg.version = 0;
  23079. }
  23080. else if (window.hasOwnProperty("ks")) {
  23081. cfg.plat = MoyuPlat.ks;
  23082. cfg.version = 0;
  23083. cfg.ads.ksVideoId = '2300002254_01';
  23084. cfg.ads.ksInsertId = '2300002254_02';
  23085. }
  23086. else if (Laya.Browser.onTTMiniGame) {
  23087. cfg.plat = MoyuPlat.tt;
  23088. cfg.version = 0;
  23089. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  23090. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  23091. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  23092. }
  23093. else if (Laya.Browser.onMiniGame) {
  23094. cfg.plat = MoyuPlat.wx;
  23095. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  23096. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  23097. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  23098. }
  23099. else if (Laya.Browser.onQQMiniGame) {
  23100. cfg.plat = MoyuPlat.qq;
  23101. }
  23102. else if (Laya.Browser.onQGMiniGame) {
  23103. cfg.plat = MoyuPlat.op;
  23104. cfg.ads.opVideoId = '455502';
  23105. cfg.ads.opBannerId = '455507';
  23106. }
  23107. else if (Laya.Browser.onVVMiniGame) {
  23108. cfg.plat = MoyuPlat.vv;
  23109. cfg.version = 0;
  23110. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  23111. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  23112. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  23113. }
  23114. else if (Laya.Browser.onHWMiniGame) {
  23115. cfg.plat = MoyuPlat.hw;
  23116. }
  23117. else if (window["mz"]) {
  23118. cfg.plat = MoyuPlat.mz;
  23119. }
  23120. else {
  23121. let cfg = window['conchConfig'];
  23122. if (cfg) {
  23123. var os = cfg.getOS();
  23124. if (os == "Conch-ios") {
  23125. cfg.plat = MoyuPlat.ios;
  23126. }
  23127. else if (os == "Conch-android") {
  23128. }
  23129. }
  23130. }
  23131. return cfg;
  23132. }
  23133. class Main {
  23134. constructor() {
  23135. if (window["Laya3D"])
  23136. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  23137. else {
  23138. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  23139. this.initMain();
  23140. }
  23141. }
  23142. initMain() {
  23143. Laya["Physics"] && Laya["Physics"].enable();
  23144. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  23145. Laya.stage.scaleMode = GameConfig.scaleMode;
  23146. Laya.stage.screenMode = GameConfig.screenMode;
  23147. Laya.stage.alignV = GameConfig.alignV;
  23148. Laya.stage.alignH = GameConfig.alignH;
  23149. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  23150. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  23151. Laya.enableDebugPanel();
  23152. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  23153. Laya["PhysicsDebugDraw"].enable();
  23154. if (GameConfig.stat)
  23155. Laya.Stat.show();
  23156. Laya.alertGlobalError(true);
  23157. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  23158. }
  23159. onVersionLoaded() {
  23160. appInit();
  23161. }
  23162. }
  23163. new Main();
  23164. }());
  23165. //# sourceMappingURL=bundle.js.map