1
0

bundle.js 867 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  52. let poolKey = {
  53. inHoleEft: "inHoleEft",
  54. d3ball: "d3ball",
  55. iceEft: "iceEft",
  56. hitEft: "hitEft",
  57. fireworksEft: "fireworksEft",
  58. };
  59. var GameMode;
  60. (function (GameMode) {
  61. GameMode[GameMode["classic"] = 0] = "classic";
  62. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  63. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  64. })(GameMode || (GameMode = {}));
  65. var SkillType;
  66. (function (SkillType) {
  67. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  68. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  69. SkillType[SkillType["ice"] = 2] = "ice";
  70. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  71. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  72. })(SkillType || (SkillType = {}));
  73. var ClassicWordsType;
  74. (function (ClassicWordsType) {
  75. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  76. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  77. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  78. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  79. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  80. })(ClassicWordsType || (ClassicWordsType = {}));
  81. var PressType;
  82. (function (PressType) {
  83. PressType[PressType["powerNode"] = 0] = "powerNode";
  84. PressType[PressType["d2Root"] = 1] = "d2Root";
  85. PressType[PressType["moveNode"] = 2] = "moveNode";
  86. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  87. })(PressType || (PressType = {}));
  88. var PlaceBallType;
  89. (function (PlaceBallType) {
  90. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  91. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  92. })(PlaceBallType || (PlaceBallType = {}));
  93. var EAdType;
  94. (function (EAdType) {
  95. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  96. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  97. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  98. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  99. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  100. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  101. EAdType[EAdType["sign"] = 6] = "sign";
  102. EAdType[EAdType["draw"] = 7] = "draw";
  103. EAdType[EAdType["triple"] = 8] = "triple";
  104. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  105. EAdType[EAdType["getPower"] = 10] = "getPower";
  106. EAdType[EAdType["box"] = 11] = "box";
  107. EAdType[EAdType["try"] = 12] = "try";
  108. EAdType[EAdType["againSign"] = 13] = "againSign";
  109. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  110. })(EAdType || (EAdType = {}));
  111. var Prop;
  112. (function (Prop) {
  113. Prop[Prop["diamond"] = 1] = "diamond";
  114. Prop[Prop["coin"] = 2] = "coin";
  115. Prop[Prop["gan1"] = 3] = "gan1";
  116. Prop[Prop["gan2"] = 4] = "gan2";
  117. Prop[Prop["gan3"] = 5] = "gan3";
  118. Prop[Prop["gan4"] = 6] = "gan4";
  119. })(Prop || (Prop = {}));
  120. var TipsType;
  121. (function (TipsType) {
  122. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  123. TipsType[TipsType["foul"] = 1] = "foul";
  124. })(TipsType || (TipsType = {}));
  125. class AwardType {
  126. constructor(type, num) {
  127. this.type = type;
  128. this.num = num;
  129. }
  130. }
  131. var define = /*#__PURE__*/Object.freeze({
  132. fguiRes: fguiRes,
  133. ballCamp: ballCamp,
  134. FoulType: FoulType,
  135. ALL_BALL_STOP: ALL_BALL_STOP,
  136. WAIT_SHOOT: WAIT_SHOOT,
  137. D3RES_LOADED: D3RES_LOADED,
  138. BALL_SHOOT: BALL_SHOOT,
  139. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  140. RESET_GAME: RESET_GAME,
  141. COIN_CHANGE: COIN_CHANGE,
  142. DIAMOND_CHANGE: DIAMOND_CHANGE,
  143. RESTART_GAME: RESTART_GAME,
  144. GET_USER_INFO: GET_USER_INFO,
  145. CHANGE_SECRETARY: CHANGE_SECRETARY,
  146. POWER_CHANGE: POWER_CHANGE,
  147. POWER_TIME: POWER_TIME,
  148. baseHeadUrl: baseHeadUrl,
  149. poolKey: poolKey,
  150. get GameMode () { return GameMode; },
  151. get SkillType () { return SkillType; },
  152. get ClassicWordsType () { return ClassicWordsType; },
  153. get PressType () { return PressType; },
  154. get PlaceBallType () { return PlaceBallType; },
  155. get EAdType () { return EAdType; },
  156. get Prop () { return Prop; },
  157. get TipsType () { return TipsType; },
  158. AwardType: AwardType
  159. });
  160. class CContext {
  161. constructor() {
  162. this.winSize = { width: 0, height: 0 };
  163. this.notchHeight = 0;
  164. this.bannerHeight = 0;
  165. }
  166. init(resList, callback) {
  167. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  168. this.notchHeight = this.getNotchHeight();
  169. this.bannerHeight = this.getBannerHeight();
  170. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  171. callback && callback();
  172. }));
  173. }
  174. getNotchHeight() {
  175. let notchHeight = 50;
  176. if (Laya.Browser.onMiniGame) {
  177. let deviceInfo = wx.getSystemInfoSync();
  178. if (Laya.Browser.onIOS) {
  179. if (deviceInfo.model.search('iPhone X') != -1) {
  180. notchHeight = deviceInfo.statusBarHeight - 10;
  181. }
  182. else {
  183. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  184. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  185. notchHeight = deviceInfo.statusBarHeight - 10;
  186. }
  187. }
  188. }
  189. else if (Laya.Browser.onAndroid) {
  190. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  191. notchHeight = deviceInfo.statusBarHeight;
  192. }
  193. }
  194. }
  195. return notchHeight;
  196. }
  197. getBannerHeight() {
  198. return 0;
  199. }
  200. }
  201. let context = new CContext();
  202. var Handler = Laya.Handler;
  203. var Tween = Laya.Tween;
  204. function playClickEffect(btn) {
  205. if (!btn)
  206. return;
  207. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  208. if (!btn)
  209. return;
  210. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  211. if (!btn)
  212. return;
  213. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  214. }), 0, true);
  215. }), 0, true);
  216. }
  217. function getNumList(strList) {
  218. let dataList = [];
  219. if (strList) {
  220. let list = strList;
  221. let array = list.split(',');
  222. for (var v in array) {
  223. dataList.push(Number(array[v]));
  224. }
  225. }
  226. return dataList;
  227. }
  228. function getStrList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split('|');
  233. for (var v in array) {
  234. dataList.push(String(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getRandStr(len) {
  240. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  241. let str = "";
  242. for (let i = 0; i < len; i++) {
  243. let rand = random(0, list.length);
  244. str += list[rand];
  245. }
  246. return str;
  247. }
  248. function getUserId() {
  249. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  250. return str;
  251. }
  252. function formatPos(pos, len = 2) {
  253. let v = Math.pow(10, len);
  254. pos.x = Math.floor(pos.x * v) / v;
  255. pos.y = Math.floor(pos.y * v) / v;
  256. if (pos.z)
  257. pos.z = Math.floor(pos.z * v) / v;
  258. return pos;
  259. }
  260. function setPosInt(pos) {
  261. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  262. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  263. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  264. return pos;
  265. }
  266. function random(min, max) {
  267. var rang = max - min;
  268. var rand = Math.random() * rang;
  269. return Math.floor(rand) + min;
  270. }
  271. function randomList(list, num) {
  272. if (list.length <= num)
  273. return list;
  274. let arry = [];
  275. list.forEach(item => {
  276. arry.push(item);
  277. });
  278. let nums = [];
  279. for (let i = 0; i < num; i++) {
  280. let rand = random(0, arry.length);
  281. let v = arry[rand];
  282. nums.push(v);
  283. arry.splice(rand, 1);
  284. }
  285. return nums;
  286. }
  287. function worldToScreen(camera, point, pos) {
  288. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  289. pos.x = pos.x / Laya.stage.clientScaleX;
  290. pos.y = pos.y / Laya.stage.clientScaleY;
  291. }
  292. function getStringLenght(str) {
  293. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  294. }
  295. function reviseString(str, len) {
  296. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  297. if (ld > len) {
  298. let sl = Math.floor(len / 2);
  299. let rs = str.substring(0, sl);
  300. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. while (d + 2 < len) {
  302. sl++;
  303. rs = str.substring(0, sl);
  304. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. return rs + "...";
  307. }
  308. return str;
  309. }
  310. function getCoinString(coin) {
  311. if (coin < 10000)
  312. return coin.toString();
  313. else if (coin < 1000000) {
  314. let vh = Math.ceil(coin / 100);
  315. return (vh / 10) + "k";
  316. }
  317. else if (coin < 1000000000) {
  318. var vh = Math.ceil(coin / 100000);
  319. return (vh / 10) + "m";
  320. }
  321. else if (coin < 1000000000000) {
  322. var vh = Math.ceil(coin / 100000000);
  323. return (vh / 10) + "b";
  324. }
  325. else if (coin < 1000000000000000) {
  326. var vh = Math.ceil(coin / 100000000000);
  327. return (vh / 10) + "t";
  328. }
  329. }
  330. function getV3Dest(pos, dir, dis, dest) {
  331. dir.x *= dis;
  332. dir.y *= dis;
  333. dir.z *= dis;
  334. Laya.Vector3.add(pos, dir, dest);
  335. return dest;
  336. }
  337. function getV2Dest(x1, y1, dir, dis, dest) {
  338. dest.x = x1 + dir.x * dis;
  339. dest.y = y1 + dir.y * dis;
  340. return dest;
  341. }
  342. function getV2Dir(x1, y1, x2, y2, dir) {
  343. dir.x = x2 - x1;
  344. dir.y = y2 - y1;
  345. Laya.Vector2.normalize(dir, dir);
  346. return dir;
  347. }
  348. function getV3Dir(p1, p2, dir) {
  349. Laya.Vector3.subtract(p1, p2, dir);
  350. Laya.Vector3.normalize(dir, dir);
  351. return dir;
  352. }
  353. function copyPos(ip, op) {
  354. op.x = ip.x;
  355. op.y = ip.y;
  356. if (ip.z)
  357. op.z = ip.z;
  358. return op;
  359. }
  360. function getScreenImg() {
  361. let gl = Laya.WebGLContext.mainContext;
  362. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  363. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  364. let w = gl.drawingBufferWidth;
  365. let h = gl.drawingBufferHeight;
  366. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  367. texture2d.setPixels(pixels);
  368. return new Laya.Texture(texture2d);
  369. }
  370. function playMoveByPositions(sp, positions, v, completeCallback) {
  371. let p;
  372. let play = () => {
  373. if (positions.length == 0) {
  374. completeCallback();
  375. return;
  376. }
  377. p = positions[0];
  378. positions.splice(0, 1);
  379. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  380. play();
  381. }));
  382. };
  383. play();
  384. }
  385. function setStarPos(node, num, max) {
  386. for (let i = 1; i <= 5; i++) {
  387. let img = node.getChildAt(i - 1);
  388. img.width = img.height = 30;
  389. img.pivotX = img.pivotY = 0.5;
  390. img.gray = i > num;
  391. img.visible = i <= max;
  392. if (max == 3) {
  393. img.x = node.width / 2 + (i - 2) * 30 - 15;
  394. img.y = node.height - 40;
  395. if (i == 2)
  396. img.y = node.height - 30;
  397. }
  398. else if (max == 5) {
  399. let ly = Math.abs(i - 3);
  400. img.x = node.width / 2 + (i - 3) * 20 - 15;
  401. img.y = node.height - ly * 8 - 30;
  402. }
  403. }
  404. }
  405. function playLoopAnimRotate(sp, time, clockwise = true) {
  406. let rotation;
  407. sp.rotation = sp.rotation % 360;
  408. if (clockwise) {
  409. rotation = -360;
  410. }
  411. else {
  412. rotation = 360;
  413. }
  414. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  415. this.playLoopAnimRotate(sp, time, clockwise);
  416. }));
  417. }
  418. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  419. let x, y;
  420. if (isBig) {
  421. x = valueXMin;
  422. y = valueYMin;
  423. }
  424. else {
  425. x = valueXMax;
  426. y = valueYMax;
  427. }
  428. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  429. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  430. }));
  431. }
  432. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  433. let scale;
  434. if (isBig) {
  435. scale = valueMin;
  436. }
  437. else {
  438. scale = valueMax;
  439. }
  440. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  441. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  442. }));
  443. }
  444. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  445. let value;
  446. if (isBig) {
  447. value = valueMin;
  448. }
  449. else {
  450. value = valueMax;
  451. }
  452. if (count) {
  453. count--;
  454. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  455. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  456. }));
  457. }
  458. else {
  459. sp.rotation = 0;
  460. }
  461. }
  462. function inRect(rect, p) {
  463. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  464. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  465. return true;
  466. }
  467. }
  468. return false;
  469. }
  470. function getNumberK(number) {
  471. if (number < 1000) {
  472. return number.toString();
  473. }
  474. else {
  475. return (number / 1000).toFixed(1) + "k";
  476. }
  477. }
  478. function pointInsideCircle(point, circle, r) {
  479. if (r === 0)
  480. return false;
  481. var dx = circle.x - point.x;
  482. var dy = circle.y - point.y;
  483. return dx * dx + dy * dy <= r * r;
  484. }
  485. function formatString(str, data) {
  486. if (!str || data == undefined) {
  487. return str;
  488. }
  489. if (typeof data === "object") {
  490. for (var key in data) {
  491. if (data.hasOwnProperty(key)) {
  492. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  493. }
  494. }
  495. }
  496. else {
  497. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  498. return str.replace(reg, function (match, index) {
  499. return args[index - (-1)];
  500. });
  501. }
  502. return str;
  503. }
  504. function getIntersection(a, b) {
  505. let t = [];
  506. for (var i = 0; i < a.length; i++) {
  507. for (var j = 0; j < b.length; j++) {
  508. if (a[i] == b[j]) {
  509. t.push(a[i]);
  510. }
  511. }
  512. }
  513. return t;
  514. }
  515. function getComplement(a, b) {
  516. let t = [];
  517. let count = false;
  518. for (var i = 0; i < a.length; i++) {
  519. count = false;
  520. for (var j = 0; j < b.length; j++) {
  521. if (a[i] == b[j]) {
  522. count = true;
  523. break;
  524. }
  525. }
  526. if (!count) {
  527. t.push(a[i]);
  528. }
  529. }
  530. return t;
  531. }
  532. function geSpriteStageRect(sp) {
  533. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  534. let rect = {
  535. x: point.x,
  536. y: point.y,
  537. width: sp.width * sp.globalScaleX,
  538. height: sp.height * sp.globalScaleY
  539. };
  540. return rect;
  541. }
  542. function touchButton(button) {
  543. let event = new Laya.Event();
  544. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  545. }
  546. function setColor(sprite, r, g, b) {
  547. var redMat = [
  548. r / 255, 0, 0, 0, 0,
  549. g / 255, 0, 0, 0, 0,
  550. b / 255, 0, 0, 0, 0,
  551. 0, 0, 0, 1, 0,
  552. ];
  553. var filter = new Laya.ColorFilter(redMat);
  554. sprite.filters = [filter];
  555. }
  556. function clone(obj, newobj = {}) {
  557. for (var attr in obj) {
  558. if (typeof obj[attr] == "object") {
  559. newobj[attr] = clone(obj[attr], newobj[attr]);
  560. }
  561. else {
  562. newobj[attr] = obj[attr];
  563. }
  564. }
  565. return newobj;
  566. }
  567. function _ms(arr, compare, begin, end) {
  568. const size = end - begin;
  569. if (size <= 1) {
  570. return;
  571. }
  572. const middle = (end + begin) >> 1;
  573. _ms(arr, compare, begin, middle);
  574. _ms(arr, compare, middle, end);
  575. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  576. return;
  577. }
  578. const merged = [];
  579. let leftIndex = begin, rightIndex = middle;
  580. while (merged.length < size) {
  581. if (leftIndex === middle) {
  582. merged.push(arr[rightIndex++]);
  583. }
  584. else if (rightIndex === end) {
  585. merged.push(arr[leftIndex++]);
  586. }
  587. else {
  588. const c = compare(arr[leftIndex], arr[rightIndex]);
  589. if (c <= 0) {
  590. merged.push(arr[leftIndex++]);
  591. }
  592. else {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. }
  596. }
  597. arr.splice(begin, size, ...merged);
  598. }
  599. function sort(arr, compare) {
  600. if (!Array.isArray(arr)) {
  601. throw new Error('sort的参数必须为数组');
  602. }
  603. _ms(arr, compare, 0, arr.length);
  604. return arr;
  605. }
  606. function getLanguage(id) {
  607. }
  608. function getLanguageByTip(id) {
  609. }
  610. function toWeights(array) {
  611. let max = 0;
  612. for (var i = 0; i < array.length; i++) {
  613. max = max + array[i];
  614. if (array[i] == 0) {
  615. array[i] = 0;
  616. }
  617. else {
  618. array[i] = max;
  619. }
  620. }
  621. return array;
  622. }
  623. function unique(array) {
  624. var n = {}, r = [], len = array.length, val, type;
  625. for (var i = 0; i < array.length; i++) {
  626. val = array[i];
  627. type = typeof val;
  628. if (!n[val]) {
  629. n[val] = [type];
  630. r.push(val);
  631. }
  632. else if (n[val].indexOf(type) < 0) {
  633. n[val].push(type);
  634. r.push(val);
  635. }
  636. }
  637. return r;
  638. }
  639. function unique1(array) {
  640. var r = [];
  641. for (var i = 0, l = array.length; i < l; i++) {
  642. for (var j = i + 1; j < l; j++)
  643. if (array[i] == array[j])
  644. j == ++i;
  645. r.push(array[i]);
  646. }
  647. return r;
  648. }
  649. function getDistance(x1, y1, x2, y2) {
  650. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  651. }
  652. function getV2Dis(pos1, pos2) {
  653. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  654. }
  655. function getV2SqDis(pos1, pos2) {
  656. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  657. }
  658. function getDis(x1, y1, x2, y2) {
  659. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  660. }
  661. function getDeltaxy(x1, y1, x2, y2) {
  662. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  663. }
  664. function getSymbolNumber(num) {
  665. if (num > 0) {
  666. return "+" + num;
  667. }
  668. else if (num < 0) {
  669. return num.toString();
  670. }
  671. return num.toString();
  672. }
  673. function fixNumber(num, length) {
  674. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  675. }
  676. function toThousands(num) {
  677. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  678. }
  679. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  680. function fmtMoney(money) {
  681. money = toThousands(money.replace(/^0+/, ''));
  682. if (money.length == 0) {
  683. money = "0";
  684. }
  685. let unit = 0;
  686. for (var i = 0; i < money.length; i++) {
  687. if (money.charAt(i) == ",") {
  688. unit++;
  689. }
  690. }
  691. if (unit == 0) {
  692. return money;
  693. }
  694. else {
  695. let idx = money.indexOf(",");
  696. if (idx) {
  697. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  698. }
  699. return money.replace(",", ".");
  700. }
  701. }
  702. function flatten(arr) {
  703. while (arr.some(item => Array.isArray(item))) {
  704. arr = [].concat(...arr);
  705. }
  706. return arr;
  707. }
  708. function getDistanceByPoint(p1, p2) {
  709. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  710. }
  711. function getAngleByPoint(p1, p2) {
  712. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  713. }
  714. function toIntByArray(array) {
  715. for (var index = 0; index < array.length; index++) {
  716. array[index] = parseInt(array[index]);
  717. }
  718. return array;
  719. }
  720. function getAngle0To360(angle) {
  721. while (angle < 0) {
  722. angle += 360;
  723. }
  724. while (angle >= 360) {
  725. angle -= 360;
  726. }
  727. return angle;
  728. }
  729. function toAngle(radian) {
  730. return radian * 180 / Math.PI;
  731. }
  732. function toRadian(angle) {
  733. return angle * Math.PI / 180;
  734. }
  735. function getArrayValueRandom(array) {
  736. return array[random(0, array.length - 1)];
  737. }
  738. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  739. }
  740. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function fmtTimeMMSS(time) {
  743. if (time < 0) {
  744. time = 0;
  745. }
  746. else
  747. time = Math.floor(time);
  748. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  749. }
  750. function fmtTimeMS(time) {
  751. if (time < 0) {
  752. time = 0;
  753. }
  754. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  755. }
  756. function fmtTimeHHMM(time) {
  757. if (time < 0) {
  758. time = 0;
  759. }
  760. time = Math.floor(time / 1000);
  761. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  762. }
  763. let severTime = 0;
  764. function getServerTime() {
  765. return new Date(new Date().getTime() - severTime);
  766. }
  767. function setServerTime(data) {
  768. severTime = (new Date().getTime() - data);
  769. }
  770. var tools = /*#__PURE__*/Object.freeze({
  771. playClickEffect: playClickEffect,
  772. getNumList: getNumList,
  773. getStrList: getStrList,
  774. getRandStr: getRandStr,
  775. getUserId: getUserId,
  776. formatPos: formatPos,
  777. setPosInt: setPosInt,
  778. random: random,
  779. randomList: randomList,
  780. worldToScreen: worldToScreen,
  781. getStringLenght: getStringLenght,
  782. reviseString: reviseString,
  783. getCoinString: getCoinString,
  784. getV3Dest: getV3Dest,
  785. getV2Dest: getV2Dest,
  786. getV2Dir: getV2Dir,
  787. getV3Dir: getV3Dir,
  788. copyPos: copyPos,
  789. getScreenImg: getScreenImg,
  790. playMoveByPositions: playMoveByPositions,
  791. setStarPos: setStarPos,
  792. playLoopAnimRotate: playLoopAnimRotate,
  793. playLoopAnimPosition: playLoopAnimPosition,
  794. playLoopAnimScale: playLoopAnimScale,
  795. playLoopAnimRotation: playLoopAnimRotation,
  796. inRect: inRect,
  797. getNumberK: getNumberK,
  798. pointInsideCircle: pointInsideCircle,
  799. formatString: formatString,
  800. getIntersection: getIntersection,
  801. getComplement: getComplement,
  802. geSpriteStageRect: geSpriteStageRect,
  803. touchButton: touchButton,
  804. setColor: setColor,
  805. clone: clone,
  806. sort: sort,
  807. getLanguage: getLanguage,
  808. getLanguageByTip: getLanguageByTip,
  809. toWeights: toWeights,
  810. unique: unique,
  811. unique1: unique1,
  812. getDistance: getDistance,
  813. getV2Dis: getV2Dis,
  814. getV2SqDis: getV2SqDis,
  815. getDis: getDis,
  816. getDeltaxy: getDeltaxy,
  817. getSymbolNumber: getSymbolNumber,
  818. fixNumber: fixNumber,
  819. toThousands: toThousands,
  820. fmtMoney: fmtMoney,
  821. flatten: flatten,
  822. getDistanceByPoint: getDistanceByPoint,
  823. getAngleByPoint: getAngleByPoint,
  824. toIntByArray: toIntByArray,
  825. getAngle0To360: getAngle0To360,
  826. toAngle: toAngle,
  827. toRadian: toRadian,
  828. getArrayValueRandom: getArrayValueRandom,
  829. promptByTip: promptByTip,
  830. promptByErrorCode: promptByErrorCode,
  831. fmtTimeMMSS: fmtTimeMMSS,
  832. fmtTimeMS: fmtTimeMS,
  833. fmtTimeHHMM: fmtTimeHHMM,
  834. getServerTime: getServerTime,
  835. setServerTime: setServerTime
  836. });
  837. class HttpMgr {
  838. constructor() {
  839. HttpMgr._instance = this;
  840. }
  841. static getInstance() {
  842. if (!this._instance) {
  843. this._instance = new HttpMgr();
  844. }
  845. return this._instance;
  846. }
  847. sendPost(url, data, call) {
  848. let httpObj = new Laya.HttpRequest();
  849. httpObj.http.timeout = 5000;
  850. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  851. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  852. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  853. function errorHandler(error) {
  854. console.log("errorHandler:" + error);
  855. }
  856. function completeHandler(data) {
  857. if (data && data.length > 0) {
  858. let jsonData = JSON.parse(data);
  859. if (call)
  860. call(jsonData);
  861. }
  862. }
  863. }
  864. sendGet(url, call) {
  865. let httpObj = new Laya.HttpRequest();
  866. httpObj.http.timeout = 5000;
  867. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  868. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  869. httpObj.send(url, '', 'get');
  870. function errorHandler(error) {
  871. console.log("errorHandler:" + error);
  872. }
  873. function completeHandler(data) {
  874. if (data && data.length > 0) {
  875. if (call)
  876. call(data);
  877. }
  878. }
  879. }
  880. }
  881. HttpMgr._instance = null;
  882. class LightShader extends Laya.Sprite {
  883. constructor() {
  884. super();
  885. this._time = 0;
  886. this._sin = 0;
  887. this.initShader();
  888. }
  889. initShader() {
  890. var vs = `
  891. #define FSHIGHPRECISION
  892. attribute vec4 posuv;
  893. uniform vec2 size;
  894. varying vec4 v_texcoord;
  895. void main() {
  896. vec4 pos = vec4(posuv.xy,0.,1.);
  897. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  898. gl_Position=pos1;
  899. v_texcoord.xy = posuv.xy;
  900. }
  901. `;
  902. var ps = `
  903. #define FSHIGHPRECISION
  904. precision highp float;
  905. varying vec4 v_texcoord;
  906. uniform vec2 size;
  907. uniform sampler2D texture;
  908. uniform float u_Time;
  909. void main() {
  910. vec4 color= texture2D(texture, v_texcoord.xy);
  911. float width = 0.2;
  912. float start = u_Time;
  913. float offset = 1.0;
  914. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  915. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  916. {
  917. color.r=1.1;
  918. color.g=1.1;
  919. color.b=1.1;
  920. gl_FragColor = color;
  921. } else {
  922. gl_FragColor = color;
  923. }
  924. }
  925. `;
  926. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  927. this.customRenderEnable = true;
  928. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  929. }
  930. customRender(context, x, y) {
  931. this.onUpdate();
  932. if (!this.texture)
  933. return;
  934. let xx = x - this.pivotX;
  935. let yy = y - this.pivotY;
  936. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  937. }
  938. onUpdate() {
  939. this._time += 2 * Laya.timer.delta * 0.001;
  940. this._sin = Math.sin(this._time);
  941. if (this._sin > 0.99) {
  942. this._sin = 0;
  943. this._time = 0;
  944. }
  945. this.shaderValue['u_Time'] = this._sin;
  946. }
  947. }
  948. LightShader.DissolveSurfaceSaveName = 9997;
  949. class UIBase extends fairygui.Window {
  950. constructor() {
  951. super();
  952. this.isEject = true;
  953. this.isHide = true;
  954. this.showbanner = true;
  955. this.className = "";
  956. this.isMuti = false;
  957. this.showbanner = false;
  958. this.onConstructor();
  959. }
  960. checkActive(show) {
  961. }
  962. getUIName() {
  963. return UIBase.uiName;
  964. }
  965. onConstructor() {
  966. }
  967. onInit() {
  968. if (!!this.contentPane) {
  969. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  970. }
  971. this.setPivot(0.5, 0.5, false);
  972. }
  973. doShowAnimation() {
  974. if (!this.isEject)
  975. return;
  976. super.doShowAnimation();
  977. Laya.Tween.clearTween(this);
  978. this.scaleX = this.scaleY = 0.8;
  979. let tweenFunc1 = (func) => {
  980. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  981. };
  982. let tweenFunc2 = (func) => {
  983. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  984. };
  985. tweenFunc1(tweenFunc2);
  986. }
  987. show(...args) {
  988. super.show();
  989. this._openParam = args;
  990. this.isHide = false;
  991. xGame.uiMgr.checkUIState();
  992. }
  993. moveBannerButton() {
  994. }
  995. showBannerButton() {
  996. this.bannerButton.visible = true;
  997. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  998. this.bannerButton.touchable = true;
  999. }));
  1000. }
  1001. hide() {
  1002. super.hide();
  1003. this.isHide = true;
  1004. xGame.uiMgr.checkUIState();
  1005. }
  1006. Dispose() {
  1007. super.dispose();
  1008. }
  1009. myUpdate(delay) {
  1010. }
  1011. refresh() { }
  1012. addUIClick(obj, func, arr = null) {
  1013. obj.onClick(this, func, arr);
  1014. obj.onClick(this, this.playBtnSound);
  1015. }
  1016. offUIClick(obj, func) {
  1017. obj.offClick(this, func);
  1018. }
  1019. playBtnSound() {
  1020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1021. }
  1022. }
  1023. UIBase.lastShowBanner = 0;
  1024. UIBase.showBannerNum = 0;
  1025. UIBase.uiName = "";
  1026. class ui_UIDraw extends fgui.GComponent {
  1027. static createInstance() {
  1028. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1029. }
  1030. onConstruct() {
  1031. this.n1 = (this.getChild("n1"));
  1032. this.extraNode = (this.getChild("extraNode"));
  1033. this.myNode = (this.getChild("myNode"));
  1034. this.closeNode = (this.getChild("closeNode"));
  1035. this.moneyNode = (this.getChild("moneyNode"));
  1036. this.n38 = (this.getChild("n38"));
  1037. this.secretary = (this.getChild("secretary"));
  1038. this.drawBtn = (this.getChild("drawBtn"));
  1039. this.talkNode = (this.getChild("talkNode"));
  1040. this.t0 = this.getTransition("t0");
  1041. }
  1042. }
  1043. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1044. class ui_UIBox extends fgui.GComponent {
  1045. static createInstance() {
  1046. return (fgui.UIPackage.createObject("game", "UIBox"));
  1047. }
  1048. onConstruct() {
  1049. this.n0 = (this.getChild("n0"));
  1050. this.n12 = (this.getChild("n12"));
  1051. this.n1 = (this.getChild("n1"));
  1052. this.n2 = (this.getChild("n2"));
  1053. this.bar = (this.getChild("bar"));
  1054. this.closeBtn = (this.getChild("closeBtn"));
  1055. this.openBtn = (this.getChild("openBtn"));
  1056. this.t0 = this.getTransition("t0");
  1057. this.t1 = this.getTransition("t1");
  1058. }
  1059. }
  1060. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1061. class GlobalManager {
  1062. constructor() {
  1063. }
  1064. registerMethod(name, method) {
  1065. console.log('zh: 注册全局方法', name);
  1066. this[name] = method;
  1067. }
  1068. callMethod(name, ...args) {
  1069. console.log('zh: 调用全局方法', name);
  1070. if (this[name]) {
  1071. return this[name](...args);
  1072. }
  1073. else {
  1074. console.error(`zh: 全局方法 Method ${name} not found`);
  1075. }
  1076. }
  1077. }
  1078. GlobalManager.instance = new GlobalManager();
  1079. class JSBridgeUtils {
  1080. constructor() { }
  1081. static get instance() {
  1082. if (!this._instance) {
  1083. this._instance = new JSBridgeUtils();
  1084. }
  1085. return this._instance;
  1086. }
  1087. initBridge() {
  1088. if (!Laya.Browser.onAndroid) {
  1089. console.log('zh:非android dev');
  1090. return;
  1091. }
  1092. let cfg = window['conchConfig'];
  1093. if (cfg) {
  1094. var os = cfg.getOS();
  1095. if (os == "Conch-android") {
  1096. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1097. if (this.bridge) {
  1098. return true;
  1099. }
  1100. else {
  1101. return false;
  1102. }
  1103. }
  1104. else {
  1105. return false;
  1106. }
  1107. }
  1108. else {
  1109. return false;
  1110. }
  1111. }
  1112. testAd1() {
  1113. if (!Laya.Browser.onAndroid) {
  1114. console.log('zh:非android dev');
  1115. return;
  1116. }
  1117. if (!this.initBridge()) {
  1118. return;
  1119. }
  1120. let rs = this.bridge.call("testString", "hello");
  1121. console.log('zh:testString rs=' + rs);
  1122. }
  1123. testAdCallBack() {
  1124. if (!this.initBridge()) {
  1125. return;
  1126. }
  1127. console.log("zh:testAdCallBack start");
  1128. const defaultObj = { code: 200, msg: "req update Ui" };
  1129. const reqObj = { code: 300, msg: "hello java ui" };
  1130. this.bridge.callWithBack((rsStr) => {
  1131. const rsObj = JSON.parse(rsStr);
  1132. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1133. }, "testAsyncCallback", JSON.stringify(reqObj));
  1134. }
  1135. showInternAd(mark) {
  1136. console.log('zh:showInternAd start');
  1137. if (!Laya.Browser.onAndroid) {
  1138. console.log('zh:showInternAd 非android dev');
  1139. return false;
  1140. }
  1141. if (!this.initBridge()) {
  1142. return false;
  1143. }
  1144. let rs = this.bridge.call("showInternAd", mark);
  1145. try {
  1146. const result = JSON.parse(rs);
  1147. if (result.code === 200) {
  1148. console.log("zh:showInternAd OK");
  1149. return true;
  1150. }
  1151. else {
  1152. console.warn("zh:showInternAd FAILL:", result.msg);
  1153. return false;
  1154. }
  1155. }
  1156. catch (e) {
  1157. console.error("zh:解析桥接返回值失败:", e);
  1158. return false;
  1159. }
  1160. }
  1161. showRewardAd(mark) {
  1162. if (!Laya.Browser.onAndroid) {
  1163. console.log('zh:非android dev');
  1164. return false;
  1165. }
  1166. if (!this.initBridge()) {
  1167. return false;
  1168. }
  1169. let rs = this.bridge.call("showRewardAd", mark);
  1170. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1171. try {
  1172. const result = JSON.parse(rs);
  1173. if (result.code === 200) {
  1174. console.log("zh:广告显示成功");
  1175. return true;
  1176. }
  1177. else {
  1178. console.warn("zh:广告显示失败:", result.msg);
  1179. return false;
  1180. }
  1181. }
  1182. catch (e) {
  1183. console.error("zh:解析桥接返回值失败:", e);
  1184. return false;
  1185. }
  1186. }
  1187. logEventForAdNoParams(eventName) {
  1188. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1189. if (!Laya.Browser.onAndroid) {
  1190. console.log('zh:非android dev');
  1191. return;
  1192. }
  1193. if (!this.initBridge()) {
  1194. return;
  1195. }
  1196. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1197. this.bridge.call("logEventForAdNoParams", eventName);
  1198. }
  1199. logEventForAdHaveParams(eventName, jsonStr) {
  1200. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1201. if (!Laya.Browser.onAndroid) {
  1202. console.log('zh:非android dev');
  1203. return;
  1204. }
  1205. if (!this.initBridge()) {
  1206. return;
  1207. }
  1208. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1209. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1210. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1211. }
  1212. nativeCallJs(msg) {
  1213. console.log("zh:nativeCallJs received data: 1111", msg);
  1214. if (msg === 'Ad1') {
  1215. GlobalManager.instance.callMethod('Ad1');
  1216. console.log("zh: Ad1 奖励发送成功");
  1217. }
  1218. else if (msg === 'Ad2') {
  1219. GlobalManager.instance.callMethod('Ad2');
  1220. console.log("zh: Ad2 奖励发送成功");
  1221. }
  1222. else if (msg === 'Ad3') {
  1223. GlobalManager.instance.callMethod('Ad3');
  1224. console.log("zh: Ad3 奖励发送成功");
  1225. }
  1226. else if (msg === 'Ad4') {
  1227. GlobalManager.instance.callMethod('Ad4');
  1228. console.log("zh: Ad4 奖励发送成功");
  1229. }
  1230. else if (msg === 'Ad5') {
  1231. console.log("zh: Ad5 奖励发送成功");
  1232. GlobalManager.instance.callMethod('Ad5');
  1233. }
  1234. }
  1235. }
  1236. class UIBox extends UIBase {
  1237. constructor() {
  1238. super();
  1239. this.boxNum = 0;
  1240. this.boxMax = 10;
  1241. this.inAd = false;
  1242. this.isClose = false;
  1243. }
  1244. onConstructor() {
  1245. this.ui = ui_UIBox.createInstance();
  1246. this.contentPane = this.ui;
  1247. this.isEject = false;
  1248. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1249. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1250. Laya.timer.loop(1000, this, this.update);
  1251. }
  1252. update() {
  1253. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1254. this.boxNum -= 1;
  1255. this.upBar();
  1256. }
  1257. }
  1258. upBar() {
  1259. if (this.boxNum > this.boxMax)
  1260. this.boxNum = this.boxMax;
  1261. this.ui.bar.value = this.boxNum * 10;
  1262. }
  1263. show() {
  1264. super.show();
  1265. this.isClose = false;
  1266. this.boxNum = 0;
  1267. this.inAd = false;
  1268. this.upBar();
  1269. this.ui.t0.play();
  1270. this.ui.closeBtn.visible = false;
  1271. Laya.timer.once(3000, this, () => {
  1272. this.ui.closeBtn.visible = true;
  1273. this.ui.bar.alpha = 1;
  1274. });
  1275. Laya.timer.once(500, this, () => {
  1276. this.ui.t1.play();
  1277. });
  1278. }
  1279. hide() {
  1280. Laya.timer.clearAll(this);
  1281. Moyu.showBannerAd(false);
  1282. super.hide();
  1283. }
  1284. onOpenBox() {
  1285. this.boxNum++;
  1286. if (this.boxNum < this.boxMax) {
  1287. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1288. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1289. }
  1290. }
  1291. else if (this.boxNum == this.boxMax) {
  1292. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1293. this.ui.openBtn.c1.selectedIndex = 13;
  1294. this.inAd = true;
  1295. }
  1296. else
  1297. this.getAward();
  1298. }
  1299. else if (this.inAd) {
  1300. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1301. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1302. }
  1303. else {
  1304. console.log('zh:AD 失败,直接发放奖励');
  1305. this.qjff_AD_for_UIBOX_onOpenBox();
  1306. }
  1307. }
  1308. this.upBar();
  1309. }
  1310. qjff_AD_for_UIBOX_onOpenBox() {
  1311. this.getAward();
  1312. }
  1313. onCloseBox() {
  1314. if (this.isClose)
  1315. this.hide();
  1316. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1317. this.isClose = true;
  1318. PlatMgr.showBanner(true, 0, 3000);
  1319. }
  1320. else
  1321. this.hide();
  1322. }
  1323. getAward() {
  1324. let str = "";
  1325. if (Math.random() < 0.5) {
  1326. let max = Moyu.isLegal ? 500 : 2500;
  1327. let num = xGame.tools.random(max, 500 + max);
  1328. DataMgr.setCoin(num);
  1329. str = "金币x" + num;
  1330. }
  1331. else {
  1332. let max = Moyu.isLegal ? 10 : 30;
  1333. let num = xGame.tools.random(max, 30 + max);
  1334. DataMgr.setDiamond(num);
  1335. str = "钻石x" + num;
  1336. }
  1337. xGame.showTip("恭喜获得-" + str);
  1338. this.hide();
  1339. }
  1340. }
  1341. UIBox.uiName = "UIBox";
  1342. class ui_UITry extends fgui.GComponent {
  1343. static createInstance() {
  1344. return (fgui.UIPackage.createObject("game", "UITry"));
  1345. }
  1346. onConstruct() {
  1347. this.n11 = (this.getChild("n11"));
  1348. this.myNode = (this.getChild("myNode"));
  1349. this.t0 = this.getTransition("t0");
  1350. }
  1351. }
  1352. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1353. class UITry extends UIBase {
  1354. constructor() {
  1355. super();
  1356. this.closeTime = 0;
  1357. this.closeNum = 0;
  1358. this.skillUrl = xGame.common.skillIconList;
  1359. }
  1360. onConstructor() {
  1361. this.ui = ui_UITry.createInstance();
  1362. this.contentPane = this.ui;
  1363. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1364. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1365. }
  1366. show() {
  1367. super.show();
  1368. this.closeNum = 0;
  1369. this.closeTime = 15;
  1370. this.ui.t0.play();
  1371. PlatMgr.showRateBanner();
  1372. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1373. Laya.timer.loop(1000, this, this.updateTime);
  1374. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1375. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1376. xGame.common.gameMgr.gamePause = true;
  1377. }
  1378. updateTime() {
  1379. if (this.closeTime > 1) {
  1380. this.closeTime--;
  1381. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1382. }
  1383. else
  1384. this.hide();
  1385. }
  1386. hide() {
  1387. Laya.timer.clearAll(this);
  1388. Moyu.showBannerAd(false);
  1389. super.hide();
  1390. xGame.common.gameMgr.gamePause = false;
  1391. }
  1392. onTry() {
  1393. console.log('zh:qjff_AD_for_uitry');
  1394. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1395. }
  1396. else {
  1397. console.log('zh:AD 失败,直接发放奖励');
  1398. this.qjff_AD_for_uitry();
  1399. }
  1400. }
  1401. qjff_AD_for_uitry() {
  1402. let select = xGame.common.curPlayerSkillType;
  1403. DataMgr.gameData.trySkill = select;
  1404. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1405. DataMgr.saveGameData();
  1406. DataMgr.setBigSkill(select, 1);
  1407. xGame.showTip("Trial Successful");
  1408. this.hide();
  1409. }
  1410. onCancel() {
  1411. if (this.closeNum > 0) {
  1412. this.closeNum--;
  1413. if (this.closeNum < 2)
  1414. this.hide();
  1415. return;
  1416. }
  1417. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1418. this.onTry();
  1419. }
  1420. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1421. this.closeNum = 3;
  1422. }
  1423. else
  1424. this.hide();
  1425. }
  1426. }
  1427. UITry.uiName = "UITry";
  1428. class PlatMgr {
  1429. static initConfig() {
  1430. this.lastVt = 0;
  1431. if (!Moyu.platConfig)
  1432. return;
  1433. for (let k in Moyu.platConfig) {
  1434. let pd = this[k];
  1435. let pc = Moyu.platConfig[k];
  1436. if (pd != undefined && pc != undefined)
  1437. this[k] = pc;
  1438. }
  1439. Moyu.setBannerPos(0.5, 1);
  1440. }
  1441. static rand100(num) {
  1442. return xGame.tools.random(0, 100) < num;
  1443. }
  1444. static isMisVideo() {
  1445. let dt = Laya.timer.currTimer - this.lastVt;
  1446. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1447. this.lastVt = Laya.timer.currTimer;
  1448. return true;
  1449. }
  1450. else {
  1451. if (this.rand100(this.fullVideoRate)) {
  1452. console.log('zh:插屏 ad start');
  1453. JSBridgeUtils.instance.showInternAd('platMgr');
  1454. }
  1455. return false;
  1456. }
  1457. }
  1458. static showVideo(call, type) {
  1459. Moyu.showVideoAd(() => {
  1460. this.lastVt = Laya.timer.currTimer;
  1461. call && call();
  1462. }, type);
  1463. }
  1464. static showInsert(delay = false) {
  1465. if (this.getRand() < this.insertRate) {
  1466. let dt = delay ? this.insertDelay : 0;
  1467. console.log('zh:插屏 ad start');
  1468. JSBridgeUtils.instance.showInternAd('gameInsert');
  1469. }
  1470. }
  1471. static gameInsert() {
  1472. let t = this.getRand();
  1473. let r = this.gameInsertRate;
  1474. if (t < r) {
  1475. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1476. }
  1477. }
  1478. static showRateBanner() {
  1479. if (this.getRand() < this.bannerRate)
  1480. this.showBanner(true, this.bannerDelay, 3000);
  1481. }
  1482. static showBanner(show, delay = 0, hide = 0) {
  1483. if (2 > 1) {
  1484. console.log('zh:显示showBanner广告 直接返回');
  1485. return;
  1486. }
  1487. if (!show)
  1488. Moyu.showBannerAd(false);
  1489. else {
  1490. Laya.timer.clear(this, this.bannerShow);
  1491. if (delay > 0)
  1492. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1493. else
  1494. this.bannerShow(true);
  1495. if (hide > 0)
  1496. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1497. }
  1498. }
  1499. static bannerShow(show) {
  1500. if (2 > 1) {
  1501. console.log('zh:显示showBanner广告 直接返回');
  1502. return;
  1503. }
  1504. Moyu.showBannerAd(show);
  1505. console.log("showBanner" + show);
  1506. }
  1507. static getRand() {
  1508. return xGame.tools.random(0, 100);
  1509. }
  1510. static openBox() {
  1511. if (this.getRand() < this.boxRate)
  1512. xGame.uiMgr.Show(UIBox);
  1513. }
  1514. static openTry() {
  1515. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1516. return;
  1517. if (this.getRand() < this.tryRate)
  1518. xGame.uiMgr.Show(UITry);
  1519. else if (DataMgr.gameData.gameCount == 1)
  1520. xGame.uiMgr.Show(UITry);
  1521. }
  1522. }
  1523. PlatMgr.forceShare = 0;
  1524. PlatMgr.signAdRate = 0;
  1525. PlatMgr.forceVideoRate = 0;
  1526. PlatMgr.forceVideoGap = 0;
  1527. PlatMgr.fullVideoRate = 0;
  1528. PlatMgr.gameInsertRate = 0;
  1529. PlatMgr.insertGap = 0;
  1530. PlatMgr.insertDelay = 0;
  1531. PlatMgr.insertRate = 0;
  1532. PlatMgr.boxRate = 0;
  1533. PlatMgr.boxVideoRate = 0;
  1534. PlatMgr.boxInsertRate = 0;
  1535. PlatMgr.boxBannerRate = 0;
  1536. PlatMgr.tryRate = 0;
  1537. PlatMgr.tryClose3Rate = 0;
  1538. PlatMgr.tryVideoRate = 0;
  1539. PlatMgr.bannerRate = 0;
  1540. PlatMgr.lastVt = 0;
  1541. class ui_UIAddProp extends fgui.GComponent {
  1542. static createInstance() {
  1543. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1544. }
  1545. onConstruct() {
  1546. this.n11 = (this.getChild("n11"));
  1547. this.myNode = (this.getChild("myNode"));
  1548. this.closeBtn = (this.getChild("closeBtn"));
  1549. this.t0 = this.getTransition("t0");
  1550. }
  1551. }
  1552. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1553. class SpineMgr {
  1554. constructor(name, loadCb = null) {
  1555. this.loaded = false;
  1556. this.spineName = '';
  1557. this.loadedCallback = loadCb;
  1558. this.templet = new Laya.Templet();
  1559. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1560. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1561. if (name === 'mishu') {
  1562. this.templet.loadAni('spine/nvmishu.sk');
  1563. }
  1564. else {
  1565. this.templet.loadAni(`spine/${name}.sk`);
  1566. }
  1567. this.templet.lock = true;
  1568. this.spineName = name;
  1569. }
  1570. onError() {
  1571. console.log("zh:spine加载出错");
  1572. }
  1573. parseComplete() {
  1574. this.loaded = true;
  1575. this.loadedCallback && this.loadedCallback();
  1576. }
  1577. dispose() {
  1578. if (this.templet && !this.templet.destroyed) {
  1579. this.templet.destroy();
  1580. }
  1581. this.templet = null;
  1582. }
  1583. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1584. if (!this.loaded) {
  1585. return;
  1586. }
  1587. let spine;
  1588. if (mySpine) {
  1589. spine = mySpine;
  1590. }
  1591. else {
  1592. spine = this.createSpine(data, parent);
  1593. }
  1594. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1595. if (!isLoop) {
  1596. spine.on(Laya.Event.STOPPED, this, () => {
  1597. spine.offAll(Laya.Event.STOPPED);
  1598. callback && callback(spine);
  1599. });
  1600. }
  1601. return spine;
  1602. }
  1603. createSpine(data, parent, type = 1) {
  1604. let spine;
  1605. spine = this.templet.buildArmature(type);
  1606. spine.showSkinByIndex(0);
  1607. parent.addChild(spine);
  1608. spine.pos(data.x, data.y);
  1609. spine.scale(data.scaleX, data.scaleY, true);
  1610. return spine;
  1611. }
  1612. }
  1613. var AIState;
  1614. (function (AIState) {
  1615. AIState[AIState["none"] = 0] = "none";
  1616. AIState[AIState["idle"] = 1] = "idle";
  1617. AIState[AIState["reset"] = 2] = "reset";
  1618. AIState[AIState["move"] = 3] = "move";
  1619. AIState[AIState["wait"] = 4] = "wait";
  1620. AIState[AIState["select"] = 5] = "select";
  1621. AIState[AIState["turn"] = 6] = "turn";
  1622. AIState[AIState["shoot"] = 7] = "shoot";
  1623. AIState[AIState["leave"] = 8] = "leave";
  1624. })(AIState || (AIState = {}));
  1625. class AIPlayer {
  1626. constructor() {
  1627. this.dtime = 30;
  1628. this.awayTime = 0;
  1629. this.awayNum = 0;
  1630. this.hideTime = 0;
  1631. this.rootMoveTime = 0;
  1632. this.isGuide = false;
  1633. this.state = AIState.none;
  1634. this.waitTime = 0;
  1635. this.forceNum = 0;
  1636. this.forceMax = 0;
  1637. this.ballSize = 33;
  1638. this.selectNum = 0;
  1639. this.destRot = 0;
  1640. this.aiLv = 10;
  1641. this.kickBall = [];
  1642. this.lineBall = [];
  1643. this.scoreBall = [];
  1644. this.holeBall = [];
  1645. this.turnNum = 0;
  1646. this.setNum = 0;
  1647. this.setMax = 0;
  1648. this.setRate = 0;
  1649. this.rectL = 0;
  1650. this.rectR = 0;
  1651. this.rectT = 0;
  1652. this.rectB = 0;
  1653. this.rootPos = { x: 0, y: 0 };
  1654. this.bestForce = 0;
  1655. this.bestAngle = 180;
  1656. this.bestPos = { x: 0, y: 0 };
  1657. this.bestKick = { x: 0, y: 0 };
  1658. this.posList = [];
  1659. this.posIdx = 0;
  1660. this.chatTime = 3000;
  1661. this.tempDir1 = new Laya.Vector2();
  1662. this.tempDir2 = new Laya.Vector2();
  1663. this.tempDir3 = new Laya.Vector2();
  1664. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1665. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1666. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1667. this.gameSrc = xGame.common.gameUI;
  1668. this.hideTime = Laya.timer.currTimer;
  1669. Moyu.setOnTipCall((id) => {
  1670. if (id == 20012)
  1671. this.hideTime = Laya.timer.currTimer;
  1672. else
  1673. (id == 20011);
  1674. {
  1675. let dt = Laya.timer.currTimer - this.hideTime;
  1676. console.log("onshow" + dt);
  1677. if (dt > 30000 && this.state > AIState.none)
  1678. xGame.common.gameMgr.aiGameEnd(false);
  1679. }
  1680. }, this);
  1681. }
  1682. init() {
  1683. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1684. this.awayTime = xGame.tools.random(5000, 10000);
  1685. this.awayNum = 0;
  1686. this.hideTime = Laya.timer.currTimer;
  1687. let rect = xGame.common.d2World.borderRect;
  1688. this.rectL = Math.ceil(rect.x) + 17;
  1689. this.rectT = Math.ceil(rect.y) + 17;
  1690. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1691. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1692. this.wBall = xGame.common.d2World.rootBall;
  1693. this.ballSize = this.wBall.gameObj.width - 1;
  1694. if (this.posList.length < 1) {
  1695. let dp = 40;
  1696. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1697. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1698. let dx = i < this.rectR ? i : this.rectR;
  1699. let dy = j < this.rectB ? j : this.rectB;
  1700. let order = xGame.tools.random(0, 1000);
  1701. this.posList.push({ x: dx, y: dy, order: order });
  1702. }
  1703. }
  1704. this.posList.sort(function (a, b) {
  1705. return a.order - b.order;
  1706. });
  1707. this.setMax = this.posList.length;
  1708. }
  1709. this.state = AIState.idle;
  1710. }
  1711. setAiLevel(num) {
  1712. this.aiLv = num;
  1713. }
  1714. initBall() {
  1715. this.rootPos.x = this.wBall.gameObj.x;
  1716. this.rootPos.y = this.wBall.gameObj.y;
  1717. this.initHoleBall();
  1718. }
  1719. initHoleBall() {
  1720. this.kickBall = [];
  1721. this.lineBall = [];
  1722. this.scoreBall = [];
  1723. this.holeBall = [];
  1724. this.selectNum = 0;
  1725. this.forceNum = 0;
  1726. this.forceMax = 0;
  1727. this.turnNum = 0;
  1728. let list = xGame.common.d2World.ballArr;
  1729. if (list.length < 20 && !this.isGuide) {
  1730. let holes = xGame.common.gameMgr.holePosList;
  1731. for (let i = 0; i < list.length; i++) {
  1732. let obj = list[i];
  1733. if (!obj)
  1734. continue;
  1735. obj.kickPos.x = 0;
  1736. obj.kickPos.y = 0;
  1737. obj.poleAngle = 0;
  1738. obj.hard = 0;
  1739. obj.borderDis = 0;
  1740. obj.kickAngle = 180;
  1741. if (obj.number == 0)
  1742. continue;
  1743. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1744. continue;
  1745. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1746. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1747. continue;
  1748. }
  1749. let b = obj.gameObj;
  1750. let wbp = this.rootPos;
  1751. let bx = wbp.x - b.x;
  1752. let by = wbp.y - b.y;
  1753. obj.borderDis = xGame.tools.random(0, 100);
  1754. this.kickBall.push(obj);
  1755. if (!this.isLine(wbp, obj))
  1756. continue;
  1757. obj.kickAngle = xGame.tools.random(90, 180);
  1758. obj.kickPos.x = b.x;
  1759. obj.kickPos.y = b.y;
  1760. this.lineBall.push(obj);
  1761. let minDis = 999999;
  1762. let hole = false;
  1763. for (let j = 0; j < holes.length; j++) {
  1764. let hp = holes[j];
  1765. if (bx >= 0 && hp.x > b.x + 100)
  1766. continue;
  1767. if (bx <= 0 && hp.x < b.x - 100)
  1768. continue;
  1769. if (by < -10 && hp.y < wbp.y)
  1770. continue;
  1771. if (by > 10 && hp.y > wbp.y)
  1772. continue;
  1773. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1774. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1775. if (dis < minDis) {
  1776. let dx = b.x - this.tempDir1.x * this.ballSize;
  1777. let dy = b.y - this.tempDir1.y * this.ballSize;
  1778. this.tempDir3.x = this.tempDir1.x;
  1779. this.tempDir3.y = this.tempDir1.y;
  1780. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1781. obj.kickPos.x = dx;
  1782. obj.kickPos.y = dy;
  1783. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1784. if (num > 1)
  1785. num = 1;
  1786. obj.kickAngle = Math.acos(num) * 57.3;
  1787. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1788. dis = dis * 2;
  1789. if (Math.abs(hp.x - 600) < 100)
  1790. dis += 50;
  1791. obj.hard = dis + obj.kickAngle * 3;
  1792. hole = true;
  1793. }
  1794. }
  1795. }
  1796. }
  1797. if (hole) {
  1798. this.scoreBall.push(obj);
  1799. this.holeBall.push(obj);
  1800. }
  1801. }
  1802. this.scoreBall.sort(function (a, b) {
  1803. return a.hard - b.hard;
  1804. });
  1805. this.holeBall.sort(function (a, b) {
  1806. return a.kickAngle - b.kickAngle;
  1807. });
  1808. this.kickBall.sort(function (a, b) {
  1809. return a.borderDis - b.borderDis;
  1810. });
  1811. }
  1812. else {
  1813. let max = list.length - 1;
  1814. let i = xGame.tools.random(0, max);
  1815. for (i; i <= max; i++) {
  1816. let idx = i >= max ? i -= max : i;
  1817. let obj = list[idx];
  1818. if (obj && obj.number != 0) {
  1819. obj.kickAngle = xGame.tools.random(90, 180);
  1820. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1821. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1822. this.lineBall.push(obj);
  1823. break;
  1824. }
  1825. }
  1826. }
  1827. }
  1828. selectBall() {
  1829. let ball = null;
  1830. this.destRot = 0;
  1831. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1832. let ai = 110 - this.aiLv * 10;
  1833. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1834. let score = false;
  1835. if (this.scoreBall.length < 1) {
  1836. if (this.lineBall.length < 1) {
  1837. for (let i = 0; i < this.kickBall.length; i++) {
  1838. let list = [];
  1839. let bo = this.kickBall[i];
  1840. let bobj = bo.gameObj;
  1841. let rect = xGame.common.d2World.borderRect;
  1842. let mobj = this.wBall.gameObj;
  1843. let minb = bobj.y - rect.y - 20;
  1844. let minw = mobj.y - rect.y - 50;
  1845. if (minb > 0 && minw > 0) {
  1846. let dlenx = 0;
  1847. let dleny = mobj.y - rect.y;
  1848. let spx = mobj.x;
  1849. let spy = rect.y - dleny;
  1850. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1851. }
  1852. minb = rect.y + rect.height - bobj.y - 20;
  1853. minw = rect.y + rect.height - mobj.y - 50;
  1854. if (minb > 0 && minw > 0) {
  1855. let dlenx = 0;
  1856. let dleny = rect.y + rect.height - mobj.y;
  1857. let spx = mobj.x;
  1858. let spy = rect.y + rect.height + dleny;
  1859. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1860. }
  1861. minb = bobj.x - rect.x - 20;
  1862. minw = mobj.x - rect.x - 50;
  1863. if (minb > 0 && minw > 0) {
  1864. let dlenx = mobj.x - rect.x;
  1865. let dleny = 0;
  1866. let spx = rect.x - dlenx;
  1867. let spy = mobj.y;
  1868. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1869. }
  1870. minb = rect.x + rect.width - bobj.x - 20;
  1871. minw = rect.x + rect.width - mobj.x - 50;
  1872. if (minb > 0 && minw > 0) {
  1873. let dlenx = rect.x + rect.width - mobj.x;
  1874. let dleny = 0;
  1875. let spx = rect.x + rect.width + dlenx;
  1876. let spy = mobj.y;
  1877. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1878. }
  1879. list.sort(function (a, b) {
  1880. return a.order - b.order;
  1881. });
  1882. for (let i = 0; i < list.length; i++) {
  1883. let data = list[i];
  1884. let mx = mobj.x - bobj.x;
  1885. let my = mobj.y - bobj.y;
  1886. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1887. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1888. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1889. if (num > 1)
  1890. num = 1;
  1891. let cos = Math.acos(num);
  1892. if (cos > 1.57)
  1893. cos = 1.57;
  1894. else if (cos < 0.01)
  1895. cos = 0.01;
  1896. let tan = Math.tan(cos);
  1897. let dx = tan * data.dleny;
  1898. let dy = tan * data.dlenx;
  1899. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1900. if (Math.abs(bx - 667) < 40)
  1901. continue;
  1902. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1903. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1904. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1905. this.forceMax = dis * 0.08;
  1906. this.destRot += mis * 0.1;
  1907. this.setKick(bx, by);
  1908. return true;
  1909. }
  1910. }
  1911. }
  1912. }
  1913. else {
  1914. ball = xGame.common.getRandArrEle(this.lineBall);
  1915. }
  1916. }
  1917. else {
  1918. for (let i = 0; i < this.scoreBall.length; i++) {
  1919. if (i < this.scoreBall.length - 1) {
  1920. let rand = 70 + this.aiLv * 10 + i * 10;
  1921. if (xGame.tools.random(0, 100) < rand) {
  1922. ball = this.scoreBall[i];
  1923. break;
  1924. }
  1925. }
  1926. else {
  1927. ball = this.scoreBall[i];
  1928. break;
  1929. }
  1930. }
  1931. score = true;
  1932. this.selectNum++;
  1933. }
  1934. if (!ball)
  1935. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1936. if (this.selectNum >= max) {
  1937. let dx = ball.gameObj.x;
  1938. let dy = ball.gameObj.y;
  1939. let kickAngle = 0;
  1940. if (score) {
  1941. dx = ball.kickPos.x;
  1942. dy = ball.kickPos.y;
  1943. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1944. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1945. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1946. if (adot > 1)
  1947. adot = 1;
  1948. kickAngle = Math.acos(adot) * 57.3;
  1949. if (kickAngle > 45) {
  1950. let kdx = ball.kickPos.x - ball.gameObj.x;
  1951. let kdy = ball.kickPos.y - ball.gameObj.y;
  1952. dx = ball.kickPos.x - kdx * mis * 0.3;
  1953. dy = ball.kickPos.y - kdy * mis * 0.3;
  1954. }
  1955. else
  1956. this.destRot += mis;
  1957. }
  1958. else if (ball.poleAngle != 0) {
  1959. this.destRot += ball.poleAngle;
  1960. }
  1961. if (xGame.common.gameMode == 0) {
  1962. let af = kickAngle * 0.08;
  1963. this.forceMax = ball.hard * 0.1 + af * af;
  1964. }
  1965. this.setKick(dx, dy);
  1966. }
  1967. else {
  1968. let rand = this.aiLv * 5 + 40;
  1969. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1970. ball = xGame.common.getRandArrEle(this.scoreBall);
  1971. else
  1972. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1973. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1974. if (xGame.tools.random(0, 100) > rand) {
  1975. this.selectNum = max;
  1976. }
  1977. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1978. this.selectNum++;
  1979. }
  1980. ball.onClick(0, true);
  1981. }
  1982. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1983. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1984. let balls = xGame.common.d2World.ballArr;
  1985. let max = xGame.tools.getDis(hx, hy, bx, by);
  1986. for (let index = 0; index < balls.length; index++) {
  1987. let obj = balls[index];
  1988. if (obj.number == 0)
  1989. continue;
  1990. if (obj.number == bn || obj.number == dn)
  1991. continue;
  1992. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1993. if (dis * dis > max)
  1994. continue;
  1995. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1996. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1997. if (num > 1)
  1998. num = 1;
  1999. if (num < 0)
  2000. continue;
  2001. let gap = Math.sin(Math.acos(num)) * dis;
  2002. if (gap < this.ballSize)
  2003. return true;
  2004. }
  2005. return false;
  2006. }
  2007. isLine(xy, ball) {
  2008. let bx = xy.x;
  2009. let by = xy.y;
  2010. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2011. let dis = ball.getDestDis(xy);
  2012. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2013. let sin = Math.sin(angle);
  2014. let cos = Math.cos(angle);
  2015. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2016. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2017. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2018. let dx = bx + this.tempDir2.x * dis;
  2019. let dy = by + this.tempDir2.y * dis;
  2020. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2021. sin = Math.sin(-angle);
  2022. cos = Math.cos(-angle);
  2023. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2024. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2025. dx = bx + this.tempDir2.x * dis;
  2026. dy = by + this.tempDir2.y * dis;
  2027. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2028. if (isr && isl)
  2029. return false;
  2030. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2031. }
  2032. return true;
  2033. }
  2034. turnPole() {
  2035. this.turnNum++;
  2036. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2037. let dr = rot - this.destRot;
  2038. let abs = Math.abs(dr) % 360;
  2039. if (abs > 180) {
  2040. if (rot > 180)
  2041. rot -= 360;
  2042. if (this.destRot > 180)
  2043. this.destRot -= 360;
  2044. }
  2045. let max = this.turnNum * 5 + this.aiLv * 5;
  2046. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2047. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2048. let at = xGame.tools.random(1000, 2000);
  2049. if (!this.onAway(3))
  2050. at += xGame.tools.random(10000, 15000);
  2051. this.setState(AIState.shoot, at);
  2052. }
  2053. else {
  2054. let mr = 0;
  2055. if (abs > 3)
  2056. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2057. else if (Math.random() > 0.6)
  2058. mr = xGame.tools.random(1, 10) * 0.1;
  2059. mr = dr > 0 ? -mr : mr;
  2060. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2061. }
  2062. }
  2063. setKick(dx, dy) {
  2064. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2065. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2066. this.tempDir1.x = 0;
  2067. this.tempDir1.y = 1;
  2068. this.tempDir2.y = -this.tempDir2.y;
  2069. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2070. if (num > 1)
  2071. num = 1;
  2072. let rot = Math.acos(num) * 57.3;
  2073. if (this.tempDir2.x < 0)
  2074. rot = 360 - rot;
  2075. this.destRot += rot;
  2076. if (!xGame.common.gameMgr.finishOneShoot) {
  2077. this.forceMax += xGame.tools.random(10, 50);
  2078. this.forceMax -= this.aiLv * 2;
  2079. if (this.forceMax < 20)
  2080. this.forceMax = 20;
  2081. }
  2082. if (this.forceMax > 100)
  2083. this.forceMax = 101;
  2084. else if (this.forceMax < 10)
  2085. this.forceMax += xGame.tools.random(0, 10);
  2086. if (xGame.common.gameMode == 1)
  2087. this.forceMax = xGame.tools.random(80, 100);
  2088. else
  2089. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2090. let max = 2000 - this.aiLv * 100;
  2091. if (Math.random() > 0.8)
  2092. max += xGame.tools.random(100, 2000);
  2093. this.setState(AIState.turn, xGame.tools.random(500, max));
  2094. }
  2095. shoot() {
  2096. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2097. if (Math.random() > 0.8) {
  2098. this.gameSrc.aiForce(1);
  2099. this.setState(AIState.wait);
  2100. }
  2101. }
  2102. else {
  2103. let df = xGame.tools.random(3, 8);
  2104. if (this.forceNum < this.forceMax)
  2105. this.forceNum += df;
  2106. else
  2107. this.forceNum -= df;
  2108. let startY = this.gameSrc.ui.powerNode.y;
  2109. let height = this.gameSrc.ui.powerNode.height;
  2110. let force = startY + height * this.forceNum * 0.01;
  2111. this.gameSrc.aiForce(2, force);
  2112. }
  2113. }
  2114. reset() {
  2115. for (let i = 0; i < 4; i++) {
  2116. this.setRate--;
  2117. this.setNum++;
  2118. let pos = this.posList[this.posIdx];
  2119. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2120. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2121. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2122. this.rootPos.x = 387;
  2123. if (this.rootPos.x < this.rectL)
  2124. this.rootPos.x = this.rectL;
  2125. else if (this.rootPos.x > this.rectR)
  2126. this.rootPos.x = this.rectR;
  2127. if (this.rootPos.y < this.rectT)
  2128. this.rootPos.y = this.rectT;
  2129. else if (this.rootPos.y > this.rectB)
  2130. this.rootPos.y = this.rectB;
  2131. this.posIdx++;
  2132. let max = this.posList.length;
  2133. if (this.posIdx >= max)
  2134. this.posIdx -= max;
  2135. this.initHoleBall();
  2136. let ball = null;
  2137. if (this.scoreBall.length > 0)
  2138. ball = this.scoreBall[0];
  2139. else if (this.lineBall.length > 0)
  2140. ball = xGame.common.getRandArrEle(this.lineBall);
  2141. if (ball && ball.kickAngle < this.bestAngle) {
  2142. this.bestAngle = ball.kickAngle;
  2143. this.bestKick.x = ball.kickPos.x;
  2144. this.bestKick.y = ball.kickPos.y;
  2145. this.bestPos.x = this.rootPos.x;
  2146. this.bestPos.y = this.rootPos.y;
  2147. this.bestForce = ball.hard * 0.08;
  2148. }
  2149. }
  2150. if (this.setNum >= this.setMax)
  2151. this.setMax = 0;
  2152. if (this.setRate < 1) {
  2153. this.setState(AIState.move, 0);
  2154. this.rootMoveTime = Laya.timer.currTimer;
  2155. this.gameSrc.aiRootMove(true);
  2156. }
  2157. }
  2158. delayLine() {
  2159. this.gameSrc.aiRootMove(false);
  2160. }
  2161. move() {
  2162. if (this.bestPos.x < 1)
  2163. this.bestPos = this.rootPos;
  2164. let wObj = this.wBall.gameObj;
  2165. let destx = wObj.x;
  2166. let desty = wObj.y;
  2167. let dx = Math.abs(destx - this.bestPos.x);
  2168. let dy = Math.abs(desty - this.bestPos.y);
  2169. let mx = 3 + dx * 0.03;
  2170. let my = 3 + dy * 0.03;
  2171. if (dx < 4 && dy < 4) {
  2172. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2173. dt = dt < 1000 ? 1000 - dt : 0;
  2174. if (this.setMax > 0) {
  2175. let min = this.setMax * 0.3 + this.aiLv * 5;
  2176. this.setRate = xGame.tools.random(min, this.setMax);
  2177. this.setState(AIState.reset, 0);
  2178. }
  2179. else {
  2180. this.destRot = 0;
  2181. this.forceMax = this.bestForce;
  2182. this.setKick(this.bestKick.x, this.bestKick.y);
  2183. }
  2184. if (dt > 100) {
  2185. Laya.timer.clear(this, this.delayLine);
  2186. Laya.timer.once(dt, this, this.delayLine);
  2187. }
  2188. else
  2189. this.gameSrc.aiRootMove(false);
  2190. }
  2191. else {
  2192. if (dx > 4)
  2193. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2194. if (dy > 4)
  2195. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2196. this.gameSrc.onRootMove({ x: destx, y: desty });
  2197. }
  2198. }
  2199. resetRoot() {
  2200. this.bestAngle = 180;
  2201. this.bestForce = 0;
  2202. this.setMax = this.posList.length;
  2203. this.posIdx = xGame.tools.random(0, this.setMax);
  2204. let min = this.setMax * 0.3 + this.aiLv * 5;
  2205. this.setRate = xGame.tools.random(min, this.setMax);
  2206. let max = 2000 - this.aiLv * 100;
  2207. if (Math.random() > 0.8)
  2208. max += xGame.tools.random(100, 1000);
  2209. if (this.isGuide)
  2210. this.setState(AIState.select, 500);
  2211. else if (this.onAway(2))
  2212. this.setState(AIState.reset, xGame.tools.random(400, max));
  2213. else
  2214. this.setState(AIState.none);
  2215. if (xGame.common.gameMgr.finishOneShoot)
  2216. this.chat();
  2217. }
  2218. runAI() {
  2219. if (this.state > AIState.idle)
  2220. return;
  2221. this.initBall();
  2222. this.onGame(2500);
  2223. if (Math.random() > 0.6)
  2224. this.chat();
  2225. }
  2226. stopRun() {
  2227. this.setState(AIState.idle);
  2228. }
  2229. onGame(base) {
  2230. let max = base - this.aiLv * 100;
  2231. if (Math.random() > 0.8)
  2232. max += xGame.tools.random(100, 1000);
  2233. if (this.onAway(2))
  2234. this.setState(AIState.select, xGame.tools.random(500, max));
  2235. else
  2236. this.setState(AIState.none);
  2237. }
  2238. setState(sta, wt = 0) {
  2239. if (this.state == AIState.none)
  2240. return;
  2241. this.state = sta;
  2242. this.waitTime = wt;
  2243. }
  2244. onUpdate() {
  2245. if (this.state == AIState.none)
  2246. return;
  2247. this.awayTime -= this.dtime;
  2248. if (this.awayTime < 1) {
  2249. this.awayTime = xGame.tools.random(6000, 10000);
  2250. this.awayNum += (11 - this.aiLv);
  2251. this.onAway(1);
  2252. }
  2253. if (this.waitTime >= 0) {
  2254. this.waitTime -= this.dtime;
  2255. return;
  2256. }
  2257. switch (this.state) {
  2258. case AIState.idle:
  2259. this.chat();
  2260. break;
  2261. case AIState.reset:
  2262. this.reset();
  2263. break;
  2264. case AIState.move:
  2265. this.move();
  2266. break;
  2267. case AIState.leave:
  2268. this.state = AIState.none;
  2269. xGame.common.gameMgr.aiGameEnd(true);
  2270. break;
  2271. case AIState.select:
  2272. this.selectBall();
  2273. break;
  2274. case AIState.turn:
  2275. this.turnPole();
  2276. break;
  2277. case AIState.shoot:
  2278. this.shoot();
  2279. break;
  2280. }
  2281. }
  2282. onAway(type) {
  2283. if (type == 1) {
  2284. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2285. let num = this.awayNum + db * 20;
  2286. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2287. xGame.common.gameMgr.aiLeave();
  2288. this.setState(AIState.leave, 6666);
  2289. }
  2290. }
  2291. else if (type == 2) {
  2292. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2293. let num = this.awayNum + db * 30;
  2294. if (xGame.tools.random(0, 10000) < num)
  2295. return false;
  2296. }
  2297. else if (type == 3) {
  2298. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2299. let num = this.awayNum + db * 10;
  2300. if (xGame.tools.random(0, 4000) < num)
  2301. return false;
  2302. }
  2303. return true;
  2304. }
  2305. chat() {
  2306. if (this.chatTime > 0) {
  2307. this.chatTime -= this.dtime;
  2308. return;
  2309. }
  2310. this.chatTime = xGame.tools.random(2000, 10000);
  2311. let rand = xGame.tools.random(0, 100);
  2312. if (rand < 15)
  2313. this.talk();
  2314. else if (rand < 35)
  2315. this.emotion();
  2316. }
  2317. talk() {
  2318. xGame.common.talkMgr.showAITalk(0);
  2319. }
  2320. emotion() {
  2321. xGame.common.talkMgr.showAIEmotion(0);
  2322. }
  2323. resetAI() {
  2324. this.stopRun();
  2325. this.state = AIState.none;
  2326. }
  2327. }
  2328. class Partical extends Laya.Script3D {
  2329. constructor() {
  2330. super();
  2331. this.duration = 2000;
  2332. }
  2333. ;
  2334. onAwake() {
  2335. this.gameObj = this.owner;
  2336. }
  2337. onEnable() {
  2338. this.openTimer();
  2339. }
  2340. openTimer() {
  2341. Laya.timer.once(this.duration, this, this.disappear);
  2342. }
  2343. setCallback(obj, callback) {
  2344. this.obj = obj;
  2345. this.callback = callback;
  2346. Laya.timer.clearAll(this);
  2347. Laya.timer.once(this.duration, this, this.disappear);
  2348. }
  2349. disappear() {
  2350. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2351. this.callback && this.callback(this.obj);
  2352. }
  2353. }
  2354. class Ball extends Laya.Script3D {
  2355. constructor() {
  2356. super();
  2357. this.posV3 = new Laya.Vector3();
  2358. this.rotRate = 2.1;
  2359. this.rotSpeed = new Laya.Vector3();
  2360. this.myIndex = 0;
  2361. }
  2362. onAwake() {
  2363. this.gameObj = this.owner;
  2364. this.transform = this.gameObj.transform;
  2365. this.ballNode = this.gameObj.getChildByName("Ball");
  2366. this.shadowNode = this.gameObj.getChildByName("shadow");
  2367. }
  2368. initSelf(index, x, y, owner) {
  2369. this.d2BallSrc = owner;
  2370. this.myIndex = index;
  2371. this.setAlbedoTexture();
  2372. this.setTransPos(x, y);
  2373. this.setScale();
  2374. this.ballNode.transform.localRotationEulerX = 90;
  2375. if (index == 0) {
  2376. }
  2377. }
  2378. setAlbedoTexture(isIce = false) {
  2379. let url;
  2380. if (isIce) {
  2381. url = `res/d3Res/ballTexture/ice.jpg`;
  2382. }
  2383. else {
  2384. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2385. }
  2386. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2387. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2388. }));
  2389. }
  2390. runFireworks(obj, delay, callback) {
  2391. Laya.timer.clearAll(this);
  2392. Laya.timer.once(delay + 1, this, () => {
  2393. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2394. fire.transform.localPositionX = this.transform.localPositionX;
  2395. fire.transform.localPositionY = this.transform.localPositionY;
  2396. fire.transform.localPositionZ = this.transform.localPositionZ;
  2397. let src = fire.getComponent(Partical);
  2398. src.duration = 1000;
  2399. src.setCallback(obj, callback);
  2400. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2401. eft.transform.localPositionX = this.transform.localPositionX;
  2402. eft.transform.localPositionY = this.transform.localPositionY;
  2403. eft.transform.localPositionZ = this.transform.localPositionZ;
  2404. });
  2405. }
  2406. setTransPos(x, y) {
  2407. this.setRotation();
  2408. xGame.common.pos2to3Convert(x, y, this.posV3);
  2409. this.transform.localPositionX = this.posV3.x;
  2410. this.transform.localPositionY = 0;
  2411. this.transform.localPositionZ = this.posV3.z;
  2412. this.transform.localRotationEulerX = 0;
  2413. this.transform.localRotationEulerY = 0;
  2414. this.transform.localRotationEulerZ = 0;
  2415. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2416. this.shadowNode.transform.localPositionY = 0.1;
  2417. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2418. }
  2419. setRotation() {
  2420. if (this.d2BallSrc.canRot) {
  2421. let speed = this.d2BallSrc.rigy.linearVelocity;
  2422. this.rotSpeed.x = speed.x * this.rotRate;
  2423. this.rotSpeed.z = speed.y * this.rotRate;
  2424. this.rotSpeed.y = this.d2BallSrc.rotY;
  2425. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2426. }
  2427. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2428. this.rotSpeed.x = this.rotSpeed.y = 0;
  2429. this.rotSpeed.y = this.d2BallSrc.rotY;
  2430. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2431. }
  2432. }
  2433. setScale() {
  2434. let radius = xGame.common.d2World.rootBall.ui.width;
  2435. let scale = xGame.common.scale2to3Convert(radius);
  2436. this.transform.localScaleX = scale;
  2437. this.transform.localScaleY = scale;
  2438. this.transform.localScaleZ = scale;
  2439. }
  2440. playInHoleEft() {
  2441. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2442. eft.transform.position = this.transform.position;
  2443. }
  2444. playIceEft() {
  2445. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2446. eft.transform.position = this.transform.position;
  2447. }
  2448. get scaleXYZ() {
  2449. return this.transform.localScaleX;
  2450. }
  2451. set scaleXYZ(val) {
  2452. this.transform.localScaleX = val;
  2453. this.transform.localScaleY = val;
  2454. this.transform.localScaleZ = val;
  2455. }
  2456. get posX() {
  2457. return this.transform.localPositionX;
  2458. }
  2459. set posX(val) {
  2460. this.transform.localPositionX = val;
  2461. }
  2462. get posY() {
  2463. return this.transform.localPositionY;
  2464. }
  2465. set posY(val) {
  2466. this.transform.localPositionY = val;
  2467. }
  2468. get posZ() {
  2469. return this.transform.localPositionZ;
  2470. }
  2471. set posZ(val) {
  2472. this.transform.localPositionZ = val;
  2473. }
  2474. destroySelf() {
  2475. this.posV3 = null;
  2476. this.rotSpeed = null;
  2477. this.d2BallSrc = null;
  2478. this.ballNode = null;
  2479. this.gameObj.destroy(true);
  2480. this.transform = null;
  2481. this.destroy();
  2482. }
  2483. }
  2484. class ui_D2Ball extends fgui.GComponent {
  2485. static createInstance() {
  2486. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2487. }
  2488. onConstruct() {
  2489. this.myIcon = (this.getChild("myIcon"));
  2490. this.inner = (this.getChild("inner"));
  2491. this.n8 = (this.getChild("n8"));
  2492. this.n4 = (this.getChild("n4"));
  2493. this.wrongTips = (this.getChild("wrongTips"));
  2494. this.rightTips = (this.getChild("rightTips"));
  2495. this.breathAni = this.getTransition("breathAni");
  2496. }
  2497. }
  2498. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2499. class D2BallSrc extends Laya.Script {
  2500. constructor() {
  2501. super();
  2502. this.number = 0;
  2503. this.startX = 0;
  2504. this.startY = 0;
  2505. this.angleV2 = new Laya.Vector2();
  2506. this.isRootBall = false;
  2507. this.isBlackBall = false;
  2508. this.ballType = "";
  2509. this.canRot = true;
  2510. this.rotY = 0;
  2511. this.poleAngle = 0;
  2512. this.kickPos = { x: 0, y: 0 };
  2513. this.hard = 0;
  2514. this.kickAngle = 0;
  2515. this.borderDis = 0;
  2516. this.speedP10 = 5.6;
  2517. this.lastSpeed = { x: 0, y: 0 };
  2518. this.stillSpeed = 0.12;
  2519. this.ballFunc = "normal";
  2520. this.isRunSkillAni = false;
  2521. this.isInHole = false;
  2522. this.iceOwner = "";
  2523. this.forceRun = false;
  2524. this.myUNID = "";
  2525. this.rectL = 0;
  2526. this.rectR = 0;
  2527. this.rectT = 0;
  2528. this.rectB = 0;
  2529. this.forceVec = new Laya.Vector2();
  2530. this.lastDis = 0;
  2531. this.helpOut = { type: "", x: 0, y: 0 };
  2532. }
  2533. initSelf(number, x, y, d3Ball) {
  2534. if (!this.gameObj)
  2535. this.gameObj = this.owner;
  2536. this.number = number;
  2537. this.startX = x;
  2538. this.startY = y;
  2539. this.d3Ball = d3Ball;
  2540. this.isRootBall = false;
  2541. this.isBlackBall = false;
  2542. this.ballType = "";
  2543. if (number == 0) {
  2544. this.isRootBall = true;
  2545. }
  2546. else if (number == 8) {
  2547. this.isBlackBall = true;
  2548. }
  2549. else {
  2550. if (number <= 7) {
  2551. this.ballType = ballCamp.full;
  2552. }
  2553. else {
  2554. this.ballType = ballCamp.flower;
  2555. }
  2556. }
  2557. this.setInfo();
  2558. this.setD3Ball();
  2559. this.owner["mySrc"] = this;
  2560. this.rigy.linearDamping = 1;
  2561. D2BallSrc._unid++;
  2562. this.myUNID = "d2ball" + D2BallSrc._unid;
  2563. let rect = xGame.common.d2World.borderRect;
  2564. this.rectL = Math.ceil(rect.x) + 20;
  2565. this.rectT = Math.ceil(rect.y) + 20;
  2566. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2567. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2568. }
  2569. setInfo() {
  2570. this.gameObj.x = this.startX;
  2571. this.gameObj.y = this.startY;
  2572. let radius = this.ui.width / 2;
  2573. this.gameObj.width = radius * 2;
  2574. this.gameObj.height = radius * 2;
  2575. if (xGame.common.showDebug) {
  2576. this.ui.myIcon.alpha = 1;
  2577. this.ui.inner.alpha = 1;
  2578. }
  2579. else {
  2580. this.ui.myIcon.alpha = 0;
  2581. this.ui.inner.alpha = 0;
  2582. }
  2583. }
  2584. setD3Ball() {
  2585. this.d3Ball = this.d3Ball;
  2586. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2587. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2588. }
  2589. onUpdate() {
  2590. if (xGame.common.gameMgr.gamePause)
  2591. return;
  2592. if (this.isInHole)
  2593. return;
  2594. if (!xGame.common.d2World.openCheckStill)
  2595. return;
  2596. this.runBall();
  2597. }
  2598. runBall() {
  2599. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2600. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2601. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2602. this.judgeBorder();
  2603. }
  2604. getDestDis(dest) {
  2605. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2606. }
  2607. setmyXY(x, y) {
  2608. this.d3BallSrc.setTransPos(x, y);
  2609. }
  2610. getSpeed() {
  2611. let speed = this.rigy.linearVelocity;
  2612. return speed.x * speed.x + speed.y * speed.y;
  2613. }
  2614. onTriggerEnter(collider) {
  2615. if (!collider || !collider.owner)
  2616. return;
  2617. let coll = "collide";
  2618. let speed = this.getSpeed();
  2619. let sv2 = this.speedP10 * this.speedP10;
  2620. if (collider.label == "ball") {
  2621. if (speed < 9 && this.number != 0)
  2622. coll = "";
  2623. else if (speed < sv2)
  2624. coll = "collide_4";
  2625. else if (speed < sv2 * 6.2)
  2626. coll = "collide_3";
  2627. else if (speed < sv2 * 25)
  2628. coll = "collide_2";
  2629. else if (speed < sv2 * 56)
  2630. coll = "collide_1";
  2631. xGame.soundMgr.playSound(coll);
  2632. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2633. if (collider.owner) {
  2634. let rig = collider.owner.getComponent(D2BallSrc);
  2635. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2636. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2637. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2638. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2639. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2640. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2641. let rx = 0;
  2642. let ry = 0;
  2643. if (this.gameObj.x < this.rectL)
  2644. rx = vx;
  2645. else if (this.gameObj.x > this.rectR)
  2646. rx = -vx;
  2647. else if (this.gameObj.y < this.rectT)
  2648. ry = vy;
  2649. else if (this.gameObj.y > this.rectB)
  2650. ry = -vy;
  2651. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2652. }
  2653. }
  2654. if (this.number != 0) {
  2655. return;
  2656. }
  2657. else {
  2658. if (this.forceRun) {
  2659. console.log("randon force");
  2660. this.applyForce(collider);
  2661. }
  2662. }
  2663. if (xGame.common.d2World.isOnSameLine) {
  2664. xGame.common.d2World.isOnSameLine = false;
  2665. this.rigy.linearVelocity = { x: 0, y: 0 };
  2666. }
  2667. if (xGame.common.gameMgr.firstColliObj == null) {
  2668. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2669. xGame.common.gameMgr.isTouchedBall = true;
  2670. }
  2671. }
  2672. else {
  2673. xGame.common.recoverCameraView();
  2674. let wallStr = "";
  2675. if (speed < 9) { }
  2676. else if (speed < sv2) { }
  2677. else if (speed < sv2 * 6.2)
  2678. wallStr = "wall_30";
  2679. else if (speed < sv2 * 25)
  2680. wallStr = "wall_50";
  2681. else if (speed < sv2 * 56)
  2682. wallStr = "wall_80";
  2683. xGame.soundMgr.playSound(wallStr);
  2684. }
  2685. }
  2686. applyForce(collider) {
  2687. let src = collider.owner.mySrc;
  2688. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2689. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2690. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2691. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2692. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2693. }
  2694. checkWrongBall(playEft = true) {
  2695. if (this.isInHole)
  2696. return;
  2697. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2698. if (this.number != 0 && playEft)
  2699. this.d3BallSrc.playInHoleEft();
  2700. let coll = "inpocket_1";
  2701. let speed = this.getSpeed();
  2702. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2703. if (speed < 9 && this.number != 0)
  2704. coll = "";
  2705. else if (speed < sv2 * 6.2)
  2706. coll = "inpocket_4";
  2707. else if (speed < sv2 * 25)
  2708. coll = "collide_3";
  2709. else if (speed < sv2 * 56)
  2710. coll = "collide_2";
  2711. xGame.soundMgr.playSound(coll);
  2712. this.isInHole = true;
  2713. if (this.number == 0) {
  2714. console.log("白球进了。。");
  2715. this.reset();
  2716. this.rigy.linearVelocity = { x: 0, y: 0 };
  2717. this.hideSelf();
  2718. xGame.common.gameUI.ui.whiteAni.visible = true;
  2719. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2720. xGame.common.gameUI.ui.whiteAni.visible = false;
  2721. }));
  2722. }
  2723. else {
  2724. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2725. xGame.common.d2World.removeOneBall(this);
  2726. this.destroySelf();
  2727. xGame.common.playHappySound(this.number);
  2728. this.runFlyEft();
  2729. }
  2730. }
  2731. runFlyEft() {
  2732. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2733. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2734. }
  2735. }
  2736. hideSelf() {
  2737. if (this.d3Ball)
  2738. this.d3Ball.active = false;
  2739. }
  2740. showSelf() {
  2741. this.isInHole = false;
  2742. if (this.d3Ball && !this.d3Ball.active)
  2743. this.d3Ball.active = true;
  2744. }
  2745. isStill() {
  2746. let speed = this.rigy.linearVelocity;
  2747. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2748. this.rigy.linearVelocity = { x: 0, y: 0 };
  2749. return true;
  2750. }
  2751. return false;
  2752. }
  2753. reset() {
  2754. }
  2755. destroySelf() {
  2756. this.d3BallSrc.destroySelf();
  2757. if (!this.ui.isDisposed) {
  2758. this.ui.removeFromParent();
  2759. this.ui.dispose();
  2760. this.ui = null;
  2761. }
  2762. this.outColli = null;
  2763. this.innerColli = null;
  2764. this.rigy = null;
  2765. this.d3Ball = null;
  2766. this.d3BallSrc = null;
  2767. this.angleV2 = null;
  2768. this.gameObj.destroy(true);
  2769. this.destroy();
  2770. }
  2771. judgeBorder() {
  2772. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2773. return;
  2774. }
  2775. if (this.destroyed)
  2776. return;
  2777. if (xGame.common.gameMode == GameMode.classic)
  2778. return;
  2779. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2780. if (isOver) {
  2781. this.checkWrongBall();
  2782. }
  2783. }
  2784. onClick(e, force = false) {
  2785. if (this.number == 0)
  2786. return;
  2787. if (force) {
  2788. }
  2789. else {
  2790. if (xGame.common.d2World.openCheckStill)
  2791. return;
  2792. if (!xGame.common.gameMgr.selfTurn) {
  2793. return;
  2794. }
  2795. }
  2796. if (!xGame.common.gameMgr.finishOneShoot)
  2797. return;
  2798. let root = xGame.common.d2World.rootBall.gameObj;
  2799. let x = this.gameObj.x - root.x;
  2800. let y = this.gameObj.y - root.y;
  2801. let angle = xGame.common.getfguiRotation(x, y);
  2802. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2803. xGame.common.d2World.getHelpLine();
  2804. xGame.common.clickedBall = true;
  2805. this.checkGuide();
  2806. }
  2807. checkGuide() {
  2808. let guide = DataMgr.getSkillGuide();
  2809. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2810. xGame.common.guideStep++;
  2811. xGame.common.gameUI.ui.guide1.visible = false;
  2812. xGame.common.gameUI.ui.guide2.visible = true;
  2813. }
  2814. }
  2815. checkDistance(disX, disY, angle) {
  2816. let diameter = this.gameObj.width - 1;
  2817. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2818. if (!this.lastDis)
  2819. this.lastDis = dis;
  2820. else {
  2821. if (dis > this.lastDis) {
  2822. this.helpOut.type = "remove";
  2823. return this.helpOut;
  2824. }
  2825. }
  2826. if (dis <= Math.pow(diameter, 2)) {
  2827. let del = 0.01;
  2828. let offest = 0;
  2829. let realX = disX - this.gameObj.x;
  2830. let realY = disY - this.gameObj.y;
  2831. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2832. offest += del;
  2833. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2834. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2835. }
  2836. this.helpOut.type = "ok";
  2837. this.helpOut.x = realX + this.gameObj.x;
  2838. this.helpOut.y = realY + this.gameObj.y;
  2839. return this.helpOut;
  2840. }
  2841. else {
  2842. this.helpOut.type = "no";
  2843. return this.helpOut;
  2844. }
  2845. }
  2846. clearBallEft() {
  2847. this.clearBallRightEft();
  2848. this.clearBallWrongEft();
  2849. }
  2850. clearBallRightEft() {
  2851. this.ui.breathAni.stop();
  2852. this.ui.rightTips.visible = false;
  2853. }
  2854. clearBallWrongEft() {
  2855. this.ui.wrongTips.visible = false;
  2856. }
  2857. showWrongEft() {
  2858. if (!xGame.common.gameMgr.selfTurn)
  2859. return;
  2860. this.ui.wrongTips.visible = true;
  2861. }
  2862. showRightEft() {
  2863. if (!xGame.common.gameMgr.selfTurn)
  2864. return;
  2865. this.ui.rightTips.visible = true;
  2866. this.ui.rightTips.scaleX = 1;
  2867. this.ui.rightTips.scaleY = 1;
  2868. this.ui.breathAni.play();
  2869. }
  2870. setBallFunc(type, owner) {
  2871. if (type == "ice") {
  2872. this.ballFunc = type;
  2873. this.d3BallSrc.setAlbedoTexture(true);
  2874. this.rigy.type = "static";
  2875. this.iceOwner = owner;
  2876. }
  2877. else {
  2878. if (owner == this.iceOwner) {
  2879. this.ballFunc = type;
  2880. this.d3BallSrc.setAlbedoTexture(false);
  2881. this.rigy.type = "dynamic";
  2882. }
  2883. }
  2884. }
  2885. }
  2886. D2BallSrc._unid = 0;
  2887. class D2RootBallSrc extends D2BallSrc {
  2888. constructor() {
  2889. super();
  2890. this.maxSpeed = 0;
  2891. this.classicMaxSpeed = 2.2;
  2892. this.bigSkillMaxSpeed = 4;
  2893. this.angle = 0;
  2894. this.allPercent = 0;
  2895. this.linearPercent = 0;
  2896. this.anglePercent = 0;
  2897. this.maxAngleRate = 0.6;
  2898. this.baseRot = 7;
  2899. this.angleMax = 0;
  2900. this.speed = new Laya.Vector2();
  2901. this.rotSpeed = new Laya.Vector2();
  2902. }
  2903. isStill() {
  2904. let speed = this.rigy.linearVelocity;
  2905. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2906. if (this.anglePercent <= 0.1) {
  2907. this.rigy.linearVelocity = { x: 0, y: 0 };
  2908. return true;
  2909. }
  2910. }
  2911. return false;
  2912. }
  2913. reset() {
  2914. this.linearPercent = 0;
  2915. this.anglePercent = 0;
  2916. }
  2917. setSpeed(percent, angle) {
  2918. this.allPercent = percent;
  2919. this.angle = angle;
  2920. this.setAngleSpeed();
  2921. this.setLinearSpeed();
  2922. let hit = "hit";
  2923. if (percent < 25)
  2924. hit = "hit03";
  2925. else if (percent < 50)
  2926. hit = "hit02";
  2927. else if (percent < 75)
  2928. hit = "hit01";
  2929. xGame.soundMgr.playSound(hit);
  2930. }
  2931. setAngleSpeed() {
  2932. let offest = xGame.common.rodOffest;
  2933. let radius = 82;
  2934. let rate = Math.abs(offest.y / radius) * 0.5;
  2935. if (offest.y > 0)
  2936. this.angleMax = -this.baseRot * 2;
  2937. else
  2938. this.angleMax = this.baseRot;
  2939. this.rotY = -offest.x / radius * 100;
  2940. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2941. this.linearPercent = this.allPercent - this.anglePercent;
  2942. }
  2943. setLinearSpeed() {
  2944. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2945. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2946. if (!xGame.common.longHelpLine) {
  2947. let offset = -150 + xGame.common.randomNum(0, 300);
  2948. offset /= 100;
  2949. this.angle += offset;
  2950. }
  2951. }
  2952. }
  2953. let sin = Math.sin(this.angle * Math.PI / 180);
  2954. let cos = Math.cos(this.angle * Math.PI / 180);
  2955. switch (xGame.common.gameMode) {
  2956. case GameMode.classic:
  2957. this.maxSpeed = this.classicMaxSpeed;
  2958. break;
  2959. case GameMode.bigMove:
  2960. this.maxSpeed = this.bigSkillMaxSpeed;
  2961. break;
  2962. case GameMode.placeBall:
  2963. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2964. if (data.type == 1) {
  2965. this.maxSpeed = this.bigSkillMaxSpeed;
  2966. }
  2967. else {
  2968. this.maxSpeed = this.classicMaxSpeed;
  2969. }
  2970. break;
  2971. default:
  2972. break;
  2973. }
  2974. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2975. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2976. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2977. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2978. this.rigy.applyLinearImpulseToCenter(this.speed);
  2979. }
  2980. onUpdate() {
  2981. if (this.anglePercent > 0.1) {
  2982. this.anglePercent *= 0.97;
  2983. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2984. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2985. this.rigy.applyForceToCenter(this.rotSpeed);
  2986. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2987. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2988. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2989. if (num > 0.9)
  2990. this.canRot = true;
  2991. }
  2992. else
  2993. this.canRot = true;
  2994. if (Math.abs(this.rotY) > 0.1)
  2995. this.rotY *= 0.98;
  2996. super.onUpdate();
  2997. }
  2998. destroySelf() {
  2999. super.destroySelf();
  3000. this.speed = null;
  3001. }
  3002. }
  3003. class D2Ball extends Laya.Sprite {
  3004. constructor(isRootBall = false) {
  3005. super();
  3006. this.ui = ui_D2Ball.createInstance();
  3007. this.pivotX = this.ui.width / 2;
  3008. this.pivotY = this.ui.width / 2;
  3009. this.x = 0;
  3010. this.y = 0;
  3011. this.addChild(this.ui.displayObject);
  3012. this.ui.displayObject.x += this.ui.width / 2;
  3013. this.ui.displayObject.y += this.ui.width / 2;
  3014. if (isRootBall) {
  3015. this.d2Src = this.addComponent(D2RootBallSrc);
  3016. }
  3017. else {
  3018. this.d2Src = this.addComponent(D2BallSrc);
  3019. }
  3020. this.d2Src.ui = this.ui;
  3021. this.addCircleCollider();
  3022. this.addInnerCircleCollider();
  3023. this.addRigyBody();
  3024. }
  3025. addCircleCollider() {
  3026. let colli = xGame.common.getCollider("circle");
  3027. colli.radius = this.ui.width / 2;
  3028. this.addComponentIntance(colli);
  3029. this.d2Src.outColli = colli;
  3030. colli.label = "ball";
  3031. }
  3032. addInnerCircleCollider() {
  3033. let colli = xGame.common.getCollider("circle");
  3034. colli.radius = this.ui.inner.width / 2;
  3035. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3036. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3037. this.addComponentIntance(colli);
  3038. this.d2Src.innerColli = colli;
  3039. colli.label = "inner";
  3040. }
  3041. addRigyBody() {
  3042. let rigy = xGame.common.getRigbody();
  3043. rigy.type = "dynamic";
  3044. this.addComponentIntance(rigy);
  3045. this.d2Src.rigy = rigy;
  3046. }
  3047. disposeSelf() {
  3048. if (!this.ui.isDisposed) {
  3049. this.ui.dispose();
  3050. this.ui.removeFromParent();
  3051. this.ui = null;
  3052. }
  3053. }
  3054. }
  3055. class ui_D2Gan extends fgui.GComponent {
  3056. static createInstance() {
  3057. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3058. }
  3059. onConstruct() {
  3060. this.myIcon = (this.getChild("myIcon"));
  3061. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3062. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3063. this.self = (this.getChild("self"));
  3064. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3065. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3066. this.ai = (this.getChild("ai"));
  3067. }
  3068. }
  3069. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3070. class D2Gan {
  3071. constructor() {
  3072. this.offset = 0.15;
  3073. this.cell = 1.5;
  3074. this.onBallCell = 0.4;
  3075. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3076. this.moveNum = 70;
  3077. this.rulerRate = 0.1;
  3078. this.ui = ui_D2Gan.createInstance();
  3079. this.changeSelfRod();
  3080. this.changeAIRod();
  3081. }
  3082. changeSelfRod() {
  3083. let index = DataMgr.getCurBallRod();
  3084. let data = cfgTable.ballrodData[index + 1];
  3085. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3086. this.selfMySpine && this.selfMySpine.dispose();
  3087. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3088. if (data.spine) {
  3089. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3090. this.selfMySpine = new SpineMgr(data.spine, () => {
  3091. let xx = this.ui.selfEftRoot.width / 2;
  3092. let yy = this.ui.selfEftRoot.height / 2;
  3093. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3094. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3095. outSpine.rotation = -90;
  3096. });
  3097. }
  3098. }
  3099. changeAIRod() {
  3100. let length = Object.keys(cfgTable.ballrodData).length;
  3101. let rand = Math.floor(length * Math.random()) + 1;
  3102. let data = cfgTable.ballrodData[rand];
  3103. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3104. this.aiMySpine && this.aiMySpine.dispose();
  3105. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3106. if (data.spine) {
  3107. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3108. this.aiMySpine = new SpineMgr(data.spine, () => {
  3109. let xx = this.ui.aiEftRoot.width / 2;
  3110. let yy = this.ui.aiEftRoot.height / 2;
  3111. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3112. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3113. outSpine.rotation = -90;
  3114. });
  3115. }
  3116. }
  3117. setGanLastInfo() {
  3118. this.lastInfo.rotation = this.ui.rotation;
  3119. this.lastInfo.x = this.ui.x;
  3120. this.lastInfo.y = this.ui.y;
  3121. }
  3122. rotateSelf(flag, isRuler = false) {
  3123. let angle;
  3124. flag = flag * this.offset;
  3125. if (xGame.common.d2World.isHelpLineOnBall) {
  3126. angle = flag * this.onBallCell;
  3127. }
  3128. else {
  3129. angle = flag * this.cell;
  3130. }
  3131. if (isRuler) {
  3132. angle *= this.rulerRate;
  3133. }
  3134. this.ui.rotation += angle;
  3135. xGame.common.d2World.getHelpLine();
  3136. }
  3137. checkDistance() {
  3138. let target = xGame.common.d2World.targetBall;
  3139. let root = xGame.common.d2World.rootBall;
  3140. if (target == null) {
  3141. return 1;
  3142. }
  3143. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3144. if (dis <= 2500) {
  3145. return 5;
  3146. }
  3147. return 1;
  3148. }
  3149. rotDest(rot) {
  3150. this.ui.rotation = rot;
  3151. xGame.common.d2World.getHelpLine();
  3152. }
  3153. storagePower(powerNum) {
  3154. let pos = (powerNum / 100) * this.moveNum;
  3155. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3156. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3157. this.ui.x = this.lastInfo.x + xx;
  3158. this.ui.y = this.lastInfo.y + yy;
  3159. }
  3160. shoot() {
  3161. this.storagePower(0);
  3162. this.ui.visible = false;
  3163. }
  3164. destroySelf() {
  3165. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3166. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3167. this.selfMySpine && this.selfMySpine.dispose();
  3168. this.aiMySpine && this.aiMySpine.dispose();
  3169. this.lastInfo = null;
  3170. if (!this.ui.isDisposed) {
  3171. this.ui.removeFromParent();
  3172. this.ui.dispose();
  3173. }
  3174. }
  3175. }
  3176. class ui_HelpLine extends fgui.GComponent {
  3177. static createInstance() {
  3178. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3179. }
  3180. onConstruct() {
  3181. this.n10 = (this.getChild("n10"));
  3182. this.rect = (this.getChild("rect"));
  3183. this.dir11 = (this.getChild("dir11"));
  3184. this.dir = (this.getChild("dir"));
  3185. this.rootDir = (this.getChild("rootDir"));
  3186. this.dirDot = (this.getChild("dirDot"));
  3187. }
  3188. }
  3189. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3190. class D2HelpLine {
  3191. constructor() {
  3192. this.starX = 0;
  3193. this.starY = 0;
  3194. this.ui = ui_HelpLine.createInstance();
  3195. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3196. this.starX = this.ui.rect.x;
  3197. this.starY = this.ui.rect.y;
  3198. }
  3199. shoot() {
  3200. this.ui.visible = false;
  3201. }
  3202. destroySelf() {
  3203. if (this.ui.isDisposed) {
  3204. this.ui.removeFromParent();
  3205. this.ui.dispose();
  3206. }
  3207. }
  3208. }
  3209. class D2World extends Laya.Script {
  3210. constructor() {
  3211. super();
  3212. this.ballArr = [];
  3213. this.openCheckStill = false;
  3214. this.checkArr = [];
  3215. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3216. this.isHelpLineOnBall = false;
  3217. this.isOnSameLine = false;
  3218. this.reflectAngle = 0;
  3219. this.powerPercent = 0;
  3220. this.inHolesSpeed = [];
  3221. this.outDir = new Laya.Vector2();
  3222. this.rootDir = new Laya.Vector2();
  3223. this.aiLv = 0;
  3224. this.rootPos = new Laya.Vector2();
  3225. this.tempDir1 = new Laya.Vector2();
  3226. this.tempDir2 = new Laya.Vector2();
  3227. this.tempDir3 = new Laya.Vector2();
  3228. this.ballSize = 33;
  3229. this.destRot = 0;
  3230. }
  3231. initSelf() {
  3232. this.createBalls();
  3233. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3234. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3235. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3236. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3237. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3238. }
  3239. setBorderRect() {
  3240. let ui = xGame.common.gameUI.ui;
  3241. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3242. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3243. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3244. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3245. this.borderRect.x = starX;
  3246. this.borderRect.y = starY;
  3247. this.borderRect.width = width;
  3248. this.borderRect.height = height;
  3249. }
  3250. resetGame() {
  3251. this.openCheckStill = false;
  3252. let temp;
  3253. for (let index = 0; index < this.ballArr.length; index++) {
  3254. temp = this.ballArr[index];
  3255. temp.destroySelf();
  3256. }
  3257. xGame.common.d3World.ballRoot.destroyChildren();
  3258. xGame.common.gameUI.ui.ballNode.removeChildren();
  3259. console.log("进入摧毁逻辑");
  3260. this.d2Gan.destroySelf();
  3261. this.d2HelpLine.destroySelf();
  3262. this.ballArr = [];
  3263. }
  3264. setD2Gan() {
  3265. let ballNode = this.rootBall.ui;
  3266. let d2Gan = new D2Gan();
  3267. this.d2Gan = d2Gan;
  3268. let ganNode = d2Gan.ui;
  3269. ballNode.addChild(ganNode);
  3270. ganNode.pivotX = ganNode.pivotX;
  3271. ganNode.pivotY = ganNode.pivotY;
  3272. ganNode.x = ganNode.myIcon.width / 2;
  3273. ganNode.y = this.rootBall.gameObj.width;
  3274. d2Gan.setGanLastInfo();
  3275. }
  3276. setHelpLine() {
  3277. let d2Help = new D2HelpLine();
  3278. this.d2HelpLine = d2Help;
  3279. }
  3280. createBalls() {
  3281. let cfg;
  3282. switch (xGame.common.gameMode) {
  3283. case GameMode.classic:
  3284. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3285. break;
  3286. case GameMode.bigMove:
  3287. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3288. break;
  3289. case GameMode.placeBall:
  3290. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3291. break;
  3292. default:
  3293. break;
  3294. }
  3295. cfg = JSON.parse(JSON.stringify(cfg));
  3296. for (const key in cfg) {
  3297. if (cfg[key].value == 0) {
  3298. this.createRootBall(cfg[key]);
  3299. delete cfg[key];
  3300. break;
  3301. }
  3302. }
  3303. this.createOtherBalls(cfg);
  3304. }
  3305. createRootBall(data) {
  3306. let root = new D2Ball(true);
  3307. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3308. this.rootBall = root.d2Src;
  3309. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3310. let d3BallSrc = d3Ball.getComponent(Ball);
  3311. xGame.common.d3World.rootBall = d3Ball;
  3312. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3313. let xx = data.x;
  3314. let yy = data.y;
  3315. let numer = data.value;
  3316. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3317. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3318. this.ballArr.push(this.rootBall);
  3319. this.setD2Gan();
  3320. this.setHelpLine();
  3321. }
  3322. createOtherBalls(cfg) {
  3323. let temp;
  3324. let src;
  3325. let data;
  3326. for (const key in cfg) {
  3327. data = cfg[key];
  3328. temp = new D2Ball();
  3329. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3330. src = temp.d2Src;
  3331. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3332. src.initSelf(data.value, data.x, data.y, d3Ball);
  3333. this.ballArr.push(src);
  3334. }
  3335. }
  3336. shoot(percent) {
  3337. this.powerPercent = percent;
  3338. this.openCheckStill = true;
  3339. let d2Angle = this.d2Gan.ui.rotation;
  3340. this.rootBall.setSpeed(percent, d2Angle);
  3341. this.clearBallAllEft();
  3342. this.changePlayerView();
  3343. }
  3344. onUpdate() {
  3345. if (!this.openCheckStill)
  3346. return;
  3347. this.checkStill();
  3348. }
  3349. checkStill() {
  3350. for (let index = 0; index < this.ballArr.length; index++) {
  3351. if (!this.ballArr[index].isStill()) {
  3352. return;
  3353. }
  3354. }
  3355. xGame.eventMgr.event(ALL_BALL_STOP);
  3356. }
  3357. allBallStop() {
  3358. this.openCheckStill = false;
  3359. xGame.common.recoverCameraView();
  3360. }
  3361. waitShoot() {
  3362. if (!this.d2Gan.ui.isDisposed) {
  3363. this.d2Gan.ui.visible = true;
  3364. }
  3365. if (!this.d2HelpLine.ui.isDisposed) {
  3366. this.d2HelpLine.ui.visible = true;
  3367. }
  3368. this.clearBallAllEft();
  3369. this.showBallRightEft();
  3370. this.getHelpLine();
  3371. this.inHolesSpeed = [];
  3372. this.selectOneBall();
  3373. }
  3374. _getAllBallArr() {
  3375. let arr = this.ballArr;
  3376. let outArr = [];
  3377. for (let index = 0; index < arr.length; index++) {
  3378. if (arr[index] instanceof D2RootBallSrc)
  3379. continue;
  3380. if (arr[index].ballFunc == "ice")
  3381. continue;
  3382. if (arr[index].destroyed)
  3383. continue;
  3384. outArr.push(arr[index]);
  3385. }
  3386. return outArr;
  3387. }
  3388. _getBlackObj() {
  3389. let arr = this.ballArr;
  3390. for (let index = 0; index < arr.length; index++) {
  3391. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3392. return arr[index];
  3393. }
  3394. }
  3395. }
  3396. selectOneBall() {
  3397. let all = this._getAllBallArr();
  3398. let target;
  3399. switch (xGame.common.gameMode) {
  3400. case GameMode.classic:
  3401. if (xGame.common.gameMgr.selfTurn) {
  3402. let self = xGame.common.gameMgr.selfBallArr;
  3403. let black = this._getBlackObj();
  3404. if (xGame.common.gameMgr.ensureBallType) {
  3405. if (self.length > 0) {
  3406. let out = [];
  3407. for (let j = 0; j < all.length; j++) {
  3408. if (self.indexOf(all[j].number) > -1) {
  3409. out.push(all[j]);
  3410. }
  3411. }
  3412. target = this.selectBestEnterOne(out);
  3413. }
  3414. else {
  3415. target = this.selectBestEnterOne([black]);
  3416. }
  3417. }
  3418. else {
  3419. target = this.selectBestEnterOne(all);
  3420. }
  3421. }
  3422. else {
  3423. target = this.selectBestEnterOne(all);
  3424. }
  3425. break;
  3426. case GameMode.bigMove:
  3427. target = this.selectBestEnterOne(all);
  3428. break;
  3429. case GameMode.placeBall:
  3430. if (all.length > 0) {
  3431. target = this.selectBestEnterOne(all);
  3432. }
  3433. break;
  3434. default:
  3435. break;
  3436. }
  3437. if (target && !target.destroyed && target.onClick) {
  3438. target.onClick(0, true);
  3439. let num = -200 + xGame.common.randomNum(0, 400);
  3440. num /= 150;
  3441. if (xGame.common.longHelpLine) {
  3442. num = 0;
  3443. }
  3444. this.destRot += num;
  3445. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3446. }
  3447. }
  3448. removeOneBall(ball) {
  3449. for (let index = 0; index < this.ballArr.length; index++) {
  3450. if (this.ballArr[index].id == ball.id) {
  3451. this.ballArr.splice(index, 1);
  3452. break;
  3453. }
  3454. }
  3455. }
  3456. getHelpLine() {
  3457. this.d2HelpLine.ui.dirDot.visible = false;
  3458. this.isOnSameLine = false;
  3459. let startX = this.rootBall.gameObj.x;
  3460. let startY = this.rootBall.gameObj.y;
  3461. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3462. if (dis == null) {
  3463. this.d2HelpLine.ui.visible = false;
  3464. console.error("辅助线异常");
  3465. return;
  3466. }
  3467. this.d2HelpLine.ui.visible = true;
  3468. let angle = this.d2Gan.ui.rotation;
  3469. let radius = 16.5;
  3470. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3471. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3472. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3473. if (colliObj == null) {
  3474. this.getColliPos(disX, disY, radius, angle);
  3475. xGame.common.d2World.isHelpLineOnBall = false;
  3476. this.targetBall = null;
  3477. this.reflectAngle = 0;
  3478. this.showBallWrongEft();
  3479. }
  3480. else {
  3481. let target = colliObj.src;
  3482. let radius = 16.5;
  3483. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3484. dis1 = Math.sqrt(dis1);
  3485. let realDis = colliObj.disHon - dis1;
  3486. let dir = colliObj.dir;
  3487. let xx = startX + dir.x * realDis;
  3488. let yy = startY + dir.y * realDis;
  3489. this.getColliPos(xx, yy, radius, angle);
  3490. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3491. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3492. let offset = xGame.common.rodOffest;
  3493. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3494. this.isOnSameLine = true;
  3495. }
  3496. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3497. xGame.common.d2World.isHelpLineOnBall = true;
  3498. this.targetBall = target;
  3499. this.reflectAngle = reflectAngle;
  3500. this.showBallWrongEft();
  3501. if (xGame.common.longHelpLine) {
  3502. this.delayReflectLine(target, reflectAngle);
  3503. }
  3504. }
  3505. }
  3506. getBorderDot(startX, startY, angle) {
  3507. let radius = 17;
  3508. let distance;
  3509. let isDone;
  3510. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3511. isDone = this.judgeUpDown(distance, angle, startX);
  3512. if (isDone != null) {
  3513. return isDone;
  3514. }
  3515. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3516. isDone = this.judgeUpDown(distance, angle, startX);
  3517. if (isDone != null) {
  3518. return isDone;
  3519. }
  3520. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3521. isDone = this.judgeLeftRight(distance, angle, startY);
  3522. if (isDone != null) {
  3523. return isDone;
  3524. }
  3525. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3526. isDone = this.judgeLeftRight(distance, angle, startY);
  3527. if (isDone != null) {
  3528. return isDone;
  3529. }
  3530. }
  3531. judgeUpDown(distance, angle, startX) {
  3532. let flag = Math.sin(angle * Math.PI / 180);
  3533. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3534. if (distance >= 0) {
  3535. if (flag > 0) {
  3536. if (temp < this.borderRect.x + this.borderRect.width) {
  3537. return distance;
  3538. }
  3539. }
  3540. else {
  3541. if (temp > this.borderRect.x) {
  3542. return distance;
  3543. }
  3544. }
  3545. }
  3546. }
  3547. judgeLeftRight(distance, angle, starY) {
  3548. let flag = -Math.cos(angle * Math.PI / 180);
  3549. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3550. if (distance >= 0) {
  3551. if (flag > 0) {
  3552. if (temp < this.borderRect.y + this.borderRect.height) {
  3553. return distance;
  3554. }
  3555. }
  3556. else {
  3557. if (temp > this.borderRect.y) {
  3558. return distance;
  3559. }
  3560. }
  3561. }
  3562. }
  3563. clearBallAllEft() {
  3564. let temp;
  3565. for (let index = 0; index < this.ballArr.length; index++) {
  3566. temp = this.ballArr[index];
  3567. temp.clearBallEft();
  3568. }
  3569. }
  3570. showBallRightEft() {
  3571. let gameMgr = xGame.common.gameMgr;
  3572. let temp;
  3573. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3574. if (targetArr.length <= 0)
  3575. return;
  3576. for (let index = 0; index < this.ballArr.length; index++) {
  3577. temp = this.ballArr[index];
  3578. if (targetArr.indexOf(temp.number) > -1) {
  3579. temp.showRightEft();
  3580. }
  3581. }
  3582. }
  3583. showBallWrongEft() {
  3584. let gameMgr = xGame.common.gameMgr;
  3585. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3586. if (targetArr.length <= 0)
  3587. return;
  3588. let temp;
  3589. for (let index = 0; index < this.ballArr.length; index++) {
  3590. temp = this.ballArr[index];
  3591. if (this.targetBall && this.targetBall.number == temp.number) {
  3592. if (targetArr.indexOf(temp.number) <= -1) {
  3593. temp.showWrongEft();
  3594. }
  3595. else {
  3596. temp.clearBallWrongEft();
  3597. }
  3598. }
  3599. else {
  3600. temp.clearBallWrongEft();
  3601. }
  3602. }
  3603. }
  3604. getColliPos(x, y, radius, angle) {
  3605. this.d2HelpLine.ui.x = x;
  3606. this.d2HelpLine.ui.y = y;
  3607. let dirX = x - this.rootBall.gameObj.x;
  3608. let dirY = y - this.rootBall.gameObj.y;
  3609. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3610. if (rectH <= 0)
  3611. rectH = 0;
  3612. this.d2HelpLine.ui.rect.height = 0;
  3613. this.d2HelpLine.ui.rect.height = rectH;
  3614. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3615. if (rectH < this.rootBall.gameObj.width) {
  3616. this.d2HelpLine.ui.rect.visible = false;
  3617. }
  3618. else {
  3619. this.d2HelpLine.ui.rect.visible = true;
  3620. }
  3621. this.d2HelpLine.ui.dir.visible = false;
  3622. this.d2HelpLine.ui.rootDir.visible = false;
  3623. }
  3624. getReflectLine(x, y, radius, target) {
  3625. this.d2HelpLine.ui.dir.visible = true;
  3626. let dirX = target.x - x;
  3627. let dirY = target.y - y;
  3628. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3629. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3630. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3631. this.d2HelpLine.ui.dir.height = 48;
  3632. this.d2HelpLine.ui.dir.rotation = angle;
  3633. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3634. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3635. return angle;
  3636. }
  3637. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3638. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3639. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3640. let targetX = target.gameObj.x;
  3641. let targetY = target.gameObj.y;
  3642. this.outDir.setValue(targetX - xx, targetY - yy);
  3643. this.rootDir.setValue(rtX - xx, rtY - yy);
  3644. let ver = Math.PI / 2;
  3645. let sin = Math.sin(ver);
  3646. let cos = Math.cos(ver);
  3647. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3648. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3649. this.outDir.setValue(outX, outY);
  3650. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3651. Laya.Vector2.normalize(this.outDir, this.outDir);
  3652. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3653. if (Math.abs(result) <= 0.08) {
  3654. this.d2HelpLine.ui.rootDir.visible = false;
  3655. return;
  3656. }
  3657. if (result > 0) {
  3658. angle += 90;
  3659. }
  3660. else if (result < 0) {
  3661. angle -= 90;
  3662. }
  3663. this.d2HelpLine.ui.rootDir.visible = true;
  3664. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3665. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3666. this.d2HelpLine.ui.rootDir.rotation = angle;
  3667. }
  3668. delayReflectLine(obj, angle) {
  3669. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3670. return;
  3671. }
  3672. this.isOnSameLine = false;
  3673. let startX = obj.gameObj.x;
  3674. let startY = obj.gameObj.y;
  3675. let dis = this.getBorderDot(startX, startY, angle);
  3676. if (dis == null) {
  3677. this.d2HelpLine.ui.dirDot.visible = false;
  3678. return;
  3679. }
  3680. this.d2HelpLine.ui.visible = true;
  3681. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3682. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3683. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3684. if (colliObj == null) {
  3685. this.setDelayLine(disX, disY, obj, angle);
  3686. }
  3687. else {
  3688. let radius = 16;
  3689. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3690. dis1 = Math.sqrt(dis1);
  3691. let realDis = colliObj.disHon - dis1;
  3692. let dir = colliObj.dir;
  3693. let xx = startX + dir.x * realDis;
  3694. let yy = startY + dir.y * realDis;
  3695. this.setDelayLine(xx, yy, obj, angle);
  3696. }
  3697. }
  3698. setDelayLine(x, y, obj, angle) {
  3699. let dirX = x - obj.gameObj.x;
  3700. let dirY = y - obj.gameObj.y;
  3701. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3702. if (rectH <= 0)
  3703. rectH = 0;
  3704. this.d2HelpLine.ui.dir.height = rectH;
  3705. this.d2HelpLine.ui.dirDot.visible = true;
  3706. this.d2HelpLine.ui.dirDot.x = 17;
  3707. this.d2HelpLine.ui.dirDot.y = 17;
  3708. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3709. ;
  3710. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3711. }
  3712. changePlayerView() {
  3713. if (Math.random() >= 0.7)
  3714. return;
  3715. if (!this.targetBall) {
  3716. return;
  3717. }
  3718. if (!xGame.common.gameMgr.selfTurn)
  3719. return;
  3720. switch (xGame.common.gameMode) {
  3721. case GameMode.classic:
  3722. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3723. if (this.targetBall.number != 8) {
  3724. return;
  3725. }
  3726. }
  3727. break;
  3728. case GameMode.bigMove:
  3729. return;
  3730. case GameMode.placeBall:
  3731. break;
  3732. default:
  3733. break;
  3734. }
  3735. let startX = this.targetBall.gameObj.x;
  3736. let startY = this.targetBall.gameObj.y;
  3737. let angle = this.reflectAngle;
  3738. let dis = this.getBorderDot(startX, startY, angle);
  3739. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3740. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3741. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3742. if (colliObj) {
  3743. return;
  3744. }
  3745. let offset = 40;
  3746. let posObj = xGame.common.gameMgr.posObj;
  3747. let temp;
  3748. let radius;
  3749. let tarX, tarY;
  3750. for (const key in posObj) {
  3751. temp = posObj[key];
  3752. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3753. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3754. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3755. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3756. xGame.common.showOneCamera("angle" + key);
  3757. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3758. Laya.physicsTimer.scale = 0.7;
  3759. break;
  3760. }
  3761. }
  3762. }
  3763. selectBestEnterOne(arr) {
  3764. this.aiLv = xGame.tools.random(1, 11);
  3765. this.aiLv = 10;
  3766. this.wBall = xGame.common.d2World.rootBall;
  3767. this.rootPos.x = this.wBall.gameObj.x;
  3768. this.rootPos.y = this.wBall.gameObj.y;
  3769. this.initHoleBall(arr);
  3770. return this.selectBall();
  3771. }
  3772. selectBall() {
  3773. let ball = null;
  3774. this.destRot = 0;
  3775. let ai = 110 - this.aiLv * 10;
  3776. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3777. let score = false;
  3778. if (this.scoreBall.length < 1) {
  3779. if (this.lineBall.length < 1) {
  3780. for (let i = 0; i < this.kickBall.length; i++) {
  3781. let list = [];
  3782. let bo = this.kickBall[i];
  3783. let bobj = bo.gameObj;
  3784. let rect = xGame.common.d2World.borderRect;
  3785. let mobj = this.wBall.gameObj;
  3786. let minb = bobj.y - rect.y - 20;
  3787. let minw = mobj.y - rect.y - 50;
  3788. if (minb > 0 && minw > 0) {
  3789. let dlenx = 0;
  3790. let dleny = mobj.y - rect.y;
  3791. let spx = mobj.x;
  3792. let spy = rect.y - dleny;
  3793. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3794. }
  3795. minb = rect.y + rect.height - bobj.y - 20;
  3796. minw = rect.y + rect.height - mobj.y - 50;
  3797. if (minb > 0 && minw > 0) {
  3798. let dlenx = 0;
  3799. let dleny = rect.y + rect.height - mobj.y;
  3800. let spx = mobj.x;
  3801. let spy = rect.y + rect.height + dleny;
  3802. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3803. }
  3804. minb = bobj.x - rect.x - 20;
  3805. minw = mobj.x - rect.x - 50;
  3806. if (minb > 0 && minw > 0) {
  3807. let dlenx = mobj.x - rect.x;
  3808. let dleny = 0;
  3809. let spx = rect.x - dlenx;
  3810. let spy = mobj.y;
  3811. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3812. }
  3813. minb = rect.x + rect.width - bobj.x - 20;
  3814. minw = rect.x + rect.width - mobj.x - 50;
  3815. if (minb > 0 && minw > 0) {
  3816. let dlenx = rect.x + rect.width - mobj.x;
  3817. let dleny = 0;
  3818. let spx = rect.x + rect.width + dlenx;
  3819. let spy = mobj.y;
  3820. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3821. }
  3822. list.sort(function (a, b) {
  3823. return a.order - b.order;
  3824. });
  3825. for (let i = 0; i < list.length; i++) {
  3826. let data = list[i];
  3827. let mx = mobj.x - bobj.x;
  3828. let my = mobj.y - bobj.y;
  3829. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3830. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3831. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3832. if (num > 1)
  3833. num = 1;
  3834. let cos = Math.acos(num);
  3835. if (cos > 1.57)
  3836. cos = 1.57;
  3837. else if (cos < 0.01)
  3838. cos = 0.01;
  3839. let tan = Math.tan(cos);
  3840. let dx = tan * data.dleny;
  3841. let dy = tan * data.dlenx;
  3842. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3843. if (Math.abs(bx - 667) < 40)
  3844. continue;
  3845. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3846. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3847. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3848. this.forceMax = dis * 0.08;
  3849. this.destRot += mis * 0.1;
  3850. this.setKick(bx, by);
  3851. return true;
  3852. }
  3853. }
  3854. }
  3855. }
  3856. else {
  3857. ball = xGame.common.getRandArrEle(this.lineBall);
  3858. }
  3859. }
  3860. else {
  3861. for (let i = 0; i < this.scoreBall.length; i++) {
  3862. if (i < this.scoreBall.length - 1) {
  3863. let rand = 70 + this.aiLv * 10 + i * 10;
  3864. if (xGame.tools.random(0, 100) < rand) {
  3865. ball = this.scoreBall[i];
  3866. break;
  3867. }
  3868. }
  3869. else {
  3870. ball = this.scoreBall[i];
  3871. break;
  3872. }
  3873. }
  3874. score = true;
  3875. this.selectNum++;
  3876. }
  3877. if (!ball)
  3878. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3879. let dx = ball.gameObj.x;
  3880. let dy = ball.gameObj.y;
  3881. let kickAngle = 0;
  3882. if (score) {
  3883. dx = ball.kickPos.x;
  3884. dy = ball.kickPos.y;
  3885. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3886. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3887. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3888. if (adot > 1)
  3889. adot = 1;
  3890. kickAngle = Math.acos(adot) * 57.3;
  3891. if (kickAngle > 45) {
  3892. let kdx = ball.kickPos.x - ball.gameObj.x;
  3893. let kdy = ball.kickPos.y - ball.gameObj.y;
  3894. dx = ball.kickPos.x - kdx * mis * 0.3;
  3895. dy = ball.kickPos.y - kdy * mis * 0.3;
  3896. }
  3897. else
  3898. this.destRot += mis;
  3899. }
  3900. else if (ball.poleAngle != 0) {
  3901. this.destRot += ball.poleAngle;
  3902. }
  3903. if (xGame.common.gameMode == 0) {
  3904. let af = kickAngle * 0.08;
  3905. this.forceMax = ball.hard * 0.1 + af * af;
  3906. }
  3907. this.setKick(dx, dy);
  3908. return ball;
  3909. }
  3910. initHoleBall(arr) {
  3911. this.kickBall = [];
  3912. this.lineBall = [];
  3913. this.scoreBall = [];
  3914. this.holeBall = [];
  3915. this.selectNum = 0;
  3916. this.forceNum = 0;
  3917. this.forceMax = 0;
  3918. this.turnNum = 0;
  3919. let list = arr;
  3920. let holes = xGame.common.gameMgr.holePosList;
  3921. let self = xGame.common.aiPlayer;
  3922. for (let i = 0; i < list.length; i++) {
  3923. let obj = list[i];
  3924. if (!obj)
  3925. continue;
  3926. obj.kickPos.x = 0;
  3927. obj.kickPos.y = 0;
  3928. obj.poleAngle = 0;
  3929. obj.hard = 0;
  3930. obj.borderDis = 0;
  3931. obj.kickAngle = 180;
  3932. let b = obj.gameObj;
  3933. let wbp = this.rootPos;
  3934. let bx = wbp.x - b.x;
  3935. let by = wbp.y - b.y;
  3936. obj.borderDis = xGame.tools.random(0, 100);
  3937. this.kickBall.push(obj);
  3938. if (!this.isLine(wbp, obj))
  3939. continue;
  3940. obj.kickAngle = xGame.tools.random(90, 180);
  3941. obj.kickPos.x = b.x;
  3942. obj.kickPos.y = b.y;
  3943. this.lineBall.push(obj);
  3944. let minDis = 999999;
  3945. let hole = false;
  3946. for (let j = 0; j < holes.length; j++) {
  3947. let hp = holes[j];
  3948. if (bx >= 0 && hp.x > b.x + 100)
  3949. continue;
  3950. if (bx <= 0 && hp.x < b.x - 100)
  3951. continue;
  3952. if (by < -10 && hp.y < wbp.y)
  3953. continue;
  3954. if (by > 10 && hp.y > wbp.y)
  3955. continue;
  3956. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3957. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3958. if (dis < minDis) {
  3959. let dx = b.x - this.tempDir1.x * this.ballSize;
  3960. let dy = b.y - this.tempDir1.y * this.ballSize;
  3961. this.tempDir3.x = this.tempDir1.x;
  3962. this.tempDir3.y = this.tempDir1.y;
  3963. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3964. obj.kickPos.x = dx;
  3965. obj.kickPos.y = dy;
  3966. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3967. if (num > 1)
  3968. num = 1;
  3969. obj.kickAngle = Math.acos(num) * 57.3;
  3970. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3971. dis = dis * 2;
  3972. if (Math.abs(hp.x - 600) < 100)
  3973. dis += 50;
  3974. obj.hard = dis + obj.kickAngle * 3;
  3975. hole = true;
  3976. }
  3977. }
  3978. }
  3979. }
  3980. if (hole) {
  3981. this.scoreBall.push(obj);
  3982. this.holeBall.push(obj);
  3983. }
  3984. }
  3985. this.scoreBall.sort(function (a, b) {
  3986. return a.hard - b.hard;
  3987. });
  3988. this.holeBall.sort(function (a, b) {
  3989. return a.kickAngle - b.kickAngle;
  3990. });
  3991. this.kickBall.sort(function (a, b) {
  3992. return a.borderDis - b.borderDis;
  3993. });
  3994. }
  3995. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3996. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3997. let balls = xGame.common.d2World.ballArr;
  3998. let max = xGame.tools.getDis(hx, hy, bx, by);
  3999. for (let index = 0; index < balls.length; index++) {
  4000. let obj = balls[index];
  4001. if (obj.number == 0)
  4002. continue;
  4003. if (obj.number == bn || obj.number == dn)
  4004. continue;
  4005. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4006. if (dis * dis > max)
  4007. continue;
  4008. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4009. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4010. if (num > 1)
  4011. num = 1;
  4012. if (num < 0)
  4013. continue;
  4014. let gap = Math.sin(Math.acos(num)) * dis;
  4015. if (gap < this.ballSize)
  4016. return true;
  4017. }
  4018. return false;
  4019. }
  4020. isLine(xy, ball) {
  4021. let bx = xy.x;
  4022. let by = xy.y;
  4023. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4024. let dis = ball.getDestDis(xy);
  4025. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4026. let sin = Math.sin(angle);
  4027. let cos = Math.cos(angle);
  4028. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4029. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4030. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4031. let dx = bx + this.tempDir2.x * dis;
  4032. let dy = by + this.tempDir2.y * dis;
  4033. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4034. sin = Math.sin(-angle);
  4035. cos = Math.cos(-angle);
  4036. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4037. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4038. dx = bx + this.tempDir2.x * dis;
  4039. dy = by + this.tempDir2.y * dis;
  4040. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4041. if (isr && isl)
  4042. return false;
  4043. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4044. }
  4045. return true;
  4046. }
  4047. setKick(dx, dy) {
  4048. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4049. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4050. this.tempDir1.x = 0;
  4051. this.tempDir1.y = 1;
  4052. this.tempDir2.y = -this.tempDir2.y;
  4053. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4054. if (num > 1)
  4055. num = 1;
  4056. let rot = Math.acos(num) * 57.3;
  4057. if (this.tempDir2.x < 0)
  4058. rot = 360 - rot;
  4059. this.destRot += rot;
  4060. }
  4061. }
  4062. class ui_UIGame extends fgui.GComponent {
  4063. static createInstance() {
  4064. return (fgui.UIPackage.createObject("game", "UIGame"));
  4065. }
  4066. onConstruct() {
  4067. this.c1 = this.getController("c1");
  4068. this.d3Root = (this.getChild("d3Root"));
  4069. this.clickNode = (this.getChild("clickNode"));
  4070. this.d2Root = (this.getChild("d2Root"));
  4071. this.topNode = (this.getChild("topNode"));
  4072. this.n72 = (this.getChild("n72"));
  4073. this.n40 = (this.getChild("n40"));
  4074. this.rulerNode = (this.getChild("rulerNode"));
  4075. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4076. this.n50 = (this.getChild("n50"));
  4077. this.keduNode = (this.getChild("keduNode"));
  4078. this.powerTxt = (this.getChild("powerTxt"));
  4079. this.powerNode = (this.getChild("powerNode"));
  4080. this.colorNode = (this.getChild("colorNode"));
  4081. this.powerEft = (this.getChild("powerEft"));
  4082. this.myPowerNode = (this.getChild("myPowerNode"));
  4083. this.ganNode = (this.getChild("ganNode"));
  4084. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4085. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4086. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4087. this.skillRod = (this.getChild("skillRod"));
  4088. this.border = (this.getChild("border"));
  4089. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4090. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4091. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4092. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4093. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4094. this.guanyuNode = (this.getChild("guanyuNode"));
  4095. this.helpBtn = (this.getChild("helpBtn"));
  4096. this.wordsBtn = (this.getChild("wordsBtn"));
  4097. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4098. this.returnBtn = (this.getChild("returnBtn"));
  4099. this.ballNode = (this.getChild("ballNode"));
  4100. this.whiteAni = (this.getChild("whiteAni"));
  4101. this.blackAni = (this.getChild("blackAni"));
  4102. this.selfTurn = (this.getChild("selfTurn"));
  4103. this.aiTurn = (this.getChild("aiTurn"));
  4104. this.deskNode = (this.getChild("deskNode"));
  4105. this.moveNode = (this.getChild("moveNode"));
  4106. this.selfTalk = (this.getChild("selfTalk"));
  4107. this.aiTalk = (this.getChild("aiTalk"));
  4108. this.d2Node = (this.getChild("d2Node"));
  4109. this.snowNode = (this.getChild("snowNode"));
  4110. this.guide2 = (this.getChild("guide2"));
  4111. this.guide1 = (this.getChild("guide1"));
  4112. this.guide3 = (this.getChild("guide3"));
  4113. this.guideNode = (this.getChild("guideNode"));
  4114. }
  4115. }
  4116. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4117. class ui_UIGameEnd extends fgui.GComponent {
  4118. static createInstance() {
  4119. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4120. }
  4121. onConstruct() {
  4122. this.c1 = this.getController("c1");
  4123. this.n22 = (this.getChild("n22"));
  4124. this.n2 = (this.getChild("n2"));
  4125. this.n52 = (this.getChild("n52"));
  4126. this.n53 = (this.getChild("n53"));
  4127. this.coinNode = (this.getChild("coinNode"));
  4128. this.closeNode = (this.getChild("closeNode"));
  4129. this.moneyNode = (this.getChild("moneyNode"));
  4130. this.secretary = (this.getChild("secretary"));
  4131. this.n27 = (this.getChild("n27"));
  4132. this.n29 = (this.getChild("n29"));
  4133. this.talkNode = (this.getChild("talkNode"));
  4134. this.n38 = (this.getChild("n38"));
  4135. this.n39 = (this.getChild("n39"));
  4136. this.n40 = (this.getChild("n40"));
  4137. this.awardNode = (this.getChild("awardNode"));
  4138. this.starNumNode = (this.getChild("starNumNode"));
  4139. this.n47 = (this.getChild("n47"));
  4140. this.conditionNode = (this.getChild("conditionNode"));
  4141. this.isGetAward = (this.getChild("isGetAward"));
  4142. this.leftBtn = (this.getChild("leftBtn"));
  4143. this.rightBtn = (this.getChild("rightBtn"));
  4144. this.btnNode = (this.getChild("btnNode"));
  4145. }
  4146. }
  4147. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4148. class ui_UIAddCoin extends fgui.GComponent {
  4149. static createInstance() {
  4150. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4151. }
  4152. onConstruct() {
  4153. this.n11 = (this.getChild("n11"));
  4154. this.myNode = (this.getChild("myNode"));
  4155. this.t0 = this.getTransition("t0");
  4156. }
  4157. }
  4158. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4159. class UIAddCoin extends UIBase {
  4160. constructor() {
  4161. super();
  4162. this.coinNum = 2000;
  4163. }
  4164. onConstructor() {
  4165. this.ui = ui_UIAddCoin.createInstance();
  4166. this.contentPane = this.ui;
  4167. this.isEject = false;
  4168. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4169. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4170. }
  4171. show() {
  4172. super.show();
  4173. this.ui.t0.play();
  4174. }
  4175. videoAddCoin() {
  4176. console.log('zh:qjff_AD_for_UIAddCoin');
  4177. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4178. }
  4179. else {
  4180. console.log('zh:AD 失败,直接发放奖励');
  4181. this.qjff_AD_for_UIAddCoin();
  4182. }
  4183. }
  4184. qjff_AD_for_UIAddCoin() {
  4185. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4186. this.hide();
  4187. }
  4188. }
  4189. UIAddCoin.uiName = "UIAddCoin";
  4190. class ui_UIInvitation extends fgui.GComponent {
  4191. static createInstance() {
  4192. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4193. }
  4194. onConstruct() {
  4195. this.n14 = (this.getChild("n14"));
  4196. this.myNode = (this.getChild("myNode"));
  4197. this.t0 = this.getTransition("t0");
  4198. }
  4199. }
  4200. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4201. class UIInvitation extends UIBase {
  4202. constructor() {
  4203. super();
  4204. }
  4205. onConstructor() {
  4206. this.ui = ui_UIInvitation.createInstance();
  4207. this.contentPane = this.ui;
  4208. this.isEject = false;
  4209. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4210. }
  4211. show() {
  4212. super.show();
  4213. }
  4214. enterGame() {
  4215. xGame.common.gameMode = GameMode.classic;
  4216. DataMgr.setChallengeTimes(1);
  4217. xGame.common.passAwardCoin = 2000;
  4218. let need = xGame.common.classicNiceNeddCoin;
  4219. if (DataMgr.coinEnough(need)) {
  4220. DataMgr.setCoin(-need);
  4221. xGame.eventMgr.event(RESTART_GAME, true);
  4222. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4223. }
  4224. else {
  4225. xGame.eventMgr.event(RESTART_GAME, true);
  4226. }
  4227. this.hide();
  4228. }
  4229. hide() {
  4230. super.hide();
  4231. }
  4232. }
  4233. UIInvitation.uiName = "UIInvitation";
  4234. class ui_UIMain extends fgui.GComponent {
  4235. static createInstance() {
  4236. return (fgui.UIPackage.createObject("game", "UIMain"));
  4237. }
  4238. onConstruct() {
  4239. this.n47 = (this.getChild("n47"));
  4240. this.n10 = (this.getChild("n10"));
  4241. this.secretary = (this.getChild("secretary"));
  4242. this.shopBtn = (this.getChild("shopBtn"));
  4243. this.moneyNode = (this.getChild("moneyNode"));
  4244. this.headNode = (this.getChild("headNode"));
  4245. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4246. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4247. this.classicBtn = (this.getChild("classicBtn"));
  4248. this.globalBtn = (this.getChild("globalBtn"));
  4249. this.n44 = (this.getChild("n44"));
  4250. this.signBtn = (this.getChild("signBtn"));
  4251. this.drawBtn = (this.getChild("drawBtn"));
  4252. this.settingNode = (this.getChild("settingNode"));
  4253. this.n45 = (this.getChild("n45"));
  4254. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4255. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4256. this.rankBtn = (this.getChild("rankBtn"));
  4257. this.n46 = (this.getChild("n46"));
  4258. this.liucheng1 = (this.getChild("liucheng1"));
  4259. this.rightBtn = (this.getChild("rightBtn"));
  4260. this.n75 = (this.getChild("n75"));
  4261. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4262. this.liucheng2 = (this.getChild("liucheng2"));
  4263. this.guideBtn = (this.getChild("guideBtn"));
  4264. this.n73 = (this.getChild("n73"));
  4265. this.wordsNode = (this.getChild("wordsNode"));
  4266. this.enterGuide = (this.getChild("enterGuide"));
  4267. this.talkNode = (this.getChild("talkNode"));
  4268. this.n83 = (this.getChild("n83"));
  4269. this.n84 = (this.getChild("n84"));
  4270. }
  4271. }
  4272. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4273. class ui_UIMoyu extends fgui.GComponent {
  4274. static createInstance() {
  4275. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4276. }
  4277. onConstruct() {
  4278. this.ageTip = (this.getChild("ageTip"));
  4279. this.mainBg = (this.getChild("mainBg"));
  4280. this.xyNode = (this.getChild("xyNode"));
  4281. this.rnNode = (this.getChild("rnNode"));
  4282. this.fcmNode = (this.getChild("fcmNode"));
  4283. this.ageNode = (this.getChild("ageNode"));
  4284. this.tipNode = (this.getChild("tipNode"));
  4285. this.msgNode = (this.getChild("msgNode"));
  4286. }
  4287. }
  4288. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4289. class MoyuMgr {
  4290. static initMoyu() {
  4291. this.moyuView = new MoyuView();
  4292. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4293. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4294. this.moyuView.ui.displayObject.zOrder = 1000;
  4295. this.moyuView.init();
  4296. this.moyuView.showTip(true);
  4297. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4298. window['XApk'] = this;
  4299. }
  4300. static showAge(show) {
  4301. if (this.moyuView)
  4302. this.moyuView.showAge(show);
  4303. }
  4304. static onPlatMsg(idx) {
  4305. if (!MoyuMgr.moyuView)
  4306. return;
  4307. if (idx == '0') {
  4308. MoyuMgr.moyuView.showTip(false);
  4309. }
  4310. }
  4311. static showAgree(call) {
  4312. if (this.moyuView)
  4313. this.moyuView.showAgree(call);
  4314. else
  4315. call && call();
  4316. }
  4317. static showXy(type = 1) {
  4318. if (this.moyuView)
  4319. this.moyuView.showXy(type);
  4320. }
  4321. }
  4322. MoyuMgr.isAdvise = false;
  4323. class MoyuView {
  4324. constructor() {
  4325. this.ysxyNum = 1;
  4326. this.ysJson = null;
  4327. this.ui = ui_UIMoyu.createInstance();
  4328. }
  4329. init() {
  4330. this.ui.mainBg.visible = false;
  4331. this.ui.xyNode.visible = false;
  4332. this.ui.ageNode.visible = false;
  4333. this.ui.tipNode.visible = false;
  4334. this.ui.rnNode.visible = false;
  4335. this.ui.fcmNode.visible = false;
  4336. this.ui.ageTip.visible = false;
  4337. this.ui.msgNode.visible = false;
  4338. this.ui.visible = false;
  4339. this.ui.xyNode.xyList.setVirtual();
  4340. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4341. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4342. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4343. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4344. this.ui.xyNode.btnKnown.visible = false;
  4345. this.ui.xyNode.xy1.visible = false;
  4346. this.ui.xyNode.xy2.visible = false;
  4347. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4348. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4349. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4350. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4351. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4352. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4353. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4354. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4355. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4356. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4357. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4358. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4359. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4360. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4361. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4362. this.ysxyNum = 2;
  4363. }
  4364. }
  4365. onClick(obj) {
  4366. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4367. switch (obj) {
  4368. case this.ui.ageTip:
  4369. if (Moyu.isTTApk) {
  4370. this.ui.ageNode.visible = true;
  4371. this.ui.mainBg.visible = true;
  4372. }
  4373. break;
  4374. case this.ui.tipNode:
  4375. this.showTip(false);
  4376. break;
  4377. case this.ui.ageNode.btnAge:
  4378. this.ui.ageNode.visible = false;
  4379. this.ui.mainBg.visible = false;
  4380. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4381. this.ui.visible = false;
  4382. break;
  4383. case this.ui.xyNode.btnXy3:
  4384. case this.ui.xyNode.btnXy1:
  4385. this.loadXy(1);
  4386. break;
  4387. case this.ui.xyNode.btnXy2:
  4388. this.loadXy(2);
  4389. break;
  4390. case this.ui.xyNode.btnBack:
  4391. this.ui.xyNode.xy1.visible = true;
  4392. this.ui.xyNode.xy2.visible = false;
  4393. break;
  4394. case this.ui.xyNode.btnKnown:
  4395. this.ui.xyNode.visible = false;
  4396. this.ui.mainBg.visible = false;
  4397. this.ui.visible = false;
  4398. break;
  4399. case this.ui.rnNode.btnCheck:
  4400. this.check();
  4401. break;
  4402. case this.ui.rnNode.btnExit:
  4403. case this.ui.xyNode.btnNo:
  4404. this.ysxyNum--;
  4405. if (this.ysxyNum > 0)
  4406. this.showMsg("Refuse to quit the game once again");
  4407. else {
  4408. Moyu.userAgree(false);
  4409. Moyu.exit();
  4410. }
  4411. break;
  4412. case this.ui.xyNode.btnSure:
  4413. case this.ui.xyNode.btnYes:
  4414. DataMgr.userData.isAgree = true;
  4415. DataMgr.saveUserData();
  4416. this.onAgree();
  4417. break;
  4418. case this.ui.rnNode.btnDone:
  4419. this.ui.rnNode.visible = false;
  4420. this.ui.visible = false;
  4421. break;
  4422. case this.ui.fcmNode.btnRn:
  4423. this.showRn();
  4424. break;
  4425. }
  4426. }
  4427. showTip(show) {
  4428. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4429. return;
  4430. if (show) {
  4431. MoyuMgr.isAdvise = true;
  4432. this.ui.visible = true;
  4433. this.ui.tipNode.visible = true;
  4434. this.ui.tipNode.alpha = 1;
  4435. Laya.timer.once(1000, this, this.showTip, [false]);
  4436. }
  4437. else {
  4438. this.ui.tipNode.alpha = 1;
  4439. this.ui.tipNode.visible = true;
  4440. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4441. this.ui.tipNode.visible = false;
  4442. MoyuMgr.isAdvise = false;
  4443. }), 1000);
  4444. }
  4445. }
  4446. showAge(show, px = 0, py = 0) {
  4447. if (Moyu.platType > 10 && !Moyu.isIos) {
  4448. this.ui.ageTip.x = px;
  4449. this.ui.ageTip.y = py;
  4450. this.ui.ageTip.visible = show;
  4451. if (show)
  4452. this.ui.visible = true;
  4453. }
  4454. }
  4455. showAgree(call) {
  4456. this.agreeCall = call;
  4457. this.onAgree();
  4458. return;
  4459. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4460. this.showXy(0);
  4461. }
  4462. else
  4463. this.onAgree();
  4464. }
  4465. onAgree() {
  4466. if (!this.ui.ageNode.visible)
  4467. this.ui.visible = false;
  4468. this.ui.xyNode.visible = false;
  4469. Moyu.userAgree(true);
  4470. this.showAge(false);
  4471. this.agreeCall && this.agreeCall();
  4472. this.showRn();
  4473. }
  4474. showMsg(txt) {
  4475. this.ui.msgNode.txtMsg.text = txt;
  4476. this.ui.msgNode.visible = true;
  4477. this.ui.msgNode.alpha = 1;
  4478. this.ui.visible = true;
  4479. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4480. this.ui.msgNode.visible = false;
  4481. }), 2500, true);
  4482. }
  4483. showRn() {
  4484. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4485. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4486. this.ui.rnNode.rn1.visible = true;
  4487. this.ui.rnNode.rn2.visible = false;
  4488. this.ui.rnNode.rn3.visible = false;
  4489. this.ui.rnNode.rn4.visible = false;
  4490. this.ui.rnNode.visible = true;
  4491. this.ui.mainBg.visible = true;
  4492. this.ui.rnNode.btnDone.visible = false;
  4493. this.ui.rnNode.btnExit.visible = true;
  4494. this.ui.rnNode.btnCheck.visible = true;
  4495. this.ui.fcmNode.visible = false;
  4496. this.ui.visible = true;
  4497. return;
  4498. }
  4499. }
  4500. this.showFcm();
  4501. }
  4502. showFcm() {
  4503. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4504. Moyu.initFCM(true);
  4505. if (Moyu.gameTime < 1)
  4506. this.fcmLoop();
  4507. else if (Moyu.gameTime < 999)
  4508. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4509. }
  4510. }
  4511. fcmLoop() {
  4512. if (Moyu.gameTime < 1) {
  4513. this.ui.rnNode.visible = false;
  4514. this.ui.fcmNode.visible = true;
  4515. this.ui.mainBg.visible = true;
  4516. this.ui.visible = true;
  4517. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4518. Laya.timer.clear(this.ui, this.fcmLoop);
  4519. }
  4520. }
  4521. check() {
  4522. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4523. this.ui.rnNode.rn1.visible = false;
  4524. this.ui.rnNode.rn2.visible = false;
  4525. this.ui.rnNode.rn4.visible = true;
  4526. }
  4527. else if (this.ui.rnNode.rn4.visible) {
  4528. let name = this.ui.rnNode.inputName.text;
  4529. let code = this.ui.rnNode.inputCode.text;
  4530. if (code && code.length == 18) {
  4531. this.ui.rnNode.rn1.visible = false;
  4532. this.ui.rnNode.rn4.visible = false;
  4533. Moyu.authenticate(name, code, (res) => {
  4534. this.ui.rnNode.rn2.visible = !res;
  4535. this.ui.rnNode.rn3.visible = res;
  4536. this.ui.rnNode.btnDone.visible = res;
  4537. this.ui.rnNode.btnExit.visible = !res;
  4538. this.ui.rnNode.btnCheck.visible = !res;
  4539. if (res)
  4540. this.showFcm();
  4541. });
  4542. }
  4543. else
  4544. this.showMsg("信息填写不完整");
  4545. }
  4546. }
  4547. loadXy(type = 0) {
  4548. this.ui.xyNode.xy1.visible = false;
  4549. this.ui.xyNode.xy2.visible = true;
  4550. this.ui.xyNode.xyList.scrollToView(0);
  4551. if (type == 1) {
  4552. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4553. }
  4554. else if (type == 2) {
  4555. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4556. }
  4557. }
  4558. showXy(type = 0) {
  4559. this.xyBtn();
  4560. if (type == 0) {
  4561. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4562. this.ui.xyNode.btnSure.visible = true;
  4563. }
  4564. else {
  4565. this.ui.xyNode.btnYes.visible = true;
  4566. this.ui.xyNode.btnNo.visible = true;
  4567. }
  4568. }
  4569. else {
  4570. this.ui.xyNode.btnKnown.visible = true;
  4571. this.ui.mainBg.visible = true;
  4572. }
  4573. this.ui.xyNode.xy1.visible = true;
  4574. this.ui.xyNode.xy2.visible = false;
  4575. this.ui.xyNode.visible = true;
  4576. this.ui.visible = true;
  4577. }
  4578. xyBtn() {
  4579. this.ui.xyNode.btnSure.visible = false;
  4580. this.ui.xyNode.btnYes.visible = false;
  4581. this.ui.xyNode.btnNo.visible = false;
  4582. this.ui.xyNode.btnKnown.visible = false;
  4583. {
  4584. this.ui.xyNode.btnXy3.visible = false;
  4585. this.ui.xyNode.btnXy2.visible = true;
  4586. this.ui.xyNode.btnXy1.visible = true;
  4587. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4588. }
  4589. }
  4590. createXY(json) {
  4591. this.ysJson = json.content;
  4592. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4593. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4594. this.ui.xyNode.xy2.visible = true;
  4595. }
  4596. renderListItem(idx, cell) {
  4597. let xy = this.ysJson[idx];
  4598. cell.height = xy.line * 30;
  4599. cell.xyItem.text = xy.text;
  4600. }
  4601. onDestroy() {
  4602. this.agreeCall = null;
  4603. }
  4604. }
  4605. class SettingNode {
  4606. constructor(ui) {
  4607. this.showSetting = false;
  4608. this.openSound = true;
  4609. this.openShake = true;
  4610. this.ui = ui;
  4611. this.ui.soundBtn.onClick(this, this.switchSound);
  4612. this.ui.shakeBtn.onClick(this, this.switchShake);
  4613. this.ui.xyBtn.onClick(this, this.onXy);
  4614. this.ui.clickNode.onClick(this, this.changeSetting);
  4615. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4616. this.ui.xyBtn.visible = false;
  4617. this.ui.shakeBtn.visible = false;
  4618. }
  4619. changeSetting() {
  4620. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4621. this.showSetting = !this.showSetting;
  4622. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4623. }
  4624. switchSound() {
  4625. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4626. this.openSound = !this.openSound;
  4627. Moyu.onSetting(this.openSound, this.openShake);
  4628. xGame.soundMgr.onSetting(this.openSound);
  4629. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4630. }
  4631. switchShake() {
  4632. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4633. this.openShake = !this.openShake;
  4634. Moyu.onSetting(this.openSound, this.openShake);
  4635. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4636. }
  4637. onXy() {
  4638. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4639. MoyuMgr.showXy(1);
  4640. }
  4641. }
  4642. class ui_UILevelDisplay extends fgui.GComponent {
  4643. static createInstance() {
  4644. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4645. }
  4646. onConstruct() {
  4647. this.n9 = (this.getChild("n9"));
  4648. this.myNode = (this.getChild("myNode"));
  4649. this.closeNode = (this.getChild("closeNode"));
  4650. }
  4651. }
  4652. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4653. class ui_UILevelProp extends fgui.GComponent {
  4654. static createInstance() {
  4655. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4656. }
  4657. onConstruct() {
  4658. this.n16 = (this.getChild("n16"));
  4659. this.myNode = (this.getChild("myNode"));
  4660. this.closeBtn = (this.getChild("closeBtn"));
  4661. this.moneyNode = (this.getChild("moneyNode"));
  4662. this.t1 = this.getTransition("t1");
  4663. }
  4664. }
  4665. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4666. class ui_ShowItem extends fgui.GComponent {
  4667. static createInstance() {
  4668. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4669. }
  4670. onConstruct() {
  4671. this.myImg = (this.getChild("myImg"));
  4672. }
  4673. }
  4674. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4675. class ShowItem {
  4676. constructor() {
  4677. this.ui = ui_ShowItem.createInstance();
  4678. }
  4679. destroySelf() {
  4680. if (!this.ui.isDisposed) {
  4681. this.ui.removeFromParent();
  4682. this.ui.dispose();
  4683. }
  4684. }
  4685. setParent(parent) {
  4686. parent.addChild(this.ui);
  4687. }
  4688. setPos(x, y) {
  4689. this.ui.x = x;
  4690. this.ui.y = y;
  4691. }
  4692. setUrl(index) {
  4693. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4694. }
  4695. }
  4696. class ui_UIPower extends fgui.GComponent {
  4697. static createInstance() {
  4698. return (fgui.UIPackage.createObject("game", "UIPower"));
  4699. }
  4700. onConstruct() {
  4701. this.n11 = (this.getChild("n11"));
  4702. this.myNode = (this.getChild("myNode"));
  4703. this.t0 = this.getTransition("t0");
  4704. }
  4705. }
  4706. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4707. class UIPower extends UIBase {
  4708. constructor() {
  4709. super();
  4710. }
  4711. onConstructor() {
  4712. this.ui = ui_UIPower.createInstance();
  4713. this.contentPane = this.ui;
  4714. this.isEject = false;
  4715. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4716. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4717. }
  4718. show() {
  4719. super.show();
  4720. this.ui.t0.play();
  4721. }
  4722. videoGetPower() {
  4723. console.log('zh:qjff_AD_for_uipower');
  4724. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4725. }
  4726. else {
  4727. console.log('zh:AD 失败,直接发放奖励');
  4728. this.qjff_AD_for_uipower();
  4729. }
  4730. }
  4731. qjff_AD_for_uipower() {
  4732. DataMgr.setPower(xGame.common.videoPower, true);
  4733. xGame.eventMgr.event(POWER_TIME);
  4734. this.hide();
  4735. }
  4736. }
  4737. UIPower.uiName = "UIPower";
  4738. class LocalStorageManager {
  4739. test1() {
  4740. LocalStorageManager.setItem("playerName", "Tom");
  4741. LocalStorageManager.setItem("playerLevel", 5);
  4742. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4743. const name = LocalStorageManager.getItem("playerName");
  4744. const level = LocalStorageManager.getItem("playerLevel");
  4745. const data = LocalStorageManager.getItem("playerData");
  4746. console.log(name);
  4747. console.log(level);
  4748. console.log(data);
  4749. LocalStorageManager.removeItem("playerLevel");
  4750. }
  4751. static setItem(key, value) {
  4752. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4753. }
  4754. static getItem(key) {
  4755. const data = Laya.LocalStorage.getItem(key);
  4756. if (data === null)
  4757. return null;
  4758. try {
  4759. return JSON.parse(data);
  4760. }
  4761. catch (e) {
  4762. return data;
  4763. }
  4764. }
  4765. static removeItem(key) {
  4766. Laya.LocalStorage.removeItem(key);
  4767. }
  4768. static clear() {
  4769. Laya.LocalStorage.clear();
  4770. }
  4771. static hasJosnKey(key) {
  4772. var value = Laya.LocalStorage.getJSON(key);
  4773. if (value != null) {
  4774. return true;
  4775. }
  4776. else {
  4777. return false;
  4778. }
  4779. }
  4780. static hasKey(key) {
  4781. return Laya.LocalStorage.getItem(key) !== null;
  4782. }
  4783. }
  4784. class UILevelProp extends UIBase {
  4785. constructor() {
  4786. super();
  4787. this.firstPos = 385;
  4788. this.secondPos = 467;
  4789. this.showItemArr = [];
  4790. }
  4791. onFontLoaded() {
  4792. try {
  4793. this.ui.myNode.conditionTxt.font = "arial";
  4794. console.log("zh: onFontLoaded 设置arial字体成功");
  4795. }
  4796. catch (error) {
  4797. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4798. }
  4799. }
  4800. onConstructor() {
  4801. this.ui = ui_UILevelProp.createInstance();
  4802. this.contentPane = this.ui;
  4803. this.isEject = false;
  4804. this.addUIClick(this.ui.closeBtn, this.hide);
  4805. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4806. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4807. }
  4808. show(level) {
  4809. super.show();
  4810. this.ui.t1.play();
  4811. this.level = level;
  4812. this.data = cfgTable.placeballData[this.level];
  4813. this.updateSelf();
  4814. this.showPreView();
  4815. this.moneyNode.ui.c1.selectedIndex = 2;
  4816. this.moneyNode.checkPowerTime();
  4817. this.moneyNode.powerChange();
  4818. }
  4819. showPreView() {
  4820. let item;
  4821. let data;
  4822. for (let index = 0; index < this.showItemArr.length; index++) {
  4823. item = this.showItemArr[index];
  4824. item.destroySelf();
  4825. }
  4826. this.showItemArr = [];
  4827. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4828. for (const key in cfgData) {
  4829. data = cfgData[key];
  4830. item = new ShowItem();
  4831. item.setParent(this.ui.myNode.displayRoot);
  4832. item.setPos(data.x, data.y);
  4833. item.setUrl(data.value);
  4834. this.showItemArr.push(item);
  4835. }
  4836. }
  4837. updateSelf() {
  4838. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4839. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4840. if (this.data.ball == -1) {
  4841. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4842. }
  4843. else {
  4844. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4845. }
  4846. let localData = DataMgr.getPlaceBallLevel(this.level);
  4847. let getAward = localData.getAward;
  4848. let cfg = cfgTable.placeballData[this.level];
  4849. let coin = this.data.award[0];
  4850. let diamond = this.data.award[1];
  4851. if (cfg.type == PlaceBallType.challenge) {
  4852. diamond = 0;
  4853. coin = 100;
  4854. }
  4855. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4856. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4857. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4858. if (cfg.type == PlaceBallType.challenge) {
  4859. this.ui.myNode.coinNode.numTxt.text = "";
  4860. }
  4861. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4862. if (coin > 0 && diamond > 0) {
  4863. this.ui.myNode.diamondNode.x = 385;
  4864. this.ui.myNode.coinNode.x = 467;
  4865. }
  4866. else {
  4867. this.ui.myNode.diamondNode.x = 385;
  4868. this.ui.myNode.coinNode.x = 385;
  4869. }
  4870. if (!getAward) {
  4871. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4872. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4873. }
  4874. else {
  4875. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4876. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4877. }
  4878. }
  4879. startGame() {
  4880. if (DataMgr.powerEnough()) {
  4881. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  4882. this.ui.myNode.startBtn.touchable = false;
  4883. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4884. console.log('zh:startGame ');
  4885. this.ui.myNode.startBtn.touchable = true;
  4886. DataMgr.setPower(-1);
  4887. xGame.eventMgr.event(POWER_TIME);
  4888. xGame.common.gameMode = GameMode.placeBall;
  4889. xGame.common.placeBallCurLevel = this.level;
  4890. xGame.uiMgr.Show(UIGame);
  4891. this.logEventForChallenge_level_start(this.level);
  4892. xGame.uiMgr.Hide(UILevelDisplay);
  4893. xGame.uiMgr.Hide(UIMain);
  4894. this.hide();
  4895. }));
  4896. }
  4897. else {
  4898. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  4899. xGame.uiMgr.Show(UIPower);
  4900. }
  4901. }
  4902. logEventForChallenge_level_start(level) {
  4903. let keyStr = 'sjmd_challenge_level_start';
  4904. let jsonStr = {
  4905. "count": 1,
  4906. "gold_balance ": DataMgr.getCoin(),
  4907. "level": level,
  4908. "diamond_balance ": DataMgr.getDiamond()
  4909. };
  4910. if (LocalStorageManager.hasJosnKey(keyStr)) {
  4911. const d = LocalStorageManager.getItem(keyStr);
  4912. if (level > d.level) {
  4913. jsonStr.count = d.count + 1;
  4914. LocalStorageManager.setItem(keyStr, jsonStr);
  4915. }
  4916. else {
  4917. }
  4918. }
  4919. else {
  4920. LocalStorageManager.setItem(keyStr, jsonStr);
  4921. }
  4922. const reqStr = JSON.stringify(jsonStr);
  4923. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  4924. }
  4925. hide() {
  4926. super.hide();
  4927. }
  4928. }
  4929. UILevelProp.uiName = "UILevelProp";
  4930. class PutBallLevelDisplay {
  4931. constructor(ui, index) {
  4932. this.index = 0;
  4933. this.ui = ui;
  4934. this.index = index;
  4935. this.ui.onClick(this, this.clickSelf);
  4936. this.updateSelf();
  4937. this.ui.levelTxt.text = (this.index + 1) + "";
  4938. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4939. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4940. }
  4941. updateSelf() {
  4942. let level = this.index + 1;
  4943. this.data = DataMgr.getPlaceBallLevel(level);
  4944. this.ui.starNode.c1.selectedIndex = this.data.star;
  4945. let isChallenge = cfgTable.placeballData[level].type;
  4946. if (this.data.isCur) {
  4947. if (isChallenge) {
  4948. this.ui.c1.selectedIndex = 5;
  4949. }
  4950. else {
  4951. this.ui.c1.selectedIndex = 2;
  4952. }
  4953. }
  4954. else {
  4955. if (this.data.play) {
  4956. if (this.data.star == 3) {
  4957. this.ui.c1.selectedIndex = 0;
  4958. }
  4959. else {
  4960. this.ui.c1.selectedIndex = 1;
  4961. }
  4962. }
  4963. else {
  4964. if (isChallenge) {
  4965. this.ui.c1.selectedIndex = 4;
  4966. }
  4967. else {
  4968. this.ui.c1.selectedIndex = 3;
  4969. }
  4970. }
  4971. }
  4972. }
  4973. clickSelf() {
  4974. if (!this.data.play)
  4975. return;
  4976. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4977. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4978. }
  4979. }
  4980. class UILevelDisplay extends UIBase {
  4981. constructor() {
  4982. super();
  4983. }
  4984. onConstructor() {
  4985. this.ui = ui_UILevelDisplay.createInstance();
  4986. this.contentPane = this.ui;
  4987. this.isEject = false;
  4988. this.myList = this.ui.myNode.myList;
  4989. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4990. this.levelItemArr = [];
  4991. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4992. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4993. this.myList.numItems = levelNum;
  4994. if (Moyu.isKs)
  4995. this.ui.closeNode.closeBtn.x += 100;
  4996. }
  4997. levelItemRender(index, target) {
  4998. let item = new PutBallLevelDisplay(target, index);
  4999. this.levelItemArr.push(item);
  5000. }
  5001. show() {
  5002. super.show();
  5003. this.updateLevel();
  5004. this.scrollToPlace();
  5005. }
  5006. updateLevel() {
  5007. let temp;
  5008. for (let index = 0; index < this.levelItemArr.length; index++) {
  5009. temp = this.levelItemArr[index];
  5010. temp.updateSelf();
  5011. }
  5012. }
  5013. scrollToPlace() {
  5014. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5015. let passArr = DataMgr.getPlaceBallLevelList();
  5016. let offest = passArr.length;
  5017. if (offest >= maxNum - 1)
  5018. offest = maxNum - 1;
  5019. this.myList.scrollToView(offest, true, true);
  5020. }
  5021. hide() {
  5022. super.hide();
  5023. }
  5024. }
  5025. UILevelDisplay.uiName = "UILevelDisplay";
  5026. class ui_UIMatching extends fgui.GComponent {
  5027. static createInstance() {
  5028. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5029. }
  5030. onConstruct() {
  5031. this.n5 = (this.getChild("n5"));
  5032. this.n49 = (this.getChild("n49"));
  5033. this.n51 = (this.getChild("n51"));
  5034. this.n64 = (this.getChild("n64"));
  5035. this.n2 = (this.getChild("n2"));
  5036. this.n53 = (this.getChild("n53"));
  5037. this.n54 = (this.getChild("n54"));
  5038. this.n56 = (this.getChild("n56"));
  5039. this.n58 = (this.getChild("n58"));
  5040. this.n59 = (this.getChild("n59"));
  5041. this.n57 = (this.getChild("n57"));
  5042. this.n60 = (this.getChild("n60"));
  5043. this.n62 = (this.getChild("n62"));
  5044. this.awardTxt = (this.getChild("awardTxt"));
  5045. this.n61 = (this.getChild("n61"));
  5046. this.selfHead = (this.getChild("selfHead"));
  5047. this.aiHead = (this.getChild("aiHead"));
  5048. this.n82 = (this.getChild("n82"));
  5049. this.n84 = (this.getChild("n84"));
  5050. this.n83 = (this.getChild("n83"));
  5051. this.t1 = this.getTransition("t1");
  5052. this.t2 = this.getTransition("t2");
  5053. this.t3 = this.getTransition("t3");
  5054. this.t4 = this.getTransition("t4");
  5055. }
  5056. }
  5057. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5058. class UIMatching extends UIBase {
  5059. constructor() {
  5060. super();
  5061. }
  5062. onConstructor() {
  5063. this.ui = ui_UIMatching.createInstance();
  5064. this.contentPane = this.ui;
  5065. this.isEject = false;
  5066. }
  5067. show(callback) {
  5068. super.show();
  5069. PlatMgr.showBanner(true);
  5070. this.callback = callback;
  5071. let user = Moyu.getUserInfo();
  5072. if (!this.selfPot) {
  5073. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5074. }
  5075. if (!this.aiPot) {
  5076. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5077. }
  5078. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5079. this.ui.selfHead.nameTxt.text = user.nickName;
  5080. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5081. this.ui.aiHead.nameTxt.text = "???";
  5082. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5083. this.ui.selfHead.c1.selectedIndex = 0;
  5084. this.ui.aiHead.c1.selectedIndex = 0;
  5085. this.ui.selfHead.x = this.selfPot.x;
  5086. this.ui.selfHead.y = this.selfPot.y;
  5087. this.ui.aiHead.x = this.aiPot.x;
  5088. this.ui.aiHead.y = this.aiPot.y;
  5089. switch (xGame.common.gameMode) {
  5090. case GameMode.classic:
  5091. break;
  5092. case GameMode.bigMove:
  5093. this.initSkillData();
  5094. break;
  5095. default:
  5096. break;
  5097. }
  5098. this.ui.t1.play(Laya.Handler.create(this, () => {
  5099. this.ui.t2.play(Laya.Handler.create(this, () => {
  5100. switch (xGame.common.gameMode) {
  5101. case GameMode.classic:
  5102. this.waitingPeople();
  5103. break;
  5104. case GameMode.bigMove:
  5105. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5106. break;
  5107. default:
  5108. break;
  5109. }
  5110. }));
  5111. }));
  5112. }
  5113. initSkillData() {
  5114. this.skillSelectData = [];
  5115. let skillUrl = xGame.common.skillIconList;
  5116. let skillName = xGame.common.skillNameList;
  5117. let skillLevel = DataMgr.getBigSkillList();
  5118. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5119. for (let index = 0; index < 5; index++) {
  5120. let obj = {};
  5121. obj.skillImg = skillUrl[index];
  5122. obj.skillName = skillName[index];
  5123. obj.skillType = skillType[index];
  5124. obj.skillLevel = skillLevel[index];
  5125. this.skillSelectData.push(obj);
  5126. }
  5127. }
  5128. getAISkillLevel(myLevel) {
  5129. let video = xGame.common.upSkillLevel;
  5130. let aiLevel;
  5131. let temp;
  5132. if (video) {
  5133. temp = xGame.common.randomNum(-2, -1);
  5134. }
  5135. else {
  5136. if (myLevel <= 5) {
  5137. temp = xGame.common.randomNum(1, 3);
  5138. }
  5139. else if (myLevel <= 9) {
  5140. temp = xGame.common.randomNum(-2, 1);
  5141. }
  5142. else {
  5143. temp = xGame.common.randomNum(-4, 0);
  5144. }
  5145. }
  5146. aiLevel = temp + myLevel;
  5147. if (aiLevel <= 1)
  5148. aiLevel = 1;
  5149. if (aiLevel >= 10)
  5150. aiLevel = 10;
  5151. return aiLevel;
  5152. }
  5153. getAISkillType() {
  5154. return xGame.common.randomNum(1, 4);
  5155. let successTimes = DataMgr.getSkillSuccessTimes();
  5156. let info = cfgTable.aiskillData[successTimes];
  5157. if (!info) {
  5158. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5159. info = cfgTable.aiskillData[max];
  5160. }
  5161. let dataArr = info.skillselect;
  5162. let myCfg = {};
  5163. for (let index = 0; index < dataArr.length; index++) {
  5164. let temp = dataArr[index].split('-');
  5165. myCfg[temp[0]] = {};
  5166. myCfg[temp[0]].id = parseInt(temp[0]);
  5167. myCfg[temp[0]].weight = parseInt(temp[1]);
  5168. }
  5169. let aiCfg = xGame.common.initWeight(myCfg);
  5170. let curData = xGame.common.getRandomWeightData(aiCfg);
  5171. return parseInt(curData.id);
  5172. }
  5173. getAISkillData(index) {
  5174. let myLevel = this.skillSelectData[index].skillLevel;
  5175. let aiLevel = this.getAISkillLevel(myLevel);
  5176. let aiType = this.getAISkillType() - 1;
  5177. return { aiLevel, aiType } = { aiLevel, aiType };
  5178. }
  5179. skillSelectFinish(index) {
  5180. let aiInfo = this.getAISkillData(index);
  5181. xGame.common.gameMgr.selfCurSkill = index;
  5182. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5183. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5184. this.ui.selfHead.c1.selectedIndex = 1;
  5185. this.ui.aiHead.c1.selectedIndex = 1;
  5186. let myData = this.skillSelectData[index];
  5187. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5188. let guide = DataMgr.getSkillGuide();
  5189. if (guide == 0) {
  5190. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5191. }
  5192. else {
  5193. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5194. }
  5195. let aiData = this.skillSelectData[aiInfo.aiType];
  5196. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5197. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5198. this.waitingPeople();
  5199. }
  5200. waitingPeople() {
  5201. let time = xGame.common.randomNum(1000, 3000);
  5202. time += 1000;
  5203. Laya.timer.once(time, this, () => {
  5204. this.matchingSuccess();
  5205. });
  5206. }
  5207. matchingSuccess() {
  5208. let gameUI = xGame.common.gameUI;
  5209. let name = gameUI.ui.topNode.aiNameTxt.text;
  5210. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5211. this.ui.aiHead.nameTxt.text = name;
  5212. this.ui.aiHead.headImg.url = url;
  5213. name = gameUI.ui.topNode.selfNameTxt.text;
  5214. url = gameUI.ui.topNode.selfHeadLoader.url;
  5215. this.ui.selfHead.nameTxt.text = name;
  5216. this.ui.selfHead.headImg.url = url;
  5217. this.ui.t3.play(Laya.Handler.create(this, () => {
  5218. this.callback && this.callback();
  5219. this.ui.t4.play(Laya.Handler.create(this, () => {
  5220. this.destroySelf();
  5221. }));
  5222. }));
  5223. }
  5224. destroySelf() {
  5225. this.callback = null;
  5226. this.skillSelectData = null;
  5227. this.selfPot = null;
  5228. this.aiPot = null;
  5229. if (!this.ui.isDisposed) {
  5230. this.ui.removeFromParent();
  5231. this.ui.dispose();
  5232. }
  5233. xGame.uiMgr.destroyUI(this);
  5234. }
  5235. }
  5236. UIMatching.uiName = "UIMatching";
  5237. class ui_UIRanking extends fgui.GComponent {
  5238. static createInstance() {
  5239. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5240. }
  5241. onConstruct() {
  5242. this.n26 = (this.getChild("n26"));
  5243. this.myNode = (this.getChild("myNode"));
  5244. }
  5245. }
  5246. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5247. class UIRanking extends UIBase {
  5248. constructor() {
  5249. super();
  5250. this.showSelf = true;
  5251. this.rankType = 1;
  5252. this.rankList = [];
  5253. this.topX = 10;
  5254. this.myIndex = this.topX + 1;
  5255. this.myStar = 0;
  5256. }
  5257. onConstructor() {
  5258. this.ui = ui_UIRanking.createInstance();
  5259. this.contentPane = this.ui;
  5260. this.isEject = false;
  5261. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5262. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5263. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5264. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5265. this.ui.myNode.myList.setVirtual();
  5266. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5267. }
  5268. show() {
  5269. super.show();
  5270. this.getPaiHangBangDataFormJosnFile();
  5271. this.updateSelf();
  5272. let self = Moyu.getUserInfo();
  5273. if (!self.isAuth) {
  5274. Moyu.initUser(this, () => {
  5275. DataMgr.upRankData();
  5276. });
  5277. }
  5278. }
  5279. getPaiHangBangDataFormJosnFile() {
  5280. const rankingList = cfgTable.paiHangBangData.list;
  5281. this.updateItemData(rankingList);
  5282. }
  5283. updateSelfItem() {
  5284. console.log('zh:Moyu.platType =' + Moyu.platType);
  5285. let self = Moyu.getUserInfo();
  5286. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5287. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5288. if (this.myIndex > this.topX) {
  5289. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5290. }
  5291. else {
  5292. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5293. }
  5294. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5295. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5296. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5297. }
  5298. updateItemData(data) {
  5299. this.myStar = xGame.common.getAllStarNum();
  5300. if (this.rankList.length < 2) {
  5301. this.rankList = data;
  5302. let self = Moyu.getUserInfo();
  5303. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5304. self.headIcon = self.headIcon;
  5305. for (let i = 0; i < data.length; i++) {
  5306. let data = this.rankList[i];
  5307. if (data.userId == self.userId) {
  5308. this.rankList.splice(i, 1);
  5309. break;
  5310. }
  5311. }
  5312. for (let i = 0; i < data.length; i++) {
  5313. let data = this.rankList[i];
  5314. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5315. this.myIndex = i + 1;
  5316. let user = { headIcon: self.headIcon, nickName: "myself" };
  5317. let ud = { user: user, data: {} };
  5318. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5319. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5320. if (Moyu.platType < 11) {
  5321. user.headIcon = self.headIcon;
  5322. user.nickName = self.nickName;
  5323. }
  5324. this.rankList.splice(i, 0, md);
  5325. break;
  5326. }
  5327. }
  5328. }
  5329. this.updateSelfItem();
  5330. this.ui.myNode.myList.numItems = this.rankList.length;
  5331. }
  5332. updateItemUI(index, obj) {
  5333. let data = this.rankList[index];
  5334. let userData = JSON.parse(data.userData).user;
  5335. obj.nameTxt.text = userData.nickName.toString();
  5336. obj.valueTxt.text = data.rankScore;
  5337. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5338. obj.rankTxt.text = index + 1;
  5339. switch (index) {
  5340. case 0:
  5341. this.setImg(obj, 1, 0, 0);
  5342. obj.rankTxt.color = "#FFC047";
  5343. break;
  5344. case 1:
  5345. this.setImg(obj, 0, 1, 0);
  5346. obj.rankTxt.color = "#ACACAC";
  5347. break;
  5348. case 2:
  5349. this.setImg(obj, 0, 0, 1);
  5350. obj.rankTxt.color = "#D09672";
  5351. break;
  5352. default:
  5353. this.setImg(obj, 0, 0, 0);
  5354. obj.rankTxt.color = "#496FAB";
  5355. break;
  5356. }
  5357. }
  5358. setImg(obj, a, b, c) {
  5359. obj.img1.visible = a ? true : false;
  5360. obj.img2.visible = b ? true : false;
  5361. obj.img3.visible = c ? true : false;
  5362. }
  5363. changeList(type) {
  5364. this.rankType = type;
  5365. this.updateSelf();
  5366. }
  5367. changeSelfNode() {
  5368. this.showSelf = !this.showSelf;
  5369. this.updateSelf();
  5370. }
  5371. updateSelf() {
  5372. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5373. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5374. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5375. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5376. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5377. }
  5378. }
  5379. UIRanking.uiName = "UIRanking";
  5380. class ui_UISecretary extends fgui.GComponent {
  5381. static createInstance() {
  5382. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5383. }
  5384. onConstruct() {
  5385. this.n0 = (this.getChild("n0"));
  5386. this.myNode = (this.getChild("myNode"));
  5387. this.closeBtn = (this.getChild("closeBtn"));
  5388. this.t0 = this.getTransition("t0");
  5389. }
  5390. }
  5391. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5392. class UISecretary extends UIBase {
  5393. constructor() {
  5394. super();
  5395. this.curIndex = 1;
  5396. }
  5397. onConstructor() {
  5398. this.ui = ui_UISecretary.createInstance();
  5399. this.contentPane = this.ui;
  5400. this.isEject = false;
  5401. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5402. this.nodeObj = { left: null, right: null, cur: null };
  5403. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5404. }
  5405. show() {
  5406. super.show();
  5407. this.ui.t0.play();
  5408. this.updateData();
  5409. }
  5410. addSecretarySpine(node, spineName) {
  5411. if (spineName == "mishu") {
  5412. if (this.secretarySpine1) {
  5413. node.displayObject.destroyChildren();
  5414. this.playWoman(this.secretarySpine1, node.displayObject);
  5415. }
  5416. else {
  5417. let spine1 = new SpineMgr("mishu", () => {
  5418. this.secretarySpine1 = spine1;
  5419. this.playWoman(this.secretarySpine1, node.displayObject);
  5420. });
  5421. }
  5422. }
  5423. else {
  5424. if (this.secretarySpine2) {
  5425. node.displayObject.destroyChildren();
  5426. this.playWoman(this.secretarySpine2, node.displayObject);
  5427. }
  5428. else {
  5429. let spine2 = new SpineMgr("xiaomishu2", () => {
  5430. this.secretarySpine2 = spine2;
  5431. this.playWoman(this.secretarySpine2, node.displayObject);
  5432. });
  5433. }
  5434. }
  5435. }
  5436. playWoman(node, parent) {
  5437. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5438. let yy = this.ui.myNode.gameNode3.secretary.height;
  5439. let scale = 1.5;
  5440. if (node == this.secretarySpine2) {
  5441. scale = 1.2;
  5442. }
  5443. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5444. node.play(data, 0, true, parent);
  5445. }
  5446. turnLeft() {
  5447. this.curIndex--;
  5448. if (this.curIndex < 1) {
  5449. this.curIndex = 2;
  5450. }
  5451. let left = this.nodeObj.left;
  5452. let right = this.nodeObj.right;
  5453. let cur = this.nodeObj.cur;
  5454. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5455. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5456. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5457. this.updateData();
  5458. }));
  5459. this.ui.myNode.setChildIndex(right, 2);
  5460. this.nodeObj.left = cur;
  5461. this.nodeObj.right = left;
  5462. this.nodeObj.cur = right;
  5463. }
  5464. turnRight() {
  5465. this.curIndex++;
  5466. if (this.curIndex > 2) {
  5467. this.curIndex = 1;
  5468. }
  5469. let left = this.nodeObj.left;
  5470. let right = this.nodeObj.right;
  5471. let cur = this.nodeObj.cur;
  5472. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5473. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5474. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5475. this.updateData();
  5476. }));
  5477. this.ui.myNode.setChildIndex(left, 2);
  5478. this.nodeObj.left = right;
  5479. this.nodeObj.right = cur;
  5480. this.nodeObj.cur = left;
  5481. }
  5482. updateData() {
  5483. console.log('zh: updateData FFFFFFFFFF');
  5484. let data = cfgTable.secretaryshopData;
  5485. let children = this.ui.myNode._children;
  5486. let temp;
  5487. let curData;
  5488. for (let index = 0; index < children.length; index++) {
  5489. temp = children[index];
  5490. curData = data[1];
  5491. temp.heightTxt.text = curData.height;
  5492. temp.foodTxt.text = curData.food;
  5493. temp.historyTxt.text = curData.history;
  5494. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5495. this.addSecretarySpine(temp.secretary, curData.spine);
  5496. let womanIndex = curData.id - 1;
  5497. let getWoman = DataMgr.getSecretary(womanIndex);
  5498. let curUse = DataMgr.getCurSecretary();
  5499. if (getWoman) {
  5500. if (curUse == womanIndex) {
  5501. temp.purchaseBtn.c1.selectedIndex = 1;
  5502. }
  5503. else {
  5504. temp.purchaseBtn.c1.selectedIndex = 2;
  5505. }
  5506. }
  5507. else {
  5508. temp.purchaseBtn.c1.selectedIndex = 0;
  5509. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5510. }
  5511. temp.purchaseBtn.visible = false;
  5512. }
  5513. }
  5514. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5515. console.log('zh: 点击了clickSecretary ');
  5516. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5517. if (getWoman) {
  5518. if (curUse != womanIndex) {
  5519. console.log();
  5520. DataMgr.setCurSecretary(womanIndex);
  5521. this.updateData();
  5522. }
  5523. }
  5524. else {
  5525. console.log('zh:点击购买了');
  5526. let need = needDiamond;
  5527. if (DataMgr.diamondEnough(need)) {
  5528. DataMgr.setDiamond(-need);
  5529. DataMgr.setSecretary(womanIndex, 1);
  5530. DataMgr.setCurSecretary(womanIndex);
  5531. this.updateData();
  5532. }
  5533. else {
  5534. xGame.uiMgr.Show(UIAddProp, 1);
  5535. }
  5536. }
  5537. }
  5538. closeSelf() {
  5539. this.hide();
  5540. }
  5541. }
  5542. UISecretary.uiName = "UISecretary";
  5543. class ui_UIShop extends fgui.GComponent {
  5544. static createInstance() {
  5545. return (fgui.UIPackage.createObject("game", "UIShop"));
  5546. }
  5547. onConstruct() {
  5548. this.n48 = (this.getChild("n48"));
  5549. this.n0 = (this.getChild("n0"));
  5550. this.secretary = (this.getChild("secretary"));
  5551. this.talkNode = (this.getChild("talkNode"));
  5552. this.closeNode = (this.getChild("closeNode"));
  5553. this.moneyNode = (this.getChild("moneyNode"));
  5554. this.myNode = (this.getChild("myNode"));
  5555. }
  5556. }
  5557. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5558. class BallRodDisplay {
  5559. constructor(ui, index) {
  5560. this.index = 0;
  5561. this.uiIndex = 0;
  5562. this.ui = ui;
  5563. this.index = index;
  5564. this.initData();
  5565. }
  5566. initData() {
  5567. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5568. let data = cfgTable.ballrodData[this.index + 1];
  5569. this.ui.nameTxt.text = data.name;
  5570. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5571. this.ui.levelNode.c1.selectedIndex = data.quality;
  5572. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5573. if (data.spine) {
  5574. this.mySpine = new SpineMgr(data.spine, () => {
  5575. let xx = 150;
  5576. let yy = 70;
  5577. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5578. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5579. });
  5580. }
  5581. }
  5582. updateSelf() {
  5583. console.log('zh:updateSelf -------------- ');
  5584. let get = DataMgr.getBallRod(this.index);
  5585. if (get == null)
  5586. get = 1;
  5587. let curUse = DataMgr.getCurBallRod();
  5588. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5589. if (get) {
  5590. if (curUse == this.index) {
  5591. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5592. }
  5593. else {
  5594. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5595. }
  5596. }
  5597. else {
  5598. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5599. }
  5600. }
  5601. buyBallRod() {
  5602. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5603. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5604. switch (selectedIndex) {
  5605. case 0:
  5606. break;
  5607. case 1:
  5608. console.log('zh:点击了 USE THIS');
  5609. DataMgr.setCurBallRod(this.index);
  5610. DataMgr.setDiamond(99999);
  5611. let curUse = DataMgr.getCurBallRod();
  5612. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5613. let ui = xGame.uiMgr.getUI(UIShop);
  5614. ui.updateBallRod();
  5615. break;
  5616. case 2:
  5617. let data = cfgTable.ballrodData[this.index + 1];
  5618. let need = data.price;
  5619. if (DataMgr.diamondEnough(need)) {
  5620. DataMgr.setDiamond(-need);
  5621. DataMgr.setBallRod(this.index, 1);
  5622. DataMgr.setCurBallRod(this.index);
  5623. let ui = xGame.uiMgr.getUI(UIShop);
  5624. ui.updateBallRod();
  5625. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5626. }
  5627. else {
  5628. xGame.uiMgr.Show(UIAddProp, 1);
  5629. }
  5630. break;
  5631. default:
  5632. break;
  5633. }
  5634. }
  5635. logEventForGouMaiGan(qiuGanName) {
  5636. const ev = {
  5637. value: qiuGanName
  5638. };
  5639. const jsonStr = JSON.stringify(ev);
  5640. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5641. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5642. }
  5643. }
  5644. class UIShop extends UIBase {
  5645. constructor() {
  5646. super();
  5647. this.itemNums = 0;
  5648. }
  5649. onConstructor() {
  5650. this.ui = ui_UIShop.createInstance();
  5651. this.contentPane = this.ui;
  5652. this.isEject = false;
  5653. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5654. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5655. this.addUIClick(this.ui, this.interuptSecretary);
  5656. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5657. this.ballRodArr = [];
  5658. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5659. this.ui.myNode.myList.numItems = this.itemNums;
  5660. if (Moyu.isKs)
  5661. this.ui.closeNode.closeBtn.x += 100;
  5662. }
  5663. show() {
  5664. super.show();
  5665. this.playSecretaryIdle();
  5666. this.updateBallRod();
  5667. }
  5668. updateBallRod() {
  5669. for (let index = 0; index < this.ballRodArr.length; index++) {
  5670. this.ballRodArr[index].updateSelf();
  5671. }
  5672. }
  5673. renderBallRod(sort, obj) {
  5674. let index = this.getIndexBySort(sort + 1) - 1;
  5675. let ballRod = new BallRodDisplay(obj, index);
  5676. this.ballRodArr.push(ballRod);
  5677. }
  5678. getIndexBySort(sort) {
  5679. let object = cfgTable.ballrodData;
  5680. for (const key in object) {
  5681. if (object[key].sort == sort) {
  5682. return parseInt(key);
  5683. }
  5684. }
  5685. }
  5686. playSecretaryIdle() {
  5687. let parent = this.ui.secretary.displayObject;
  5688. parent.destroyChildren();
  5689. let xx = this.ui.secretary.width / 2;
  5690. let yy = this.ui.secretary.height;
  5691. let scale = xGame.common.getSecretaryScale();
  5692. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5693. xGame.common.secretary.play(data, 0, true, parent);
  5694. }
  5695. interuptSecretary() {
  5696. Laya.timer.clearAll(this);
  5697. this.playSecretaryRandomSound();
  5698. }
  5699. playSecretaryRandomSound() {
  5700. if (this.isHide)
  5701. return;
  5702. let time = xGame.common.randomNum(45000, 60000);
  5703. Laya.timer.once(time, this, () => {
  5704. if (this.isHide)
  5705. return;
  5706. let index = xGame.common.randomNum(4, 7);
  5707. xGame.soundMgr.playSound("s_main0" + index);
  5708. let words = 1;
  5709. switch (index) {
  5710. case 4:
  5711. words = 5;
  5712. break;
  5713. case 5:
  5714. words = 3;
  5715. break;
  5716. case 6:
  5717. words = 6;
  5718. break;
  5719. case 7:
  5720. words = 7;
  5721. break;
  5722. default:
  5723. break;
  5724. }
  5725. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5726. this.playSecretaryRandomSound();
  5727. });
  5728. }
  5729. closeSelf() {
  5730. this.hide();
  5731. }
  5732. }
  5733. UIShop.uiName = "UIShop";
  5734. class ui_UISign extends fgui.GComponent {
  5735. static createInstance() {
  5736. return (fgui.UIPackage.createObject("game", "UISign"));
  5737. }
  5738. onConstruct() {
  5739. this.n6 = (this.getChild("n6"));
  5740. this.closeNode = (this.getChild("closeNode"));
  5741. this.myNode = (this.getChild("myNode"));
  5742. this.moneyNode = (this.getChild("moneyNode"));
  5743. this.secretary = (this.getChild("secretary"));
  5744. this.talkNode = (this.getChild("talkNode"));
  5745. this.tripleBtn = (this.getChild("tripleBtn"));
  5746. this.normalBtn = (this.getChild("normalBtn"));
  5747. this.tipsNode = (this.getChild("tipsNode"));
  5748. this.againBtn = (this.getChild("againBtn"));
  5749. this.t0 = this.getTransition("t0");
  5750. }
  5751. }
  5752. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5753. class SignMax {
  5754. constructor(ui) {
  5755. this.ui = ui;
  5756. }
  5757. updateSelf(index, sameDay, curDayIndex) {
  5758. let data = cfgTable.signData[index + 1];
  5759. this.ui.titleTxt.text = data.title;
  5760. let arr1 = data.award[0].split('-');
  5761. let arr2 = data.award[1].split('-');
  5762. let num1 = parseInt(arr1[1]);
  5763. let num2 = parseInt(arr2[1]);
  5764. this.ui.numTxt1.text = num1 + "";
  5765. this.ui.numTxt2.text = num2 + "";
  5766. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5767. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5768. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5769. this.ui.numTxt1.visible = false;
  5770. }
  5771. else {
  5772. this.ui.numTxt1.visible = true;
  5773. }
  5774. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5775. this.ui.numTxt2.visible = false;
  5776. }
  5777. else {
  5778. this.ui.numTxt2.visible = true;
  5779. }
  5780. if (index < curDayIndex) {
  5781. this.ui.c1.selectedIndex = 1;
  5782. }
  5783. else if (index == curDayIndex) {
  5784. if (sameDay) {
  5785. this.ui.c1.selectedIndex = 2;
  5786. }
  5787. else {
  5788. this.ui.c1.selectedIndex = 2;
  5789. }
  5790. }
  5791. else {
  5792. this.ui.c1.selectedIndex = 0;
  5793. }
  5794. }
  5795. }
  5796. class SignNormal {
  5797. constructor(ui) {
  5798. this.ui = ui;
  5799. }
  5800. updateSelf(index, sameDay, curDayIndex) {
  5801. let data = cfgTable.signData[index + 1];
  5802. this.ui.titleTxt.text = data.title;
  5803. let arr = data.award[0].split('-');
  5804. let type = parseInt(arr[0]);
  5805. let num = parseInt(arr[1]);
  5806. this.ui.numTxt.text = num + "";
  5807. if (type > 2) {
  5808. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5809. this.ui.myIcon.rotation = 0;
  5810. }
  5811. else {
  5812. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5813. this.ui.myIcon.rotation = 0;
  5814. }
  5815. if (xGame.common.signAwardContainsRod(data.award)) {
  5816. this.ui.numTxt.visible = false;
  5817. }
  5818. else {
  5819. this.ui.numTxt.visible = true;
  5820. }
  5821. if (index < curDayIndex) {
  5822. this.ui.c1.selectedIndex = 1;
  5823. }
  5824. else if (index == curDayIndex) {
  5825. if (sameDay) {
  5826. this.ui.c1.selectedIndex = 2;
  5827. }
  5828. else {
  5829. this.ui.c1.selectedIndex = 2;
  5830. }
  5831. }
  5832. else {
  5833. this.ui.c1.selectedIndex = 0;
  5834. }
  5835. }
  5836. }
  5837. class UISign extends UIBase {
  5838. constructor() {
  5839. super();
  5840. this.curDayIndex = 0;
  5841. this.starX = 0;
  5842. }
  5843. onConstructor() {
  5844. this.ui = ui_UISign.createInstance();
  5845. this.contentPane = this.ui;
  5846. this.isEject = false;
  5847. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5848. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5849. this.initSignItem();
  5850. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5851. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5852. }
  5853. show() {
  5854. super.show();
  5855. this.ui.t0.play();
  5856. this.playSecretaryIdle();
  5857. this.updateSign();
  5858. }
  5859. initSignItem() {
  5860. this.signArr = [];
  5861. for (let index = 0; index < 6; index++) {
  5862. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5863. this.signArr.push(temp);
  5864. }
  5865. this.signMax = new SignMax(this.ui.myNode.day7);
  5866. if (Moyu.isKs)
  5867. this.ui.closeNode.closeBtn.x += 100;
  5868. }
  5869. updateSign() {
  5870. let sameDay = xGame.common.judgeSameDay();
  5871. let max = 7;
  5872. this.curDayIndex = DataMgr.getSignData();
  5873. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5874. this.curDayIndex = 0;
  5875. if (!sameDay) {
  5876. this.ui.normalBtn.visible = true;
  5877. this.ui.tipsNode.visible = false;
  5878. this.ui.againBtn.visible = false;
  5879. }
  5880. else {
  5881. this.ui.normalBtn.visible = false;
  5882. let again = DataMgr.getExtraSign();
  5883. let isCurrency = false;
  5884. let index = this.curDayIndex;
  5885. if (index == 0)
  5886. index = 7;
  5887. let award = cfgTable.signData[index].award;
  5888. let num = award[0].split("-")[0];
  5889. if (num == "1" || num == "2")
  5890. isCurrency = true;
  5891. let showAgain = again == 0 && isCurrency;
  5892. this.ui.againBtn.visible = showAgain;
  5893. this.ui.tipsNode.visible = !showAgain;
  5894. }
  5895. for (let index = 0; index < this.signArr.length; index++) {
  5896. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5897. }
  5898. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5899. }
  5900. playSecretaryIdle() {
  5901. let parent = this.ui.secretary.displayObject;
  5902. parent.destroyChildren();
  5903. let xx = this.ui.secretary.width / 2;
  5904. let yy = this.ui.secretary.height;
  5905. let scale = xGame.common.getSecretaryScale();
  5906. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5907. xGame.common.secretary.play(data, 0, true, parent);
  5908. }
  5909. closeSelf() {
  5910. this.hide();
  5911. }
  5912. normalGetAward() {
  5913. let sameDay = xGame.common.judgeSameDay();
  5914. if (!sameDay) {
  5915. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5916. let temp;
  5917. let type;
  5918. let num;
  5919. let arr = [];
  5920. for (let index = 0; index < award.length; index++) {
  5921. temp = award[index].split("-");
  5922. type = parseInt(temp[0]);
  5923. num = parseInt(temp[1]);
  5924. let awardType = new AwardType();
  5925. awardType.num = num;
  5926. awardType.type = type;
  5927. arr.push(awardType);
  5928. }
  5929. xGame.common.getAward(arr, (watchVideo) => {
  5930. this.curDayIndex++;
  5931. if (this.curDayIndex > 7)
  5932. this.curDayIndex = 0;
  5933. DataMgr.setSignData(this.curDayIndex);
  5934. DataMgr.setSignTime(new Date().getTime());
  5935. if (watchVideo) {
  5936. DataMgr.setExtraSign(1);
  5937. Moyu.sendDataEvent("signIn1");
  5938. }
  5939. this.updateSign();
  5940. });
  5941. }
  5942. }
  5943. againGetAward() {
  5944. Moyu.sendDataEvent("signIn2");
  5945. console.log('zh:qjff_AD_for_uisign');
  5946. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  5947. }
  5948. else {
  5949. console.log('zh:AD 失败,直接发放奖励');
  5950. this.qjff_AD_for_uisign();
  5951. }
  5952. }
  5953. qjff_AD_for_uisign() {
  5954. let index = this.curDayIndex;
  5955. if (index == 0)
  5956. index = 7;
  5957. let award = cfgTable.signData[index].award;
  5958. let temp;
  5959. let type;
  5960. let num;
  5961. for (let index = 0; index < award.length; index++) {
  5962. temp = award[index].split("-");
  5963. type = parseInt(temp[0]);
  5964. num = parseInt(temp[1]) * 3;
  5965. xGame.common.playObjFlyAnim(num, type);
  5966. }
  5967. DataMgr.setExtraSign(1);
  5968. this.updateSign();
  5969. }
  5970. }
  5971. UISign.uiName = "UISign";
  5972. class ui_UISkill extends fgui.GComponent {
  5973. static createInstance() {
  5974. return (fgui.UIPackage.createObject("game", "UISkill"));
  5975. }
  5976. onConstruct() {
  5977. this.n48 = (this.getChild("n48"));
  5978. this.n0 = (this.getChild("n0"));
  5979. this.secretary = (this.getChild("secretary"));
  5980. this.talkNode = (this.getChild("talkNode"));
  5981. this.closeNode = (this.getChild("closeNode"));
  5982. this.moneyNode = (this.getChild("moneyNode"));
  5983. this.skillNode = (this.getChild("skillNode"));
  5984. this.guideNode = (this.getChild("guideNode"));
  5985. }
  5986. }
  5987. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5988. class SkillDisplay {
  5989. constructor(ui, data, uiIndex) {
  5990. this.starX = 0;
  5991. this.starY = 0;
  5992. this.index = 0;
  5993. this.ui = ui;
  5994. this.data = data;
  5995. this.index = uiIndex;
  5996. this.initSelf();
  5997. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5998. }
  5999. initSelf() {
  6000. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6001. this.ui.nameTxt.text = this.data.name;
  6002. this.ui.describeTxt.text = this.data.describe;
  6003. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6004. this.ui.startBtn.onClick(this, this.startGame);
  6005. this.updateSelf();
  6006. }
  6007. updateSelf() {
  6008. this.checkTry();
  6009. let level = DataMgr.getBigSkillByIndex(this.index);
  6010. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6011. }
  6012. checkTry() {
  6013. let index = this.index;
  6014. let level = DataMgr.getBigSkillByIndex(index);
  6015. if (level == null) {
  6016. DataMgr.setBigSkill(index, 1, false);
  6017. level = 1;
  6018. }
  6019. this.ui.levelTxt.text = "LV." + level;
  6020. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6021. this.ui.tryNode.visible = true;
  6022. else
  6023. this.ui.tryNode.visible = false;
  6024. }
  6025. clickAddLevel() {
  6026. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6027. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6028. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6029. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6030. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6031. }
  6032. else {
  6033. console.log('zh:AD 失败,直接发放奖励');
  6034. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6035. }
  6036. }
  6037. qjff_AD_for_skilldisplay_clickAddLevel() {
  6038. DataMgr.setBigSkill(this.data.index, 1);
  6039. this.updateSelf();
  6040. xGame.common.upSkillLevel = true;
  6041. }
  6042. startGame() {
  6043. console.log('zh:rod skill startgame');
  6044. if (this.data.index == 3) {
  6045. alert('Coming soon!');
  6046. return;
  6047. }
  6048. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6049. let needCoin = xGame.common.bigMoveNeedCoin;
  6050. xGame.common.passAwardCoin = 2000;
  6051. let guide = DataMgr.getSkillGuide();
  6052. console.log('zh:startGame guide=' + guide);
  6053. xGame.common.temSelfLevel = 0;
  6054. if (guide == 0) {
  6055. needCoin = 0;
  6056. xGame.common.temSelfLevel = 100;
  6057. }
  6058. if (DataMgr.coinEnough(needCoin)) {
  6059. DataMgr.setCoin(-needCoin);
  6060. xGame.common.curPlayerSkillType = this.index;
  6061. if (guide == 0)
  6062. xGame.common.curPlayerSkillType = 0;
  6063. console.log('zh: skilldisplay 1');
  6064. xGame.uiMgr.Show(UIGame);
  6065. xGame.uiMgr.Hide(UIMain);
  6066. xGame.uiMgr.Show(UIMatching, () => {
  6067. xGame.common.gameUI.ui.alpha = 1;
  6068. xGame.common.gameUI.startGame();
  6069. xGame.uiMgr.Hide(UISkill);
  6070. });
  6071. this.logEventForRod_start();
  6072. }
  6073. else {
  6074. console.log('zh: skilldisplay 2');
  6075. xGame.uiMgr.Show(UIAddProp, 0);
  6076. Moyu.sendDataEvent("AddCoinVideo");
  6077. }
  6078. }
  6079. logEventForRod_start() {
  6080. let gfmsIdx = xGame.common.curPlayerSkillType;
  6081. console.log('zh:选择的技能=' + gfmsIdx);
  6082. let gfmc = 'Skyfall Shot';
  6083. if (gfmsIdx == 0) {
  6084. gfmc = 'Skyfall Shot';
  6085. }
  6086. if (gfmsIdx == 1) {
  6087. gfmc = 'Surging break';
  6088. }
  6089. if (gfmsIdx == 2) {
  6090. gfmc = 'Frost Lock';
  6091. }
  6092. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6093. let jsonStr = {
  6094. "count": 0,
  6095. "name": gfmc
  6096. };
  6097. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6098. const d = LocalStorageManager.getItem(keyStr);
  6099. jsonStr.count = d.count + 1;
  6100. LocalStorageManager.setItem(keyStr, jsonStr);
  6101. }
  6102. else {
  6103. LocalStorageManager.setItem(keyStr, jsonStr);
  6104. }
  6105. const reqStr = JSON.stringify(jsonStr);
  6106. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6107. }
  6108. }
  6109. class UISkill extends UIBase {
  6110. constructor() {
  6111. super();
  6112. this.skillData = [];
  6113. }
  6114. onConstructor() {
  6115. this.ui = ui_UISkill.createInstance();
  6116. this.contentPane = this.ui;
  6117. this.isEject = false;
  6118. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6119. this.initSkillData();
  6120. console.log('zh:aaaaaa1111111111');
  6121. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6122. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6123. console.log('zh:aaaaaa22222222');
  6124. this.displayList = [];
  6125. this.ui.skillNode.skillList.numItems = 3;
  6126. this.addUIClick(this.ui, this.interuptSecretary);
  6127. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6128. this.ui.talkNode.visible = false;
  6129. if (Moyu.isKs)
  6130. this.ui.closeNode.closeBtn.x += 100;
  6131. }
  6132. show() {
  6133. super.show();
  6134. this.playSecretaryIdle();
  6135. this.moneyNode.ui.c1.selectedIndex = 1;
  6136. Laya.timer.clearAll(this);
  6137. xGame.soundMgr.playSound("s_start");
  6138. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6139. let guide = DataMgr.getSkillGuide();
  6140. this.ui.guideNode.visible = guide == 0;
  6141. let item = this.getSkillItemByUIIndex(0);
  6142. if (guide == 0) {
  6143. item.ui.c1.selectedIndex = 1;
  6144. }
  6145. else {
  6146. item.ui.c1.selectedIndex = 0;
  6147. }
  6148. this.ui.guideNode.guideBtn.visible = guide == 0;
  6149. for (let index = 0; index < this.displayList.length; index++) {
  6150. this.displayList[index].checkTry();
  6151. }
  6152. }
  6153. getSkillItemByUIIndex(cur) {
  6154. for (let index = 0; index < this.displayList.length; index++) {
  6155. if (this.displayList[index].index == cur) {
  6156. return this.displayList[index];
  6157. }
  6158. }
  6159. }
  6160. enterGuideLevel() {
  6161. let item = this.getSkillItemByUIIndex(0);
  6162. item.startGame();
  6163. if (DataMgr.getNewUser())
  6164. Moyu.sendDataEvent("gameStart1");
  6165. }
  6166. initSkillData() {
  6167. this.skillData = [];
  6168. let nameList = xGame.common.skillNameList;
  6169. let iconList = xGame.common.skillIconList;
  6170. let describeList = [
  6171. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6172. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  6173. "The power of frost descends—freezing the flow and taking full control of the game!"
  6174. ];
  6175. console.log('zh:initSkillData 111111111');
  6176. let data;
  6177. for (let index = 0; index < nameList.length; index++) {
  6178. data = {};
  6179. data.name = nameList[index];
  6180. data.icon = iconList[index];
  6181. data.describe = describeList[index];
  6182. data.index = index;
  6183. this.skillData.push(data);
  6184. }
  6185. }
  6186. updateSkillItem(index, target) {
  6187. if (this.displayList[index] == null) {
  6188. let uiIndex;
  6189. switch (index) {
  6190. case 0:
  6191. uiIndex = 1;
  6192. break;
  6193. case 1:
  6194. uiIndex = 0;
  6195. break;
  6196. case 2:
  6197. uiIndex = 2;
  6198. break;
  6199. case 3:
  6200. uiIndex = 3;
  6201. break;
  6202. default:
  6203. break;
  6204. }
  6205. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6206. this.displayList.push(temp);
  6207. }
  6208. }
  6209. playSecretaryIdle() {
  6210. let parent = this.ui.secretary.displayObject;
  6211. parent.destroyChildren();
  6212. let xx = this.ui.secretary.width / 2;
  6213. let yy = this.ui.secretary.height;
  6214. let scale = xGame.common.getSecretaryScale();
  6215. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6216. xGame.common.secretary.play(data, 0, true, parent);
  6217. }
  6218. returnUIMain() {
  6219. this.hide();
  6220. xGame.common.stopGirlPop(this.ui.talkNode);
  6221. xGame.uiMgr.Show(UIMain);
  6222. }
  6223. interuptSecretary() {
  6224. Laya.timer.clearAll(this);
  6225. this.playSecretaryRandomSound();
  6226. }
  6227. playSecretaryRandomSound() {
  6228. if (this.isHide)
  6229. return;
  6230. let time = xGame.common.randomNum(45000, 60000);
  6231. Laya.timer.once(time, this, () => {
  6232. if (this.isHide)
  6233. return;
  6234. let index = xGame.common.randomNum(4, 7);
  6235. xGame.soundMgr.playSound("s_main0" + index);
  6236. let words = 1;
  6237. switch (index) {
  6238. case 4:
  6239. words = 5;
  6240. break;
  6241. case 5:
  6242. words = 3;
  6243. break;
  6244. case 6:
  6245. words = 6;
  6246. break;
  6247. case 7:
  6248. words = 7;
  6249. break;
  6250. default:
  6251. break;
  6252. }
  6253. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6254. this.playSecretaryRandomSound();
  6255. });
  6256. }
  6257. }
  6258. UISkill.uiName = "UISkill";
  6259. class ui_UIMsg extends fgui.GComponent {
  6260. static createInstance() {
  6261. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6262. }
  6263. onConstruct() {
  6264. this.tipsNode = (this.getChild("tipsNode"));
  6265. }
  6266. }
  6267. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6268. class UIMsg extends UIBase {
  6269. constructor() {
  6270. super();
  6271. }
  6272. onConstructor() {
  6273. this.ui = ui_UIMsg.createInstance();
  6274. this.contentPane = this.ui;
  6275. this.isEject = false;
  6276. this.isMuti = true;
  6277. }
  6278. show(msg, callback) {
  6279. super.show();
  6280. this.ui.tipsNode.msgTxt.text = msg;
  6281. this.ui.alpha = 1;
  6282. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6283. this.hide();
  6284. callback && callback();
  6285. }), 1000);
  6286. }
  6287. }
  6288. UIMsg.uiName = "UIMsg";
  6289. class ui_UIModeSelection extends fgui.GComponent {
  6290. static createInstance() {
  6291. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6292. }
  6293. onConstruct() {
  6294. this.n19 = (this.getChild("n19"));
  6295. this.closeBtn = (this.getChild("closeBtn"));
  6296. this.myNode = (this.getChild("myNode"));
  6297. this.t0 = this.getTransition("t0");
  6298. }
  6299. }
  6300. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6301. class UIModeSelection extends UIBase {
  6302. constructor() {
  6303. super();
  6304. }
  6305. onConstructor() {
  6306. this.ui = ui_UIModeSelection.createInstance();
  6307. this.contentPane = this.ui;
  6308. this.isEject = false;
  6309. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6310. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6311. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6312. this.addUIClick(this.ui.closeBtn, this.hide);
  6313. this.peopleArr = [650, 6900, 3800];
  6314. this.peopleOffest = [50, 500, 200];
  6315. this.updateSelf();
  6316. }
  6317. show(callback) {
  6318. super.show();
  6319. this.ui.t0.play();
  6320. this.callback = callback;
  6321. }
  6322. updateSelf() {
  6323. let cfg = cfgTable.modeselectData;
  6324. for (let index = 1; index <= 3; index++) {
  6325. let node = this.ui.myNode["type" + index];
  6326. node.need.text = cfg[index].need;
  6327. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6328. node.peopleTxt.text = this.getRandPeople(index - 1);
  6329. }
  6330. }
  6331. enterGame(type) {
  6332. console.log('zh: 进入经典模式 type: ' + type);
  6333. xGame.common.classicRoomType = type;
  6334. let cfg = cfgTable.modeselectData[type];
  6335. let need = cfg.need;
  6336. xGame.common.passAwardCoin = cfg.award;
  6337. if (DataMgr.coinEnough(need)) {
  6338. DataMgr.setCoin(-need);
  6339. this.ui.myNode["type" + type].t0.play();
  6340. Laya.timer.once(200, this, () => {
  6341. this.callback && this.callback();
  6342. });
  6343. this.logEventForClassic_start();
  6344. }
  6345. else {
  6346. Moyu.sendDataEvent("AddCoinVideo");
  6347. xGame.uiMgr.Show(UIAddProp, 0);
  6348. }
  6349. }
  6350. getRandPeople(index) {
  6351. let rand = this.peopleOffest[index];
  6352. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6353. }
  6354. logEventForClassic_start() {
  6355. let rtype = xGame.common.classicRoomType;
  6356. let msmc = '';
  6357. if (rtype == 1) {
  6358. msmc = 'beginner';
  6359. }
  6360. if (rtype == 2) {
  6361. msmc = 'expert';
  6362. }
  6363. if (rtype == 3) {
  6364. msmc = 'master';
  6365. }
  6366. let keyStr = 'sjmd_classic_start_' + rtype;
  6367. let jsonStr = {
  6368. "difficulty": msmc,
  6369. "classic_count": 1,
  6370. "difficulty_count": 1
  6371. };
  6372. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6373. const d = LocalStorageManager.getItem(keyStr);
  6374. jsonStr.classic_count = d.classic_count + 1;
  6375. jsonStr.difficulty_count = d.difficulty_count + 1;
  6376. LocalStorageManager.setItem(keyStr, jsonStr);
  6377. }
  6378. else {
  6379. LocalStorageManager.setItem(keyStr, jsonStr);
  6380. }
  6381. const reqStr = JSON.stringify(jsonStr);
  6382. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6383. }
  6384. }
  6385. UIModeSelection.uiName = "UIModeSelection";
  6386. class ui_UIGetAward extends fgui.GComponent {
  6387. static createInstance() {
  6388. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6389. }
  6390. onConstruct() {
  6391. this.n4 = (this.getChild("n4"));
  6392. this.n0 = (this.getChild("n0"));
  6393. this.myList = (this.getChild("myList"));
  6394. this.n1 = (this.getChild("n1"));
  6395. this.eftNode = (this.getChild("eftNode"));
  6396. this.btnNode = (this.getChild("btnNode"));
  6397. this.t0 = this.getTransition("t0");
  6398. }
  6399. }
  6400. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6401. class UIGetAward extends UIBase {
  6402. constructor() {
  6403. super();
  6404. this.showTriple = true;
  6405. }
  6406. onConstructor() {
  6407. this.ui = ui_UIGetAward.createInstance();
  6408. this.contentPane = this.ui;
  6409. this.isEject = false;
  6410. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6411. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6412. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6413. }
  6414. show(arr, showTriple, callback) {
  6415. super.show();
  6416. this.ui.t0.play();
  6417. this.ui.eftNode.visible = true;
  6418. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6419. this.ui.eftNode.visible = false;
  6420. }), 1, 0, 0, 0.9);
  6421. this.awardArr = arr;
  6422. this.showTriple = showTriple;
  6423. this.callback = callback;
  6424. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6425. this.ui.myList.numItems = arr.length;
  6426. xGame.soundMgr.playSound("getaward");
  6427. }
  6428. updateSelf(index, obj) {
  6429. let temp = this.awardArr[index];
  6430. let icon = this.getIcon(temp.type);
  6431. let str = icon;
  6432. if (temp.type > 2) {
  6433. str = "s" + icon;
  6434. }
  6435. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6436. obj.myIcon.rotation = 0;
  6437. obj.numTxt.text = temp.num + "";
  6438. obj.numTxt.visible = temp.type > 2 ? false : true;
  6439. obj.nameTxt.text = this.getNameStr(temp.type);
  6440. }
  6441. renderItem(index, obj) {
  6442. this.updateSelf(index, obj);
  6443. }
  6444. tripleGetAward() {
  6445. console.log('zh:qjff_AD_for_uigetAward');
  6446. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6447. }
  6448. else {
  6449. console.log('zh:AD 失败,直接发放奖励');
  6450. this.qjff_AD_for_uigetAward();
  6451. }
  6452. }
  6453. qjff_AD_for_uigetAward() {
  6454. this.getAward(3);
  6455. }
  6456. normalGetAward() {
  6457. if (PlatMgr.isMisVideo())
  6458. this.tripleGetAward();
  6459. else
  6460. this.getAward();
  6461. }
  6462. getAward(times = 1) {
  6463. this.hide();
  6464. for (let index = 0; index < this.awardArr.length; index++) {
  6465. this.awardArr[index].num *= times;
  6466. }
  6467. this.callback && this.callback(times != 1);
  6468. }
  6469. getIcon(type) {
  6470. switch (type) {
  6471. case Prop.diamond:
  6472. return "ty_zs";
  6473. case Prop.coin:
  6474. return "ty_jb";
  6475. case Prop.gan1:
  6476. return "qg1";
  6477. case Prop.gan2:
  6478. return "qg2";
  6479. case Prop.gan3:
  6480. return "qg3";
  6481. case Prop.gan4:
  6482. return "qg4";
  6483. default:
  6484. break;
  6485. }
  6486. }
  6487. getNameStr(type) {
  6488. switch (type) {
  6489. case Prop.diamond:
  6490. return "Diamond";
  6491. case Prop.coin:
  6492. return "Coins";
  6493. case Prop.gan1:
  6494. case Prop.gan2:
  6495. case Prop.gan3:
  6496. case Prop.gan4:
  6497. return cfgTable.ballrodData[type - 1].name;
  6498. default:
  6499. break;
  6500. }
  6501. }
  6502. }
  6503. UIGetAward.uiName = "UIGetAward";
  6504. class ui_UIRepentProp extends fgui.GComponent {
  6505. static createInstance() {
  6506. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6507. }
  6508. onConstruct() {
  6509. this.c1 = this.getController("c1");
  6510. this.n11 = (this.getChild("n11"));
  6511. this.regretNode = (this.getChild("regretNode"));
  6512. this.helpLineNode = (this.getChild("helpLineNode"));
  6513. this.t0 = this.getTransition("t0");
  6514. }
  6515. }
  6516. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6517. class UIRepentProp extends UIBase {
  6518. constructor() {
  6519. super();
  6520. this.viewType = 0;
  6521. this.regretType = 0;
  6522. }
  6523. onConstructor() {
  6524. this.ui = ui_UIRepentProp.createInstance();
  6525. this.contentPane = this.ui;
  6526. this.isEject = false;
  6527. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6528. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6529. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6530. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6531. }
  6532. show(viewType, regretType, callback) {
  6533. PlatMgr.showInsert(true);
  6534. this.viewType = viewType;
  6535. this.regretType = regretType;
  6536. this.callback = callback;
  6537. super.show();
  6538. this.ui.t0.play();
  6539. this.ui.c1.selectedIndex = this.viewType;
  6540. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6541. if (this.viewType == 0) {
  6542. let guide = DataMgr.getGuideHelpLine();
  6543. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6544. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6545. }
  6546. xGame.common.gameMgr.gamePause = true;
  6547. }
  6548. hideSelf() {
  6549. xGame.common.gameMgr.gamePause = false;
  6550. this.callback && this.callback(false);
  6551. this.hide();
  6552. }
  6553. videoRegret() {
  6554. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6555. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6556. }
  6557. else {
  6558. console.log('zh:AD 失败,直接发放奖励');
  6559. this.qjff_AD_for_UIrepentProp_videoRegret();
  6560. }
  6561. }
  6562. qjff_AD_for_UIrepentProp_videoRegret() {
  6563. this.callback && this.callback(true);
  6564. this.hideSelf();
  6565. }
  6566. videoAddHelpLine() {
  6567. let guide = DataMgr.getGuideHelpLine();
  6568. if (guide == 0) {
  6569. this.callback && this.callback(true);
  6570. this.hideSelf();
  6571. DataMgr.setGuideHelpLine();
  6572. xGame.common.gameUI.ui.guideNode.visible = false;
  6573. }
  6574. else {
  6575. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6576. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6577. }
  6578. else {
  6579. console.log('zh:AD 失败,直接发放奖励');
  6580. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6581. }
  6582. }
  6583. }
  6584. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6585. this.callback && this.callback(true);
  6586. this.hideSelf();
  6587. }
  6588. }
  6589. UIRepentProp.uiName = "UIRepentProp";
  6590. class UIMain extends UIBase {
  6591. constructor() {
  6592. super();
  6593. this.firstEnter = true;
  6594. }
  6595. nativeCallJs(msg) {
  6596. let t = msg;
  6597. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6598. switch (t) {
  6599. case 'qjff_chouJiang':
  6600. let dui = xGame.uiMgr.getUI(UIDraw);
  6601. dui.qjff_chouJiang();
  6602. break;
  6603. case 'qjff_AD_for_uisign':
  6604. let dui2 = xGame.uiMgr.getUI(UISign);
  6605. dui2.qjff_AD_for_uisign();
  6606. break;
  6607. case 'qjff_AD_for_uitry':
  6608. let dui3 = xGame.uiMgr.getUI(UITry);
  6609. dui3.qjff_AD_for_uitry();
  6610. break;
  6611. case 'qjff_AD_for_uipower':
  6612. let dui4 = xGame.uiMgr.getUI(UIPower);
  6613. dui4.qjff_AD_for_uipower();
  6614. break;
  6615. case 'qjff_AD_for_uigetAward':
  6616. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6617. dui5.qjff_AD_for_uigetAward();
  6618. break;
  6619. case 'qjff_AD_for_uiGameEnd':
  6620. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6621. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6622. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6623. break;
  6624. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6625. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6626. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6627. break;
  6628. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6629. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6630. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6631. break;
  6632. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6633. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6634. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6635. break;
  6636. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6637. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6638. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6639. break;
  6640. case 'qjff_AD_for_UIBOX_onOpenBox':
  6641. let dui11 = xGame.uiMgr.getUI(UIBox);
  6642. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6643. break;
  6644. case 'qjff_AD_for_UIAddCoin':
  6645. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6646. dui12.qjff_AD_for_UIAddCoin();
  6647. break;
  6648. case '111a':
  6649. let dui14 = xGame.uiMgr.getUI(UISign);
  6650. dui14.qjff_AD_for_uisign();
  6651. break;
  6652. case '222a':
  6653. let dui15 = xGame.uiMgr.getUI(UISign);
  6654. dui15.qjff_AD_for_uisign();
  6655. break;
  6656. case '333a':
  6657. let dui16 = xGame.uiMgr.getUI(UISign);
  6658. dui16.qjff_AD_for_uisign();
  6659. break;
  6660. default:
  6661. console.log('zh:未知的方法名字' + t);
  6662. break;
  6663. }
  6664. }
  6665. onConstructor() {
  6666. console.log('zh: UIMain onConstructor');
  6667. this.ui = ui_UIMain.createInstance();
  6668. this.contentPane = this.ui;
  6669. this.isEject = false;
  6670. this.addEvent();
  6671. this.addClickSpine();
  6672. this.settingNode = new SettingNode(this.ui.settingNode);
  6673. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6674. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6675. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6676. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6677. let curUse = DataMgr.getCurSecretary();
  6678. this.changeSecretary(curUse);
  6679. this.ui.talkNode.visible = false;
  6680. let guide = DataMgr.getSkillGuide();
  6681. if (xGame.common.isNewDay && guide == 1) {
  6682. xGame.common.isNewDay = false;
  6683. xGame.soundMgr.playSound("s_main01");
  6684. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6685. console.log("zh:播放小秘书每天语音");
  6686. }
  6687. this.ui.n83.visible = false;
  6688. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6689. }
  6690. changeSecretary(curUse) {
  6691. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6692. xGame.common.secretary && xGame.common.secretary.dispose();
  6693. this.addSecretarySpine(name);
  6694. }
  6695. addSecretarySpine(name) {
  6696. let spine = new SpineMgr(name, () => {
  6697. this.playSecretaryIdle();
  6698. });
  6699. xGame.common.secretary = spine;
  6700. }
  6701. addClickSpine() {
  6702. let clickSpine = new SpineMgr("dianji", () => {
  6703. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6704. let parent = Laya.stage;
  6705. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6706. clickSpine.play(data, 0, false, parent, (spine) => {
  6707. spine.destroy(true);
  6708. });
  6709. });
  6710. });
  6711. }
  6712. addEvent() {
  6713. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6714. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6715. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6716. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6717. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6718. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6719. this.addUIClick(this.ui, this.interuptSecretary);
  6720. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6721. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6722. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6723. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6724. this.addUIClick(this.ui.signBtn, this.openSignView);
  6725. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6726. this.addUIClick(this.ui.rankBtn, this.openRanking);
  6727. }
  6728. show(showFailWords) {
  6729. super.show();
  6730. this.moneyNode.ui.c1.selectedIndex = 1;
  6731. this.playSecretaryIdle();
  6732. xGame.soundMgr.playMusic("caromhall01", 0);
  6733. Laya.timer.clearAll(this);
  6734. this.playSecretaryRandomSound();
  6735. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  6736. if (showFailWords) {
  6737. console.log('zh:uimain.ts ');
  6738. setTimeout(() => {
  6739. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6740. let words = -1;
  6741. if (str == "s_main02") {
  6742. words = 2;
  6743. }
  6744. else {
  6745. words = 3;
  6746. }
  6747. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6748. xGame.soundMgr.playSound(str);
  6749. }, 300);
  6750. }
  6751. this.showGuide();
  6752. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6753. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6754. let guide = DataMgr.getSkillGuide();
  6755. if (guide == 1) {
  6756. let randTime = xGame.common.randomNum(300, 800);
  6757. if (this.firstEnter) {
  6758. console.log("zh: firstEnter");
  6759. this.firstEnter = false;
  6760. randTime += 900;
  6761. }
  6762. else {
  6763. console.log("zh: no firstEnter");
  6764. }
  6765. Laya.timer.once(randTime, this, () => {
  6766. xGame.common.autoPopUIView();
  6767. });
  6768. }
  6769. }
  6770. checkActive(show) {
  6771. }
  6772. showGuide() {
  6773. let guide = DataMgr.getSkillGuide();
  6774. this.ui.guideBtn.visible = guide == 0;
  6775. this.ui.enterGuide.visible = false;
  6776. this.ui.secretaryGuide.visible = guide == 0;
  6777. if (guide == 0) {
  6778. console.log("zh:显示引导");
  6779. xGame.soundMgr.playSound("s_guide");
  6780. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6781. }
  6782. else {
  6783. console.log("zh:不需要显示引导");
  6784. }
  6785. }
  6786. ensureSecretary() {
  6787. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6788. this.ui.secretaryGuide.visible = false;
  6789. this.ui.enterGuide.visible = true;
  6790. this.ui.wordsNode.t0.play();
  6791. if (DataMgr.getNewUser())
  6792. Moyu.sendDataEvent("gameReady");
  6793. }
  6794. playSecretaryIdle() {
  6795. let parent = this.ui.secretary.displayObject;
  6796. parent.destroyChildren();
  6797. let xx = this.ui.secretary.width / 2;
  6798. let yy = this.ui.secretary.height;
  6799. let scale = xGame.common.getSecretaryScale();
  6800. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6801. console.log("zh:playSecretaryIdle", data);
  6802. xGame.common.secretary.play(data, 0, true, parent);
  6803. }
  6804. startGame(type) {
  6805. xGame.common.gameMode = type;
  6806. Moyu.sendDataEvent("PlayGame", { type: type });
  6807. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  6808. switch (xGame.common.gameMode) {
  6809. case GameMode.classic:
  6810. console.log('zh:进入经典模式111111111');
  6811. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  6812. let db_over_lev = DataMgr.getChallengeMode_overLev();
  6813. console.log('zh:classic db_over_lev=', db_over_lev);
  6814. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  6815. console.log('zh:判断是否可以玩该模式classic =NO');
  6816. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  6817. xGame.uiMgr.Show(UIMsg, tipStr);
  6818. console.log('zh:返回');
  6819. return;
  6820. }
  6821. else {
  6822. console.log('zh:可以玩该模式classic 66666666666666');
  6823. this.beginGame();
  6824. }
  6825. }
  6826. else {
  6827. console.log('zh:不需要判断是否可以玩该classic');
  6828. let challengeTimes = DataMgr.getChallengeTimes();
  6829. if (challengeTimes == 0) {
  6830. xGame.uiMgr.Show(UIInvitation);
  6831. }
  6832. else {
  6833. this.beginGame();
  6834. }
  6835. break;
  6836. }
  6837. case GameMode.bigMove:
  6838. console.error('zh:bigMove check');
  6839. let guide = DataMgr.getSkillGuide();
  6840. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  6841. let db_over_lev = DataMgr.getChallengeMode_overLev();
  6842. console.log('zh:bigMove db_over_lev=', db_over_lev);
  6843. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  6844. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  6845. xGame.uiMgr.Show(UIMsg, tipStr);
  6846. return;
  6847. }
  6848. else {
  6849. console.log('zh:可以玩该模式 bigMove');
  6850. this.beginGame();
  6851. if (DataMgr.getNewUser())
  6852. Moyu.sendDataEvent("gameStart0");
  6853. }
  6854. }
  6855. else {
  6856. this.beginGame();
  6857. if (DataMgr.getNewUser())
  6858. Moyu.sendDataEvent("gameStart0");
  6859. }
  6860. break;
  6861. default:
  6862. console.error('zh:未知错误!!!!');
  6863. break;
  6864. }
  6865. }
  6866. beginGame(isNice = false) {
  6867. console.log('zh:beginGame ');
  6868. let guide = DataMgr.getSkillGuide();
  6869. if (guide == 1) {
  6870. console.log('zh:非新手引导,showInternAd ');
  6871. JSBridgeUtils.instance.showInternAd('beginGame');
  6872. }
  6873. else {
  6874. console.log('zh:新手引导,不显示AD ');
  6875. }
  6876. console.log('zh:beginGame 2 go');
  6877. if (xGame.common.gameMode == GameMode.classic) {
  6878. if (isNice) {
  6879. this.enterClassic();
  6880. }
  6881. else {
  6882. xGame.uiMgr.Show(UIModeSelection, () => {
  6883. console.log('zh:BBBBBBBBBBBBBBB');
  6884. this.enterClassic();
  6885. });
  6886. }
  6887. }
  6888. else if (xGame.common.gameMode == GameMode.bigMove) {
  6889. this.ui.enterGuide.visible = false;
  6890. xGame.uiMgr.Show(UISkill);
  6891. }
  6892. }
  6893. enterClassic() {
  6894. xGame.uiMgr.Show(UIGame);
  6895. xGame.uiMgr.Show(UIMatching, () => {
  6896. if (!this.isHide)
  6897. this.hide();
  6898. xGame.common.gameUI.ui.alpha = 1;
  6899. xGame.common.gameUI.startGame();
  6900. xGame.uiMgr.Hide(UIGameEnd);
  6901. });
  6902. }
  6903. startGlobal() {
  6904. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6905. }
  6906. startWeekly() {
  6907. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6908. }
  6909. zhouSaiMonth() {
  6910. console.log('zh: zhouSaiMonth 被调用');
  6911. }
  6912. startPlaceBall() {
  6913. xGame.uiMgr.Show(UILevelDisplay);
  6914. }
  6915. hide() {
  6916. console.log('zh:uimain hide ...');
  6917. super.hide();
  6918. xGame.common.stopGirlPop(this.ui.talkNode);
  6919. }
  6920. onGetUserInfo(force = false) {
  6921. if (Moyu.isWx) {
  6922. let info = Moyu.getSystemInfo();
  6923. if (info)
  6924. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6925. }
  6926. else {
  6927. Moyu.initUser(this, this.freshUser, force);
  6928. }
  6929. if (!Moyu.hasUserInfo) {
  6930. let user = Moyu.getUserInfo();
  6931. user.headIcon = 'res/ty_touxiang.png';
  6932. }
  6933. this.freshUser();
  6934. }
  6935. freshUser() {
  6936. let user = Moyu.getUserInfo();
  6937. if (!user.isAuth) {
  6938. user.headIcon = 'res/ty_touxiang.png';
  6939. }
  6940. else
  6941. DataMgr.upRankData();
  6942. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6943. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6944. }
  6945. interuptSecretary() {
  6946. Laya.timer.clearAll(this);
  6947. this.playSecretaryRandomSound();
  6948. }
  6949. playSecretaryRandomSound() {
  6950. if (this.isHide)
  6951. return;
  6952. let time = xGame.common.randomNum(45000, 60000);
  6953. Laya.timer.once(time, this, () => {
  6954. if (this.isHide)
  6955. return;
  6956. let index = xGame.common.randomNum(4, 7);
  6957. xGame.soundMgr.playSound("s_main0" + index);
  6958. let words = 1;
  6959. switch (index) {
  6960. case 4:
  6961. words = 5;
  6962. break;
  6963. case 5:
  6964. words = 3;
  6965. break;
  6966. case 6:
  6967. words = 6;
  6968. break;
  6969. case 7:
  6970. words = 7;
  6971. break;
  6972. default:
  6973. break;
  6974. }
  6975. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6976. this.playSecretaryRandomSound();
  6977. });
  6978. }
  6979. openSecretaryView() {
  6980. xGame.uiMgr.Show(UISecretary);
  6981. Moyu.sendDataEvent("secretary");
  6982. }
  6983. openShopView() {
  6984. xGame.uiMgr.Show(UIShop);
  6985. }
  6986. openSignView() {
  6987. xGame.uiMgr.Show(UISign);
  6988. }
  6989. openDrawView() {
  6990. xGame.uiMgr.Show(UIDraw);
  6991. }
  6992. openRanking() {
  6993. console.log('zh:phb openRanking');
  6994. xGame.uiMgr.Show(UIRanking);
  6995. Moyu.sendDataEvent("rankingList");
  6996. }
  6997. }
  6998. UIMain.uiName = "UIMain";
  6999. class UIGameEnd extends UIBase {
  7000. constructor() {
  7001. super();
  7002. this.success = false;
  7003. this.awardCoinNum = 1000;
  7004. this.awardDiamondNum = 10;
  7005. }
  7006. onConstructor() {
  7007. this.ui = ui_UIGameEnd.createInstance();
  7008. this.contentPane = this.ui;
  7009. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7010. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7011. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7012. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7013. this.ui.talkNode.visible = false;
  7014. if (Moyu.isKs)
  7015. this.ui.closeNode.closeBtn.x += 100;
  7016. }
  7017. updateType() {
  7018. switch (xGame.common.gameMode) {
  7019. case GameMode.classic:
  7020. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7021. this.ui.coinNode.visible = this.success;
  7022. if (!this.success) {
  7023. Laya.timer.once(500, this, () => {
  7024. xGame.uiMgr.Show(UIAddCoin);
  7025. });
  7026. }
  7027. else {
  7028. this.logEventForClassic_win();
  7029. }
  7030. this.logEventForClassic_complete();
  7031. this.ui.isGetAward.visible = false;
  7032. this.ui.leftBtn.c1.selectedIndex = 3;
  7033. this.ui.rightBtn.c1.selectedIndex = 0;
  7034. this.moneyNode.ui.c1.selectedIndex = 1;
  7035. break;
  7036. case GameMode.bigMove:
  7037. console.log('zh:招法模式 aaaaaa bigMove');
  7038. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7039. this.ui.coinNode.visible = this.success;
  7040. if (xGame.common.gameMode == GameMode.bigMove) {
  7041. if (this.success) {
  7042. DataMgr.setSkillSuccessTimes(1, true);
  7043. DataMgr.setSkillAccTimes(1);
  7044. }
  7045. else {
  7046. DataMgr.setSkillSuccessTimes(0, false);
  7047. }
  7048. }
  7049. this.logEventForRod_complete_N();
  7050. if (!this.success) {
  7051. Laya.timer.once(500, this, () => {
  7052. xGame.uiMgr.Show(UIAddCoin);
  7053. });
  7054. }
  7055. else {
  7056. this.logEventForRod_win();
  7057. }
  7058. this.ui.isGetAward.visible = false;
  7059. this.ui.leftBtn.c1.selectedIndex = 3;
  7060. this.ui.rightBtn.c1.selectedIndex = 0;
  7061. this.moneyNode.ui.c1.selectedIndex = 1;
  7062. break;
  7063. case GameMode.placeBall:
  7064. this.ui.coinNode.visible = false;
  7065. if (this.success) {
  7066. if (xGame.common.placeBallStarNum == 3) {
  7067. this.ui.c1.selectedIndex = 2;
  7068. }
  7069. else {
  7070. this.ui.c1.selectedIndex = 3;
  7071. }
  7072. let level = xGame.common.placeBallCurLevel;
  7073. if (level > 59) {
  7074. this.logEventForChallenge_level_complete(level);
  7075. }
  7076. else {
  7077. this.logEventForChallenge_level_N(level);
  7078. }
  7079. }
  7080. else {
  7081. this.ui.c1.selectedIndex = 4;
  7082. }
  7083. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7084. if (cfg.type == PlaceBallType.challenge) {
  7085. this.ui.c1.selectedIndex = 2;
  7086. }
  7087. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7088. this.updatePlaceBallBtn();
  7089. this.updatePlaceBallStarNum();
  7090. this.updatePlaceBallAwardState();
  7091. this.moneyNode.ui.c1.selectedIndex = 2;
  7092. this.moneyNode.checkPowerTime();
  7093. this.moneyNode.powerChange();
  7094. DataMgr.upRankData();
  7095. break;
  7096. default:
  7097. break;
  7098. }
  7099. }
  7100. logEventForRod_complete_N() {
  7101. let gfmsIdx = xGame.common.curPlayerSkillType;
  7102. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7103. let gfmc = 'Skyfall Shot';
  7104. if (gfmsIdx == 0) {
  7105. gfmc = 'Skyfall Shot';
  7106. }
  7107. if (gfmsIdx == 1) {
  7108. gfmc = 'Surging break';
  7109. }
  7110. if (gfmsIdx == 2) {
  7111. gfmc = 'Frost Lock';
  7112. }
  7113. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7114. console.log('zh:logEventForRod_complete_N level = ' + level);
  7115. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7116. let jsonStr = {
  7117. "count": 0,
  7118. "name": gfmc
  7119. };
  7120. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7121. const d = LocalStorageManager.getItem(keyStr);
  7122. jsonStr.count = d.count + 1;
  7123. LocalStorageManager.setItem(keyStr, jsonStr);
  7124. }
  7125. else {
  7126. LocalStorageManager.setItem(keyStr, jsonStr);
  7127. }
  7128. const d2 = LocalStorageManager.getItem(keyStr);
  7129. let count = d2.count;
  7130. console.log('zh:logEventForRod_complete_N count = ' + count);
  7131. if (count % 5 == 0) {
  7132. const reqStr = JSON.stringify(jsonStr);
  7133. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7134. }
  7135. }
  7136. logEventForRod_win() {
  7137. console.log('zh:logEventForRod_win,胜利');
  7138. let gfmsIdx = xGame.common.curPlayerSkillType;
  7139. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7140. let gfmc = 'Skyfall Shot';
  7141. if (gfmsIdx == 0) {
  7142. gfmc = 'Skyfall Shot';
  7143. }
  7144. if (gfmsIdx == 1) {
  7145. gfmc = 'Surging break';
  7146. }
  7147. if (gfmsIdx == 2) {
  7148. gfmc = 'Frost Lock';
  7149. }
  7150. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7151. console.log('zh:logEventForRod_win level = ' + level);
  7152. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7153. let jsonStr = {
  7154. "count": 1,
  7155. "name": gfmc + ' Lev' + level
  7156. };
  7157. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7158. const d = LocalStorageManager.getItem(keyStr);
  7159. jsonStr.count = d.count + 1;
  7160. LocalStorageManager.setItem(keyStr, jsonStr);
  7161. }
  7162. else {
  7163. LocalStorageManager.setItem(keyStr, jsonStr);
  7164. }
  7165. const reqStr = JSON.stringify(jsonStr);
  7166. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7167. }
  7168. logEventForClassic_win() {
  7169. console.log('zh:logEventForClassic_win,胜利');
  7170. let rtype = xGame.common.classicRoomType;
  7171. let msmc = '';
  7172. if (rtype == 1) {
  7173. msmc = 'beginner';
  7174. }
  7175. if (rtype == 2) {
  7176. msmc = 'expert';
  7177. }
  7178. if (rtype == 3) {
  7179. msmc = 'master';
  7180. }
  7181. let keyStr = 'sjmd_classic_win_' + rtype;
  7182. let jsonStr = {
  7183. "difficulty": msmc,
  7184. "classic_count": 1,
  7185. "difficulty_count": 1
  7186. };
  7187. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7188. const d = LocalStorageManager.getItem(keyStr);
  7189. jsonStr.classic_count = d.classic_count + 1;
  7190. jsonStr.difficulty_count = d.difficulty_count + 1;
  7191. LocalStorageManager.setItem(keyStr, jsonStr);
  7192. }
  7193. else {
  7194. LocalStorageManager.setItem(keyStr, jsonStr);
  7195. }
  7196. const reqStr = JSON.stringify(jsonStr);
  7197. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7198. }
  7199. logEventForClassic_complete() {
  7200. console.log('zh:logEventForClassic_complete,胜利');
  7201. let rtype = xGame.common.classicRoomType;
  7202. let msmc = '';
  7203. if (rtype == 1) {
  7204. msmc = 'beginner';
  7205. }
  7206. if (rtype == 2) {
  7207. msmc = 'expert';
  7208. }
  7209. if (rtype == 3) {
  7210. msmc = 'master';
  7211. }
  7212. let keyStr = 'sjmd_classic_complete_' + rtype;
  7213. let jsonStr = {
  7214. "msmc": msmc,
  7215. "count": 0
  7216. };
  7217. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7218. const d = LocalStorageManager.getItem(keyStr);
  7219. jsonStr.count = d.count + 1;
  7220. LocalStorageManager.setItem(keyStr, jsonStr);
  7221. }
  7222. else {
  7223. LocalStorageManager.setItem(keyStr, jsonStr);
  7224. }
  7225. if (jsonStr.count % 5 == 0) {
  7226. const reqStr = JSON.stringify(jsonStr);
  7227. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  7228. }
  7229. }
  7230. updatePlaceBallBtn() {
  7231. this.ui.leftBtn.c1.selectedIndex = 5;
  7232. if (this.success) {
  7233. this.ui.rightBtn.c1.selectedIndex = 14;
  7234. }
  7235. else {
  7236. if (xGame.common.placeBallStarNum == 3) {
  7237. this.ui.rightBtn.c1.selectedIndex = 14;
  7238. }
  7239. else {
  7240. this.ui.rightBtn.c1.selectedIndex = 1;
  7241. }
  7242. }
  7243. }
  7244. updatePlaceBallStarNum() {
  7245. let starNum = xGame.common.placeBallStarNum;
  7246. if (starNum == 0)
  7247. this.ui.starNumNode.c1.selectedIndex = 3;
  7248. else {
  7249. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  7250. }
  7251. }
  7252. updatePlaceBallAwardState() {
  7253. let level = xGame.common.placeBallCurLevel;
  7254. let starNum = xGame.common.placeBallStarNum;
  7255. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7256. let data = cfgTable.placeballData[level].award;
  7257. let cfg = cfgTable.placeballData[level];
  7258. this.awardDiamondNum = data[1];
  7259. this.awardCoinNum = data[0];
  7260. if (cfg.type == PlaceBallType.challenge) {
  7261. this.awardDiamondNum = 0;
  7262. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7263. }
  7264. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  7265. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  7266. if (cfg.type == PlaceBallType.challenge) {
  7267. this.ui.awardNode.coinNode.visible = true;
  7268. }
  7269. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  7270. this.ui.awardNode.diamondNode.x = 265;
  7271. this.ui.awardNode.coinNode.x = 354;
  7272. }
  7273. else {
  7274. this.ui.awardNode.diamondNode.x = 291;
  7275. this.ui.awardNode.coinNode.x = 291;
  7276. }
  7277. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  7278. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  7279. if (this.awardCoinNum == 0) {
  7280. this.ui.awardNode.coinNode.numTxt.text = "";
  7281. }
  7282. if (getAward) {
  7283. this.ui.isGetAward.visible = true;
  7284. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  7285. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  7286. }
  7287. else {
  7288. this.ui.isGetAward.visible = false;
  7289. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7290. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7291. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7292. }
  7293. else {
  7294. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7295. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7296. }
  7297. }
  7298. }
  7299. show(success) {
  7300. super.show();
  7301. xGame.eventMgr.event(RESET_GAME);
  7302. this.success = success;
  7303. Laya.timer.clearAll(this);
  7304. this.playSecretaryAni();
  7305. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7306. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7307. offsetTime = Math.floor(offsetTime / 1000);
  7308. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7309. this.updateType();
  7310. Laya.timer.once(200, this, () => {
  7311. this.addAward(() => {
  7312. this.updateType();
  7313. Laya.timer.once(500, this, () => {
  7314. this.showChallengeLevel();
  7315. });
  7316. });
  7317. });
  7318. if (this.success) {
  7319. JSBridgeUtils.instance.showInternAd('gameend_success');
  7320. console.log('zh:game end 成功');
  7321. xGame.soundMgr.playSound('slots_roll01');
  7322. xGame.soundMgr.playSound("s_win");
  7323. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7324. this.diyGameDataUtilForGameWin();
  7325. }
  7326. else {
  7327. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7328. console.log('zh:game end失败');
  7329. xGame.soundMgr.playSound('matchwin01');
  7330. xGame.soundMgr.playSound("s_lose");
  7331. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7332. }
  7333. let challengeNum = DataMgr.getChallengeTimes();
  7334. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7335. DataMgr.setChallengeTimes(1);
  7336. }
  7337. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7338. DataMgr.setClassicTimes();
  7339. }
  7340. }
  7341. diyGameDataUtilForGameWin() {
  7342. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7343. switch (xGame.common.gameMode) {
  7344. case GameMode.classic:
  7345. console.log('zh:DiyGameDataUtilForGameWin 111');
  7346. case GameMode.bigMove:
  7347. console.log('zh:DiyGameDataUtilForGameWin 222');
  7348. this.restartGame();
  7349. break;
  7350. case GameMode.placeBall:
  7351. console.log('zh:DiyGameDataUtilForGameWin 333');
  7352. var level = xGame.common.placeBallCurLevel;
  7353. console.log('zh:练习模式 联系了多少LEV=' + level);
  7354. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7355. if (level > db_over_lev) {
  7356. DataMgr.setChallengeMode_overLev(level);
  7357. }
  7358. break;
  7359. default:
  7360. console.log('zh:DiyGameDataUtilForGameWin 444');
  7361. break;
  7362. }
  7363. }
  7364. showChallengeLevel() {
  7365. if (DataMgr.getChallengeTimes() != 0)
  7366. return;
  7367. let skill = DataMgr.getSkillAccTimes();
  7368. let put = DataMgr.getPlaceBallLevelList().length;
  7369. if (skill >= 3 || put >= 5) {
  7370. xGame.uiMgr.Show(UIInvitation);
  7371. this.hide();
  7372. }
  7373. }
  7374. addAward(callback) {
  7375. if (!this.success) {
  7376. callback && callback();
  7377. return;
  7378. }
  7379. switch (xGame.common.gameMode) {
  7380. case GameMode.classic:
  7381. this.awardCoinNum = xGame.common.passAwardCoin;
  7382. this.awardDiamondNum = 0;
  7383. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7384. break;
  7385. case GameMode.bigMove:
  7386. this.awardCoinNum = xGame.common.passAwardCoin;
  7387. this.awardDiamondNum = 0;
  7388. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7389. callback && callback();
  7390. break;
  7391. case GameMode.placeBall:
  7392. let level = xGame.common.placeBallCurLevel;
  7393. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  7394. if (xGame.common.placeBallStarNum != 3) {
  7395. callback && callback();
  7396. return;
  7397. }
  7398. else {
  7399. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7400. if (getAward) {
  7401. callback && callback();
  7402. return;
  7403. }
  7404. }
  7405. let cfg = cfgTable.placeballData[level];
  7406. let data = cfgTable.placeballData[level].award;
  7407. this.awardCoinNum = data[0];
  7408. this.awardDiamondNum = data[1];
  7409. if (cfg.type == PlaceBallType.challenge) {
  7410. this.awardDiamondNum = 0;
  7411. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7412. }
  7413. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  7414. let diamondAward;
  7415. if (this.awardDiamondNum > 0) {
  7416. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  7417. xGame.common.getAward([diamondAward, coinAward], callback);
  7418. }
  7419. else {
  7420. xGame.common.getAward([coinAward], callback);
  7421. }
  7422. if (cfg.type == PlaceBallType.normal) {
  7423. DataMgr.setPlaceBallAward(level);
  7424. }
  7425. break;
  7426. default:
  7427. break;
  7428. }
  7429. }
  7430. playSecretaryAni_old() {
  7431. let parent = this.ui.secretary.displayObject;
  7432. parent.destroyChildren();
  7433. let xx = this.ui.secretary.width / 2;
  7434. let yy = this.ui.secretary.height;
  7435. let scale = xGame.common.getSecretaryScale();
  7436. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7437. if (this.success) {
  7438. let rand = Math.random() <= 0.5 ? 2 : 3;
  7439. xGame.common.secretary.play(data, rand, false, parent, () => {
  7440. xGame.common.secretary.play(data, 1, true, parent);
  7441. });
  7442. }
  7443. else {
  7444. xGame.common.secretary.play(data, 0, true, parent);
  7445. }
  7446. }
  7447. playSecretaryAni() {
  7448. let parent = this.ui.secretary.displayObject;
  7449. parent.destroyChildren();
  7450. let xx = this.ui.secretary.width / 2;
  7451. let yy = this.ui.secretary.height;
  7452. let scale = xGame.common.getSecretaryScale();
  7453. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7454. if (this.success) {
  7455. let rand = 0;
  7456. xGame.common.secretary.play(data, 0, true, parent);
  7457. }
  7458. else {
  7459. xGame.common.secretary.play(data, 0, true, parent);
  7460. }
  7461. }
  7462. restartGame() {
  7463. switch (xGame.common.gameMode) {
  7464. case GameMode.classic:
  7465. xGame.eventMgr.event(RESTART_GAME);
  7466. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7467. break;
  7468. case GameMode.bigMove:
  7469. this.hide();
  7470. xGame.eventMgr.event(RESTART_GAME);
  7471. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7472. break;
  7473. default:
  7474. break;
  7475. }
  7476. }
  7477. hide() {
  7478. super.hide();
  7479. xGame.common.stopGirlPop(this.ui.talkNode);
  7480. PlatMgr.showBanner(false);
  7481. }
  7482. returnHome() {
  7483. this.hide();
  7484. let showFailWords = !this.success;
  7485. xGame.uiMgr.Show(UIMain, showFailWords);
  7486. }
  7487. clickLeftBtn() {
  7488. switch (xGame.common.gameMode) {
  7489. case GameMode.classic:
  7490. case GameMode.bigMove:
  7491. this.returnHome();
  7492. break;
  7493. case GameMode.placeBall:
  7494. let level = xGame.common.placeBallCurLevel;
  7495. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7496. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7497. break;
  7498. default:
  7499. break;
  7500. }
  7501. }
  7502. powerStartPlaceBallLevel(level, btn) {
  7503. if (DataMgr.powerEnough()) {
  7504. btn.touchable = false;
  7505. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7506. btn.touchable = true;
  7507. DataMgr.setPower(-1);
  7508. xGame.eventMgr.event(POWER_TIME);
  7509. this.startPlaceBallLevel(level);
  7510. this.logEventForChallenge_level_start(level);
  7511. }));
  7512. }
  7513. else {
  7514. xGame.uiMgr.Show(UIPower, 0);
  7515. }
  7516. }
  7517. clickRightBtn() {
  7518. switch (xGame.common.gameMode) {
  7519. case GameMode.classic:
  7520. console.log('zh:clickRightBtn 111');
  7521. case GameMode.bigMove:
  7522. console.log('zh:clickRightBtn 222');
  7523. this.restartGame();
  7524. break;
  7525. case GameMode.placeBall:
  7526. console.log('zh:clickRightBtn 333');
  7527. let level = xGame.common.placeBallCurLevel;
  7528. let data = DataMgr.getPlaceBallLevel(level);
  7529. let curPss = data.play && !data.isCur;
  7530. if (curPss) {
  7531. console.log('zh:clickRightBtn 333-111');
  7532. console.log('zh:当前LV=' + level);
  7533. if (level == 60) {
  7534. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7535. Laya.timer.once(3000, this, () => {
  7536. this.returnHome();
  7537. });
  7538. }
  7539. else {
  7540. let lev = level + 1;
  7541. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  7542. }
  7543. }
  7544. else {
  7545. console.log('zh:clickRightBtn 333-000');
  7546. Moyu.sendDataEvent("placeBallNextLevel");
  7547. console.log('zh:qjff_AD_for_uiGameEnd');
  7548. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7549. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7550. }
  7551. else {
  7552. console.log('zh:AD 失败,直接发放奖励');
  7553. this.qjff_AD_for_uiGameEnd(level);
  7554. }
  7555. }
  7556. break;
  7557. default:
  7558. console.log('zh:clickRightBtn 444');
  7559. break;
  7560. }
  7561. }
  7562. logEventForChallenge_level_start(level) {
  7563. let keyStr = 'sjmd_challenge_level_start';
  7564. let jsonStr = {
  7565. "count": 0,
  7566. "gold_balance ": DataMgr.getCoin(),
  7567. "level": level,
  7568. "diamond_balance ": DataMgr.getDiamond()
  7569. };
  7570. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7571. const d = LocalStorageManager.getItem(keyStr);
  7572. if (level > d.level) {
  7573. jsonStr.count = d.count + 1;
  7574. LocalStorageManager.setItem(keyStr, jsonStr);
  7575. }
  7576. else {
  7577. }
  7578. }
  7579. else {
  7580. LocalStorageManager.setItem(keyStr, jsonStr);
  7581. }
  7582. const reqStr = JSON.stringify(jsonStr);
  7583. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  7584. }
  7585. qjff_AD_for_uiGameEnd(level) {
  7586. DataMgr.setPlaceBallLevel(level, 1);
  7587. this.startPlaceBallLevel(level + 1);
  7588. }
  7589. startPlaceBallLevel(level) {
  7590. xGame.common.gameMode = GameMode.placeBall;
  7591. xGame.common.placeBallCurLevel = level;
  7592. xGame.uiMgr.Show(UIGame);
  7593. this.hide();
  7594. }
  7595. logEventForChallenge_level_complete(level) {
  7596. let keyStr = 'sjmd_challenge_level_complete';
  7597. let jsonStr = {
  7598. "count": 1,
  7599. "gold_balance ": DataMgr.getCoin(),
  7600. "level": level,
  7601. "diamond_balance ": DataMgr.getDiamond()
  7602. };
  7603. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7604. const d = LocalStorageManager.getItem(keyStr);
  7605. jsonStr.count = d.count + 1;
  7606. LocalStorageManager.setItem(keyStr, jsonStr);
  7607. }
  7608. else {
  7609. LocalStorageManager.setItem(keyStr, jsonStr);
  7610. }
  7611. const reqStr = JSON.stringify(jsonStr);
  7612. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  7613. }
  7614. logEventForChallenge_level_N(level) {
  7615. console.log('zh:logEventForChallenge_level_N ' + level);
  7616. let keyStr = 'sjmd_challenge_level_N';
  7617. if (LocalStorageManager.hasKey(keyStr)) {
  7618. let lev = LocalStorageManager.getItem(keyStr);
  7619. if (level > lev) {
  7620. LocalStorageManager.setItem(keyStr, level);
  7621. }
  7622. if ((level) % 5 == 0) {
  7623. console.log('zh:每5关上报1次');
  7624. let sjmc = 'challenge_level_' + level;
  7625. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  7626. }
  7627. else {
  7628. console.log('zh:5 no 上报');
  7629. }
  7630. }
  7631. else {
  7632. LocalStorageManager.setItem(keyStr, level);
  7633. }
  7634. }
  7635. }
  7636. UIGameEnd.uiName = "UIGameEnd";
  7637. class ui_UIVideoShare extends fgui.GComponent {
  7638. static createInstance() {
  7639. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7640. }
  7641. onConstruct() {
  7642. this.n10 = (this.getChild("n10"));
  7643. this.myNode = (this.getChild("myNode"));
  7644. this.t0 = this.getTransition("t0");
  7645. }
  7646. }
  7647. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7648. class UIVideoShare extends UIBase {
  7649. constructor() {
  7650. super();
  7651. this.success = false;
  7652. this.awardNum = 0;
  7653. this.isShared = true;
  7654. }
  7655. onConstructor() {
  7656. this.ui = ui_UIVideoShare.createInstance();
  7657. this.contentPane = this.ui;
  7658. this.isEject = false;
  7659. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7660. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7661. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7662. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7663. }
  7664. show(success) {
  7665. super.show();
  7666. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7667. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7668. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7669. this.success = success;
  7670. let time = xGame.common.randomNum(600, 1500);
  7671. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  7672. if (success)
  7673. xGame.soundMgr.playSound("applause");
  7674. this.ui.t0.play();
  7675. this.checkShareState();
  7676. let times = DataMgr.getDailyVideoShareTimes();
  7677. this.awardNum = times == 0 ? 2000 : 200;
  7678. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7679. }
  7680. checkShareState() {
  7681. if (PlatMgr.forceShare == 0) {
  7682. this.ui.myNode.closeBtn.visible = true;
  7683. this.ui.myNode.tipsNode.visible = false;
  7684. this.ui.myNode.closeBtn.x = 90;
  7685. this.ui.myNode.shareBtn.x = 342;
  7686. }
  7687. else if (PlatMgr.forceShare == 1) {
  7688. this.ui.myNode.closeBtn.visible = false;
  7689. this.ui.myNode.tipsNode.visible = true;
  7690. this.ui.myNode.shareBtn.x = 218;
  7691. this.isShared = true;
  7692. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7693. }
  7694. }
  7695. checkForceShare() {
  7696. this.isShared = !this.isShared;
  7697. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7698. }
  7699. videoShare() {
  7700. if (PlatMgr.forceShare == 1) {
  7701. if (this.isShared) {
  7702. this.shareGame();
  7703. }
  7704. else {
  7705. this.hideSelf();
  7706. }
  7707. }
  7708. else {
  7709. this.shareGame();
  7710. }
  7711. }
  7712. shareGame() {
  7713. Moyu.sendDataEvent("VideoShare");
  7714. if (Moyu.canShare() > 100) {
  7715. Moyu.shareGame((success) => {
  7716. if (success) {
  7717. DataMgr.setDailyVideoShareTimes(1);
  7718. DataMgr.setCoin(this.awardNum);
  7719. }
  7720. this.hideSelf();
  7721. }, this);
  7722. }
  7723. else {
  7724. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7725. this.hideSelf();
  7726. }
  7727. }
  7728. hideSelf() {
  7729. this.hide();
  7730. xGame.uiMgr.Show(UIGameEnd, this.success);
  7731. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7732. xGame.common.screenImg.destroy();
  7733. xGame.common.screenImg = null;
  7734. }
  7735. }
  7736. }
  7737. UIVideoShare.uiName = "UIVideoShare";
  7738. class ui_UITips extends fgui.GComponent {
  7739. static createInstance() {
  7740. return (fgui.UIPackage.createObject("game", "UITips"));
  7741. }
  7742. onConstruct() {
  7743. this.n0 = (this.getChild("n0"));
  7744. this.myNode = (this.getChild("myNode"));
  7745. this.t0 = this.getTransition("t0");
  7746. }
  7747. }
  7748. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7749. class UITips extends UIBase {
  7750. constructor() {
  7751. super();
  7752. this.type = 0;
  7753. }
  7754. onConstructor() {
  7755. this.ui = ui_UITips.createInstance();
  7756. this.contentPane = this.ui;
  7757. this.isEject = false;
  7758. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7759. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7760. }
  7761. show(tipsTxt, womanTxt, type) {
  7762. super.show();
  7763. this.ui.t0.play();
  7764. this.ui.myNode.tipsTxt.text = tipsTxt;
  7765. this.ui.myNode.womanTxt.text = womanTxt;
  7766. PlatMgr.showInsert(true);
  7767. this.ui.myNode.c1.selectedIndex = type;
  7768. this.type = type;
  7769. switch (this.type) {
  7770. case TipsType.exitGame:
  7771. xGame.common.gameMgr.gamePause = true;
  7772. break;
  7773. case TipsType.foul:
  7774. Laya.timer.once(200, this, () => {
  7775. xGame.common.gameMgr.gamePause = true;
  7776. });
  7777. break;
  7778. default:
  7779. break;
  7780. }
  7781. }
  7782. clickLeftBtn() {
  7783. this.hide();
  7784. xGame.common.gameMgr.gamePause = false;
  7785. switch (this.type) {
  7786. case TipsType.exitGame:
  7787. break;
  7788. case TipsType.foul:
  7789. break;
  7790. default:
  7791. break;
  7792. }
  7793. }
  7794. clickRightBtn() {
  7795. this.hide();
  7796. switch (this.type) {
  7797. case TipsType.exitGame:
  7798. xGame.eventMgr.event(RESET_GAME);
  7799. xGame.uiMgr.Show(UIMain);
  7800. Moyu.recordEnd(this, null);
  7801. xGame.common.longHelpLine = false;
  7802. break;
  7803. case TipsType.foul:
  7804. xGame.common.gameMgr.gamePause = false;
  7805. Laya.timer.clearAll(this);
  7806. break;
  7807. default:
  7808. break;
  7809. }
  7810. }
  7811. }
  7812. UITips.uiName = "UITips";
  7813. class GameMgr {
  7814. constructor() {
  7815. this.selfCamp = "";
  7816. this.selfFoulNum = 0;
  7817. this.selfBallArr = [];
  7818. this.selfTimer = 0;
  7819. this.selfScore = 0;
  7820. this.aiCamp = "";
  7821. this.aiFoulNum = 0;
  7822. this.aiBallArr = [];
  7823. this.aiTimer = 0;
  7824. this.aiScore = 0;
  7825. this.aiSkillLevelNum = 1;
  7826. this.targertScore = 0;
  7827. this.setTime = 30;
  7828. this.selfTurnRate = 0.5;
  7829. this.accTime = 0;
  7830. this.curFoul = "";
  7831. this.maxFoulTimes = 3;
  7832. this.isFirstInGame = true;
  7833. this.firstColliObj = null;
  7834. this.inHoleBalls = [];
  7835. this.blackNum = 8;
  7836. this.success = false;
  7837. this.holePosList = [];
  7838. this.posObj = {};
  7839. this._selfTurn = false;
  7840. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7841. this.ensureBallType = false;
  7842. this.isOpenBall = true;
  7843. this.finishOneShoot = true;
  7844. this.isEnd = false;
  7845. this.isChangeTurn = false;
  7846. this.isInterrupt = false;
  7847. this.aiPlayedBreakArmy = false;
  7848. this.isTouchedBall = false;
  7849. this.finishBalls = 0;
  7850. this.needBalls = 0;
  7851. this.allBallNum = 0;
  7852. this.placeBallPosData = {};
  7853. this.curHP = 0;
  7854. this.showLongView = false;
  7855. this.firstShoot = true;
  7856. this._gamePause = false;
  7857. this.trunCount = 0;
  7858. this.isBlackInHole = false;
  7859. this.isEnter = true;
  7860. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7861. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7862. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7863. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7864. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7865. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7866. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7867. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7868. }
  7869. get gamePause() {
  7870. return this._gamePause;
  7871. }
  7872. set gamePause(v) {
  7873. if (v) {
  7874. Laya.physicsTimer.pause();
  7875. }
  7876. else {
  7877. Laya.physicsTimer.resume();
  7878. }
  7879. this._gamePause = v;
  7880. }
  7881. get selfTurn() {
  7882. return this._selfTurn;
  7883. }
  7884. set selfTurn(val) {
  7885. this.trunCount++;
  7886. this._selfTurn = val;
  7887. if (val) {
  7888. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7889. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7890. }
  7891. else {
  7892. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7893. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7894. if (this.trunCount > 1)
  7895. PlatMgr.openBox();
  7896. }
  7897. }
  7898. resetGame() {
  7899. this.inHoleBalls = [];
  7900. this.isFirstInGame = true;
  7901. this.firstColliObj = null;
  7902. this.aiCamp = "";
  7903. this.selfCamp = "";
  7904. this.aiFoulNum = 0;
  7905. this.selfFoulNum = 0;
  7906. this.selfBallArr = [];
  7907. this.aiBallArr = [];
  7908. this.gamePause = false;
  7909. this.ensureBallType = false;
  7910. this.isInterrupt = false;
  7911. this.updateLeftBall();
  7912. this.clearTime();
  7913. this.aiPlayedBreakArmy = false;
  7914. this.isBlackInHole = false;
  7915. this.placeBallPosData = {};
  7916. if (xGame.common.d3World.knifeRoot) {
  7917. xGame.common.d3World.knifeRoot.destroyChildren();
  7918. }
  7919. }
  7920. gameReady() {
  7921. this.trunCount = 0;
  7922. this.firstColliObj = null;
  7923. this.isFirstInGame = true;
  7924. this.selfTurn = Math.random() <= this.selfTurnRate;
  7925. let challengeNum = DataMgr.getChallengeTimes();
  7926. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7927. this.selfTurn = true;
  7928. }
  7929. if (xGame.common.gameMode == GameMode.placeBall)
  7930. this.selfTurn = true;
  7931. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7932. this.selfTurn = true;
  7933. }
  7934. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7935. this.checkGuide();
  7936. if (xGame.common.uiRodMethod)
  7937. xGame.common.uiRodMethod.resetRod();
  7938. xGame.common.d2World.getHelpLine();
  7939. this.isOpenBall = true;
  7940. this.isTouchedBall = false;
  7941. xGame.common.aiPlayer.stopRun();
  7942. this.setTime = 30;
  7943. let ui = xGame.common.gameUI.ui;
  7944. switch (xGame.common.gameMode) {
  7945. case GameMode.classic:
  7946. xGame.common.aiPlayer.init();
  7947. this.blackNum = 8;
  7948. this.placeRootBall();
  7949. this.peoplePlay(9, 10);
  7950. ui.wordsBtn.visible = true;
  7951. ui.aiWordsBtn.visible = true;
  7952. xGame.common.talkMgr.changeAIState(true);
  7953. DataMgr.gameData.gameCount++;
  7954. DataMgr.saveGameData();
  7955. break;
  7956. case GameMode.bigMove:
  7957. this.blackNum = -1;
  7958. this.selfScore = 0;
  7959. this.aiScore = 0;
  7960. xGame.common.aiPlayer.init();
  7961. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7962. this.updateSelfScore();
  7963. this.updateAIScore();
  7964. this.updateTargetSroce();
  7965. this.placeRootBall();
  7966. this.peoplePlay(9, 10);
  7967. ui.wordsBtn.visible = true;
  7968. ui.aiWordsBtn.visible = true;
  7969. xGame.common.talkMgr.changeAIState(true);
  7970. if (DataMgr.getSkillGuide() < 1)
  7971. DataMgr.gameData.gameCount = 0;
  7972. else {
  7973. DataMgr.gameData.gameCount++;
  7974. DataMgr.saveGameData();
  7975. PlatMgr.openTry();
  7976. }
  7977. if (xGame.common.d3World.knifeRoot) {
  7978. xGame.common.d3World.knifeRoot.destroyChildren();
  7979. }
  7980. break;
  7981. case GameMode.placeBall:
  7982. this.blackNum = -1;
  7983. this.selfTurn = true;
  7984. this.setTime = 10000;
  7985. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7986. this.curHP = this.placeBallData.hp;
  7987. if (this.placeBallData.ball == -1)
  7988. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7989. else
  7990. this.needBalls = this.placeBallData.ball;
  7991. console.log("需要的进球数目", this.needBalls);
  7992. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7993. this.finishBalls = 0;
  7994. this.placeBallPosData = {};
  7995. this.updatePlaceBallPos();
  7996. this.updatePlaceBallState();
  7997. this.finishOneShoot = true;
  7998. xGame.common.gameUI.ui.moveNode.visible = false;
  7999. this.isOpenBall = false;
  8000. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8001. ui.wordsBtn.visible = false;
  8002. ui.aiWordsBtn.visible = false;
  8003. xGame.common.talkMgr.changeAIState(false);
  8004. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8005. PlatMgr.openBox();
  8006. });
  8007. break;
  8008. default:
  8009. break;
  8010. }
  8011. this.showLongView = false;
  8012. xGame.common.wordsMgr.comboTimes = 1;
  8013. let guide = DataMgr.getSkillGuide();
  8014. if (guide)
  8015. xGame.eventMgr.event(WAIT_SHOOT);
  8016. xGame.common.upSkillLevel = false;
  8017. xGame.common.gameStartTime = new Date().getTime();
  8018. this.firstShoot = true;
  8019. }
  8020. checkGuide() {
  8021. let guide = DataMgr.getSkillGuide();
  8022. let gameUI = xGame.common.gameUI.ui;
  8023. gameUI.guide1.visible = false;
  8024. gameUI.guide2.visible = false;
  8025. gameUI.guide3.visible = false;
  8026. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8027. this.selfTurn = true;
  8028. }
  8029. else {
  8030. return;
  8031. }
  8032. let oneBall = this.getOneBall();
  8033. gameUI.guide1.visible = true;
  8034. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8035. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8036. }
  8037. getOneBall() {
  8038. let arr = xGame.common.d2World.ballArr;
  8039. for (let index = 0; index < arr.length; index++) {
  8040. if (arr[index].number == 0)
  8041. continue;
  8042. return arr[index];
  8043. }
  8044. }
  8045. updateSelfScore() {
  8046. let ui = xGame.common.gameUI.ui.topNode;
  8047. ui.selfScoreTxt.text = this.selfScore + "";
  8048. }
  8049. updateAIScore() {
  8050. let ui = xGame.common.gameUI.ui.topNode;
  8051. ui.aiScoreTxt.text = this.aiScore + "";
  8052. }
  8053. updateTargetSroce() {
  8054. let ui = xGame.common.gameUI.ui.topNode;
  8055. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8056. }
  8057. updateLeftBall() {
  8058. let topUI = xGame.common.gameUI.ui.topNode;
  8059. topUI.selfBallList.numItems = this.selfBallArr.length;
  8060. topUI.aiBallList.numItems = this.aiBallArr.length;
  8061. }
  8062. ballShoot() {
  8063. this.clearTime();
  8064. this.finishOneShoot = false;
  8065. xGame.common.gameUI.ui.moveNode.visible = false;
  8066. if (xGame.common.gameUI.ui.guideNode.visible) {
  8067. xGame.common.gameUI.ui.guideNode.visible = false;
  8068. }
  8069. if (this.firstShoot) {
  8070. this.firstShoot = false;
  8071. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8072. }
  8073. }
  8074. ensureCamp(number) {
  8075. this.ensureBallType = true;
  8076. this.isOpenBall = false;
  8077. if (xGame.common.gameMode != GameMode.classic)
  8078. return;
  8079. let full = [1, 2, 3, 4, 5, 6, 7];
  8080. let flower = [9, 10, 11, 12, 13, 14, 15];
  8081. let sayWords = "";
  8082. if (this.selfTurn) {
  8083. if (number <= 7) {
  8084. this.selfCamp = ballCamp.full;
  8085. this.selfBallArr = full;
  8086. this.aiCamp = ballCamp.flower;
  8087. this.aiBallArr = flower;
  8088. sayWords = cfgTable.wordsData[3].msg;
  8089. }
  8090. else {
  8091. this.selfCamp = ballCamp.flower;
  8092. this.selfBallArr = flower;
  8093. this.aiCamp = ballCamp.full;
  8094. this.aiBallArr = full;
  8095. sayWords = cfgTable.wordsData[4].msg;
  8096. }
  8097. }
  8098. else {
  8099. if (number <= 7) {
  8100. this.selfCamp = ballCamp.flower;
  8101. this.selfBallArr = flower;
  8102. this.aiCamp = ballCamp.full;
  8103. this.aiBallArr = full;
  8104. sayWords = cfgTable.wordsData[2].msg;
  8105. }
  8106. else {
  8107. this.selfCamp = ballCamp.full;
  8108. this.selfBallArr = full;
  8109. this.aiCamp = ballCamp.flower;
  8110. this.aiBallArr = flower;
  8111. sayWords = cfgTable.wordsData[1].msg;
  8112. }
  8113. }
  8114. this.updateLeftBall();
  8115. xGame.uiMgr.Show(UIMsg, sayWords);
  8116. }
  8117. updatePlaceBallState() {
  8118. let ui = xGame.common.gameUI.ui;
  8119. switch (this.placeBallData.type) {
  8120. case PlaceBallType.normal:
  8121. let normal = ui.placeNormalNode;
  8122. normal.hpTxt.text = this.curHP + "";
  8123. this.updatePlaceBallStar(normal);
  8124. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8125. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8126. break;
  8127. case PlaceBallType.challenge:
  8128. let challenge = ui.placeChallengeNode;
  8129. challenge.hpTxt.text = "Shots:" + this.curHP;
  8130. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8131. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8132. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8133. break;
  8134. default:
  8135. break;
  8136. }
  8137. }
  8138. playSubHpAni() {
  8139. let ui = xGame.common.gameUI.ui;
  8140. switch (this.placeBallData.type) {
  8141. case PlaceBallType.normal:
  8142. let normal = ui.placeNormalNode;
  8143. normal.hpTxt.visible = false;
  8144. normal.starAni.c1.selectedIndex = 1;
  8145. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8146. normal.hpTxt.visible = true;
  8147. normal.starAni.c1.selectedIndex = 0;
  8148. }));
  8149. break;
  8150. default:
  8151. break;
  8152. }
  8153. }
  8154. getEndStarNum() {
  8155. let num;
  8156. let level = xGame.common.placeBallCurLevel;
  8157. if (this.curHP == this.placeBallData.hp) {
  8158. num = 3;
  8159. }
  8160. else if (this.curHP <= 1) {
  8161. num = 1;
  8162. }
  8163. else {
  8164. num = 2;
  8165. }
  8166. if (!this.success) {
  8167. num = 0;
  8168. }
  8169. else {
  8170. DataMgr.setPlaceBallLevel(level, num);
  8171. }
  8172. let myType = cfgTable.placeballData[level].type;
  8173. if (this.success && myType == 1) {
  8174. num = 3;
  8175. }
  8176. xGame.common.placeBallStarNum = num;
  8177. }
  8178. updatePlaceBallStar(node) {
  8179. let star = 0;
  8180. if (this.curHP == this.placeBallData.hp) {
  8181. star = 3;
  8182. }
  8183. else if (this.curHP >= 2) {
  8184. star = 2;
  8185. }
  8186. else if (this.curHP == 1) {
  8187. star = 1;
  8188. }
  8189. else {
  8190. star = 0;
  8191. }
  8192. let temp;
  8193. for (let index = 1; index <= 3; index++) {
  8194. temp = node["star" + index];
  8195. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8196. }
  8197. node.myProgress.value = (star / 3) * 100;
  8198. }
  8199. openRegretView(isFoul, GoalNum, challenge = false) {
  8200. let regretType = -1;
  8201. if (isFoul) {
  8202. regretType = 1;
  8203. }
  8204. else {
  8205. if (GoalNum <= 0) {
  8206. regretType = 0;
  8207. }
  8208. }
  8209. if (challenge) {
  8210. regretType = 1;
  8211. }
  8212. if (regretType != -1) {
  8213. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8214. if (success) {
  8215. this.curHP++;
  8216. this.updatePlaceBallState();
  8217. this.setPlaceBallAllPos();
  8218. xGame.common.gameUI.ui.moveNode.visible = false;
  8219. }
  8220. else {
  8221. if (this.curHP <= 0) {
  8222. this.success = false;
  8223. this.gameEnd();
  8224. }
  8225. this.playSubHpAni();
  8226. }
  8227. this.updatePlaceBallState();
  8228. this.updatePlaceBallPos();
  8229. });
  8230. }
  8231. }
  8232. setPlaceBallAllPos() {
  8233. let allBall = xGame.common.d2World.ballArr;
  8234. let cfgArr = this.placeBallPosData;
  8235. let temp;
  8236. let obj;
  8237. for (let index = 0; index < allBall.length; index++) {
  8238. temp = allBall[index];
  8239. if (temp.destroyed)
  8240. continue;
  8241. obj = cfgArr[temp.myUNID];
  8242. if (obj && obj.src && !obj.src.destroyed) {
  8243. temp.gameObj.x = obj.posX;
  8244. temp.gameObj.y = obj.posY;
  8245. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  8246. }
  8247. }
  8248. xGame.common.d2World.getHelpLine();
  8249. }
  8250. updatePlaceBallPos() {
  8251. let arr = xGame.common.d2World.ballArr;
  8252. let temp;
  8253. for (let index = 0; index < arr.length; index++) {
  8254. temp = arr[index];
  8255. if (!this.placeBallPosData[temp.myUNID]) {
  8256. this.placeBallPosData[temp.myUNID] = {
  8257. src: temp,
  8258. posX: temp.gameObj.x,
  8259. posY: temp.gameObj.y
  8260. };
  8261. }
  8262. else {
  8263. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  8264. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  8265. }
  8266. }
  8267. let check;
  8268. for (const key in this.placeBallPosData) {
  8269. check = this.placeBallPosData[key];
  8270. if (check.src.destroyed) {
  8271. delete this.placeBallPosData[key];
  8272. }
  8273. }
  8274. }
  8275. gameRun(type) {
  8276. if (this.gamePause)
  8277. return;
  8278. this.curFoul = this.getFoulType();
  8279. if (type) {
  8280. xGame.common.d2World.d2Gan.shoot();
  8281. xGame.common.gameUI.forceCancel();
  8282. this.curFoul = type;
  8283. }
  8284. this.isEnd = false;
  8285. this.isChangeTurn = true;
  8286. if (xGame.common.gameMode == GameMode.classic) {
  8287. this.judgeClassic(this.curFoul);
  8288. this.checkClassicWords(() => {
  8289. xGame.common.destroyClassicEmotion();
  8290. if (this.isEnd) {
  8291. if (this.isBlackInHole) {
  8292. xGame.common.gameUI.ui.blackAni.visible = true;
  8293. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  8294. xGame.common.gameUI.ui.blackAni.visible = false;
  8295. this.gameEnd();
  8296. }));
  8297. }
  8298. else {
  8299. this.gameEnd();
  8300. }
  8301. }
  8302. else {
  8303. this.waitShoot();
  8304. xGame.eventMgr.event(WAIT_SHOOT);
  8305. }
  8306. });
  8307. }
  8308. else if (xGame.common.gameMode == GameMode.bigMove) {
  8309. xGame.common.aiPlayer.stopRun();
  8310. let scoreArr = this.getScore(this.curFoul);
  8311. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  8312. this.isEnd = true;
  8313. }
  8314. this.checkBigSkillWords(() => {
  8315. if (this.isEnd) {
  8316. this.gameEnd();
  8317. }
  8318. else {
  8319. this.waitShoot();
  8320. xGame.eventMgr.event(WAIT_SHOOT);
  8321. }
  8322. });
  8323. }
  8324. else if (xGame.common.gameMode == GameMode.placeBall) {
  8325. xGame.common.destroyAwardSpine();
  8326. let isFoul = this.curFoul == FoulType.rootHole;
  8327. let GoalNum = this.inHoleBalls.length;
  8328. if (this.inHoleBalls.indexOf(0) > -1)
  8329. GoalNum -= 1;
  8330. if (isFoul) {
  8331. this.placeRootBall();
  8332. }
  8333. console.log("neeballs", this.needBalls);
  8334. console.log("当前完成的goalNum", GoalNum);
  8335. this.finishBalls += GoalNum;
  8336. console.log("当前完成的finishballs", this.finishBalls);
  8337. let need = this.needBalls;
  8338. if (this.placeBallData.type == PlaceBallType.challenge) {
  8339. need += 100;
  8340. }
  8341. if (this.finishBalls >= need) {
  8342. this.success = true;
  8343. this.gameEnd();
  8344. }
  8345. else {
  8346. switch (this.placeBallData.type) {
  8347. case PlaceBallType.normal:
  8348. if (!isFoul && GoalNum > 0) {
  8349. this.updatePlaceBallPos();
  8350. this.updatePlaceBallState();
  8351. }
  8352. else {
  8353. this.curHP--;
  8354. this.openRegretView(isFoul, GoalNum);
  8355. }
  8356. this.waitShoot();
  8357. xGame.eventMgr.event(WAIT_SHOOT);
  8358. break;
  8359. case PlaceBallType.challenge:
  8360. this.curHP--;
  8361. this.updatePlaceBallState();
  8362. if (isFoul) {
  8363. this.openRegretView(isFoul, GoalNum, true);
  8364. }
  8365. else {
  8366. this.updatePlaceBallPos();
  8367. if (this.curHP <= 0) {
  8368. this.success = true;
  8369. this.gameEnd();
  8370. }
  8371. }
  8372. this.waitShoot();
  8373. xGame.eventMgr.event(WAIT_SHOOT);
  8374. break;
  8375. default:
  8376. break;
  8377. }
  8378. }
  8379. }
  8380. }
  8381. checkClassicWords(callback) {
  8382. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  8383. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  8384. let type = this.getClassicWordsType();
  8385. if (condition && type != -1) {
  8386. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  8387. xGame.soundMgr.playSound(str);
  8388. xGame.common.wordsMgr.playClassicWords(type, callback);
  8389. }
  8390. else {
  8391. Laya.timer.once(300, this, () => {
  8392. callback && callback();
  8393. });
  8394. }
  8395. }
  8396. getClassicWordsType() {
  8397. let d2world = xGame.common.d2World;
  8398. let type = -1;
  8399. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  8400. type = ClassicWordsType.perfectShow;
  8401. return type;
  8402. }
  8403. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  8404. type = ClassicWordsType.directShoot;
  8405. return type;
  8406. }
  8407. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  8408. type = ClassicWordsType.anotherShoot;
  8409. return type;
  8410. }
  8411. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  8412. type = ClassicWordsType.bigPower;
  8413. return type;
  8414. }
  8415. let minSpeed = 1;
  8416. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  8417. type = ClassicWordsType.hardShoot;
  8418. return type;
  8419. }
  8420. if (this.inHoleBalls.length > 0) {
  8421. type = ClassicWordsType.directShoot;
  8422. return type;
  8423. }
  8424. return type;
  8425. }
  8426. checkBigSkillWords(callback) {
  8427. if (this.curFoul == FoulType.timeOut) {
  8428. callback && callback();
  8429. }
  8430. else {
  8431. let playSkill = false;
  8432. if (this.selfTurn) {
  8433. playSkill = true;
  8434. }
  8435. else {
  8436. if (!this.aiPlayedBreakArmy) {
  8437. this.aiPlayedBreakArmy = true;
  8438. playSkill = true;
  8439. }
  8440. if (this.aiCurSkill != SkillType.breakArmy) {
  8441. playSkill = true;
  8442. }
  8443. }
  8444. if (xGame.common.skillMgr.playedLastSkill) {
  8445. xGame.common.skillMgr.playedLastSkill = false;
  8446. playSkill = false;
  8447. }
  8448. if (playSkill) {
  8449. xGame.common.skillMgr.runBigSkill((extraScore) => {
  8450. let selfExtra = 0;
  8451. let aiExtra = 0;
  8452. if (this.selfTurn)
  8453. selfExtra += extraScore;
  8454. else
  8455. aiExtra += extraScore;
  8456. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  8457. this.isEnd = true;
  8458. }
  8459. this.playBigSkillTimes(callback);
  8460. });
  8461. }
  8462. else {
  8463. this.playBigSkillTimes(callback);
  8464. }
  8465. }
  8466. }
  8467. playBigSkillTimes(callback) {
  8468. let length = this.inHoleBalls.length;
  8469. if (this.inHoleBalls.indexOf(0) > -1) {
  8470. length = this.inHoleBalls.length - 1;
  8471. }
  8472. if (length <= 0) {
  8473. callback && callback();
  8474. return;
  8475. }
  8476. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  8477. callback && callback();
  8478. });
  8479. }
  8480. playSkillTips() {
  8481. let levelNum = 0;
  8482. let curType;
  8483. if (this.selfTurn) {
  8484. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  8485. curType = this.selfCurSkill;
  8486. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8487. levelNum += 5;
  8488. }
  8489. }
  8490. else {
  8491. levelNum = this.aiSkillLevelNum;
  8492. curType = this.aiCurSkill;
  8493. }
  8494. let str = ``;
  8495. switch (curType) {
  8496. case SkillType.highSpace:
  8497. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8498. break;
  8499. case SkillType.breakArmy:
  8500. str = `You pocketed ${levelNum} extra balls`;
  8501. break;
  8502. case SkillType.ice:
  8503. str = `${levelNum * 2} extra balls were frozen`;
  8504. break;
  8505. case SkillType.fireworks:
  8506. str = `${levelNum} extra balls exploded `;
  8507. break;
  8508. case SkillType.GuanYu:
  8509. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8510. break;
  8511. default:
  8512. break;
  8513. }
  8514. xGame.uiMgr.Show(UIMsg, str);
  8515. }
  8516. getFoulType() {
  8517. let foulType = "";
  8518. if (this.firstColliObj == null) {
  8519. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8520. return FoulType.rootHole;
  8521. }
  8522. return FoulType.notTouch;
  8523. }
  8524. else {
  8525. if (this.selfTurn) {
  8526. if (this.selfBallArr.length > 0) {
  8527. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8528. foulType = FoulType.wrongTouch;
  8529. }
  8530. }
  8531. else {
  8532. if (this.ensureBallType) {
  8533. }
  8534. else {
  8535. if (this.firstColliObj == this.blackNum) {
  8536. foulType = FoulType.wrongTouch;
  8537. }
  8538. }
  8539. }
  8540. }
  8541. else {
  8542. if (this.aiBallArr.length > 0) {
  8543. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8544. foulType = FoulType.wrongTouch;
  8545. }
  8546. }
  8547. else {
  8548. if (this.ensureBallType) {
  8549. }
  8550. else {
  8551. if (this.firstColliObj == this.blackNum) {
  8552. foulType = FoulType.wrongTouch;
  8553. }
  8554. }
  8555. }
  8556. }
  8557. if (this.inHoleBalls.length <= 0) {
  8558. return foulType;
  8559. }
  8560. let temp;
  8561. if (this.inHoleBalls.indexOf(0) > -1) {
  8562. foulType = FoulType.rootHole;
  8563. }
  8564. else {
  8565. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8566. temp = this.inHoleBalls[index];
  8567. if (this.selfTurn) {
  8568. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8569. foulType = FoulType.wrongHole;
  8570. break;
  8571. }
  8572. }
  8573. else {
  8574. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8575. foulType = FoulType.wrongHole;
  8576. break;
  8577. }
  8578. }
  8579. }
  8580. }
  8581. let foo;
  8582. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8583. temp = this.inHoleBalls[index];
  8584. foo = this.selfBallArr.indexOf(temp);
  8585. if (foo > -1) {
  8586. this.selfBallArr.splice(foo, 1);
  8587. }
  8588. foo = this.aiBallArr.indexOf(temp);
  8589. if (foo > -1) {
  8590. this.aiBallArr.splice(foo, 1);
  8591. }
  8592. }
  8593. this.updateLeftBall();
  8594. }
  8595. return foulType;
  8596. }
  8597. judgeGameEndByBlack(arr) {
  8598. if (this.selfTurn) {
  8599. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8600. this.selfFoulNum = this.maxFoulTimes;
  8601. return true;
  8602. }
  8603. }
  8604. else {
  8605. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8606. this.aiFoulNum = this.maxFoulTimes;
  8607. return true;
  8608. }
  8609. }
  8610. }
  8611. judgeClassic(type) {
  8612. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8613. xGame.common.aiPlayer.stopRun();
  8614. if (this.judgeNormalSuccess()) {
  8615. this.isEnd = true;
  8616. return;
  8617. }
  8618. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8619. if (this.selfTurn) {
  8620. if (isFoul) {
  8621. this.selfFoulNum++;
  8622. }
  8623. if (this.selfFoulNum >= this.maxFoulTimes) {
  8624. this.success = false;
  8625. this.isEnd = true;
  8626. return;
  8627. }
  8628. }
  8629. else {
  8630. if (isFoul)
  8631. this.aiFoulNum++;
  8632. if (this.aiFoulNum >= this.maxFoulTimes) {
  8633. this.success = true;
  8634. this.isEnd = true;
  8635. return;
  8636. }
  8637. }
  8638. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8639. this.isChangeTurn = false;
  8640. }
  8641. else {
  8642. this.isInterrupt = true;
  8643. }
  8644. }
  8645. waitShoot() {
  8646. if (xGame.common.gameMode == GameMode.classic) {
  8647. switch (this.curFoul) {
  8648. case FoulType.timeOut:
  8649. case FoulType.rootHole:
  8650. this.selfTurn = !this.selfTurn;
  8651. this.peoplePlay(5, 6, true);
  8652. break;
  8653. case FoulType.notTouch:
  8654. this.selfTurn = !this.selfTurn;
  8655. this.peoplePlay(7, 7);
  8656. break;
  8657. case FoulType.wrongHole:
  8658. this.selfTurn = !this.selfTurn;
  8659. this.peoplePlay(11, 11);
  8660. break;
  8661. default:
  8662. if (this.inHoleBalls.length > 0) {
  8663. this.peoplePlay(0, 0, false, false);
  8664. }
  8665. else {
  8666. this.selfTurn = !this.selfTurn;
  8667. this.peoplePlay(7, 7);
  8668. }
  8669. break;
  8670. }
  8671. }
  8672. else if (xGame.common.gameMode == GameMode.bigMove) {
  8673. if (this.curFoul == FoulType.timeOut) {
  8674. this.selfTurn = !this.selfTurn;
  8675. this.peoplePlay(14, 15);
  8676. this.placeRootBall();
  8677. }
  8678. else {
  8679. this.selfTurn = !this.selfTurn;
  8680. if (this.curFoul == FoulType.rootHole) {
  8681. this.peoplePlay(12, 13);
  8682. this.placeRootBall();
  8683. }
  8684. else {
  8685. this.peoplePlay(0, 0, false, false);
  8686. }
  8687. }
  8688. }
  8689. else if (xGame.common.gameMode == GameMode.placeBall) {
  8690. this.finishOneShoot = true;
  8691. }
  8692. this.gameResult();
  8693. }
  8694. gameResult() {
  8695. this.firstColliObj = null;
  8696. this.inHoleBalls = [];
  8697. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8698. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8699. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8700. if (xGame.common.uiRodMethod)
  8701. xGame.common.uiRodMethod.resetRod();
  8702. xGame.common.d2World.rootBall.showSelf();
  8703. this.clearIceSkill();
  8704. if (this.selfTurn) {
  8705. console.log("zh:处理一杆结束后的逻辑 gameResult");
  8706. PlatMgr.gameInsert();
  8707. }
  8708. xGame.common.d3World.knifeRoot.destroyChildren();
  8709. if (this.selfTurn) {
  8710. xGame.common.gameUI.showHelpLineGuide();
  8711. xGame.common.gameUI.setTurnAlpha(true);
  8712. }
  8713. else {
  8714. xGame.common.gameUI.setTurnAlpha(false);
  8715. }
  8716. }
  8717. getScore(type) {
  8718. let selfAdd = 0;
  8719. let aiAdd = 0;
  8720. if (type == FoulType.timeOut) {
  8721. if (this.selfTurn)
  8722. aiAdd += 3;
  8723. else
  8724. selfAdd += 3;
  8725. }
  8726. else {
  8727. if (this.inHoleBalls.length > 0) {
  8728. if (this.selfTurn) {
  8729. if (type == FoulType.rootHole) {
  8730. aiAdd += 3;
  8731. if (this.inHoleBalls.length - 1 > 0) {
  8732. selfAdd += this.inHoleBalls.length - 1;
  8733. }
  8734. }
  8735. else {
  8736. selfAdd += this.inHoleBalls.length;
  8737. }
  8738. }
  8739. else {
  8740. if (type == FoulType.rootHole) {
  8741. selfAdd += 3;
  8742. if (this.inHoleBalls.length - 1 > 0) {
  8743. aiAdd += this.inHoleBalls.length - 1;
  8744. }
  8745. }
  8746. else {
  8747. aiAdd += this.inHoleBalls.length;
  8748. }
  8749. }
  8750. }
  8751. }
  8752. return [selfAdd, aiAdd];
  8753. }
  8754. judgeScoreEnd(selfAdd, aiAdd) {
  8755. this.selfScore += selfAdd;
  8756. this.aiScore += aiAdd;
  8757. this.updateAIScore();
  8758. this.updateSelfScore();
  8759. if (this.selfScore >= this.targertScore) {
  8760. this.success = true;
  8761. return true;
  8762. }
  8763. if (this.aiScore >= this.targertScore) {
  8764. this.success = false;
  8765. return true;
  8766. }
  8767. let ballArr = xGame.common.d2World.ballArr;
  8768. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8769. if (this.selfScore > this.aiScore) {
  8770. this.success = true;
  8771. return true;
  8772. }
  8773. else if (this.selfScore < this.aiScore) {
  8774. this.success = false;
  8775. return true;
  8776. }
  8777. else {
  8778. if (this.selfTurn) {
  8779. this.success = false;
  8780. }
  8781. else {
  8782. this.success = true;
  8783. }
  8784. return true;
  8785. }
  8786. }
  8787. }
  8788. clearIceSkill() {
  8789. let arr = xGame.common.d2World.ballArr;
  8790. let temp;
  8791. if (this.selfTurn) {
  8792. if (this.selfCurSkill == SkillType.ice) {
  8793. for (let index = 0; index < arr.length; index++) {
  8794. temp = arr[index];
  8795. if (temp.ballFunc == "ice") {
  8796. temp.setBallFunc("normal", "self");
  8797. }
  8798. }
  8799. }
  8800. }
  8801. else {
  8802. if (this.aiCurSkill == SkillType.ice) {
  8803. for (let index = 0; index < arr.length; index++) {
  8804. temp = arr[index];
  8805. if (temp.ballFunc == "ice") {
  8806. temp.setBallFunc("normal", "ai");
  8807. }
  8808. }
  8809. }
  8810. }
  8811. }
  8812. judgeNormalSuccess() {
  8813. if (this.selfTurn) {
  8814. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8815. this.success = true;
  8816. return true;
  8817. }
  8818. }
  8819. else {
  8820. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8821. this.success = false;
  8822. return true;
  8823. }
  8824. }
  8825. }
  8826. gameEnd() {
  8827. if (Moyu.isTT) {
  8828. xGame.common.screenImg = getScreenImg();
  8829. }
  8830. console.log("游戏结束", this.success);
  8831. xGame.common.aiPlayer.stopRun();
  8832. if (xGame.common.gameMode == GameMode.placeBall) {
  8833. this.getEndStarNum();
  8834. this.updatePlaceBallState();
  8835. }
  8836. this.isEnter = false;
  8837. Moyu.recordEnd(this, () => {
  8838. if (this.isEnter)
  8839. return;
  8840. this.isEnter = true;
  8841. console.log("进入录结束回调");
  8842. this.enterNext();
  8843. });
  8844. Laya.timer.once(1000, this, () => {
  8845. if (this.isEnter)
  8846. return;
  8847. this.isEnter = true;
  8848. this.enterNext();
  8849. });
  8850. xGame.common.longHelpLine = false;
  8851. }
  8852. enterNext() {
  8853. Laya.timer.clearAll(this);
  8854. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8855. xGame.uiMgr.Show(UIVideoShare, this.success);
  8856. }
  8857. else {
  8858. xGame.uiMgr.Show(UIGameEnd, this.success);
  8859. }
  8860. }
  8861. aiLeave() {
  8862. let ui = xGame.common.gameUI.ui;
  8863. ui.topNode.aiNameTxt.text = "offline";
  8864. }
  8865. aiGameEnd(suc) {
  8866. this.success = suc;
  8867. xGame.common.aiPlayer.stopRun();
  8868. if (this.success) {
  8869. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8870. Laya.timer.once(1000, this, () => {
  8871. this.clearTime();
  8872. this.gameEnd();
  8873. });
  8874. }
  8875. }
  8876. openTimer() {
  8877. let src = xGame.common.gameUI;
  8878. if (this.selfTurn) {
  8879. src.ui.topNode.selfProgress.visible = true;
  8880. src.ui.topNode.aiProgress.visible = false;
  8881. this.curTimer = src.ui.topNode.selfProgress;
  8882. }
  8883. else {
  8884. src.ui.topNode.selfProgress.visible = false;
  8885. src.ui.topNode.aiProgress.visible = true;
  8886. this.curTimer = src.ui.topNode.aiProgress;
  8887. }
  8888. this.accTime = 0;
  8889. Laya.timer.clearAll(this);
  8890. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8891. this.curTimer.value = 100;
  8892. }
  8893. updateTime(dt) {
  8894. if (this.gamePause)
  8895. return;
  8896. this.accTime += dt;
  8897. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8898. if (this.accTime >= this.setTime) {
  8899. this.clearTime();
  8900. console.log("时钟进入了gameRun");
  8901. this.gameRun(FoulType.timeOut);
  8902. }
  8903. }
  8904. clearTime() {
  8905. let src = xGame.common.gameUI;
  8906. src.ui.topNode.selfProgress.visible = false;
  8907. src.ui.topNode.aiProgress.visible = false;
  8908. Laya.timer.clearAll(this);
  8909. }
  8910. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8911. let ui = xGame.common.gameUI.ui;
  8912. let selfMsg, aiMsg;
  8913. if (sayWords) {
  8914. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8915. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8916. if (Foul) {
  8917. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8918. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8919. this.placeRootBall();
  8920. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8921. if (this.curFoul == FoulType.rootHole) {
  8922. if (!DataMgr.getRootBallFoul()) {
  8923. DataMgr.setRootBallFoul();
  8924. aiMsg = "";
  8925. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8926. let woman = "Boss, pay attention next time~";
  8927. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8928. }
  8929. }
  8930. else if (this.curFoul == FoulType.timeOut) {
  8931. if (!DataMgr.getTimeoutFoul()) {
  8932. DataMgr.setTimeoutFoul();
  8933. aiMsg = "";
  8934. let tips = "Game timeout, 3 fouls, this game failed.";
  8935. let woman = "Boss, pay attention to the timeline~";
  8936. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8937. }
  8938. }
  8939. }
  8940. }
  8941. }
  8942. if (this.selfTurn) {
  8943. if (sayWords) {
  8944. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8945. ui.selfTurn.visible = true;
  8946. ui.aiTurn.visible = false;
  8947. ui.selfTurn.t0.play();
  8948. Moyu.vibration();
  8949. });
  8950. }
  8951. }
  8952. else {
  8953. let aiNum = xGame.tools.random(1, 11);
  8954. let challengeNum = DataMgr.getChallengeTimes();
  8955. let delay = false;
  8956. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8957. aiNum = 9;
  8958. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8959. aiNum = 3;
  8960. if (challengeNum == 3) {
  8961. if (!this.showLongView) {
  8962. this.showLongView = true;
  8963. delay = true;
  8964. }
  8965. }
  8966. }
  8967. }
  8968. if (delay) {
  8969. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8970. if (success) {
  8971. xGame.common.longHelpLine = true;
  8972. xGame.common.d2World.getHelpLine();
  8973. }
  8974. else {
  8975. aiNum = 10;
  8976. }
  8977. xGame.common.aiPlayer.setAiLevel(aiNum);
  8978. if (sayWords) {
  8979. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8980. xGame.common.aiPlayer.runAI();
  8981. ui.selfTurn.visible = false;
  8982. ui.aiTurn.visible = true;
  8983. ui.aiTurn.t0.play();
  8984. });
  8985. }
  8986. else {
  8987. xGame.common.aiPlayer.runAI();
  8988. }
  8989. this.openTimer();
  8990. this.finishOneShoot = true;
  8991. if (this.selfTurn) {
  8992. ui.topNode.selfKuang.visible = true;
  8993. ui.topNode.aiKuang.visible = false;
  8994. ui.topNode.selfTips.visible = true;
  8995. ui.topNode.aiTips.visible = false;
  8996. }
  8997. else {
  8998. ui.topNode.selfKuang.visible = false;
  8999. ui.topNode.aiKuang.visible = true;
  9000. ui.topNode.selfTips.visible = false;
  9001. ui.topNode.aiTips.visible = true;
  9002. }
  9003. });
  9004. return;
  9005. }
  9006. if (xGame.common.gameMode == GameMode.classic) {
  9007. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9008. if (cfg) {
  9009. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9010. aiNum = aiLevel;
  9011. }
  9012. }
  9013. xGame.common.aiPlayer.setAiLevel(aiNum);
  9014. if (sayWords) {
  9015. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9016. xGame.common.aiPlayer.runAI();
  9017. ui.selfTurn.visible = false;
  9018. ui.aiTurn.visible = true;
  9019. ui.aiTurn.t0.play();
  9020. });
  9021. }
  9022. else {
  9023. xGame.common.aiPlayer.runAI();
  9024. }
  9025. }
  9026. this.openTimer();
  9027. this.finishOneShoot = true;
  9028. if (this.selfTurn) {
  9029. ui.topNode.selfKuang.visible = true;
  9030. ui.topNode.aiKuang.visible = false;
  9031. ui.topNode.selfTips.visible = true;
  9032. ui.topNode.aiTips.visible = false;
  9033. }
  9034. else {
  9035. ui.topNode.selfKuang.visible = false;
  9036. ui.topNode.aiKuang.visible = true;
  9037. ui.topNode.selfTips.visible = false;
  9038. ui.topNode.aiTips.visible = true;
  9039. }
  9040. }
  9041. placeRootBall() {
  9042. let rootBall = xGame.common.d2World.rootBall;
  9043. if (!rootBall)
  9044. return;
  9045. rootBall.gameObj.x = this.lastRootBallPos.x;
  9046. rootBall.gameObj.y = this.lastRootBallPos.y;
  9047. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9048. let moveNode = xGame.common.gameUI.ui.moveNode;
  9049. moveNode.visible = true;
  9050. moveNode.x = this.lastRootBallPos.x;
  9051. moveNode.y = this.lastRootBallPos.y;
  9052. if (!this.selfTurn) {
  9053. xGame.common.aiPlayer.resetRoot();
  9054. }
  9055. }
  9056. }
  9057. class ui_guanyuAni extends fgui.GComponent {
  9058. static createInstance() {
  9059. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9060. }
  9061. onConstruct() {
  9062. this.n0 = (this.getChild("n0"));
  9063. }
  9064. }
  9065. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9066. class UIFireworks extends UIBase {
  9067. constructor() {
  9068. super();
  9069. }
  9070. onConstructor() {
  9071. this.isEject = false;
  9072. }
  9073. show(callback) {
  9074. super.show();
  9075. }
  9076. }
  9077. UIFireworks.uiName = "UIFireworks";
  9078. class ui_UIGuanYu extends fgui.GComponent {
  9079. static createInstance() {
  9080. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9081. }
  9082. onConstruct() {
  9083. this.n2 = (this.getChild("n2"));
  9084. this.n1 = (this.getChild("n1"));
  9085. this.n3 = (this.getChild("n3"));
  9086. this.n4 = (this.getChild("n4"));
  9087. this.n5 = (this.getChild("n5"));
  9088. this.n6 = (this.getChild("n6"));
  9089. this.n8 = (this.getChild("n8"));
  9090. this.n7 = (this.getChild("n7"));
  9091. this.t0 = this.getTransition("t0");
  9092. }
  9093. }
  9094. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9095. class UIGuanYu extends UIBase {
  9096. constructor() {
  9097. super();
  9098. }
  9099. onConstructor() {
  9100. this.ui = ui_UIGuanYu.createInstance();
  9101. this.contentPane = this.ui;
  9102. this.isEject = false;
  9103. }
  9104. show(callback) {
  9105. super.show();
  9106. this.ui.t0.play(Laya.Handler.create(this, () => {
  9107. callback && callback();
  9108. this.hide();
  9109. }));
  9110. }
  9111. }
  9112. UIGuanYu.uiName = "UIGuanYu";
  9113. class SkillMgr {
  9114. constructor() {
  9115. this.leveNum = 0;
  9116. this.extraScore = 0;
  9117. this.selfTurn = false;
  9118. this.playedLastSkill = false;
  9119. this.tweenArr = [];
  9120. this._finishNum = 0;
  9121. this._curFinish = 0;
  9122. this._rootX = 0;
  9123. this._rootY = 0;
  9124. this.knifeTimes = 0;
  9125. this.knifeV2 = new Laya.Vector2();
  9126. this.knifeV3 = new Laya.Vector3();
  9127. this.rtStarX = 0;
  9128. this.rtStarY = 0;
  9129. this.addBigSkillSpine();
  9130. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9131. }
  9132. addBigSkillSpine() {
  9133. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9134. console.log("extra2 success");
  9135. });
  9136. }
  9137. runBigSkill(callback) {
  9138. this.tweenArr = [];
  9139. this.callback = callback;
  9140. this.judgeSkill();
  9141. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9142. let guide = DataMgr.getSkillGuide();
  9143. if (!xGame.common.gameMgr.selfTurn) {
  9144. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9145. }
  9146. else {
  9147. if (xGame.common.temSelfLevel != 0) {
  9148. this.leveNum = xGame.common.temSelfLevel;
  9149. }
  9150. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9151. this.leveNum += 5;
  9152. }
  9153. }
  9154. if (guide == 0) {
  9155. DataMgr.setSkillGuide(1);
  9156. if (DataMgr.getNewUser()) {
  9157. Moyu.sendDataEvent("gameFirstPlay");
  9158. DataMgr.setNewUser();
  9159. }
  9160. }
  9161. this.playSpineAni(() => {
  9162. switch (this.curSkill) {
  9163. case SkillType.highSpace:
  9164. this.runHighSpace();
  9165. break;
  9166. case SkillType.breakArmy:
  9167. this.runBreakArmy();
  9168. break;
  9169. case SkillType.ice:
  9170. this.runIce();
  9171. break;
  9172. case SkillType.fireworks:
  9173. this.runFireworks();
  9174. break;
  9175. case SkillType.GuanYu:
  9176. this.runGuanYu();
  9177. break;
  9178. default:
  9179. break;
  9180. }
  9181. });
  9182. }
  9183. judgeSkill() {
  9184. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9185. let gameMgr = xGame.common.gameMgr;
  9186. let type;
  9187. for (let index = 0; index < typeArr.length; index++) {
  9188. type = typeArr[index];
  9189. if (gameMgr.selfTurn) {
  9190. if (gameMgr.selfCurSkill == type) {
  9191. this.selfTurn = true;
  9192. this.curSkill = type;
  9193. return;
  9194. }
  9195. }
  9196. else {
  9197. if (gameMgr.aiCurSkill == type) {
  9198. this.selfTurn = false;
  9199. this.curSkill = type;
  9200. return;
  9201. }
  9202. }
  9203. }
  9204. }
  9205. playSpineAni(callback) {
  9206. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9207. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9208. parent.destroyChildren();
  9209. let aniIndex = 0;
  9210. let skillSpine;
  9211. switch (this.curSkill) {
  9212. case SkillType.highSpace:
  9213. aniIndex = 1;
  9214. xGame.soundMgr.playSound("skill01");
  9215. skillSpine = this.skillSpine2;
  9216. data.scaleX = 0.5;
  9217. data.scaleY = 0.5;
  9218. skillSpine.play(data, 1, false, parent, () => {
  9219. callback && callback();
  9220. });
  9221. break;
  9222. case SkillType.breakArmy:
  9223. aniIndex = 2;
  9224. xGame.soundMgr.playSound("skill02");
  9225. skillSpine = this.skillSpine2;
  9226. data.scaleX = 0.5;
  9227. data.scaleY = 0.5;
  9228. skillSpine.play(data, 2, false, parent, () => {
  9229. callback && callback();
  9230. });
  9231. break;
  9232. case SkillType.ice:
  9233. aniIndex = 0;
  9234. xGame.soundMgr.playSound("skill03");
  9235. skillSpine = this.skillSpine2;
  9236. data.scaleX = 0.5;
  9237. data.scaleY = 0.5;
  9238. skillSpine.play(data, 0, false, parent, () => {
  9239. callback && callback();
  9240. });
  9241. break;
  9242. case SkillType.fireworks:
  9243. xGame.soundMgr.playSound("skill_04_01");
  9244. xGame.soundMgr.playSound("skill04");
  9245. xGame.uiMgr.Show(UIFireworks, callback);
  9246. break;
  9247. case SkillType.GuanYu:
  9248. xGame.soundMgr.playSound("skill05_1");
  9249. xGame.soundMgr.playSound("skill05");
  9250. xGame.uiMgr.Show(UIGuanYu, callback);
  9251. break;
  9252. default:
  9253. break;
  9254. }
  9255. }
  9256. getAllBallArr() {
  9257. let arr = xGame.common.d2World.ballArr;
  9258. let outArr = [];
  9259. for (let index = 0; index < arr.length; index++) {
  9260. if (arr[index] instanceof D2RootBallSrc)
  9261. continue;
  9262. if (arr[index].ballFunc == "ice")
  9263. continue;
  9264. if (arr[index].destroyed)
  9265. continue;
  9266. outArr.push(arr[index]);
  9267. }
  9268. return outArr;
  9269. }
  9270. getOneArr(deletObj) {
  9271. let allArr = this.getAllBallArr();
  9272. let temp;
  9273. for (let index = 0; index < allArr.length; index++) {
  9274. temp = allArr[index];
  9275. if (temp.id == deletObj.id) {
  9276. allArr.splice(index, 1);
  9277. break;
  9278. }
  9279. }
  9280. return allArr;
  9281. }
  9282. getNearBallBag(ball) {
  9283. let ui = xGame.common.gameUI.ui;
  9284. let circleArr = [];
  9285. for (let index = 1; index <= 6; index++) {
  9286. circleArr.push(ui.border["circle" + index]);
  9287. }
  9288. let outIndex = 0;
  9289. let temp;
  9290. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  9291. ;
  9292. let dis = 0;
  9293. for (let index = 1; index < circleArr.length; index++) {
  9294. temp = circleArr[index];
  9295. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  9296. if (dis < min) {
  9297. min = dis;
  9298. outIndex = index;
  9299. }
  9300. }
  9301. return [circleArr[outIndex], outIndex];
  9302. }
  9303. ballFlyToBag(ballArr, time = 300) {
  9304. let temp;
  9305. let hole;
  9306. this._finishNum = ballArr.length;
  9307. this._curFinish = 0;
  9308. let holeObj = {};
  9309. let holeCfg = {
  9310. "1": 0,
  9311. "2": 0,
  9312. "3": 0,
  9313. "4": 0,
  9314. "5": 0,
  9315. "6": 0
  9316. };
  9317. for (let index = 0; index < ballArr.length; index++) {
  9318. temp = ballArr[index];
  9319. temp.outColli.isSensor = true;
  9320. temp.innerColli.isSensor = true;
  9321. temp.isRunSkillAni = true;
  9322. let holeArr = this.getNearBallBag(temp);
  9323. hole = holeArr[0];
  9324. holeObj[index] = holeArr[1];
  9325. temp.d3BallSrc.scaleXYZ = 0.5;
  9326. this.tweenArr.push(temp.d3BallSrc, temp);
  9327. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9328. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  9329. }));
  9330. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  9331. let mIndex = holeObj[this._curFinish];
  9332. let isDone = holeCfg[mIndex];
  9333. if (isDone) {
  9334. ballArr[this._curFinish].checkWrongBall(false);
  9335. }
  9336. else {
  9337. holeCfg[mIndex] = 1;
  9338. ballArr[this._curFinish].checkWrongBall();
  9339. }
  9340. this._curFinish++;
  9341. if (this._curFinish >= this._finishNum) {
  9342. if (this.curSkill == SkillType.highSpace) {
  9343. }
  9344. else if (this.curSkill == SkillType.breakArmy) {
  9345. let rootBall = xGame.common.d2World.rootBall;
  9346. rootBall.gameObj.x = this._rootX;
  9347. rootBall.gameObj.y = this._rootY;
  9348. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9349. xGame.common.d2World.d2Gan.ui.visible = true;
  9350. xGame.common.d2World.d2HelpLine.ui.visible = true;
  9351. xGame.common.d2World.getHelpLine();
  9352. this.callback && this.callback(this.extraScore);
  9353. }
  9354. }
  9355. }));
  9356. }
  9357. }
  9358. runHighSpace() {
  9359. let rootBall = xGame.common.d2World.rootBall;
  9360. rootBall.showSelf();
  9361. let d3Src = rootBall.d3BallSrc;
  9362. let allArr = this.getAllBallArr();
  9363. if (allArr.length <= 0) {
  9364. this.callback && this.callback(0);
  9365. return;
  9366. }
  9367. let selectBall = xGame.common.d2World.targetBall;
  9368. let wrong = selectBall && selectBall.destroyed;
  9369. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  9370. selectBall = xGame.common.getRandArrEle(allArr);
  9371. }
  9372. let targetD3Src = selectBall.d3BallSrc;
  9373. xGame.common.d2World.d2Gan.ui.visible = false;
  9374. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9375. d3Src.scaleXYZ = 0.5;
  9376. this.tweenArr.push(d3Src);
  9377. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9378. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9379. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  9380. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  9381. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  9382. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  9383. let outArr = [selectBall];
  9384. let other = this.leveNum - 1;
  9385. if (other > 0) {
  9386. let nearArr = this.getOneArr(selectBall);
  9387. if (nearArr.length > 0) {
  9388. xGame.common.botherArr(nearArr);
  9389. if (other >= nearArr.length)
  9390. other = nearArr.length;
  9391. for (let index = 0; index < other; index++) {
  9392. outArr.push(nearArr[index]);
  9393. }
  9394. }
  9395. }
  9396. xGame.common.extraMoveNum = other + 1;
  9397. this.extraScore = other + 1;
  9398. this._rootX = selectBall.gameObj.x;
  9399. this._rootY = selectBall.gameObj.y;
  9400. rootBall.gameObj.x = this._rootX;
  9401. rootBall.gameObj.y = this._rootY;
  9402. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9403. Laya.Tween.clearAll(d3Src);
  9404. this.addRandomForce(outArr);
  9405. }));
  9406. }));
  9407. }
  9408. addRandomForce(outArr) {
  9409. if (outArr.length > 0) {
  9410. xGame.common.d2World.openCheckStill = true;
  9411. this.playedLastSkill = true;
  9412. }
  9413. let temp;
  9414. for (let index = 0; index < outArr.length; index++) {
  9415. let angle = xGame.common.randomNum(0, 360);
  9416. let linearPercent = xGame.common.randomNum(65, 100);
  9417. temp = outArr[index];
  9418. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  9419. }
  9420. }
  9421. setLinearSpeed(angle, rigy, linearPercent) {
  9422. let sin = Math.sin(angle * Math.PI / 180);
  9423. let cos = Math.cos(angle * Math.PI / 180);
  9424. let maxSpeed = 4;
  9425. let speed = new Laya.Vector2();
  9426. speed.x = maxSpeed * linearPercent * sin;
  9427. speed.y = -maxSpeed * linearPercent * cos;
  9428. rigy.applyLinearImpulseToCenter(speed);
  9429. }
  9430. runBreakArmy() {
  9431. xGame.common.d2World.d2Gan.ui.visible = false;
  9432. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9433. let gameUI = xGame.common.gameUI.ui;
  9434. gameUI.skillRod.visible = true;
  9435. gameUI.skillRod.rotation = 110;
  9436. let outArr = this.getAllBallArr();
  9437. if (outArr.length <= 0) {
  9438. gameUI.skillRod.visible = false;
  9439. this.callback && this.callback(0);
  9440. return;
  9441. }
  9442. xGame.common.botherArr(outArr);
  9443. if (this.leveNum >= outArr.length)
  9444. this.leveNum = outArr.length;
  9445. let deleteNum = outArr.length - this.leveNum;
  9446. outArr.splice(0, deleteNum);
  9447. this.extraScore = this.leveNum;
  9448. let potX = gameUI.skillRod.x;
  9449. let potY = gameUI.skillRod.y;
  9450. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  9451. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  9452. let disArr = [];
  9453. for (let index = 0; index < outArr.length; index++) {
  9454. let obj = outArr[index];
  9455. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  9456. dis = Math.pow(dis, 0.5);
  9457. disArr.push(dis);
  9458. }
  9459. this.tweenArr.push(gameUI.skillRod);
  9460. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9461. })).update = Laya.Handler.create(this, (e, t, c) => {
  9462. let angle = gameUI.skillRod.rotation;
  9463. let xx;
  9464. let yy;
  9465. let temp;
  9466. for (let index = 0; index < outArr.length; index++) {
  9467. temp = outArr[index];
  9468. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  9469. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  9470. yy -= 20;
  9471. temp.gameObj.x = xx;
  9472. temp.gameObj.y = yy;
  9473. temp.d3BallSrc.setTransPos(xx, yy);
  9474. }
  9475. if (angle <= 60) {
  9476. Laya.Tween.clearAll(gameUI.skillRod);
  9477. this.ballFlyToBag(outArr, 150);
  9478. gameUI.skillRod.visible = false;
  9479. }
  9480. }, null, false);
  9481. }
  9482. runIce() {
  9483. let ballArr = xGame.common.d2World.ballArr;
  9484. this.leveNum *= 2;
  9485. if (this.leveNum >= ballArr.length - 1)
  9486. this.leveNum = ballArr.length - 1;
  9487. let tempArr = [];
  9488. let outArr = [];
  9489. for (let index = 0; index < ballArr.length; index++) {
  9490. if (ballArr[index] instanceof D2RootBallSrc)
  9491. continue;
  9492. tempArr.push(ballArr[index]);
  9493. }
  9494. if (tempArr.length <= 0) {
  9495. this.callback && this.callback(0);
  9496. return;
  9497. }
  9498. xGame.common.botherArr(tempArr);
  9499. for (let index = 0; index < this.leveNum; index++) {
  9500. outArr.push(tempArr[index]);
  9501. }
  9502. this.extraScore = this.leveNum;
  9503. let temp;
  9504. for (let index = 0; index < outArr.length; index++) {
  9505. temp = outArr[index];
  9506. temp.d3BallSrc.playIceEft();
  9507. }
  9508. Laya.timer.once(2000, this, () => {
  9509. for (let index = 0; index < outArr.length; index++) {
  9510. temp = outArr[index];
  9511. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9512. temp.setBallFunc("ice", str);
  9513. }
  9514. this.callback && this.callback(0);
  9515. });
  9516. }
  9517. runFireworks() {
  9518. let allArr = this.getAllBallArr();
  9519. if (allArr.length <= 0) {
  9520. this.callback && this.callback(0);
  9521. return;
  9522. }
  9523. xGame.common.d2World.d2Gan.ui.visible = false;
  9524. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9525. let outArr = [];
  9526. let other = this.leveNum;
  9527. if (other > 0) {
  9528. if (allArr.length > 0) {
  9529. xGame.common.botherArr(allArr);
  9530. if (other >= allArr.length)
  9531. other = allArr.length;
  9532. for (let index = 0; index < other; index++) {
  9533. outArr.push(allArr[index]);
  9534. }
  9535. }
  9536. }
  9537. xGame.common.extraMoveNum = other;
  9538. this.extraScore = other;
  9539. this.addRandmomFireworks(outArr);
  9540. }
  9541. addRandmomFireworks(outArr) {
  9542. Laya.timer.once(1100, this, () => {
  9543. if (outArr.length > 0) {
  9544. xGame.common.d2World.openCheckStill = true;
  9545. this.playedLastSkill = true;
  9546. }
  9547. });
  9548. xGame.soundMgr.playSound("skill_04_02");
  9549. let temp;
  9550. let delay = -200;
  9551. for (let index = 0; index < outArr.length; index++) {
  9552. temp = outArr[index];
  9553. delay += 200;
  9554. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9555. let angle = xGame.common.randomNum(0, 360);
  9556. angle = this.getFireworksAngle(obj);
  9557. let linearPercent = xGame.common.randomNum(45, 80);
  9558. if (!obj.destroyed)
  9559. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9560. });
  9561. }
  9562. }
  9563. getFireworksAngle(obj) {
  9564. let rootBall = xGame.common.d2World.rootBall;
  9565. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9566. }
  9567. resetGame() {
  9568. Laya.timer.clearAll(this);
  9569. if (this.tweenArr) {
  9570. for (let index = 0; index < this.tweenArr.length; index++) {
  9571. Laya.Tween.clearAll(this.tweenArr[index]);
  9572. }
  9573. }
  9574. this.tweenArr = null;
  9575. }
  9576. runGuanYu() {
  9577. xGame.common.d2World.d2Gan.ui.visible = false;
  9578. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9579. let rootBall = xGame.common.d2World.rootBall;
  9580. if (rootBall.isInHole) {
  9581. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9582. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9583. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9584. rootBall.showSelf();
  9585. }
  9586. this.rtStarX = rootBall.gameObj.x;
  9587. this.rtStarY = rootBall.gameObj.y;
  9588. this.knifeTimes = 0;
  9589. this.playedLastSkill = true;
  9590. rootBall.forceRun = true;
  9591. rootBall.rigy.type = "static";
  9592. xGame.common.d2World.openCheckStill = true;
  9593. this.guanyuRandomKnife();
  9594. }
  9595. guanyuRandomKnife() {
  9596. let rootBall = xGame.common.d2World.rootBall;
  9597. let dir = this.getRandDir();
  9598. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9599. console.log("当前angle", angle);
  9600. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9601. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9602. let dis = 324;
  9603. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9604. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9605. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9606. this.rtStarX = rootBall.gameObj.x;
  9607. this.rtStarY = rootBall.gameObj.y;
  9608. this.knifeTimes++;
  9609. let skillLevel;
  9610. if (xGame.common.gameMgr.selfTurn) {
  9611. skillLevel = DataMgr.getBigSkillByIndex(4);
  9612. }
  9613. else {
  9614. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9615. }
  9616. if (!skillLevel)
  9617. skillLevel = 1;
  9618. skillLevel += 2;
  9619. if (this.knifeTimes < skillLevel) {
  9620. Laya.timer.once(400, this, () => {
  9621. this.guanyuRandomKnife();
  9622. });
  9623. }
  9624. else {
  9625. rootBall.forceRun = false;
  9626. rootBall.rigy.type = "dynamic";
  9627. xGame.common.extraMoveNum = skillLevel;
  9628. }
  9629. }));
  9630. }
  9631. getRandDir() {
  9632. let rootBall = xGame.common.d2World.rootBall;
  9633. let allBall = this.getAllBallArr();
  9634. let target = xGame.common.getRandArrEle(allBall);
  9635. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9636. return this.knifeV2;
  9637. }
  9638. cloneKnife(x, y, rotation) {
  9639. let parent = xGame.common.d3World.knifeRoot;
  9640. let prefab = xGame.common.d3World.knife;
  9641. let clone = prefab.clone();
  9642. parent.addChild(clone);
  9643. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9644. clone.transform.localPositionX = this.knifeV3.x;
  9645. clone.transform.localPositionY = 0;
  9646. clone.transform.localPositionZ = this.knifeV3.z;
  9647. clone.transform.localRotationEulerX = 0;
  9648. clone.transform.localRotationEulerY = rotation;
  9649. clone.transform.localRotationEulerZ = 0;
  9650. clone.active = true;
  9651. return clone;
  9652. }
  9653. cloneGuanYuEft(x, y, angle) {
  9654. return;
  9655. let parent = xGame.common.gameUI.ui.guanyuNode;
  9656. let eft = new ui_guanyuAni();
  9657. eft.parent = parent;
  9658. eft.x = x;
  9659. eft.y = y;
  9660. eft.rotation = angle;
  9661. }
  9662. }
  9663. class ui_UIWordsList extends fgui.GComponent {
  9664. static createInstance() {
  9665. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9666. }
  9667. onConstruct() {
  9668. this.c1 = this.getController("c1");
  9669. this.n74 = (this.getChild("n74"));
  9670. this.clickNode = (this.getChild("clickNode"));
  9671. this.myNode = (this.getChild("myNode"));
  9672. this.n68 = (this.getChild("n68"));
  9673. this.n66 = (this.getChild("n66"));
  9674. this.n55 = (this.getChild("n55"));
  9675. this.wordsBtn = (this.getChild("wordsBtn"));
  9676. this.emotionBtn = (this.getChild("emotionBtn"));
  9677. this.mybggg = (this.getChild("mybggg"));
  9678. this.wordsList = (this.getChild("wordsList"));
  9679. this.emotionList = (this.getChild("emotionList"));
  9680. this.myRoot = (this.getChild("myRoot"));
  9681. }
  9682. }
  9683. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9684. class EmotionDisplay {
  9685. constructor(index, ui) {
  9686. this.ui = ui;
  9687. this.index = index;
  9688. this.ui.onClick(this, this.clickSelf);
  9689. this.updateSelf();
  9690. }
  9691. updateSelf() {
  9692. let data = cfgTable.emotionData[this.index + 1];
  9693. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9694. }
  9695. clickSelf() {
  9696. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9697. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9698. xGame.common.talkMgr.closeTalkView();
  9699. }
  9700. }
  9701. class WordsDisplay {
  9702. constructor(index, ui) {
  9703. this.ui = ui;
  9704. this.index = index;
  9705. this.ui.onClick(this, this.clickSelf);
  9706. this.updateSelf();
  9707. }
  9708. updateSelf() {
  9709. let data = cfgTable.talkwordsData[this.index + 1];
  9710. this.ui.txt.text = data.msg;
  9711. }
  9712. clickSelf() {
  9713. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9714. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9715. xGame.common.talkMgr.closeTalkView();
  9716. }
  9717. }
  9718. class UIWordsList extends UIBase {
  9719. constructor() {
  9720. super();
  9721. }
  9722. onConstructor() {
  9723. this.ui = ui_UIWordsList.createInstance();
  9724. this.contentPane = this.ui;
  9725. this.isEject = false;
  9726. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9727. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9728. this.addUIClick(this.ui.clickNode, this.hide);
  9729. this.initTalkList();
  9730. this.initEmotionList();
  9731. }
  9732. show() {
  9733. super.show();
  9734. }
  9735. initTalkList() {
  9736. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9737. let data = cfgTable.talkwordsData;
  9738. let length = Object.keys(data).length;
  9739. this.ui.wordsList.numItems = length;
  9740. }
  9741. initEmotionList() {
  9742. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9743. let data = cfgTable.emotionData;
  9744. let length = Object.keys(data).length;
  9745. this.ui.emotionList.numItems = length;
  9746. }
  9747. renderTalkItem(index, obj) {
  9748. let temp = new WordsDisplay(index, obj);
  9749. }
  9750. renderEmotionItem(index, obj) {
  9751. let temp = new EmotionDisplay(index, obj);
  9752. }
  9753. openTalkList() {
  9754. this.ui.c1.selectedIndex = 0;
  9755. }
  9756. openEmotionList() {
  9757. this.ui.c1.selectedIndex = 1;
  9758. }
  9759. }
  9760. UIWordsList.uiName = "UIWordsList";
  9761. class TalkMgr {
  9762. constructor() {
  9763. this.aiSpeak = true;
  9764. this.emotionList = [];
  9765. this.talkList = [];
  9766. this.addEvent();
  9767. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9768. this.emotionList = [];
  9769. this.talkList = [];
  9770. for (let k in cfgTable.emotionData) {
  9771. this.emotionList.push(cfgTable.emotionData[k].id);
  9772. }
  9773. for (let k in cfgTable.talkwordsData) {
  9774. this.talkList.push(cfgTable.talkwordsData[k].id);
  9775. }
  9776. }
  9777. addEvent() {
  9778. let ui = xGame.common.gameUI.ui;
  9779. ui.wordsBtn.visible = true;
  9780. ui.wordsBtn.onClick(this, this.openTalkView);
  9781. ui.aiWordsBtn.visible = true;
  9782. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9783. }
  9784. openTalkView() {
  9785. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9786. xGame.uiMgr.Show(UIWordsList);
  9787. }
  9788. closeTalkView() {
  9789. xGame.uiMgr.Hide(UIWordsList);
  9790. }
  9791. clickAIState() {
  9792. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9793. this.aiSpeak = !this.aiSpeak;
  9794. this.changeAIState(this.aiSpeak);
  9795. }
  9796. changeAIState(speak) {
  9797. this.aiSpeak = speak;
  9798. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9799. if (speak) {
  9800. btn.c1.selectedIndex = 0;
  9801. }
  9802. else {
  9803. btn.c1.selectedIndex = 1;
  9804. }
  9805. }
  9806. showSelfTalk(wordsId) {
  9807. let ui = xGame.common.gameUI.ui;
  9808. ui.selfTalk.visible = true;
  9809. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9810. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9811. ui.selfTalk.t0.play();
  9812. }
  9813. showSelfEmotion(emotionId) {
  9814. let ui = xGame.common.gameUI.ui;
  9815. ui.selfTalk.visible = true;
  9816. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9817. this.selfSpine && this.selfSpine.dispose();
  9818. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9819. let spineData = cfgTable.emotionData[emotionId].spine;
  9820. this.selfSpine = new SpineMgr(spineData, () => {
  9821. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9822. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9823. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9824. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9825. });
  9826. ui.selfTalk.t0.play();
  9827. }
  9828. showAITalk(wordsId) {
  9829. if (!this.aiSpeak)
  9830. return;
  9831. if (DataMgr.gameData.gameCount < 2)
  9832. return;
  9833. if (wordsId < 1)
  9834. wordsId = this.getRandTalk();
  9835. let ui = xGame.common.gameUI.ui;
  9836. ui.aiTalk.visible = true;
  9837. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9838. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9839. ui.aiTalk.t0.play();
  9840. }
  9841. getRandTalk() {
  9842. let rand = xGame.tools.random(0, this.talkList.length);
  9843. return this.emotionList[rand];
  9844. }
  9845. getRandEmotion() {
  9846. let rand = xGame.tools.random(0, this.emotionList.length);
  9847. return this.emotionList[rand];
  9848. }
  9849. showAIEmotion(emotionId) {
  9850. if (!this.aiSpeak)
  9851. return;
  9852. if (DataMgr.gameData.gameCount < 2)
  9853. return;
  9854. if (emotionId < 1)
  9855. emotionId = this.getRandEmotion();
  9856. let ui = xGame.common.gameUI.ui;
  9857. ui.aiTalk.visible = true;
  9858. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9859. this.aiSpine && this.aiSpine.dispose();
  9860. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9861. let spineData = cfgTable.emotionData[emotionId].spine;
  9862. this.aiSpine = new SpineMgr(spineData, () => {
  9863. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9864. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9865. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9866. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9867. });
  9868. ui.aiTalk.t0.play();
  9869. }
  9870. resetGame() {
  9871. let ui = xGame.common.gameUI.ui;
  9872. ui.aiTalk.visible = false;
  9873. ui.selfTalk.visible = false;
  9874. this.aiSpine && this.aiSpine.dispose();
  9875. this.selfSpine && this.selfSpine.dispose();
  9876. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9877. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9878. this.closeTalkView();
  9879. }
  9880. }
  9881. class WordsMgr {
  9882. constructor() {
  9883. this.comboTimes = 1;
  9884. this.skillTimes = 0;
  9885. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9886. this.comboSpine = new SpineMgr("yxz_liangan");
  9887. this.skillSpine = new SpineMgr("yiganxqiu");
  9888. this.scoreSpine = new SpineMgr("defen");
  9889. }
  9890. setClassicCombo(isInterrupt) {
  9891. if (isInterrupt) {
  9892. this.comboTimes = 0;
  9893. }
  9894. }
  9895. playClassicWords(type, callback) {
  9896. this.callback = callback;
  9897. let aniIndex = type;
  9898. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9899. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9900. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9901. mySpine.destroy(true);
  9902. this.playClassicTimes();
  9903. });
  9904. }
  9905. playClassicTimes() {
  9906. this.comboTimes++;
  9907. if (this.comboTimes <= 1) {
  9908. this.callback && this.callback();
  9909. }
  9910. else {
  9911. let aniIndex = this.comboTimes - 1;
  9912. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9913. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9914. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9915. mySpine.destroy(true);
  9916. this.callback && this.callback();
  9917. });
  9918. }
  9919. }
  9920. playBigSkillTimes(times, callback) {
  9921. if (times <= 0) {
  9922. callback && callback();
  9923. return;
  9924. }
  9925. this.callback = callback;
  9926. let pre = "sz_0";
  9927. let aniIndex = 0;
  9928. this.getWordsImg(times, pre, () => {
  9929. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9930. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9931. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9932. let r1 = ``;
  9933. let r2 = ``;
  9934. if (times <= 9) {
  9935. r1 = `res/d2Res/${pre}${times}.png`;
  9936. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9937. aniIndex = 0;
  9938. }
  9939. else {
  9940. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9941. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9942. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9943. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9944. aniIndex = 1;
  9945. }
  9946. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9947. mySpine.destroy(true);
  9948. xGame.common.gameMgr.playSkillTips();
  9949. this.playScore(times);
  9950. xGame.common.playRandomMutiBallBigSkillSound();
  9951. }, mySpine);
  9952. });
  9953. }
  9954. playScore(score) {
  9955. let pre = "sz_";
  9956. let aniIndex = 0;
  9957. this.getWordsImg(score, pre, () => {
  9958. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9959. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9960. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9961. let r1 = ``;
  9962. let r2 = ``;
  9963. if (score <= 9) {
  9964. r1 = `res/d2Res/${pre}${score}.png`;
  9965. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9966. aniIndex = 0;
  9967. }
  9968. else {
  9969. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9970. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9971. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9972. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9973. aniIndex = 1;
  9974. }
  9975. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9976. mySpine.destroy(true);
  9977. this.callback && this.callback();
  9978. }, mySpine);
  9979. });
  9980. }
  9981. getWordsImg(number, pre = "", callback) {
  9982. let arr = [];
  9983. if (number <= 9) {
  9984. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9985. }
  9986. else {
  9987. 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 });
  9988. }
  9989. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9990. callback && callback();
  9991. }));
  9992. }
  9993. }
  9994. class ui_UIRodMethod extends fgui.GComponent {
  9995. static createInstance() {
  9996. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9997. }
  9998. onConstruct() {
  9999. this.n24 = (this.getChild("n24"));
  10000. this.white = (this.getChild("white"));
  10001. this.dot = (this.getChild("dot"));
  10002. this.sureBtn = (this.getChild("sureBtn"));
  10003. this.n20 = (this.getChild("n20"));
  10004. this.n21 = (this.getChild("n21"));
  10005. this.n22 = (this.getChild("n22"));
  10006. this.n23 = (this.getChild("n23"));
  10007. this.n5 = (this.getChild("n5"));
  10008. this.n14 = (this.getChild("n14"));
  10009. this.t0 = this.getTransition("t0");
  10010. }
  10011. }
  10012. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10013. class UIRodMethod extends UIBase {
  10014. constructor() {
  10015. super();
  10016. this.isPressd = false;
  10017. }
  10018. onConstructor() {
  10019. this.ui = ui_UIRodMethod.createInstance();
  10020. this.contentPane = this.ui;
  10021. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10022. this.moveDir = new Laya.Vector2();
  10023. this.moveDest = new Laya.Vector2();
  10024. this.centerPos = new Laya.Vector2();
  10025. xGame.common.uiRodMethod = this;
  10026. }
  10027. show() {
  10028. super.show();
  10029. xGame.common.gameMgr.gamePause = true;
  10030. this.openPressDotEvent();
  10031. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10032. this.centerPos.x = this.ui.white.x;
  10033. this.centerPos.y = this.ui.white.y;
  10034. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10035. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10036. this.setDot();
  10037. }
  10038. setDot() {
  10039. this.ui.dot.x = this.moveDest.x;
  10040. this.ui.dot.y = this.moveDest.y;
  10041. }
  10042. closeSelf() {
  10043. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10044. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10045. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10046. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10047. xGame.common.gameMgr.gamePause = false;
  10048. this.hide();
  10049. }
  10050. openPressDotEvent() {
  10051. this.closePressDotEvent();
  10052. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10053. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10054. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10055. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10056. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10057. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10058. }
  10059. closePressDotEvent() {
  10060. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10061. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10062. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10063. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10064. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10065. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10066. }
  10067. onDown(e) {
  10068. if (e.type == Laya.Event.MOUSE_DOWN)
  10069. this.isPressd = true;
  10070. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10071. this.isPressd = false;
  10072. if (!this.isPressd)
  10073. return;
  10074. this.moveDest.x = e.stageX;
  10075. this.moveDest.y = e.stageY;
  10076. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10077. if (dis > 6724) {
  10078. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10079. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10080. }
  10081. this.setDot();
  10082. }
  10083. resetRod() {
  10084. this.ui.dot.x = this.ui.white.x;
  10085. this.ui.dot.y = this.ui.white.y;
  10086. this.gameRod.dot.x = this.gameRod.bg.x;
  10087. this.gameRod.dot.y = this.gameRod.bg.y;
  10088. xGame.common.rodOffest.x = 0;
  10089. xGame.common.rodOffest.y = 0;
  10090. }
  10091. }
  10092. UIRodMethod.uiName = "UIRodMethod";
  10093. class UIGame extends UIBase {
  10094. constructor() {
  10095. super();
  10096. this.powerNum = 0;
  10097. this.isD3Inited = false;
  10098. this.isPrePlay = false;
  10099. this.isMoveRod = false;
  10100. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10101. this.rulerDis = 20;
  10102. this.rulerOffset = 0;
  10103. }
  10104. onConstructor() {
  10105. this.ui = ui_UIGame.createInstance();
  10106. this.contentPane = this.ui;
  10107. this.ui.x += xGame.common.sysOffestNum;
  10108. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10109. this.isEject = false;
  10110. xGame.common.gameUI = this;
  10111. this.initSelf();
  10112. }
  10113. isTurnSelf() {
  10114. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10115. return true;
  10116. }
  10117. }
  10118. initSelf() {
  10119. let topUI = this.ui.topNode;
  10120. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10121. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10122. this.barInfo = {};
  10123. this.barInfo.curY = 0;
  10124. this.barInfo.height = this.ui.powerNode.height;
  10125. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10126. this.barInfo.powerStartY = this.ui.powerNode.y;
  10127. xGame.common.aiPlayer = new AIPlayer();
  10128. xGame.common.gameMgr = new GameMgr();
  10129. xGame.common.skillMgr = new SkillMgr();
  10130. xGame.common.wordsMgr = new WordsMgr();
  10131. xGame.common.talkMgr = new TalkMgr();
  10132. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10133. console.log("加载经典模式表情文件chenggon !");
  10134. });
  10135. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10136. console.log("挑战模式奖励模式spine加载成功!");
  10137. });
  10138. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10139. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10140. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10141. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10142. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10143. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10144. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10145. }
  10146. getGanZiImg() {
  10147. let index = DataMgr.getCurBallRod();
  10148. let data = cfgTable.ballrodData[index + 1];
  10149. let gan_url = xGame.common.getGameIconUrl(data.img);
  10150. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10151. this.ui.powerNode.showImg.url = gan_url;
  10152. console.log('zh:修改杆子图标O K');
  10153. }
  10154. returnHome() {
  10155. let tips = "Are you sure to exit the game?";
  10156. let woman = "Boss, why don't you play for a while longer?";
  10157. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10158. }
  10159. addRodMethodClick() {
  10160. if (this.isTurnSelf()) {
  10161. xGame.uiMgr.Show(UIRodMethod);
  10162. }
  10163. }
  10164. clickHelpLineBtn(force = false) {
  10165. if (!this.isTurnSelf())
  10166. return;
  10167. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10168. if (success) {
  10169. xGame.common.longHelpLine = true;
  10170. xGame.common.d2World.getHelpLine();
  10171. Moyu.sendDataEvent("guideNum");
  10172. }
  10173. else {
  10174. }
  10175. });
  10176. }
  10177. renderSelfDisplayBalls(index, target) {
  10178. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10179. target.myImg.url = xGame.common.getGameIconUrl(str);
  10180. }
  10181. renderAIDisplayBalls(index, target) {
  10182. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10183. target.myImg.url = xGame.common.getGameIconUrl(str);
  10184. ;
  10185. }
  10186. updateMode() {
  10187. if (xGame.common.gameMode == GameMode.classic) {
  10188. this.ui.topNode.scoreNode.visible = false;
  10189. }
  10190. else if (xGame.common.gameMode == GameMode.bigMove) {
  10191. this.ui.topNode.scoreNode.visible = true;
  10192. }
  10193. }
  10194. show() {
  10195. super.show();
  10196. console.log("zh:uigame show AADD");
  10197. this.ui.alpha = 0;
  10198. this.updateSelf();
  10199. xGame.common.gameMgr.gamePause = false;
  10200. xGame.common.gameUI.ui.blackAni.visible = false;
  10201. xGame.common.gameUI.ui.whiteAni.visible = false;
  10202. this.ui.powerEft.visible = false;
  10203. this.ui.colorNode.visible = false;
  10204. this.updateHead();
  10205. let curUse = DataMgr.getCurBallRod();
  10206. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10207. this.getGanZiImg();
  10208. }
  10209. updateSelf() {
  10210. if (xGame.common.gameMode == GameMode.classic) {
  10211. this.ui.c1.selectedIndex = 0;
  10212. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10213. this.ui.topNode.middleNode.visible = true;
  10214. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10215. }
  10216. else if (xGame.common.gameMode == GameMode.bigMove) {
  10217. this.ui.c1.selectedIndex = 0;
  10218. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10219. this.ui.topNode.middleNode.visible = false;
  10220. let max = xGame.cfgMgr.getMaxBigMoveLength();
  10221. let rand = xGame.common.randomNum(1, max);
  10222. let guide = DataMgr.getSkillGuide();
  10223. if (guide == 0)
  10224. rand = 1;
  10225. xGame.common.bigMoveLevelIndex = rand;
  10226. }
  10227. else if (xGame.common.gameMode == GameMode.placeBall) {
  10228. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  10229. this.ui.c1.selectedIndex = 1 + data.type;
  10230. this.ui.alpha = 1;
  10231. this.startGame();
  10232. }
  10233. this.updateMode();
  10234. this.initD3world();
  10235. this.initD2world();
  10236. }
  10237. startGame() {
  10238. this.ui.snowNode.visible = Math.random() <= 0.1;
  10239. this.ui.d2Node.visible = false;
  10240. xGame.common.d3World.d3Hand.gameObj.active = false;
  10241. xGame.common.d3World.tableSrc.init();
  10242. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10243. this.cameraViewChange(() => {
  10244. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  10245. switch (xGame.common.gameMode) {
  10246. case GameMode.classic:
  10247. xGame.common.d3World.d3Hand.gameObj.active = true;
  10248. this.playPutBallD3Ani();
  10249. break;
  10250. case GameMode.bigMove:
  10251. this.enterGame();
  10252. Laya.timer.once(500, this, () => {
  10253. this.ui.topNode.middleNode.visible = true;
  10254. this.ui.topNode.middleNode.t0.play();
  10255. });
  10256. break;
  10257. case GameMode.placeBall:
  10258. this.enterGame();
  10259. break;
  10260. default:
  10261. break;
  10262. }
  10263. });
  10264. PlatMgr.showBanner(false);
  10265. }
  10266. enterGame() {
  10267. this.ui.d2Node.visible = true;
  10268. xGame.common.d3World.d3Hand.gameObj.active = false;
  10269. xGame.common.showOneCamera("mainCamera");
  10270. Moyu.recordGame(30, true);
  10271. if (!this.isPrePlay) {
  10272. this.isPrePlay = true;
  10273. xGame.common.d3World.prePlayEft();
  10274. }
  10275. xGame.common.gameMgr.gameReady();
  10276. this.openAllEvent();
  10277. this.ui.snowNode.visible = false;
  10278. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  10279. this.ui.helpBtn.visible = condition;
  10280. }
  10281. showHelpLineGuide() {
  10282. let longGuide = DataMgr.getGuideHelpLine();
  10283. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  10284. this.ui.helpBtn.visible = true;
  10285. this.ui.guideNode.visible = true;
  10286. }
  10287. }
  10288. setTurnAlpha(alpha) {
  10289. this.ui.keduNode.alpha = alpha;
  10290. this.ui.ganNode.alpha = alpha;
  10291. this.ui.rodMethodNode.alpha = alpha;
  10292. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  10293. }
  10294. cameraViewChange(callback) {
  10295. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10296. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  10297. xGame.common.showOneCamera("visitAngle");
  10298. cameraSrc.localRotationEulerY = 180;
  10299. cameraSrc.localRotationEulerZ = 0;
  10300. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  10301. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  10302. callback && callback();
  10303. }));
  10304. }));
  10305. }
  10306. playPutBallD3Ani() {
  10307. xGame.common.showOneCamera("mainCamera");
  10308. let handSrc = xGame.common.d3World.d3Hand;
  10309. handSrc.gameObj.active = true;
  10310. handSrc.transform.localPositionZ = 3;
  10311. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10312. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  10313. handSrc.gameObj.active = false;
  10314. this.enterGame();
  10315. }), 400);
  10316. }));
  10317. }
  10318. updateHead() {
  10319. let user = Moyu.getUserInfo();
  10320. this.ui.topNode.selfNameTxt.text = user.nickName;
  10321. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  10322. let aiData = xGame.cfgMgr.getRandomUserInfo();
  10323. if (DataMgr.getSkillGuide() < 1) {
  10324. this.ui.topNode.aiNameTxt.text = 'billiards';
  10325. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  10326. }
  10327. else {
  10328. this.ui.topNode.aiNameTxt.text = aiData.name;
  10329. let randNo = Math.floor(Math.random() * 10) + 1;
  10330. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  10331. }
  10332. }
  10333. initD2world() {
  10334. let node = this.ui.d2Root.displayObject;
  10335. let src = node.getComponent(D2World);
  10336. if (!src) {
  10337. xGame.common.d2World = node.addComponent(D2World);
  10338. }
  10339. xGame.common.d2World.initSelf();
  10340. }
  10341. initD3world() {
  10342. if (this.isD3Inited)
  10343. return;
  10344. this.isD3Inited = true;
  10345. let scene3D = xGame.common.d3Scene;
  10346. this.ui.d3Root.displayObject.addChild(scene3D);
  10347. scene3D.active = true;
  10348. xGame.common.d3World.tableSrc.setBorderPos();
  10349. }
  10350. onRootMove(e) {
  10351. let rootBall = xGame.common.d2World.rootBall;
  10352. this.ui.moveNode.x = e.x;
  10353. this.ui.moveNode.y = e.y;
  10354. rootBall.gameObj.x = e.x;
  10355. rootBall.gameObj.y = e.y;
  10356. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  10357. }
  10358. aiRootMove(move) {
  10359. if (move)
  10360. this.hideBallUI();
  10361. else {
  10362. this.showBallUI();
  10363. xGame.common.d2World.getHelpLine();
  10364. }
  10365. }
  10366. aiForce(type, force = 0) {
  10367. this.pressTarget = PressType.powerNode;
  10368. if (type == 1)
  10369. this.onEventUp({ force: true });
  10370. else if (type == 2)
  10371. this.onEventMove({ stageY: force, force: true });
  10372. }
  10373. onEventPress(e) {
  10374. if (e.stopPropagation)
  10375. e.stopPropagation();
  10376. if (!this.isTurnSelf())
  10377. return;
  10378. let target = e.target;
  10379. switch (target) {
  10380. case this.ui.myPowerNode.displayObject:
  10381. this.pressTarget = PressType.powerNode;
  10382. this.barInfo.curY = e.stageY;
  10383. this.updateBarInfo();
  10384. break;
  10385. case this.ui.moveNode.displayObject:
  10386. this.pressTarget = PressType.moveNode;
  10387. this.hideBallUI();
  10388. this.eventObj.curX = this.ui.moveNode.x;
  10389. this.eventObj.curY = this.ui.moveNode.y;
  10390. this.ui.moveNode.finger.visible = false;
  10391. this.eventObj.lastX = e.stageX;
  10392. this.eventObj.lastY = e.stageY;
  10393. break;
  10394. case this.ui.rulerClickNode.displayObject:
  10395. this.pressTarget = PressType.rulerNode;
  10396. this.eventObj.lastY = e.stageY;
  10397. break;
  10398. case this.ui.d2Root.displayObject:
  10399. this.pressTarget = PressType.d2Root;
  10400. this.eventObj.lastX = e.stageX;
  10401. this.eventObj.lastY = e.stageY;
  10402. this.eventObj.starX = e.stageX;
  10403. this.eventObj.starY = e.stageY;
  10404. this.eventObj.curX = 0;
  10405. this.eventObj.curY = 0;
  10406. xGame.common.d2World.d2Gan.setGanLastInfo();
  10407. this.rulerOffset = 0;
  10408. break;
  10409. default:
  10410. break;
  10411. }
  10412. }
  10413. onEventMove(e) {
  10414. if (e.stopPropagation)
  10415. e.stopPropagation();
  10416. if (e && e.force) {
  10417. }
  10418. else {
  10419. if (!this.isTurnSelf())
  10420. return;
  10421. }
  10422. switch (this.pressTarget) {
  10423. case PressType.powerNode:
  10424. this.barInfo.curY = e.stageY;
  10425. this.updateBarInfo();
  10426. this.isMoveRod = true;
  10427. break;
  10428. case PressType.moveNode:
  10429. let rootBall = xGame.common.d2World.rootBall;
  10430. let radius = rootBall.gameObj.width / 2;
  10431. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  10432. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  10433. let border = xGame.common.d2World.borderRect;
  10434. if (curX <= border.x + radius)
  10435. curX = border.x + radius;
  10436. else if (curX >= border.x + border.width - radius)
  10437. curX = border.x + border.width - radius;
  10438. if (curY <= border.y + radius)
  10439. curY = border.y + radius;
  10440. else if (curY >= border.y + border.height - radius)
  10441. curY = border.y + border.height - radius;
  10442. if (xGame.common.gameMgr.isOpenBall) {
  10443. if (curX >= border.x + border.openBallW - radius)
  10444. curX = border.x + border.openBallW - radius;
  10445. }
  10446. this.ui.moveNode.x = curX;
  10447. this.ui.moveNode.y = curY;
  10448. rootBall.gameObj.x = curX;
  10449. rootBall.gameObj.y = curY;
  10450. rootBall.d3BallSrc.setTransPos(curX, curY);
  10451. this.isMoveRod = true;
  10452. break;
  10453. case PressType.rulerNode:
  10454. let yy = e.stageY - this.eventObj.lastY;
  10455. this.eventObj.lastY = e.stageY;
  10456. let ruler1 = this.ui.rulerNode.img1;
  10457. let ruler2 = this.ui.rulerNode.img2;
  10458. ruler1.y += yy;
  10459. ruler2.y += yy;
  10460. this.rulerOffset += yy;
  10461. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  10462. this.rulerOffset = 0;
  10463. xGame.soundMgr.playSound("inch", 1, 10);
  10464. }
  10465. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  10466. let h = ruler1.height;
  10467. this.checkGuide();
  10468. this.isMoveRod = true;
  10469. if (ruler1.y >= h) {
  10470. ruler1.y = -h;
  10471. ruler2.y = 0;
  10472. return;
  10473. }
  10474. else if (ruler1.y <= -h) {
  10475. ruler1.y = h;
  10476. ruler2.y = 0;
  10477. return;
  10478. }
  10479. if (ruler2.y >= h) {
  10480. ruler2.y = -h;
  10481. ruler1.y = 0;
  10482. return;
  10483. }
  10484. else if (ruler2.y <= -h) {
  10485. ruler2.y = h;
  10486. ruler1.y = 0;
  10487. return;
  10488. }
  10489. break;
  10490. case PressType.d2Root:
  10491. this.eventObj.curX = e.stageX;
  10492. this.eventObj.curY = e.stageY;
  10493. let offset = this.checkRodMoveDir();
  10494. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10495. this.eventObj.lastX = e.stageX;
  10496. this.eventObj.lastY = e.stageY;
  10497. break;
  10498. default:
  10499. break;
  10500. }
  10501. }
  10502. onEventUp(e) {
  10503. if (e.stopPropagation)
  10504. e.stopPropagation();
  10505. if (e && e.force) {
  10506. }
  10507. else {
  10508. if (!this.isTurnSelf())
  10509. return;
  10510. }
  10511. switch (this.pressTarget) {
  10512. case PressType.powerNode:
  10513. this.ui.powerNode.value = 0;
  10514. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10515. this.ui.powerTxt.text = "";
  10516. if (this.powerNum > 0) {
  10517. xGame.eventMgr.event(BALL_SHOOT);
  10518. xGame.common.d2World.shoot(this.powerNum);
  10519. xGame.common.d2World.d2Gan.shoot();
  10520. xGame.common.d2World.d2HelpLine.shoot();
  10521. this.finishGuide();
  10522. this.ui.powerEft.visible = false;
  10523. this.ui.colorNode.visible = false;
  10524. let ganStr = "";
  10525. if (this.powerNum <= 30) {
  10526. ganStr = "gan_30";
  10527. }
  10528. else if (this.powerNum <= 60) {
  10529. ganStr = "gan_50";
  10530. }
  10531. else {
  10532. ganStr = "gan_80";
  10533. }
  10534. xGame.soundMgr.playSound(ganStr);
  10535. }
  10536. break;
  10537. case PressType.moveNode:
  10538. let rootBall = xGame.common.d2World.rootBall;
  10539. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10540. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10541. let isIntersect = this.judgeBallIntersect();
  10542. if (isIntersect) {
  10543. this.ui.moveNode.x = lastX;
  10544. this.ui.moveNode.y = lastY;
  10545. rootBall.gameObj.x = lastX;
  10546. rootBall.gameObj.y = lastY;
  10547. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10548. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10549. }
  10550. else {
  10551. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10552. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10553. }
  10554. this.showBallUI();
  10555. this.ui.moveNode.finger.visible = true;
  10556. xGame.common.d2World.getHelpLine();
  10557. break;
  10558. case PressType.rulerNode:
  10559. break;
  10560. case PressType.d2Root:
  10561. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10562. if (dis <= 25) {
  10563. this.moveToClickDot(e);
  10564. }
  10565. break;
  10566. default:
  10567. break;
  10568. }
  10569. this.pressTarget = -1;
  10570. }
  10571. checkGuide() {
  10572. let guide = DataMgr.getSkillGuide();
  10573. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10574. xGame.common.guideStep++;
  10575. xGame.common.gameUI.ui.guide2.visible = false;
  10576. xGame.common.gameUI.ui.guide3.visible = true;
  10577. }
  10578. }
  10579. finishGuide() {
  10580. let guide = DataMgr.getSkillGuide();
  10581. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10582. xGame.common.guideStep = 10;
  10583. this.closeAllGuide();
  10584. console.log('zh: 新手引导完毕');
  10585. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  10586. }
  10587. }
  10588. closeAllGuide() {
  10589. xGame.common.gameUI.ui.guide1.visible = false;
  10590. xGame.common.gameUI.ui.guide2.visible = false;
  10591. xGame.common.gameUI.ui.guide3.visible = false;
  10592. }
  10593. updateBarInfo() {
  10594. let star = this.ui.powerNode.y;
  10595. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10596. if (rate >= 1)
  10597. rate = 1;
  10598. if (rate <= 0)
  10599. rate = 0;
  10600. this.powerNum = Math.ceil(rate * 100);
  10601. this.ui.powerNode.value = this.powerNum;
  10602. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10603. this.ui.colorNode.value = this.powerNum;
  10604. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10605. this.ui.powerEft.visible = this.powerNum != 0;
  10606. this.ui.colorNode.visible = this.powerNum != 0;
  10607. this.ui.powerTxt.text = this.powerNum + "";
  10608. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10609. }
  10610. forceCancel() {
  10611. this.ui.powerNode.value = 0;
  10612. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10613. this.ui.powerTxt.text = "";
  10614. }
  10615. checkRodMoveDir() {
  10616. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10617. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10618. if (tempX >= 0 && tempY <= 0) {
  10619. return this.checkDir();
  10620. }
  10621. else if (tempX < 0 && tempY < 0) {
  10622. return this.checkDir(1, -1);
  10623. }
  10624. else if (tempX < 0 && tempY > 0) {
  10625. return this.checkDir(-1, -1);
  10626. }
  10627. else {
  10628. return this.checkDir(-1, 1);
  10629. }
  10630. }
  10631. checkDir(flagX = 1, flagY = 1) {
  10632. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10633. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10634. if (offsetY == 0) {
  10635. return offsetX * flagX;
  10636. }
  10637. if (offsetX == 0) {
  10638. return offsetY * flagY;
  10639. }
  10640. let angle = offsetY / offsetX;
  10641. if (Math.abs(angle) >= 1) {
  10642. return offsetY * flagY;
  10643. }
  10644. else {
  10645. return offsetX * flagX;
  10646. }
  10647. }
  10648. judgeBallIntersect() {
  10649. let rootBall = xGame.common.d2World.rootBall;
  10650. let ballArr = xGame.common.d2World.ballArr;
  10651. let radius = rootBall.gameObj.width / 2;
  10652. let temp;
  10653. let isIntersect = false;
  10654. for (let index = 0; index < ballArr.length; index++) {
  10655. temp = ballArr[index];
  10656. if (temp.number == rootBall.number)
  10657. continue;
  10658. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10659. if (isIntersect) {
  10660. break;
  10661. }
  10662. }
  10663. return isIntersect;
  10664. }
  10665. hideBallUI() {
  10666. let d2Gan = xGame.common.d2World.d2Gan;
  10667. if (!d2Gan.ui.isDisposed)
  10668. d2Gan.ui.visible = false;
  10669. let d2Help = xGame.common.d2World.d2HelpLine;
  10670. if (!d2Help.ui.isDisposed)
  10671. d2Help.ui.visible = false;
  10672. let rootBall = xGame.common.d2World.rootBall;
  10673. if (!rootBall.destroyed) {
  10674. rootBall.gameObj.active = false;
  10675. }
  10676. }
  10677. showBallUI() {
  10678. let d2Gan = xGame.common.d2World.d2Gan;
  10679. if (!d2Gan.ui.isDisposed)
  10680. d2Gan.ui.visible = true;
  10681. let d2Help = xGame.common.d2World.d2HelpLine;
  10682. if (!d2Help.ui.isDisposed)
  10683. d2Help.ui.visible = true;
  10684. let rootBall = xGame.common.d2World.rootBall;
  10685. if (!rootBall.destroyed) {
  10686. rootBall.gameObj.active = true;
  10687. }
  10688. }
  10689. moveToClickDot(e) {
  10690. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10691. let root = xGame.common.d2World.rootBall.gameObj;
  10692. let xx = e.stageX - xGame.common.sysOffestNum;
  10693. let yy = e.stageY;
  10694. let x = xx - root.x;
  10695. let y = yy - root.y;
  10696. let angle = xGame.common.getfguiRotation(x, y);
  10697. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10698. xGame.common.d2World.getHelpLine();
  10699. }
  10700. this.isMoveRod = false;
  10701. xGame.common.clickedBall = false;
  10702. }
  10703. openAllEvent() {
  10704. this.closeAllEvent();
  10705. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10706. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10707. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10708. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10709. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10710. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10711. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10712. }
  10713. closeAllEvent() {
  10714. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10715. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10716. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10717. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10718. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10719. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10720. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10721. }
  10722. resetGame() {
  10723. this.closeAllEvent();
  10724. this.hideBallUI();
  10725. xGame.common.gameMgr.gamePause = true;
  10726. }
  10727. }
  10728. UIGame.uiName = "UIGame";
  10729. class UIAddProp extends UIBase {
  10730. constructor() {
  10731. super();
  10732. this.curType = "";
  10733. }
  10734. onConstructor() {
  10735. this.ui = ui_UIAddProp.createInstance();
  10736. this.contentPane = this.ui;
  10737. this.isEject = false;
  10738. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10739. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10740. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10741. this.updateUI();
  10742. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10743. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10744. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10745. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10746. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10747. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10748. }
  10749. show(type) {
  10750. super.show();
  10751. this.curType = type == 0 ? "coin" : "diamond";
  10752. this.switchBtn("");
  10753. this.ui.t0.play();
  10754. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10755. PlatMgr.showInsert(true);
  10756. }
  10757. closeSelf() {
  10758. this.hide();
  10759. }
  10760. updateUI() {
  10761. let data = cfgTable.moneyData;
  10762. let temp;
  10763. let obj;
  10764. for (const key in data) {
  10765. temp = data[key];
  10766. obj = this.ui.myNode["node" + key];
  10767. if (parseInt(key) <= 2) {
  10768. obj.diamondTxt.text = "+" + temp.num;
  10769. }
  10770. else {
  10771. obj.coinTxt.text = temp.num;
  10772. obj.diamondTxt.text = temp.get.split('_')[1];
  10773. }
  10774. }
  10775. this.updateDiamondShare();
  10776. }
  10777. updateDiamondShare() {
  10778. let data = DataMgr.getShareDiamondTimes();
  10779. if (data >= xGame.common.maxShareDiamondTimes) {
  10780. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10781. this.ui.myNode.node1.touchable = false;
  10782. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10783. }
  10784. else {
  10785. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10786. this.ui.myNode.node1.touchable = true;
  10787. }
  10788. }
  10789. switchBtn(type) {
  10790. if (type == "")
  10791. type = this.curType;
  10792. else {
  10793. if (this.curType == type) {
  10794. return;
  10795. }
  10796. else {
  10797. this.curType = type;
  10798. }
  10799. }
  10800. if (type == "coin") {
  10801. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10802. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10803. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10804. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10805. this.ui.myNode.c1.selectedIndex = 0;
  10806. }
  10807. else {
  10808. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10809. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10810. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10811. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10812. this.ui.myNode.c1.selectedIndex = 1;
  10813. }
  10814. }
  10815. convertCoin(index) {
  10816. let data = cfgTable.moneyData[index];
  10817. let coinNum = data.num;
  10818. let str = data.get.split('_')[1];
  10819. let needDiamond = parseInt(str);
  10820. if (DataMgr.diamondEnough(needDiamond)) {
  10821. DataMgr.setDiamond(-needDiamond);
  10822. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10823. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10824. }
  10825. else {
  10826. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10827. this.switchBtn("diamond");
  10828. }
  10829. }
  10830. videoGetDiamond() {
  10831. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10832. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10833. }
  10834. else {
  10835. console.log('zh:AD 失败,直接发放奖励');
  10836. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10837. }
  10838. }
  10839. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10840. let num = cfgTable.moneyData[2].num;
  10841. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10842. this.closeSelf();
  10843. }
  10844. videoGetCoin() {
  10845. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10846. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10847. }
  10848. else {
  10849. console.log('zh:AD 失败,直接发放奖励');
  10850. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10851. }
  10852. }
  10853. qjff_AD_for_uiAddProp_videoGetCoin() {
  10854. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10855. this.closeSelf();
  10856. }
  10857. shareGetDiamond() {
  10858. let times = DataMgr.getShareDiamondTimes();
  10859. if (times >= xGame.common.maxShareDiamondTimes) {
  10860. console.log('zh: 233333333333 maxShareDiamondTimes');
  10861. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10862. }
  10863. else {
  10864. console.log('zh:33333333333333ad');
  10865. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  10866. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  10867. }
  10868. else {
  10869. console.log('zh:AD 失败,直接发放奖励');
  10870. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  10871. }
  10872. }
  10873. }
  10874. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10875. let diamond = xGame.common.randomNum(50, 100);
  10876. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10877. DataMgr.setShareDiamondTimes(1);
  10878. this.updateDiamondShare();
  10879. }
  10880. openPutBallView() {
  10881. let end = xGame.uiMgr.getUI(UIGameEnd);
  10882. let skill = xGame.uiMgr.getUI(UISkill);
  10883. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10884. let uigame = xGame.uiMgr.getUI(UIGame);
  10885. if (end && !end.isHide) {
  10886. xGame.uiMgr.Hide(UIGameEnd);
  10887. xGame.uiMgr.Show(UIMain);
  10888. }
  10889. if (skill && !skill.isHide)
  10890. xGame.uiMgr.Hide(UISkill);
  10891. if (uigame && !uigame.isHide)
  10892. xGame.uiMgr.Hide(UIGame);
  10893. if (level && !level.isHide) {
  10894. }
  10895. else {
  10896. xGame.uiMgr.Show(UILevelDisplay);
  10897. }
  10898. this.closeSelf();
  10899. }
  10900. }
  10901. UIAddProp.uiName = "UIAddProp";
  10902. class MoneyNode {
  10903. constructor(ui) {
  10904. this.leftTime = 0;
  10905. this.ui = ui;
  10906. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10907. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10908. this.ui.addPowerBtn.onClick(this, this.addPower);
  10909. this.ui.c1.selectedIndex = 1;
  10910. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10911. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10912. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10913. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10914. this.coinChange();
  10915. this.diamondChange();
  10916. this.powerChange();
  10917. }
  10918. addPower() {
  10919. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10920. xGame.uiMgr.Show(UIPower);
  10921. }
  10922. powerChange() {
  10923. let powerNum = DataMgr.getPower();
  10924. this.ui.powerTxt.text = powerNum + "";
  10925. }
  10926. checkPowerTime() {
  10927. let cur = new Date().getTime();
  10928. let last = DataMgr.getPowerTime();
  10929. if (last == 0) {
  10930. last = cur;
  10931. DataMgr.setPowerTime(cur);
  10932. }
  10933. let power = DataMgr.getPower();
  10934. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10935. Laya.timer.clearAll(this);
  10936. if (power >= xGame.common.natureMaxPower) {
  10937. this.ui.powerTimeTxt.text = "";
  10938. DataMgr.setPowerTime(cur);
  10939. return;
  10940. }
  10941. if (power + offset >= xGame.common.natureMaxPower) {
  10942. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10943. this.ui.powerTimeTxt.text = "";
  10944. DataMgr.setPowerTime(cur);
  10945. }
  10946. else {
  10947. if (offset > 0) {
  10948. DataMgr.setPower(offset);
  10949. DataMgr.setPowerTime(cur);
  10950. }
  10951. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10952. this.leftTime = xGame.common.powerRecoverNum - time;
  10953. if (this.leftTime <= 0)
  10954. this.leftTime = 0;
  10955. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10956. Laya.timer.loop(1000, this, this.updatePowerTime);
  10957. }
  10958. }
  10959. updatePowerTime() {
  10960. this.leftTime -= 1;
  10961. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10962. if (this.leftTime <= 0) {
  10963. this.checkPowerTime();
  10964. }
  10965. }
  10966. coinChange() {
  10967. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10968. }
  10969. diamondChange() {
  10970. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10971. }
  10972. addCoin() {
  10973. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10974. Moyu.sendDataEvent("AddCoinBtn");
  10975. xGame.uiMgr.Show(UIAddProp, 0);
  10976. }
  10977. addDiamond() {
  10978. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10979. Moyu.sendDataEvent("AddDiamondBtn");
  10980. xGame.uiMgr.Show(UIAddProp, 1);
  10981. }
  10982. }
  10983. class UIDraw extends UIBase {
  10984. constructor() {
  10985. super();
  10986. this.curKey = 0;
  10987. }
  10988. onConstructor() {
  10989. this.ui = ui_UIDraw.createInstance();
  10990. this.contentPane = this.ui;
  10991. this.isEject = false;
  10992. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10993. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10994. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10995. this.initDraw();
  10996. this.initUI();
  10997. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10998. if (Moyu.isKs)
  10999. this.ui.closeNode.closeBtn.x += 100;
  11000. }
  11001. show() {
  11002. super.show();
  11003. this.ui.t0.play();
  11004. this.playSecretaryIdle();
  11005. this.updateDraw();
  11006. this.checkFree();
  11007. if (PlatMgr.bannerDelay > 0) {
  11008. this.ui.closeNode.closeBtn.visible = false;
  11009. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11010. this.ui.closeNode.closeBtn.visible = true;
  11011. });
  11012. }
  11013. PlatMgr.showRateBanner();
  11014. }
  11015. hide() {
  11016. Laya.timer.clearAll(this);
  11017. super.hide();
  11018. }
  11019. checkFree() {
  11020. let isFree = DataMgr.getDailyfreeDrawTimes();
  11021. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11022. }
  11023. initDraw() {
  11024. this.drawObj = [];
  11025. let data = cfgTable.drawData;
  11026. let temp;
  11027. let weight = 0;
  11028. for (const key in data) {
  11029. temp = data[key];
  11030. weight += temp.weight;
  11031. this.drawObj.push(weight);
  11032. }
  11033. this.allWeight = weight;
  11034. }
  11035. initUI() {
  11036. let data = cfgTable.drawData;
  11037. let temp;
  11038. let img;
  11039. let txt;
  11040. for (const key in data) {
  11041. temp = data[key];
  11042. img = this.ui.myNode.rotNode["img" + key];
  11043. txt = this.ui.myNode.rotNode["txt" + key];
  11044. img.url = xGame.common.getGameIconUrl(temp.icon);
  11045. txt.visible = true;
  11046. if (temp.award > 2) {
  11047. img.rotation = 0;
  11048. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11049. }
  11050. else {
  11051. img.rotation = temp.rotation;
  11052. txt.text = temp.num;
  11053. }
  11054. }
  11055. }
  11056. getCurkey() {
  11057. let rand = Math.random() * this.allWeight;
  11058. let temp;
  11059. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11060. temp = this.drawObj[index];
  11061. if (index == 0) {
  11062. if (rand < temp) {
  11063. return index + 1;
  11064. }
  11065. }
  11066. else {
  11067. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11068. return index + 1;
  11069. }
  11070. }
  11071. }
  11072. return 2;
  11073. }
  11074. startDraw() {
  11075. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11076. if (freeTimes > 0) {
  11077. this.beginDraw();
  11078. DataMgr.setDailyfreeDrawTimes(0);
  11079. this.checkFree();
  11080. }
  11081. else {
  11082. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11083. }
  11084. else {
  11085. console.log('zh:AD 失败,直接发放奖励');
  11086. this.qjff_chouJiang();
  11087. }
  11088. }
  11089. }
  11090. qjff_chouJiang() {
  11091. this.beginDraw();
  11092. }
  11093. beginDraw() {
  11094. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11095. this.ui.drawBtn.touchable = false;
  11096. this.curKey = this.getCurkey();
  11097. console.log("当前key", this.curKey);
  11098. let cell = 60;
  11099. let lap = 3;
  11100. let angle = cell * (this.curKey - 1) + lap * 360;
  11101. let target = this.ui.myNode.rotNode;
  11102. target.rotation = 0;
  11103. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11104. console.log("旋转完成");
  11105. this.ui.drawBtn.touchable = true;
  11106. this.getAward();
  11107. }));
  11108. }
  11109. getAward() {
  11110. let data = cfgTable.drawData[this.curKey];
  11111. let temp = new AwardType();
  11112. temp.type = data.award;
  11113. temp.num = data.num;
  11114. xGame.common.getAward([temp], () => {
  11115. DataMgr.setDrawTimes(1);
  11116. this.updateDraw();
  11117. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11118. });
  11119. }
  11120. updateDraw() {
  11121. let drawTimes = DataMgr.getDrawTimes();
  11122. let awardTimes = DataMgr.getDrawAwardTimes();
  11123. if (Math.floor(drawTimes / 3) > awardTimes) {
  11124. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11125. this.ui.extraNode.boxBtn.touchable = true;
  11126. this.ui.extraNode.tipsTxt.text = "3/3";
  11127. this.ui.extraNode.barNode.width = 265;
  11128. this.getExtraAward();
  11129. }
  11130. else {
  11131. this.ui.extraNode.boxBtn.t0.stop();
  11132. this.ui.extraNode.boxBtn.touchable = false;
  11133. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11134. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11135. }
  11136. let data = cfgTable.drawData[1];
  11137. if (awardTimes == 0) {
  11138. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11139. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11140. this.ui.myNode.rotNode.img1.rotation = 0;
  11141. }
  11142. else {
  11143. let award = data.nextid;
  11144. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11145. this.ui.myNode.rotNode.txt1.text = award[1];
  11146. this.ui.myNode.rotNode.img1.rotation = 0;
  11147. }
  11148. }
  11149. getExtraAward() {
  11150. let drawTimes = DataMgr.getDrawTimes();
  11151. let awardTimes = DataMgr.getDrawAwardTimes();
  11152. let data = cfgTable.drawData[1];
  11153. let award = new AwardType();
  11154. if (awardTimes == 0) {
  11155. award.num = data.num;
  11156. award.type = data.award;
  11157. xGame.common.getAward([award], () => {
  11158. let all = Math.floor(drawTimes / 3);
  11159. DataMgr.setDrawAwardTimes(all);
  11160. this.updateDraw();
  11161. });
  11162. }
  11163. else {
  11164. award.num = parseInt(data.nextid[1]);
  11165. award.type = parseInt(data.nextid[0]);
  11166. xGame.common.getAward([award], () => {
  11167. let all = Math.floor(drawTimes / 3);
  11168. DataMgr.setDrawAwardTimes(all);
  11169. this.updateDraw();
  11170. });
  11171. }
  11172. }
  11173. closeSelf() {
  11174. this.hide();
  11175. }
  11176. playSecretaryIdle() {
  11177. let parent = this.ui.secretary.displayObject;
  11178. parent.destroyChildren();
  11179. let xx = this.ui.secretary.width / 2;
  11180. let yy = this.ui.secretary.height;
  11181. let scale = xGame.common.getSecretaryScale();
  11182. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11183. xGame.common.secretary.play(data, 0, true, parent);
  11184. }
  11185. }
  11186. UIDraw.uiName = "UIDraw";
  11187. class ui_UIFlyEft extends fgui.GComponent {
  11188. static createInstance() {
  11189. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11190. }
  11191. onConstruct() {
  11192. this.n0 = (this.getChild("n0"));
  11193. this.n1 = (this.getChild("n1"));
  11194. this.n2 = (this.getChild("n2"));
  11195. this.n3 = (this.getChild("n3"));
  11196. this.n4 = (this.getChild("n4"));
  11197. this.n5 = (this.getChild("n5"));
  11198. this.n6 = (this.getChild("n6"));
  11199. this.n7 = (this.getChild("n7"));
  11200. this.iconNode = (this.getChild("iconNode"));
  11201. this.txt = (this.getChild("txt"));
  11202. this.txtNode = (this.getChild("txtNode"));
  11203. }
  11204. }
  11205. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  11206. class UIFlyEft extends UIBase {
  11207. constructor() {
  11208. super();
  11209. this.max = 8;
  11210. this.delay = 0;
  11211. }
  11212. onConstructor() {
  11213. this.ui = ui_UIFlyEft.createInstance();
  11214. this.contentPane = this.ui;
  11215. this.isEject = false;
  11216. this.isMuti = true;
  11217. this.ui.x += xGame.common.sysOffestNum;
  11218. }
  11219. getArrPos() {
  11220. if (this.iconPos && this.iconPos.length > 0)
  11221. return;
  11222. this.iconPos = [];
  11223. let temp;
  11224. for (let index = 0; index < this.max; index++) {
  11225. temp = this.ui["n" + index];
  11226. this.iconPos.push([temp.x, temp.y]);
  11227. }
  11228. }
  11229. show(stPos, edPos, num, type, callback) {
  11230. super.show();
  11231. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  11232. this.getArrPos();
  11233. this.updateUI(type);
  11234. this.updatePos();
  11235. this.runFly(edPos, callback);
  11236. this.runWorlds(stPos, num);
  11237. }
  11238. updateUI(type) {
  11239. let temp;
  11240. let str;
  11241. for (let index = 0; index < this.max; index++) {
  11242. temp = this.ui["n" + index];
  11243. str = this.getIconStr(type);
  11244. temp.url = xGame.common.getGameIconUrl(str);
  11245. }
  11246. }
  11247. getIconStr(type) {
  11248. switch (type) {
  11249. case Prop.diamond:
  11250. return "ty_zs";
  11251. case Prop.coin:
  11252. return "ty_jb";
  11253. default:
  11254. break;
  11255. }
  11256. }
  11257. updatePos() {
  11258. let temp;
  11259. for (let index = 0; index < this.max; index++) {
  11260. temp = this.ui["n" + index];
  11261. temp.x = this.iconPos[index][0];
  11262. temp.y = this.iconPos[index][1];
  11263. }
  11264. }
  11265. runFly(endPos, callback) {
  11266. let all = 0;
  11267. let temp;
  11268. for (let index = 0; index < this.max; index++) {
  11269. temp = this.ui["n" + index];
  11270. temp.visible = true;
  11271. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  11272. temp.visible = false;
  11273. all++;
  11274. if (all >= this.max) {
  11275. callback && callback();
  11276. }
  11277. }), 20 * index);
  11278. }
  11279. }
  11280. runWorlds(stPos, num) {
  11281. let str = "+" + num;
  11282. this.ui.txt.text = str;
  11283. let starX = stPos.x;
  11284. let starY = stPos.y + 50;
  11285. this.ui.txt.x = starX;
  11286. this.ui.txt.y = starY;
  11287. this.ui.txt.visible = true;
  11288. this.ui.txt.alpha = 1;
  11289. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  11290. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  11291. this.ui.txt.visible = false;
  11292. this.hide();
  11293. }));
  11294. }));
  11295. }
  11296. }
  11297. UIFlyEft.uiName = "UIFlyEft";
  11298. class Common {
  11299. constructor() {
  11300. this.convertNum = 0.025;
  11301. this.VectorUp = new Laya.Vector3(0, 1, 0);
  11302. this.scaleV3One = new Laya.Vector3();
  11303. this.scaleV3Two = new Laya.Vector3();
  11304. this.posV4 = new Laya.Vector4();
  11305. this.showDebug = false;
  11306. this.openGuide = true;
  11307. this.rodOffest = new Laya.Vector2(0, 0);
  11308. this.rodAngle = 0;
  11309. this.gameMode = GameMode.classic;
  11310. this.bigMoveLevelIndex = 1;
  11311. this.bigMoveNeedCoin = 1000;
  11312. this.classicNiceNeddCoin = 1000;
  11313. this.passAwardCoin = 2000;
  11314. this.classicRoomType = 1;
  11315. this.maxPower = 20;
  11316. this.natureMaxPower = 5;
  11317. this.videoPower = 2;
  11318. this.powerRecoverNum = 900;
  11319. this.curPlayerSkillType = 0;
  11320. this.isNewDay = false;
  11321. this.clickedBall = false;
  11322. this.placeBallCurLevel = 0;
  11323. this.placeBallStarNum = 0;
  11324. this.longHelpLine = false;
  11325. this.maxShareDiamondTimes = 3;
  11326. this.guideStep = 0;
  11327. this.temSelfLevel = 0;
  11328. this.extraMoveNum = 0;
  11329. this.curRankID = 0;
  11330. this.rankID = {
  11331. normalStar: 12000,
  11332. wxStar: 12001
  11333. };
  11334. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  11335. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  11336. this.btnClickStr = "buttonclick";
  11337. this.maxSkillLevel = 10;
  11338. this.upSkillLevel = false;
  11339. this.gameStartTime = 0;
  11340. this._sysOffestNum = 0;
  11341. this.angleV2 = new Laya.Vector2();
  11342. this.rootV = new Laya.Vector2(0, 1);
  11343. this.tempDir1 = new Laya.Vector2();
  11344. this.tempDir2 = new Laya.Vector2();
  11345. this.ballSize = 33;
  11346. this.stPos = new Laya.Point();
  11347. this.edPos = new Laya.Point();
  11348. Common._instance = this;
  11349. window["common"] = this;
  11350. }
  11351. static getInstance() {
  11352. if (!this._instance) {
  11353. this._instance = new Common();
  11354. }
  11355. return this._instance;
  11356. }
  11357. get sysOffestNum() {
  11358. if (this._sysOffestNum == 0) {
  11359. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  11360. }
  11361. return this._sysOffestNum;
  11362. }
  11363. testShader() {
  11364. let test = new LightShader();
  11365. test.texture = "res/d3Res/ballTexture/ball1.png";
  11366. Laya.stage.addChild(test);
  11367. }
  11368. playScale(node) {
  11369. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  11370. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  11371. }));
  11372. }));
  11373. }
  11374. setGroup(colli, ...group) {
  11375. let out = 0;
  11376. for (let index = 0; index < group.length; index++) {
  11377. if (index == 0) {
  11378. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11379. }
  11380. else {
  11381. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11382. }
  11383. }
  11384. colli.collisionGroup = out;
  11385. }
  11386. setCanGroupWith(colli, ...group) {
  11387. let out = 0;
  11388. for (let index = 0; index < group.length; index++) {
  11389. if (index == 0) {
  11390. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11391. }
  11392. else {
  11393. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11394. }
  11395. }
  11396. colli.canCollideWith = out;
  11397. }
  11398. loadPrefab(name, callback) {
  11399. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  11400. let prefab = new Laya.Prefab();
  11401. prefab.json = obj;
  11402. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  11403. callback && callback(img);
  11404. }));
  11405. }
  11406. pos2to3Convert(x, y, d3Pos) {
  11407. x = x + this.sysOffestNum;
  11408. d3Pos.setValue(x, y, 0);
  11409. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  11410. if (success) {
  11411. }
  11412. else {
  11413. console.error("转换出错了。。。。。。。。");
  11414. }
  11415. }
  11416. scale2to3Convert(num) {
  11417. this.scaleV3One.setValue(0, 0, 0);
  11418. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  11419. this.scaleV3Two.setValue(0, num, 0);
  11420. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  11421. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  11422. return outNum;
  11423. }
  11424. pos3to2Convert(d3Pos) {
  11425. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  11426. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  11427. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  11428. d3Pos.x -= this.sysOffestNum;
  11429. }
  11430. scale3to2Convert(num) {
  11431. let scale = this.scale2to3Convert(1);
  11432. let d2Out = num / scale;
  11433. return d2Out;
  11434. }
  11435. getCollider(type, restitution = 0.9, density = 10) {
  11436. let colli;
  11437. if (type == "box")
  11438. colli = new Laya.BoxCollider();
  11439. else
  11440. colli = new Laya.CircleCollider();
  11441. colli.friction = 0;
  11442. colli.restitution = restitution;
  11443. colli.density = density;
  11444. return colli;
  11445. }
  11446. getRigbody() {
  11447. let rigy = new Laya.RigidBody();
  11448. rigy.bullet = true;
  11449. rigy.allowRotation = false;
  11450. rigy.allowSleep = false;
  11451. rigy.gravityScale = 0;
  11452. return rigy;
  11453. }
  11454. getfguiRotation(x, y) {
  11455. this.angleV2.setValue(x, y);
  11456. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11457. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11458. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  11459. angle = -angle;
  11460. }
  11461. return 180 + angle;
  11462. }
  11463. getAngle(x, y) {
  11464. this.angleV2.setValue(x, y);
  11465. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11466. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11467. return angle;
  11468. }
  11469. randomNum(a, b) {
  11470. return a + Math.floor((b - a + 1) * Math.random());
  11471. }
  11472. getRandArrEle(arr) {
  11473. return arr[Math.floor(arr.length * Math.random())];
  11474. }
  11475. getSign(val) {
  11476. return val >= 0 ? 1 : -1;
  11477. }
  11478. botherArr(arr) {
  11479. let times = arr.length + 2;
  11480. let length = arr.length;
  11481. let a;
  11482. let b;
  11483. let temp;
  11484. for (let index = 0; index < times; index++) {
  11485. a = Math.floor(Math.random() * length);
  11486. b = Math.floor(Math.random() * length);
  11487. temp = arr[a];
  11488. arr[a] = arr[b];
  11489. arr[b] = temp;
  11490. }
  11491. }
  11492. getGameIconUrl(id) {
  11493. return "ui://game/" + id;
  11494. }
  11495. getComponentUrl(id) {
  11496. return "ui://game/" + id;
  11497. }
  11498. getAnimation() {
  11499. }
  11500. judgeSkillType(type = SkillType.highSpace) {
  11501. if (this.gameMode == GameMode.classic)
  11502. return;
  11503. let gameMgr = this.gameMgr;
  11504. if (gameMgr.selfTurn) {
  11505. if (gameMgr.selfCurSkill == type) {
  11506. return true;
  11507. }
  11508. }
  11509. else {
  11510. if (gameMgr.aiCurSkill == type) {
  11511. return true;
  11512. }
  11513. }
  11514. }
  11515. ballColliHole(collider) {
  11516. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11517. xGame.common.gameMgr.isFirstInGame = false;
  11518. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11519. }
  11520. collider.owner.mySrc.checkWrongBall();
  11521. }
  11522. getArrMaxEle(arr) {
  11523. let max = -Infinity;
  11524. for (let index = 0; index < arr.length; index++) {
  11525. max = Math.max(arr[index], max);
  11526. }
  11527. return max;
  11528. }
  11529. getArrMinEle(arr) {
  11530. let min = Infinity;
  11531. for (let index = 0; index < arr.length; index++) {
  11532. min = Math.min(arr[index], min);
  11533. }
  11534. return min;
  11535. }
  11536. playRandomMutiBallBigSkillSound() {
  11537. if (Math.random() <= 0.5)
  11538. return;
  11539. let rand = this.randomNum(1, 6);
  11540. let str = "ganfa0" + rand;
  11541. xGame.soundMgr.playSound(str);
  11542. }
  11543. showOneCamera(type) {
  11544. let object = xGame.common.d3World.cameraObj;
  11545. for (const key in object) {
  11546. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11547. object[key].init();
  11548. object[key].owner.active = key == type;
  11549. }
  11550. }
  11551. }
  11552. checkBallOverBorder(x, y) {
  11553. let radius = 17;
  11554. let condition = this._checkBorder(x + radius, y) ||
  11555. this._checkBorder(x - radius, y) ||
  11556. this._checkBorder(x, y + radius) ||
  11557. this._checkBorder(x, y - radius);
  11558. if (condition) {
  11559. return true;
  11560. }
  11561. }
  11562. _checkBorder(x, y) {
  11563. let borderRect = this.d2World.borderRect;
  11564. let xOffest = 20;
  11565. let yOffest = 20;
  11566. if (y <= borderRect.y - yOffest) {
  11567. return true;
  11568. }
  11569. if (y >= borderRect.y + borderRect.height + yOffest) {
  11570. return true;
  11571. }
  11572. if (x <= borderRect.x - xOffest) {
  11573. return true;
  11574. }
  11575. if (x >= borderRect.x + borderRect.width + xOffest) {
  11576. return true;
  11577. }
  11578. }
  11579. initWeight(cfg) {
  11580. let allCfgData = { data: {}, allWeightNum: 0 };
  11581. let weightCfg = allCfgData.data;
  11582. let weight = 0;
  11583. for (const key in cfg) {
  11584. weightCfg[key] = {};
  11585. weightCfg[key].id = cfg[key].id;
  11586. weightCfg[key].minWeight = weight;
  11587. weight += cfg[key].weight;
  11588. weightCfg[key].maxWeight = weight;
  11589. }
  11590. allCfgData.allWeightNum = weight;
  11591. return allCfgData;
  11592. }
  11593. getRandomWeightData(cfg) {
  11594. let weightCfg = cfg.data;
  11595. let allWeightNum = cfg.allWeightNum;
  11596. let rand = Math.floor(Math.random() * allWeightNum);
  11597. for (const key in weightCfg) {
  11598. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11599. return weightCfg[key];
  11600. }
  11601. }
  11602. return weightCfg[1];
  11603. }
  11604. showGirlTalkPop(wordsIndex, node, msgNode) {
  11605. node.visible = true;
  11606. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11607. node.t0.play(Laya.Handler.create(this, () => {
  11608. node.visible = false;
  11609. }));
  11610. }
  11611. stopGirlPop(node) {
  11612. node.t0.stop();
  11613. node.visible = false;
  11614. }
  11615. createHead(loader, url, size = 107) {
  11616. if (Laya.Browser.name == "Browser") {
  11617. loader.url = url;
  11618. return;
  11619. }
  11620. else {
  11621. console.log('zh:url=', url);
  11622. loader.url = url;
  11623. }
  11624. }
  11625. addTestCoin(num) {
  11626. DataMgr.setCoin(num);
  11627. }
  11628. addTestDiamond(num) {
  11629. DataMgr.setDiamond(num);
  11630. }
  11631. addTestSkill() {
  11632. DataMgr.setBigSkill(0, 99);
  11633. DataMgr.setBigSkill(1, 99);
  11634. DataMgr.setBigSkill(2, 99);
  11635. }
  11636. playClassicEmotion(number, x, y) {
  11637. if (this.gameMode == GameMode.bigMove)
  11638. return;
  11639. let randIndex = this.randomNum(0, 2);
  11640. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11641. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11642. if (this.gameMgr.selfTurn) {
  11643. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11644. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11645. }
  11646. else {
  11647. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11648. }
  11649. else {
  11650. if (number == this.gameMgr.blackNum) {
  11651. if (this.gameMgr.selfBallArr.length == 0) {
  11652. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11653. }
  11654. else {
  11655. }
  11656. }
  11657. else {
  11658. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11659. }
  11660. }
  11661. }
  11662. }
  11663. else {
  11664. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11665. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11666. }
  11667. else {
  11668. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11669. }
  11670. else {
  11671. if (number == this.gameMgr.blackNum) {
  11672. if (this.gameMgr.aiBallArr.length == 0) {
  11673. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11674. }
  11675. else {
  11676. }
  11677. }
  11678. else {
  11679. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11680. }
  11681. }
  11682. }
  11683. }
  11684. }
  11685. playHappySound(number) {
  11686. if (this.gameMode != GameMode.classic)
  11687. return;
  11688. if (number == 8)
  11689. return;
  11690. let play = false;
  11691. if (this.gameMgr.selfTurn) {
  11692. if (this.gameMgr.ensureBallType) {
  11693. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11694. play = true;
  11695. }
  11696. }
  11697. else {
  11698. play = true;
  11699. }
  11700. }
  11701. else {
  11702. if (this.gameMgr.ensureBallType) {
  11703. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11704. play = true;
  11705. }
  11706. }
  11707. else {
  11708. play = true;
  11709. }
  11710. }
  11711. if (play)
  11712. xGame.soundMgr.playSound("applause");
  11713. }
  11714. destroyClassicEmotion() {
  11715. if (this.gameMode == GameMode.bigMove)
  11716. return;
  11717. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11718. parent.destroyChildren();
  11719. }
  11720. playAwardSpine(x, y) {
  11721. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11722. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11723. this.awardSpine.play(data, 0, false, parent);
  11724. }
  11725. destroyAwardSpine() {
  11726. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11727. parent.destroyChildren();
  11728. }
  11729. isBlock(bx, by, hx, hy, except = null) {
  11730. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11731. let balls = xGame.common.d2World.ballArr;
  11732. let outArr = [];
  11733. for (let index = 0; index < balls.length; index++) {
  11734. let obj = balls[index];
  11735. if (obj.number == 0)
  11736. continue;
  11737. if (obj == except)
  11738. continue;
  11739. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11740. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11741. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11742. if (num >= 1)
  11743. num = 1;
  11744. if (num < 0)
  11745. continue;
  11746. let gap = Math.sin(Math.acos(num)) * dis;
  11747. if (gap < this.ballSize) {
  11748. outArr.push({
  11749. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11750. disHon: Math.cos(Math.acos(num)) * dis,
  11751. disVer: Math.sin(Math.acos(num)) * dis,
  11752. src: balls[index],
  11753. dir: this.tempDir1
  11754. });
  11755. }
  11756. }
  11757. if (outArr.length > 0) {
  11758. outArr.sort((a, b) => { return a.dis - b.dis; });
  11759. return outArr[0];
  11760. }
  11761. }
  11762. AngleBetween(vector1, vector2) {
  11763. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11764. return rad * (180 / Math.PI);
  11765. }
  11766. getSecretaryScale() {
  11767. if (this.secretary.spineName == "mishu") {
  11768. return 1.28;
  11769. }
  11770. else {
  11771. return 1.024;
  11772. }
  11773. }
  11774. signAwardContainsRod(arr) {
  11775. let temp;
  11776. for (let index = 0; index < arr.length; index++) {
  11777. temp = arr[index].split('-')[0];
  11778. if (parseInt(temp) > 2) {
  11779. return true;
  11780. }
  11781. }
  11782. }
  11783. judgeSameDay() {
  11784. let lastTime = DataMgr.getSignTime();
  11785. let curTime = new Date().getTime();
  11786. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11787. return true;
  11788. }
  11789. return false;
  11790. }
  11791. getAward(arr, callback) {
  11792. let showTriple = arr[0].type <= 2;
  11793. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11794. let temp;
  11795. for (let index = 0; index < arr.length; index++) {
  11796. temp = arr[index];
  11797. switch (temp.type) {
  11798. case 1:
  11799. this.playObjFlyAnim(temp.num, temp.type);
  11800. break;
  11801. case 2:
  11802. this.playObjFlyAnim(temp.num, temp.type);
  11803. break;
  11804. case 3:
  11805. case 4:
  11806. case 5:
  11807. case 6:
  11808. DataMgr.setBallRod(temp.type - 2, 1);
  11809. DataMgr.setCurBallRod(temp.type - 2);
  11810. break;
  11811. default:
  11812. break;
  11813. }
  11814. }
  11815. callback && callback(watchVideo);
  11816. });
  11817. }
  11818. getMoneyNode() {
  11819. let moneyNode;
  11820. let sign = xGame.uiMgr.getUI(UISign);
  11821. let draw = xGame.uiMgr.getUI(UIDraw);
  11822. let end = xGame.uiMgr.getUI(UIGameEnd);
  11823. let skill = xGame.uiMgr.getUI(UISkill);
  11824. if (sign && !sign.isHide)
  11825. moneyNode = sign.ui.moneyNode;
  11826. if (draw && !draw.isHide)
  11827. moneyNode = draw.ui.moneyNode;
  11828. if (end && !end.isHide)
  11829. moneyNode = end.ui.moneyNode;
  11830. if (skill && !skill.isHide)
  11831. moneyNode = skill.ui.moneyNode;
  11832. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11833. let main = xGame.uiMgr.getUI(UIMain);
  11834. if (condition1 && main && !main.isHide) {
  11835. moneyNode = main.ui.moneyNode;
  11836. }
  11837. return moneyNode;
  11838. }
  11839. playObjFlyAnim(num, type, callback = null) {
  11840. this.stPos.x = Laya.stage.width / 2;
  11841. this.stPos.y = Laya.stage.height / 2;
  11842. let moneyNode = this.getMoneyNode();
  11843. switch (type) {
  11844. case Prop.diamond:
  11845. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11846. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11847. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11848. this.edPos.x /= 2;
  11849. this.edPos.y /= 2;
  11850. break;
  11851. case Prop.coin:
  11852. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11853. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11854. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11855. this.edPos.x /= 2;
  11856. this.edPos.y /= 2;
  11857. break;
  11858. default:
  11859. break;
  11860. }
  11861. xGame.soundMgr.playSound("coinbag");
  11862. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11863. switch (type) {
  11864. case Prop.diamond:
  11865. DataMgr.setDiamond(num);
  11866. break;
  11867. case Prop.coin:
  11868. DataMgr.setCoin(num);
  11869. break;
  11870. default:
  11871. break;
  11872. }
  11873. callback && callback();
  11874. });
  11875. }
  11876. autoPopUIView() {
  11877. let arr = [];
  11878. let sign = this.judgeSameDay() ? false : true;
  11879. if (sign)
  11880. arr.push("sign");
  11881. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11882. if (draw)
  11883. arr.push("draw");
  11884. if (arr.length <= 0)
  11885. return;
  11886. let str = this.getRandArrEle(arr);
  11887. switch (str) {
  11888. case "sign":
  11889. xGame.uiMgr.Show(UISign);
  11890. break;
  11891. case "draw":
  11892. xGame.uiMgr.Show(UIDraw);
  11893. break;
  11894. default:
  11895. break;
  11896. }
  11897. }
  11898. getMSTime(time) {
  11899. let min = Math.floor(time / 60);
  11900. let sec = Math.floor((time - min * 60));
  11901. if (sec < 10)
  11902. sec = "0" + sec;
  11903. if (min < 10)
  11904. min = "0" + min;
  11905. return `${min}:${sec}`;
  11906. }
  11907. testPower() {
  11908. DataMgr.setPower(0, false);
  11909. }
  11910. getAllStarNum() {
  11911. let data = DataMgr.getPlaceBallLevelList();
  11912. let out = 0;
  11913. for (let index = 0; index < data.length; index++) {
  11914. out += data[index].star;
  11915. }
  11916. return out;
  11917. }
  11918. recoverCameraView() {
  11919. Laya.timer.once(900, this, () => {
  11920. xGame.common.showOneCamera("mainCamera");
  11921. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11922. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11923. xGame.common.gameUI.ui.border.alpha = 0;
  11924. if (Laya.physicsTimer.scale < 1) {
  11925. Laya.physicsTimer.scale = 1;
  11926. }
  11927. }
  11928. });
  11929. }
  11930. getClassicLevel() {
  11931. let successTimes = DataMgr.getClassicTimes();
  11932. let needKey = "";
  11933. let lastKey = "";
  11934. let cfg = cfgTable.classictimesData;
  11935. let data;
  11936. for (const key in cfg) {
  11937. data = cfg[key];
  11938. if (successTimes <= data.times) {
  11939. needKey = key;
  11940. }
  11941. lastKey = key;
  11942. }
  11943. if (needKey == "")
  11944. needKey = lastKey;
  11945. return cfg[needKey];
  11946. }
  11947. }
  11948. Common._instance = null;
  11949. class ui_Component92 extends fgui.GComponent {
  11950. static createInstance() {
  11951. return (fgui.UIPackage.createObject("game", "Component92"));
  11952. }
  11953. onConstruct() {
  11954. this.n0 = (this.getChild("n0"));
  11955. }
  11956. }
  11957. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11958. class ui_Component129 extends fgui.GProgressBar {
  11959. static createInstance() {
  11960. return (fgui.UIPackage.createObject("game", "Component129"));
  11961. }
  11962. onConstruct() {
  11963. this.bar_v = (this.getChild("bar_v"));
  11964. this.n84 = (this.getChild("n84"));
  11965. }
  11966. }
  11967. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11968. class ui_Component130 extends fgui.GComponent {
  11969. static createInstance() {
  11970. return (fgui.UIPackage.createObject("game", "Component130"));
  11971. }
  11972. onConstruct() {
  11973. this.ani = (this.getChild("ani"));
  11974. this.t0 = this.getTransition("t0");
  11975. }
  11976. }
  11977. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11978. class ui_powerEft extends fgui.GComponent {
  11979. static createInstance() {
  11980. return (fgui.UIPackage.createObject("game", "powerEft"));
  11981. }
  11982. onConstruct() {
  11983. this.ani = (this.getChild("ani"));
  11984. this.n88 = (this.getChild("n88"));
  11985. this.n89 = (this.getChild("n89"));
  11986. }
  11987. }
  11988. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11989. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11990. static createInstance() {
  11991. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11992. }
  11993. onConstruct() {
  11994. this.c1 = this.getController("c1");
  11995. this.n2 = (this.getChild("n2"));
  11996. this.n22 = (this.getChild("n22"));
  11997. this.n23 = (this.getChild("n23"));
  11998. this.n15 = (this.getChild("n15"));
  11999. this.challenge = (this.getChild("challenge"));
  12000. this.n17 = (this.getChild("n17"));
  12001. this.n3 = (this.getChild("n3"));
  12002. this.starNode = (this.getChild("starNode"));
  12003. this.levelTxt = (this.getChild("levelTxt"));
  12004. this.n14 = (this.getChild("n14"));
  12005. this.n19 = (this.getChild("n19"));
  12006. this.n20 = (this.getChild("n20"));
  12007. this.n21 = (this.getChild("n21"));
  12008. this.special = (this.getChild("special"));
  12009. }
  12010. }
  12011. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12012. class ui_Component79 extends fgui.GComponent {
  12013. static createInstance() {
  12014. return (fgui.UIPackage.createObject("game", "Component79"));
  12015. }
  12016. onConstruct() {
  12017. this.c1 = this.getController("c1");
  12018. this.n7 = (this.getChild("n7"));
  12019. this.n8 = (this.getChild("n8"));
  12020. this.n9 = (this.getChild("n9"));
  12021. this.n10 = (this.getChild("n10"));
  12022. this.n11 = (this.getChild("n11"));
  12023. this.n12 = (this.getChild("n12"));
  12024. }
  12025. }
  12026. ui_Component79.URL = "ui://isxx5ak7avag477";
  12027. class ui_Component80 extends fgui.GComponent {
  12028. static createInstance() {
  12029. return (fgui.UIPackage.createObject("game", "Component80"));
  12030. }
  12031. onConstruct() {
  12032. this.n0 = (this.getChild("n0"));
  12033. this.n1 = (this.getChild("n1"));
  12034. this.myList = (this.getChild("myList"));
  12035. this.t0 = this.getTransition("t0");
  12036. }
  12037. }
  12038. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12039. class ui_SignNormal extends fgui.GComponent {
  12040. static createInstance() {
  12041. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12042. }
  12043. onConstruct() {
  12044. this.c1 = this.getController("c1");
  12045. this.n7 = (this.getChild("n7"));
  12046. this.n15 = (this.getChild("n15"));
  12047. this.titleTxt = (this.getChild("titleTxt"));
  12048. this.n8 = (this.getChild("n8"));
  12049. this.myIcon = (this.getChild("myIcon"));
  12050. this.numTxt = (this.getChild("numTxt"));
  12051. this.n12 = (this.getChild("n12"));
  12052. this.n13 = (this.getChild("n13"));
  12053. this.n17 = (this.getChild("n17"));
  12054. this.n14 = (this.getChild("n14"));
  12055. }
  12056. }
  12057. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12058. class ui_screenNode extends fgui.GComponent {
  12059. static createInstance() {
  12060. return (fgui.UIPackage.createObject("game", "screenNode"));
  12061. }
  12062. onConstruct() {
  12063. this.n9 = (this.getChild("n9"));
  12064. this.screenImg = (this.getChild("screenImg"));
  12065. }
  12066. }
  12067. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12068. class ui_GetAwrad_com1 extends fgui.GComponent {
  12069. static createInstance() {
  12070. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12071. }
  12072. onConstruct() {
  12073. this.n38 = (this.getChild("n38"));
  12074. this.n39 = (this.getChild("n39"));
  12075. this.n40 = (this.getChild("n40"));
  12076. this.t0 = this.getTransition("t0");
  12077. this.t1 = this.getTransition("t1");
  12078. }
  12079. }
  12080. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12081. class ui_GetAwrad_com2 extends fgui.GComponent {
  12082. static createInstance() {
  12083. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12084. }
  12085. onConstruct() {
  12086. this.n39 = (this.getChild("n39"));
  12087. this.n40 = (this.getChild("n40"));
  12088. this.t0 = this.getTransition("t0");
  12089. }
  12090. }
  12091. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12092. class ui_Component128 extends fgui.GComponent {
  12093. static createInstance() {
  12094. return (fgui.UIPackage.createObject("game", "Component128"));
  12095. }
  12096. onConstruct() {
  12097. this.n38 = (this.getChild("n38"));
  12098. this.n40 = (this.getChild("n40"));
  12099. }
  12100. }
  12101. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12102. class ui_Component100_1 extends fgui.GComponent {
  12103. static createInstance() {
  12104. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12105. }
  12106. onConstruct() {
  12107. this.myNode = (this.getChild("myNode"));
  12108. this.t0 = this.getTransition("t0");
  12109. }
  12110. }
  12111. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12112. class ui_Component142 extends fgui.GComponent {
  12113. static createInstance() {
  12114. return (fgui.UIPackage.createObject("game", "Component142"));
  12115. }
  12116. onConstruct() {
  12117. this.n41 = (this.getChild("n41"));
  12118. this.n42 = (this.getChild("n42"));
  12119. }
  12120. }
  12121. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12122. class ui_main_guang extends fgui.GComponent {
  12123. static createInstance() {
  12124. return (fgui.UIPackage.createObject("game", "main_guang"));
  12125. }
  12126. onConstruct() {
  12127. this.n1 = (this.getChild("n1"));
  12128. this.n2 = (this.getChild("n2"));
  12129. this.n3 = (this.getChild("n3"));
  12130. this.n4 = (this.getChild("n4"));
  12131. this.n5 = (this.getChild("n5"));
  12132. this.n6 = (this.getChild("n6"));
  12133. this.n8 = (this.getChild("n8"));
  12134. this.t0 = this.getTransition("t0");
  12135. }
  12136. }
  12137. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12138. class ui_try_com1 extends fgui.GComponent {
  12139. static createInstance() {
  12140. return (fgui.UIPackage.createObject("game", "try_com1"));
  12141. }
  12142. onConstruct() {
  12143. this.c1 = this.getController("c1");
  12144. this.n0 = (this.getChild("n0"));
  12145. this.n2 = (this.getChild("n2"));
  12146. this.cancelBtn = (this.getChild("cancelBtn"));
  12147. this.videoBtn = (this.getChild("videoBtn"));
  12148. this.n9 = (this.getChild("n9"));
  12149. this.n24 = (this.getChild("n24"));
  12150. this.titleTxt = (this.getChild("titleTxt"));
  12151. this.n32 = (this.getChild("n32"));
  12152. this.n29 = (this.getChild("n29"));
  12153. this.n36 = (this.getChild("n36"));
  12154. this.txtTime = (this.getChild("txtTime"));
  12155. this.t0 = this.getTransition("t0");
  12156. }
  12157. }
  12158. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12159. class ui_try_com2 extends fgui.GComponent {
  12160. static createInstance() {
  12161. return (fgui.UIPackage.createObject("game", "try_com2"));
  12162. }
  12163. onConstruct() {
  12164. this.skillicon = (this.getChild("skillicon"));
  12165. this.n35 = (this.getChild("n35"));
  12166. this.n31 = (this.getChild("n31"));
  12167. this.n32 = (this.getChild("n32"));
  12168. this.n33 = (this.getChild("n33"));
  12169. this.n34 = (this.getChild("n34"));
  12170. }
  12171. }
  12172. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12173. class ui_try_com3 extends fgui.GComponent {
  12174. static createInstance() {
  12175. return (fgui.UIPackage.createObject("game", "try_com3"));
  12176. }
  12177. onConstruct() {
  12178. this.n33 = (this.getChild("n33"));
  12179. this.n34 = (this.getChild("n34"));
  12180. this.n35 = (this.getChild("n35"));
  12181. this.t0 = this.getTransition("t0");
  12182. }
  12183. }
  12184. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  12185. class ui_huihe1 extends fgui.GComponent {
  12186. static createInstance() {
  12187. return (fgui.UIPackage.createObject("game", "huihe1"));
  12188. }
  12189. onConstruct() {
  12190. this.n0 = (this.getChild("n0"));
  12191. this.n1 = (this.getChild("n1"));
  12192. this.t0 = this.getTransition("t0");
  12193. }
  12194. }
  12195. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  12196. class ui_huihe2 extends fgui.GComponent {
  12197. static createInstance() {
  12198. return (fgui.UIPackage.createObject("game", "huihe2"));
  12199. }
  12200. onConstruct() {
  12201. this.n0 = (this.getChild("n0"));
  12202. this.n1 = (this.getChild("n1"));
  12203. this.t0 = this.getTransition("t0");
  12204. }
  12205. }
  12206. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  12207. class ui_Component143 extends fgui.GComponent {
  12208. static createInstance() {
  12209. return (fgui.UIPackage.createObject("game", "Component143"));
  12210. }
  12211. onConstruct() {
  12212. this.n3 = (this.getChild("n3"));
  12213. this.n4 = (this.getChild("n4"));
  12214. this.n5 = (this.getChild("n5"));
  12215. this.n6 = (this.getChild("n6"));
  12216. this.n7 = (this.getChild("n7"));
  12217. this.n8 = (this.getChild("n8"));
  12218. this.n9 = (this.getChild("n9"));
  12219. this.n10 = (this.getChild("n10"));
  12220. this.t0 = this.getTransition("t0");
  12221. }
  12222. }
  12223. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  12224. class ui_dh_jingbi2 extends fgui.GComponent {
  12225. static createInstance() {
  12226. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  12227. }
  12228. onConstruct() {
  12229. this.n0 = (this.getChild("n0"));
  12230. this.n1 = (this.getChild("n1"));
  12231. this.n2 = (this.getChild("n2"));
  12232. this.n3 = (this.getChild("n3"));
  12233. this.n4 = (this.getChild("n4"));
  12234. this.n5 = (this.getChild("n5"));
  12235. this.n6 = (this.getChild("n6"));
  12236. this.n8 = (this.getChild("n8"));
  12237. this.n10 = (this.getChild("n10"));
  12238. this.t0 = this.getTransition("t0");
  12239. }
  12240. }
  12241. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  12242. class ui_dh_jingbi2_1 extends fgui.GComponent {
  12243. static createInstance() {
  12244. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  12245. }
  12246. onConstruct() {
  12247. this.n1 = (this.getChild("n1"));
  12248. this.n4 = (this.getChild("n4"));
  12249. this.t0 = this.getTransition("t0");
  12250. }
  12251. }
  12252. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  12253. class ui_dh_jingbi3 extends fgui.GComponent {
  12254. static createInstance() {
  12255. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  12256. }
  12257. onConstruct() {
  12258. this.n0 = (this.getChild("n0"));
  12259. this.n1 = (this.getChild("n1"));
  12260. this.n2 = (this.getChild("n2"));
  12261. this.n3 = (this.getChild("n3"));
  12262. this.n4 = (this.getChild("n4"));
  12263. this.n5 = (this.getChild("n5"));
  12264. this.n6 = (this.getChild("n6"));
  12265. this.n8 = (this.getChild("n8"));
  12266. this.n10 = (this.getChild("n10"));
  12267. this.t0 = this.getTransition("t0");
  12268. }
  12269. }
  12270. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  12271. class ui_dh_jingbi3_1 extends fgui.GComponent {
  12272. static createInstance() {
  12273. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  12274. }
  12275. onConstruct() {
  12276. this.n3 = (this.getChild("n3"));
  12277. this.n1 = (this.getChild("n1"));
  12278. this.t0 = this.getTransition("t0");
  12279. }
  12280. }
  12281. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  12282. class ui_hb_jinbi1 extends fgui.GButton {
  12283. static createInstance() {
  12284. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  12285. }
  12286. onConstruct() {
  12287. this.n20 = (this.getChild("n20"));
  12288. this.n25 = (this.getChild("n25"));
  12289. this.coinTxt = (this.getChild("coinTxt"));
  12290. this.n28 = (this.getChild("n28"));
  12291. this.n32 = (this.getChild("n32"));
  12292. this.n38 = (this.getChild("n38"));
  12293. this.n45 = (this.getChild("n45"));
  12294. this.getTips = (this.getChild("getTips"));
  12295. this.n39 = (this.getChild("n39"));
  12296. this.diamondTxt = (this.getChild("diamondTxt"));
  12297. this.n41 = (this.getChild("n41"));
  12298. this.n42 = (this.getChild("n42"));
  12299. this.n46 = (this.getChild("n46"));
  12300. this.n47 = (this.getChild("n47"));
  12301. this.n48 = (this.getChild("n48"));
  12302. this.t0 = this.getTransition("t0");
  12303. }
  12304. }
  12305. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  12306. class ui_hb_jinbi2 extends fgui.GButton {
  12307. static createInstance() {
  12308. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  12309. }
  12310. onConstruct() {
  12311. this.n20 = (this.getChild("n20"));
  12312. this.n25 = (this.getChild("n25"));
  12313. this.coinTxt = (this.getChild("coinTxt"));
  12314. this.n28 = (this.getChild("n28"));
  12315. this.n32 = (this.getChild("n32"));
  12316. this.n38 = (this.getChild("n38"));
  12317. this.n39 = (this.getChild("n39"));
  12318. this.diamondTxt = (this.getChild("diamondTxt"));
  12319. this.n41 = (this.getChild("n41"));
  12320. this.n42 = (this.getChild("n42"));
  12321. this.n43 = (this.getChild("n43"));
  12322. this.n44 = (this.getChild("n44"));
  12323. this.n45 = (this.getChild("n45"));
  12324. this.t0 = this.getTransition("t0");
  12325. }
  12326. }
  12327. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  12328. class ui_hb_jinbi3 extends fgui.GButton {
  12329. static createInstance() {
  12330. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  12331. }
  12332. onConstruct() {
  12333. this.n20 = (this.getChild("n20"));
  12334. this.n25 = (this.getChild("n25"));
  12335. this.coinTxt = (this.getChild("coinTxt"));
  12336. this.n28 = (this.getChild("n28"));
  12337. this.n32 = (this.getChild("n32"));
  12338. this.n38 = (this.getChild("n38"));
  12339. this.n39 = (this.getChild("n39"));
  12340. this.diamondTxt = (this.getChild("diamondTxt"));
  12341. this.n41 = (this.getChild("n41"));
  12342. this.n42 = (this.getChild("n42"));
  12343. this.n43 = (this.getChild("n43"));
  12344. this.n44 = (this.getChild("n44"));
  12345. this.n45 = (this.getChild("n45"));
  12346. this.t0 = this.getTransition("t0");
  12347. }
  12348. }
  12349. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  12350. class ui_Component104 extends fgui.GComponent {
  12351. static createInstance() {
  12352. return (fgui.UIPackage.createObject("game", "Component104"));
  12353. }
  12354. onConstruct() {
  12355. this.c1 = this.getController("c1");
  12356. this.n12 = (this.getChild("n12"));
  12357. this.coinBtn = (this.getChild("coinBtn"));
  12358. this.diamondBtn = (this.getChild("diamondBtn"));
  12359. this.node3 = (this.getChild("node3"));
  12360. this.node4 = (this.getChild("node4"));
  12361. this.node5 = (this.getChild("node5"));
  12362. this.node1 = (this.getChild("node1"));
  12363. this.node2 = (this.getChild("node2"));
  12364. this.node6 = (this.getChild("node6"));
  12365. this.t0 = this.getTransition("t0");
  12366. }
  12367. }
  12368. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  12369. class ui_Component105 extends fgui.GButton {
  12370. static createInstance() {
  12371. return (fgui.UIPackage.createObject("game", "Component105"));
  12372. }
  12373. onConstruct() {
  12374. this.c1 = this.getController("c1");
  12375. this.n49 = (this.getChild("n49"));
  12376. this.n18 = (this.getChild("n18"));
  12377. this.n46 = (this.getChild("n46"));
  12378. this.n48 = (this.getChild("n48"));
  12379. }
  12380. }
  12381. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  12382. class ui_Component106 extends fgui.GButton {
  12383. static createInstance() {
  12384. return (fgui.UIPackage.createObject("game", "Component106"));
  12385. }
  12386. onConstruct() {
  12387. this.c1 = this.getController("c1");
  12388. this.n49 = (this.getChild("n49"));
  12389. this.n18 = (this.getChild("n18"));
  12390. this.n46 = (this.getChild("n46"));
  12391. this.n48 = (this.getChild("n48"));
  12392. }
  12393. }
  12394. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  12395. class ui_hb_zs1 extends fgui.GButton {
  12396. static createInstance() {
  12397. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  12398. }
  12399. onConstruct() {
  12400. this.c1 = this.getController("c1");
  12401. this.n20 = (this.getChild("n20"));
  12402. this.n21 = (this.getChild("n21"));
  12403. this.n26 = (this.getChild("n26"));
  12404. this.n27 = (this.getChild("n27"));
  12405. this.shareTxt = (this.getChild("shareTxt"));
  12406. this.n32 = (this.getChild("n32"));
  12407. this.n38 = (this.getChild("n38"));
  12408. this.n39 = (this.getChild("n39"));
  12409. this.n44 = (this.getChild("n44"));
  12410. this.diamondTxt = (this.getChild("diamondTxt"));
  12411. this.n41 = (this.getChild("n41"));
  12412. this.n45 = (this.getChild("n45"));
  12413. this.n47 = (this.getChild("n47"));
  12414. this.n48 = (this.getChild("n48"));
  12415. this.randTxt = (this.getChild("randTxt"));
  12416. this.n50 = (this.getChild("n50"));
  12417. this.t0 = this.getTransition("t0");
  12418. }
  12419. }
  12420. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  12421. class ui_dh_zs1 extends fgui.GComponent {
  12422. static createInstance() {
  12423. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  12424. }
  12425. onConstruct() {
  12426. this.n10 = (this.getChild("n10"));
  12427. this.n9 = (this.getChild("n9"));
  12428. this.n1 = (this.getChild("n1"));
  12429. this.n2 = (this.getChild("n2"));
  12430. this.n3 = (this.getChild("n3"));
  12431. this.n4 = (this.getChild("n4"));
  12432. this.n5 = (this.getChild("n5"));
  12433. this.n6 = (this.getChild("n6"));
  12434. this.n8 = (this.getChild("n8"));
  12435. this.n11 = (this.getChild("n11"));
  12436. this.t0 = this.getTransition("t0");
  12437. }
  12438. }
  12439. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  12440. class ui_dh_zs1_1 extends fgui.GComponent {
  12441. static createInstance() {
  12442. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  12443. }
  12444. onConstruct() {
  12445. this.n3 = (this.getChild("n3"));
  12446. this.n1 = (this.getChild("n1"));
  12447. this.t0 = this.getTransition("t0");
  12448. }
  12449. }
  12450. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  12451. class ui_hb_zs2 extends fgui.GButton {
  12452. static createInstance() {
  12453. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  12454. }
  12455. onConstruct() {
  12456. this.n20 = (this.getChild("n20"));
  12457. this.n21 = (this.getChild("n21"));
  12458. this.n26 = (this.getChild("n26"));
  12459. this.n27 = (this.getChild("n27"));
  12460. this.n32 = (this.getChild("n32"));
  12461. this.n38 = (this.getChild("n38"));
  12462. this.n39 = (this.getChild("n39"));
  12463. this.n44 = (this.getChild("n44"));
  12464. this.diamondTxt = (this.getChild("diamondTxt"));
  12465. this.n41 = (this.getChild("n41"));
  12466. this.n45 = (this.getChild("n45"));
  12467. this.t0 = this.getTransition("t0");
  12468. }
  12469. }
  12470. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  12471. class ui_hb_zs3 extends fgui.GButton {
  12472. static createInstance() {
  12473. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  12474. }
  12475. onConstruct() {
  12476. this.n20 = (this.getChild("n20"));
  12477. this.n21 = (this.getChild("n21"));
  12478. this.n26 = (this.getChild("n26"));
  12479. this.n27 = (this.getChild("n27"));
  12480. this.n32 = (this.getChild("n32"));
  12481. this.n38 = (this.getChild("n38"));
  12482. this.n47 = (this.getChild("n47"));
  12483. this.t0 = this.getTransition("t0");
  12484. }
  12485. }
  12486. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12487. class ui_dh_zs2 extends fgui.GComponent {
  12488. static createInstance() {
  12489. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12490. }
  12491. onConstruct() {
  12492. this.n10 = (this.getChild("n10"));
  12493. this.n9 = (this.getChild("n9"));
  12494. this.n1 = (this.getChild("n1"));
  12495. this.n2 = (this.getChild("n2"));
  12496. this.n3 = (this.getChild("n3"));
  12497. this.n4 = (this.getChild("n4"));
  12498. this.n5 = (this.getChild("n5"));
  12499. this.n6 = (this.getChild("n6"));
  12500. this.n8 = (this.getChild("n8"));
  12501. this.n11 = (this.getChild("n11"));
  12502. this.t0 = this.getTransition("t0");
  12503. }
  12504. }
  12505. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12506. class ui_dh_zs2_1 extends fgui.GComponent {
  12507. static createInstance() {
  12508. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12509. }
  12510. onConstruct() {
  12511. this.n3 = (this.getChild("n3"));
  12512. this.n1 = (this.getChild("n1"));
  12513. this.t0 = this.getTransition("t0");
  12514. }
  12515. }
  12516. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12517. class ui_dh_zs3 extends fgui.GComponent {
  12518. static createInstance() {
  12519. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12520. }
  12521. onConstruct() {
  12522. this.n10 = (this.getChild("n10"));
  12523. this.n9 = (this.getChild("n9"));
  12524. this.n1 = (this.getChild("n1"));
  12525. this.n2 = (this.getChild("n2"));
  12526. this.n3 = (this.getChild("n3"));
  12527. this.n4 = (this.getChild("n4"));
  12528. this.n5 = (this.getChild("n5"));
  12529. this.n6 = (this.getChild("n6"));
  12530. this.n8 = (this.getChild("n8"));
  12531. this.n11 = (this.getChild("n11"));
  12532. this.t0 = this.getTransition("t0");
  12533. }
  12534. }
  12535. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12536. class ui_dh_zs3_1 extends fgui.GComponent {
  12537. static createInstance() {
  12538. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12539. }
  12540. onConstruct() {
  12541. this.n3 = (this.getChild("n3"));
  12542. this.n1 = (this.getChild("n1"));
  12543. this.t0 = this.getTransition("t0");
  12544. }
  12545. }
  12546. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12547. class ui_Component107 extends fgui.GComponent {
  12548. static createInstance() {
  12549. return (fgui.UIPackage.createObject("game", "Component107"));
  12550. }
  12551. onConstruct() {
  12552. this.n18 = (this.getChild("n18"));
  12553. this.n19 = (this.getChild("n19"));
  12554. this.n20 = (this.getChild("n20"));
  12555. this.n21 = (this.getChild("n21"));
  12556. this.n22 = (this.getChild("n22"));
  12557. this.levelTxt = (this.getChild("levelTxt"));
  12558. this.t0 = this.getTransition("t0");
  12559. }
  12560. }
  12561. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12562. class ui_box_com1 extends fgui.GComponent {
  12563. static createInstance() {
  12564. return (fgui.UIPackage.createObject("game", "box_com1"));
  12565. }
  12566. onConstruct() {
  12567. this.n14 = (this.getChild("n14"));
  12568. this.n6 = (this.getChild("n6"));
  12569. this.t0 = this.getTransition("t0");
  12570. }
  12571. }
  12572. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12573. class ui_box_com2 extends fgui.GProgressBar {
  12574. static createInstance() {
  12575. return (fgui.UIPackage.createObject("game", "box_com2"));
  12576. }
  12577. onConstruct() {
  12578. this.bg0 = (this.getChild("bg0"));
  12579. this.bg = (this.getChild("bg"));
  12580. this.bar = (this.getChild("bar"));
  12581. this.n7 = (this.getChild("n7"));
  12582. this.n8 = (this.getChild("n8"));
  12583. this.n10 = (this.getChild("n10"));
  12584. this.n11 = (this.getChild("n11"));
  12585. this.n12 = (this.getChild("n12"));
  12586. }
  12587. }
  12588. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12589. class ui_box_com4 extends fgui.GComponent {
  12590. static createInstance() {
  12591. return (fgui.UIPackage.createObject("game", "box_com4"));
  12592. }
  12593. onConstruct() {
  12594. this.n8 = (this.getChild("n8"));
  12595. this.t0 = this.getTransition("t0");
  12596. }
  12597. }
  12598. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12599. class ui_box_com3 extends fgui.GComponent {
  12600. static createInstance() {
  12601. return (fgui.UIPackage.createObject("game", "box_com3"));
  12602. }
  12603. onConstruct() {
  12604. this.n2 = (this.getChild("n2"));
  12605. this.n3 = (this.getChild("n3"));
  12606. this.n4 = (this.getChild("n4"));
  12607. this.n5 = (this.getChild("n5"));
  12608. this.t0 = this.getTransition("t0");
  12609. this.t1 = this.getTransition("t1");
  12610. }
  12611. }
  12612. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12613. class ui_Component97 extends fgui.GComponent {
  12614. static createInstance() {
  12615. return (fgui.UIPackage.createObject("game", "Component97"));
  12616. }
  12617. onConstruct() {
  12618. this.c1 = this.getController("c1");
  12619. this.n46 = (this.getChild("n46"));
  12620. this.diamondNode = (this.getChild("diamondNode"));
  12621. this.coinNode = (this.getChild("coinNode"));
  12622. this.t0 = this.getTransition("t0");
  12623. }
  12624. }
  12625. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12626. class ui_Component98 extends fgui.GButton {
  12627. static createInstance() {
  12628. return (fgui.UIPackage.createObject("game", "Component98"));
  12629. }
  12630. onConstruct() {
  12631. this.n8 = (this.getChild("n8"));
  12632. this.n40 = (this.getChild("n40"));
  12633. }
  12634. }
  12635. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12636. class ui_Component28_11 extends fgui.GButton {
  12637. static createInstance() {
  12638. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12639. }
  12640. onConstruct() {
  12641. this.c1 = this.getController("c1");
  12642. this.n12 = (this.getChild("n12"));
  12643. this.n17 = (this.getChild("n17"));
  12644. this.n13 = (this.getChild("n13"));
  12645. this.diamondTxt = (this.getChild("diamondTxt"));
  12646. this.n15 = (this.getChild("n15"));
  12647. this.n16 = (this.getChild("n16"));
  12648. }
  12649. }
  12650. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12651. class ui_Component58_11 extends fgui.GComponent {
  12652. static createInstance() {
  12653. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12654. }
  12655. onConstruct() {
  12656. this.n23 = (this.getChild("n23"));
  12657. this.n41 = (this.getChild("n41"));
  12658. this.myList = (this.getChild("myList"));
  12659. this.n45 = (this.getChild("n45"));
  12660. this.n44 = (this.getChild("n44"));
  12661. this.t0 = this.getTransition("t0");
  12662. }
  12663. }
  12664. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12665. class ui_Component100 extends fgui.GComponent {
  12666. static createInstance() {
  12667. return (fgui.UIPackage.createObject("game", "Component100"));
  12668. }
  12669. onConstruct() {
  12670. this.c1 = this.getController("c1");
  12671. this.n75 = (this.getChild("n75"));
  12672. this.n76 = (this.getChild("n76"));
  12673. this.n80 = (this.getChild("n80"));
  12674. this.txt = (this.getChild("txt"));
  12675. this.spineRoot = (this.getChild("spineRoot"));
  12676. }
  12677. }
  12678. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12679. class ui_Component101 extends fgui.GComponent {
  12680. static createInstance() {
  12681. return (fgui.UIPackage.createObject("game", "Component101"));
  12682. }
  12683. onConstruct() {
  12684. this.c1 = this.getController("c1");
  12685. this.n36 = (this.getChild("n36"));
  12686. this.n35 = (this.getChild("n35"));
  12687. this.n33 = (this.getChild("n33"));
  12688. this.n34 = (this.getChild("n34"));
  12689. }
  12690. }
  12691. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12692. class ui_Component53 extends fgui.GComponent {
  12693. static createInstance() {
  12694. return (fgui.UIPackage.createObject("game", "Component53"));
  12695. }
  12696. onConstruct() {
  12697. this.n0 = (this.getChild("n0"));
  12698. this.n1 = (this.getChild("n1"));
  12699. this.n2 = (this.getChild("n2"));
  12700. this.n3 = (this.getChild("n3"));
  12701. this.n4 = (this.getChild("n4"));
  12702. this.n5 = (this.getChild("n5"));
  12703. this.n6 = (this.getChild("n6"));
  12704. this.n7 = (this.getChild("n7"));
  12705. this.n8 = (this.getChild("n8"));
  12706. this.n9 = (this.getChild("n9"));
  12707. this.n10 = (this.getChild("n10"));
  12708. this.n11 = (this.getChild("n11"));
  12709. this.n12 = (this.getChild("n12"));
  12710. this.n13 = (this.getChild("n13"));
  12711. this.n14 = (this.getChild("n14"));
  12712. this.n15 = (this.getChild("n15"));
  12713. this.n16 = (this.getChild("n16"));
  12714. this.n19 = (this.getChild("n19"));
  12715. this.n20 = (this.getChild("n20"));
  12716. this.n21 = (this.getChild("n21"));
  12717. this.n22 = (this.getChild("n22"));
  12718. this.n23 = (this.getChild("n23"));
  12719. this.n24 = (this.getChild("n24"));
  12720. this.n25 = (this.getChild("n25"));
  12721. this.n26 = (this.getChild("n26"));
  12722. this.n27 = (this.getChild("n27"));
  12723. this.n28 = (this.getChild("n28"));
  12724. this.n29 = (this.getChild("n29"));
  12725. this.n30 = (this.getChild("n30"));
  12726. this.n31 = (this.getChild("n31"));
  12727. this.n32 = (this.getChild("n32"));
  12728. this.n33 = (this.getChild("n33"));
  12729. this.n34 = (this.getChild("n34"));
  12730. this.n35 = (this.getChild("n35"));
  12731. this.t0 = this.getTransition("t0");
  12732. }
  12733. }
  12734. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12735. class ui_Component58 extends fgui.GComponent {
  12736. static createInstance() {
  12737. return (fgui.UIPackage.createObject("game", "Component58"));
  12738. }
  12739. onConstruct() {
  12740. this.n23 = (this.getChild("n23"));
  12741. this.n41 = (this.getChild("n41"));
  12742. this.n8 = (this.getChild("n8"));
  12743. this.skillList = (this.getChild("skillList"));
  12744. this.t0 = this.getTransition("t0");
  12745. }
  12746. }
  12747. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12748. class ui_Component59 extends fgui.GComponent {
  12749. static createInstance() {
  12750. return (fgui.UIPackage.createObject("game", "Component59"));
  12751. }
  12752. onConstruct() {
  12753. this.n3 = (this.getChild("n3"));
  12754. this.msgTxt = (this.getChild("msgTxt"));
  12755. this.t0 = this.getTransition("t0");
  12756. }
  12757. }
  12758. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12759. class ui_RulerNode extends fgui.GComponent {
  12760. static createInstance() {
  12761. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12762. }
  12763. onConstruct() {
  12764. this.n6 = (this.getChild("n6"));
  12765. this.n4 = (this.getChild("n4"));
  12766. this.img1 = (this.getChild("img1"));
  12767. this.img2 = (this.getChild("img2"));
  12768. }
  12769. }
  12770. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12771. class ui_Component108 extends fgui.GComponent {
  12772. static createInstance() {
  12773. return (fgui.UIPackage.createObject("game", "Component108"));
  12774. }
  12775. onConstruct() {
  12776. this.n19 = (this.getChild("n19"));
  12777. this.t0 = this.getTransition("t0");
  12778. }
  12779. }
  12780. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12781. class ui_Component63 extends fgui.GComponent {
  12782. static createInstance() {
  12783. return (fgui.UIPackage.createObject("game", "Component63"));
  12784. }
  12785. onConstruct() {
  12786. this.n66 = (this.getChild("n66"));
  12787. this.n56 = (this.getChild("n56"));
  12788. this.n63 = (this.getChild("n63"));
  12789. this.n65 = (this.getChild("n65"));
  12790. this.t0 = this.getTransition("t0");
  12791. }
  12792. }
  12793. ui_Component63.URL = "ui://isxx5ak7h657452";
  12794. class ui_topNode extends fgui.GComponent {
  12795. static createInstance() {
  12796. return (fgui.UIPackage.createObject("game", "topNode"));
  12797. }
  12798. onConstruct() {
  12799. this.selfProgress = (this.getChild("selfProgress"));
  12800. this.aiProgress = (this.getChild("aiProgress"));
  12801. this.selfKuang = (this.getChild("selfKuang"));
  12802. this.aiKuang = (this.getChild("aiKuang"));
  12803. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12804. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12805. this.n33 = (this.getChild("n33"));
  12806. this.n34 = (this.getChild("n34"));
  12807. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12808. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12809. this.selfBallList = (this.getChild("selfBallList"));
  12810. this.aiBallList = (this.getChild("aiBallList"));
  12811. this.middleNode = (this.getChild("middleNode"));
  12812. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12813. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12814. this.scoreNode = (this.getChild("scoreNode"));
  12815. this.selfTips = (this.getChild("selfTips"));
  12816. this.aiTips = (this.getChild("aiTips"));
  12817. }
  12818. }
  12819. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12820. class ui_selfProgress extends fgui.GProgressBar {
  12821. static createInstance() {
  12822. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12823. }
  12824. onConstruct() {
  12825. this.n3 = (this.getChild("n3"));
  12826. this.bar = (this.getChild("bar"));
  12827. }
  12828. }
  12829. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12830. class ui_aiProgress extends fgui.GProgressBar {
  12831. static createInstance() {
  12832. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12833. }
  12834. onConstruct() {
  12835. this.n3 = (this.getChild("n3"));
  12836. this.bar = (this.getChild("bar"));
  12837. }
  12838. }
  12839. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12840. class ui_ballDisplay extends fgui.GComponent {
  12841. static createInstance() {
  12842. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12843. }
  12844. onConstruct() {
  12845. this.myImg = (this.getChild("myImg"));
  12846. }
  12847. }
  12848. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12849. class ui_moveNode extends fgui.GComponent {
  12850. static createInstance() {
  12851. return (fgui.UIPackage.createObject("game", "moveNode"));
  12852. }
  12853. onConstruct() {
  12854. this.n8 = (this.getChild("n8"));
  12855. this.finger = (this.getChild("finger"));
  12856. }
  12857. }
  12858. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12859. class ui_cancelBtn extends fgui.GButton {
  12860. static createInstance() {
  12861. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12862. }
  12863. onConstruct() {
  12864. this.c1 = this.getController("c1");
  12865. this.n0 = (this.getChild("n0"));
  12866. this.n1 = (this.getChild("n1"));
  12867. }
  12868. }
  12869. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12870. class ui_shareBtn extends fgui.GButton {
  12871. static createInstance() {
  12872. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12873. }
  12874. onConstruct() {
  12875. this.c1 = this.getController("c1");
  12876. this.n2 = (this.getChild("n2"));
  12877. this.n1 = (this.getChild("n1"));
  12878. this.n3 = (this.getChild("n3"));
  12879. this.n4 = (this.getChild("n4"));
  12880. this.n5 = (this.getChild("n5"));
  12881. this.n6 = (this.getChild("n6"));
  12882. }
  12883. }
  12884. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12885. class ui_share2Btn extends fgui.GButton {
  12886. static createInstance() {
  12887. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12888. }
  12889. onConstruct() {
  12890. this.n3 = (this.getChild("n3"));
  12891. }
  12892. }
  12893. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12894. class ui_rodMethodNode extends fgui.GComponent {
  12895. static createInstance() {
  12896. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12897. }
  12898. onConstruct() {
  12899. this.bg = (this.getChild("bg"));
  12900. this.dot = (this.getChild("dot"));
  12901. }
  12902. }
  12903. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12904. class ui_sureBtn extends fgui.GButton {
  12905. static createInstance() {
  12906. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12907. }
  12908. onConstruct() {
  12909. this.n2 = (this.getChild("n2"));
  12910. this.n1 = (this.getChild("n1"));
  12911. }
  12912. }
  12913. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12914. class ui_Component18 extends fgui.GComponent {
  12915. static createInstance() {
  12916. return (fgui.UIPackage.createObject("game", "Component18"));
  12917. }
  12918. onConstruct() {
  12919. this.c1 = this.getController("c1");
  12920. this.nameTxt = (this.getChild("nameTxt"));
  12921. this.headImg = (this.getChild("headImg"));
  12922. this.n24 = (this.getChild("n24"));
  12923. this.skillImg = (this.getChild("skillImg"));
  12924. this.skillTxt = (this.getChild("skillTxt"));
  12925. }
  12926. }
  12927. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12928. class ui_Component45 extends fgui.GComponent {
  12929. static createInstance() {
  12930. return (fgui.UIPackage.createObject("game", "Component45"));
  12931. }
  12932. onConstruct() {
  12933. this.c1 = this.getController("c1");
  12934. this.n40 = (this.getChild("n40"));
  12935. this.n41 = (this.getChild("n41"));
  12936. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12937. this.n42 = (this.getChild("n42"));
  12938. this.awardTxt = (this.getChild("awardTxt"));
  12939. this.n44 = (this.getChild("n44"));
  12940. this.t0 = this.getTransition("t0");
  12941. }
  12942. }
  12943. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12944. class ui_emotionDisplay extends fgui.GButton {
  12945. static createInstance() {
  12946. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12947. }
  12948. onConstruct() {
  12949. this.myIcon = (this.getChild("myIcon"));
  12950. }
  12951. }
  12952. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12953. class ui_Component49 extends fgui.GButton {
  12954. static createInstance() {
  12955. return (fgui.UIPackage.createObject("game", "Component49"));
  12956. }
  12957. onConstruct() {
  12958. this.n69 = (this.getChild("n69"));
  12959. this.n56 = (this.getChild("n56"));
  12960. }
  12961. }
  12962. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12963. class ui_Component50 extends fgui.GButton {
  12964. static createInstance() {
  12965. return (fgui.UIPackage.createObject("game", "Component50"));
  12966. }
  12967. onConstruct() {
  12968. this.n54 = (this.getChild("n54"));
  12969. this.n65 = (this.getChild("n65"));
  12970. }
  12971. }
  12972. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12973. class ui_Component51 extends fgui.GButton {
  12974. static createInstance() {
  12975. return (fgui.UIPackage.createObject("game", "Component51"));
  12976. }
  12977. onConstruct() {
  12978. this.c1 = this.getController("c1");
  12979. this.n51 = (this.getChild("n51"));
  12980. this.n54 = (this.getChild("n54"));
  12981. }
  12982. }
  12983. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12984. class ui_Button5 extends fgui.GButton {
  12985. static createInstance() {
  12986. return (fgui.UIPackage.createObject("game", "Button5"));
  12987. }
  12988. onConstruct() {
  12989. this.c1 = this.getController("c1");
  12990. this.n0 = (this.getChild("n0"));
  12991. this.n2 = (this.getChild("n2"));
  12992. }
  12993. }
  12994. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12995. class ui_Component124 extends fgui.GComponent {
  12996. static createInstance() {
  12997. return (fgui.UIPackage.createObject("game", "Component124"));
  12998. }
  12999. onConstruct() {
  13000. this.n22 = (this.getChild("n22"));
  13001. this.shareNode = (this.getChild("shareNode"));
  13002. }
  13003. }
  13004. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13005. class ui_Component125 extends fgui.GComponent {
  13006. static createInstance() {
  13007. return (fgui.UIPackage.createObject("game", "Component125"));
  13008. }
  13009. onConstruct() {
  13010. this.n29 = (this.getChild("n29"));
  13011. this.coinTxt = (this.getChild("coinTxt"));
  13012. }
  13013. }
  13014. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13015. class ui_Component52 extends fgui.GButton {
  13016. static createInstance() {
  13017. return (fgui.UIPackage.createObject("game", "Component52"));
  13018. }
  13019. onConstruct() {
  13020. this.n35 = (this.getChild("n35"));
  13021. this.n36 = (this.getChild("n36"));
  13022. }
  13023. }
  13024. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13025. class ui_drawBtn extends fgui.GButton {
  13026. static createInstance() {
  13027. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13028. }
  13029. onConstruct() {
  13030. this.c1 = this.getController("c1");
  13031. this.n2 = (this.getChild("n2"));
  13032. this.n1 = (this.getChild("n1"));
  13033. this.n5 = (this.getChild("n5"));
  13034. }
  13035. }
  13036. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13037. class ui_Component43 extends fgui.GButton {
  13038. static createInstance() {
  13039. return (fgui.UIPackage.createObject("game", "Component43"));
  13040. }
  13041. onConstruct() {
  13042. this.n49 = (this.getChild("n49"));
  13043. }
  13044. }
  13045. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13046. class ui_wordsDisplay extends fgui.GComponent {
  13047. static createInstance() {
  13048. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13049. }
  13050. onConstruct() {
  13051. this.txt = (this.getChild("txt"));
  13052. this.n63 = (this.getChild("n63"));
  13053. }
  13054. }
  13055. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13056. class ui_Component_phb extends fgui.GComponent {
  13057. static createInstance() {
  13058. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13059. }
  13060. onConstruct() {
  13061. this.n3 = (this.getChild("n3"));
  13062. this.n4 = (this.getChild("n4"));
  13063. }
  13064. }
  13065. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13066. class ui_Component3 extends fgui.GComponent {
  13067. static createInstance() {
  13068. return (fgui.UIPackage.createObject("game", "Component3"));
  13069. }
  13070. onConstruct() {
  13071. this.n26 = (this.getChild("n26"));
  13072. this.n24 = (this.getChild("n24"));
  13073. this.nameTxt = (this.getChild("nameTxt"));
  13074. this.headRoot = (this.getChild("headRoot"));
  13075. }
  13076. }
  13077. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13078. class ui_Component4 extends fgui.GComponent {
  13079. static createInstance() {
  13080. return (fgui.UIPackage.createObject("game", "Component4"));
  13081. }
  13082. onConstruct() {
  13083. this.headImg = (this.getChild("headImg"));
  13084. }
  13085. }
  13086. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13087. class ui_Component7 extends fgui.GButton {
  13088. static createInstance() {
  13089. return (fgui.UIPackage.createObject("game", "Component7"));
  13090. }
  13091. onConstruct() {
  13092. this.n17 = (this.getChild("n17"));
  13093. }
  13094. }
  13095. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13096. class ui_Component8 extends fgui.GButton {
  13097. static createInstance() {
  13098. return (fgui.UIPackage.createObject("game", "Component8"));
  13099. }
  13100. onConstruct() {
  13101. this.n19 = (this.getChild("n19"));
  13102. }
  13103. }
  13104. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13105. class ui_Component10 extends fgui.GButton {
  13106. static createInstance() {
  13107. return (fgui.UIPackage.createObject("game", "Component10"));
  13108. }
  13109. onConstruct() {
  13110. this.c1 = this.getController("c1");
  13111. this.n40 = (this.getChild("n40"));
  13112. }
  13113. }
  13114. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13115. class ui_Component11 extends fgui.GButton {
  13116. static createInstance() {
  13117. return (fgui.UIPackage.createObject("game", "Component11"));
  13118. }
  13119. onConstruct() {
  13120. this.n34 = (this.getChild("n34"));
  13121. }
  13122. }
  13123. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13124. class ui_Component12 extends fgui.GButton {
  13125. static createInstance() {
  13126. return (fgui.UIPackage.createObject("game", "Component12"));
  13127. }
  13128. onConstruct() {
  13129. this.n35 = (this.getChild("n35"));
  13130. }
  13131. }
  13132. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13133. class ui_Component13 extends fgui.GButton {
  13134. static createInstance() {
  13135. return (fgui.UIPackage.createObject("game", "Component13"));
  13136. }
  13137. onConstruct() {
  13138. this.n27 = (this.getChild("n27"));
  13139. this.n36 = (this.getChild("n36"));
  13140. }
  13141. }
  13142. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  13143. class ui_dh_js_tuowei extends fgui.GComponent {
  13144. static createInstance() {
  13145. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  13146. }
  13147. onConstruct() {
  13148. this.n19 = (this.getChild("n19"));
  13149. this.n18 = (this.getChild("n18"));
  13150. this.n0 = (this.getChild("n0"));
  13151. this.n3 = (this.getChild("n3"));
  13152. this.n4 = (this.getChild("n4"));
  13153. this.n5 = (this.getChild("n5"));
  13154. this.n6 = (this.getChild("n6"));
  13155. this.n8 = (this.getChild("n8"));
  13156. this.n9 = (this.getChild("n9"));
  13157. this.n10 = (this.getChild("n10"));
  13158. this.n11 = (this.getChild("n11"));
  13159. this.n12 = (this.getChild("n12"));
  13160. this.n13 = (this.getChild("n13"));
  13161. this.n14 = (this.getChild("n14"));
  13162. this.n15 = (this.getChild("n15"));
  13163. this.n20 = (this.getChild("n20"));
  13164. this.t0 = this.getTransition("t0");
  13165. this.t1 = this.getTransition("t1");
  13166. }
  13167. }
  13168. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  13169. class ui_dh_js_tw_g extends fgui.GComponent {
  13170. static createInstance() {
  13171. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  13172. }
  13173. onConstruct() {
  13174. this.n0 = (this.getChild("n0"));
  13175. this.n1 = (this.getChild("n1"));
  13176. this.t0 = this.getTransition("t0");
  13177. }
  13178. }
  13179. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  13180. class ui_dh_js_xingxing extends fgui.GComponent {
  13181. static createInstance() {
  13182. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  13183. }
  13184. onConstruct() {
  13185. this.n1 = (this.getChild("n1"));
  13186. this.n2 = (this.getChild("n2"));
  13187. this.n3 = (this.getChild("n3"));
  13188. this.n4 = (this.getChild("n4"));
  13189. this.n0 = (this.getChild("n0"));
  13190. this.t2 = this.getTransition("t2");
  13191. this.t1 = this.getTransition("t1");
  13192. }
  13193. }
  13194. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  13195. class ui_dh_zy_jiazai extends fgui.GComponent {
  13196. static createInstance() {
  13197. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  13198. }
  13199. onConstruct() {
  13200. this.c1 = this.getController("c1");
  13201. this.n0 = (this.getChild("n0"));
  13202. this.n1 = (this.getChild("n1"));
  13203. this.n2 = (this.getChild("n2"));
  13204. this.n4 = (this.getChild("n4"));
  13205. this.n5 = (this.getChild("n5"));
  13206. this.n6 = (this.getChild("n6"));
  13207. this.n8 = (this.getChild("n8"));
  13208. this.n7 = (this.getChild("n7"));
  13209. this.t0 = this.getTransition("t0");
  13210. }
  13211. }
  13212. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  13213. class ui_dh_js_xingxing2 extends fgui.GComponent {
  13214. static createInstance() {
  13215. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  13216. }
  13217. onConstruct() {
  13218. this.c1 = this.getController("c1");
  13219. this.n3 = (this.getChild("n3"));
  13220. this.n5 = (this.getChild("n5"));
  13221. this.n4 = (this.getChild("n4"));
  13222. this.n0 = (this.getChild("n0"));
  13223. this.n1 = (this.getChild("n1"));
  13224. this.n2 = (this.getChild("n2"));
  13225. }
  13226. }
  13227. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  13228. class ui_dh_js_tuowei2 extends fgui.GComponent {
  13229. static createInstance() {
  13230. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  13231. }
  13232. onConstruct() {
  13233. this.n19 = (this.getChild("n19"));
  13234. this.n21 = (this.getChild("n21"));
  13235. this.n0 = (this.getChild("n0"));
  13236. this.n3 = (this.getChild("n3"));
  13237. this.n4 = (this.getChild("n4"));
  13238. this.n5 = (this.getChild("n5"));
  13239. this.n6 = (this.getChild("n6"));
  13240. this.n8 = (this.getChild("n8"));
  13241. this.n9 = (this.getChild("n9"));
  13242. this.n10 = (this.getChild("n10"));
  13243. this.n11 = (this.getChild("n11"));
  13244. this.n12 = (this.getChild("n12"));
  13245. this.n13 = (this.getChild("n13"));
  13246. this.n14 = (this.getChild("n14"));
  13247. this.n15 = (this.getChild("n15"));
  13248. this.n23 = (this.getChild("n23"));
  13249. this.t0 = this.getTransition("t0");
  13250. this.t1 = this.getTransition("t1");
  13251. }
  13252. }
  13253. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  13254. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  13255. static createInstance() {
  13256. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  13257. }
  13258. onConstruct() {
  13259. this.n1 = (this.getChild("n1"));
  13260. this.n2 = (this.getChild("n2"));
  13261. this.t0 = this.getTransition("t0");
  13262. }
  13263. }
  13264. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  13265. class ui_dh_js_shibai_1 extends fgui.GComponent {
  13266. static createInstance() {
  13267. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  13268. }
  13269. onConstruct() {
  13270. this.n4 = (this.getChild("n4"));
  13271. this.n2 = (this.getChild("n2"));
  13272. this.n3 = (this.getChild("n3"));
  13273. this.idle = this.getTransition("idle");
  13274. this.attack = this.getTransition("attack");
  13275. }
  13276. }
  13277. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  13278. class ui_special extends fgui.GComponent {
  13279. static createInstance() {
  13280. return (fgui.UIPackage.createObject("game", "special"));
  13281. }
  13282. onConstruct() {
  13283. this.n18 = (this.getChild("n18"));
  13284. this.n19 = (this.getChild("n19"));
  13285. this.n20 = (this.getChild("n20"));
  13286. this.n21 = (this.getChild("n21"));
  13287. this.n22 = (this.getChild("n22"));
  13288. this.levelTxt = (this.getChild("levelTxt"));
  13289. this.n24 = (this.getChild("n24"));
  13290. this.n25 = (this.getChild("n25"));
  13291. this.t0 = this.getTransition("t0");
  13292. }
  13293. }
  13294. ui_special.URL = "ui://isxx5ak7j979v4i6";
  13295. class ui_Component145 extends fgui.GComponent {
  13296. static createInstance() {
  13297. return (fgui.UIPackage.createObject("game", "Component145"));
  13298. }
  13299. onConstruct() {
  13300. this.guanyuNode = (this.getChild("guanyuNode"));
  13301. }
  13302. }
  13303. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  13304. class ui_longBtn extends fgui.GButton {
  13305. static createInstance() {
  13306. return (fgui.UIPackage.createObject("game", "longBtn"));
  13307. }
  13308. onConstruct() {
  13309. this.c1 = this.getController("c1");
  13310. this.n2 = (this.getChild("n2"));
  13311. this.n1 = (this.getChild("n1"));
  13312. this.n4 = (this.getChild("n4"));
  13313. }
  13314. }
  13315. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  13316. class ui_Component146 extends fgui.GComponent {
  13317. static createInstance() {
  13318. return (fgui.UIPackage.createObject("game", "Component146"));
  13319. }
  13320. onConstruct() {
  13321. this.n89 = (this.getChild("n89"));
  13322. this.n90 = (this.getChild("n90"));
  13323. this.guideBtn = (this.getChild("guideBtn"));
  13324. }
  13325. }
  13326. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  13327. class ui_Component146_11 extends fgui.GComponent {
  13328. static createInstance() {
  13329. return (fgui.UIPackage.createObject("game", "Component146_11"));
  13330. }
  13331. onConstruct() {
  13332. this.n89 = (this.getChild("n89"));
  13333. this.n90 = (this.getChild("n90"));
  13334. this.guideBtn = (this.getChild("guideBtn"));
  13335. }
  13336. }
  13337. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  13338. class ui_Component111_1 extends fgui.GComponent {
  13339. static createInstance() {
  13340. return (fgui.UIPackage.createObject("game", "Component111_1"));
  13341. }
  13342. onConstruct() {
  13343. this.n68 = (this.getChild("n68"));
  13344. this.myMask = (this.getChild("myMask"));
  13345. }
  13346. }
  13347. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  13348. class ui_Component64_1 extends fgui.GComponent {
  13349. static createInstance() {
  13350. return (fgui.UIPackage.createObject("game", "Component64_1"));
  13351. }
  13352. onConstruct() {
  13353. this.n57 = (this.getChild("n57"));
  13354. this.n54 = (this.getChild("n54"));
  13355. this.n55 = (this.getChild("n55"));
  13356. this.n56 = (this.getChild("n56"));
  13357. this.t1 = this.getTransition("t1");
  13358. }
  13359. }
  13360. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  13361. class ui_ModeSelection_com123 extends fgui.GComponent {
  13362. static createInstance() {
  13363. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  13364. }
  13365. onConstruct() {
  13366. this.type1 = (this.getChild("type1"));
  13367. this.type2 = (this.getChild("type2"));
  13368. this.type3 = (this.getChild("type3"));
  13369. this.n38 = (this.getChild("n38"));
  13370. this.t0 = this.getTransition("t0");
  13371. }
  13372. }
  13373. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  13374. class ui_Component132_2 extends fgui.GComponent {
  13375. static createInstance() {
  13376. return (fgui.UIPackage.createObject("game", "Component132_2"));
  13377. }
  13378. onConstruct() {
  13379. this.n25 = (this.getChild("n25"));
  13380. this.n26 = (this.getChild("n26"));
  13381. this.n27 = (this.getChild("n27"));
  13382. this.t0 = this.getTransition("t0");
  13383. }
  13384. }
  13385. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  13386. class ui_UIPower$1 extends fgui.GComponent {
  13387. static createInstance() {
  13388. return (fgui.UIPackage.createObject("game", "UIPower"));
  13389. }
  13390. onConstruct() {
  13391. this.n11 = (this.getChild("n11"));
  13392. this.myNode = (this.getChild("myNode"));
  13393. this.t0 = this.getTransition("t0");
  13394. }
  13395. }
  13396. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  13397. class ui_Component133 extends fgui.GComponent {
  13398. static createInstance() {
  13399. return (fgui.UIPackage.createObject("game", "Component133"));
  13400. }
  13401. onConstruct() {
  13402. this.n29 = (this.getChild("n29"));
  13403. this.n30 = (this.getChild("n30"));
  13404. }
  13405. }
  13406. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  13407. class ui_Component134 extends fgui.GComponent {
  13408. static createInstance() {
  13409. return (fgui.UIPackage.createObject("game", "Component134"));
  13410. }
  13411. onConstruct() {
  13412. this.n30 = (this.getChild("n30"));
  13413. this.n31 = (this.getChild("n31"));
  13414. this.t0 = this.getTransition("t0");
  13415. }
  13416. }
  13417. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  13418. class ui_Component135 extends fgui.GComponent {
  13419. static createInstance() {
  13420. return (fgui.UIPackage.createObject("game", "Component135"));
  13421. }
  13422. onConstruct() {
  13423. this.n30 = (this.getChild("n30"));
  13424. this.t0 = this.getTransition("t0");
  13425. }
  13426. }
  13427. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  13428. class ui_Component137 extends fgui.GComponent {
  13429. static createInstance() {
  13430. return (fgui.UIPackage.createObject("game", "Component137"));
  13431. }
  13432. onConstruct() {
  13433. this.n28 = (this.getChild("n28"));
  13434. this.n29 = (this.getChild("n29"));
  13435. this.n30 = (this.getChild("n30"));
  13436. this.n32 = (this.getChild("n32"));
  13437. }
  13438. }
  13439. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  13440. class ui_dh_zuanshi extends fgui.GButton {
  13441. static createInstance() {
  13442. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  13443. }
  13444. onConstruct() {
  13445. this.n1 = (this.getChild("n1"));
  13446. this.n2 = (this.getChild("n2"));
  13447. this.n0 = (this.getChild("n0"));
  13448. this.n3 = (this.getChild("n3"));
  13449. this.n4 = (this.getChild("n4"));
  13450. }
  13451. }
  13452. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  13453. class ui_Component138 extends fgui.GComponent {
  13454. static createInstance() {
  13455. return (fgui.UIPackage.createObject("game", "Component138"));
  13456. }
  13457. onConstruct() {
  13458. this.n1 = (this.getChild("n1"));
  13459. this.n2 = (this.getChild("n2"));
  13460. this.t0 = this.getTransition("t0");
  13461. }
  13462. }
  13463. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  13464. class ui_Component139 extends fgui.GComponent {
  13465. static createInstance() {
  13466. return (fgui.UIPackage.createObject("game", "Component139"));
  13467. }
  13468. onConstruct() {
  13469. this.n0 = (this.getChild("n0"));
  13470. this.t0 = this.getTransition("t0");
  13471. }
  13472. }
  13473. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  13474. class ui_Component140 extends fgui.GComponent {
  13475. static createInstance() {
  13476. return (fgui.UIPackage.createObject("game", "Component140"));
  13477. }
  13478. onConstruct() {
  13479. this.n2 = (this.getChild("n2"));
  13480. this.n3 = (this.getChild("n3"));
  13481. this.t0 = this.getTransition("t0");
  13482. }
  13483. }
  13484. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  13485. class ui_Component141 extends fgui.GComponent {
  13486. static createInstance() {
  13487. return (fgui.UIPackage.createObject("game", "Component141"));
  13488. }
  13489. onConstruct() {
  13490. this.n0 = (this.getChild("n0"));
  13491. this.t0 = this.getTransition("t0");
  13492. }
  13493. }
  13494. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13495. class ui_powerNode extends fgui.GProgressBar {
  13496. static createInstance() {
  13497. return (fgui.UIPackage.createObject("game", "powerNode"));
  13498. }
  13499. onConstruct() {
  13500. this.n2 = (this.getChild("n2"));
  13501. this.bar_v = (this.getChild("bar_v"));
  13502. this.showImg = (this.getChild("showImg"));
  13503. this.n12 = (this.getChild("n12"));
  13504. }
  13505. }
  13506. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13507. class ui_dh_jingbi1 extends fgui.GComponent {
  13508. static createInstance() {
  13509. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13510. }
  13511. onConstruct() {
  13512. this.n0 = (this.getChild("n0"));
  13513. this.n1 = (this.getChild("n1"));
  13514. this.n2 = (this.getChild("n2"));
  13515. this.n3 = (this.getChild("n3"));
  13516. this.n4 = (this.getChild("n4"));
  13517. this.n5 = (this.getChild("n5"));
  13518. this.n6 = (this.getChild("n6"));
  13519. this.n8 = (this.getChild("n8"));
  13520. this.t0 = this.getTransition("t0");
  13521. }
  13522. }
  13523. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13524. class ui_Component94 extends fgui.GButton {
  13525. static createInstance() {
  13526. return (fgui.UIPackage.createObject("game", "Component94"));
  13527. }
  13528. onConstruct() {
  13529. this.n77 = (this.getChild("n77"));
  13530. }
  13531. }
  13532. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13533. class ui_Component95 extends fgui.GButton {
  13534. static createInstance() {
  13535. return (fgui.UIPackage.createObject("game", "Component95"));
  13536. }
  13537. onConstruct() {
  13538. this.n77 = (this.getChild("n77"));
  13539. }
  13540. }
  13541. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13542. class ui_Component126 extends fgui.GComponent {
  13543. static createInstance() {
  13544. return (fgui.UIPackage.createObject("game", "Component126"));
  13545. }
  13546. onConstruct() {
  13547. this.c1 = this.getController("c1");
  13548. this.normalBtn = (this.getChild("normalBtn"));
  13549. this.tripleBtn = (this.getChild("tripleBtn"));
  13550. }
  13551. }
  13552. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13553. class ui_Component60 extends fgui.GComponent {
  13554. static createInstance() {
  13555. return (fgui.UIPackage.createObject("game", "Component60"));
  13556. }
  13557. onConstruct() {
  13558. this.c1 = this.getController("c1");
  13559. this.n48 = (this.getChild("n48"));
  13560. this.womanTxt = (this.getChild("womanTxt"));
  13561. this.t0 = this.getTransition("t0");
  13562. }
  13563. }
  13564. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13565. class ui_Component98_3 extends fgui.GButton {
  13566. static createInstance() {
  13567. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13568. }
  13569. onConstruct() {
  13570. this.c1 = this.getController("c1");
  13571. this.n8 = (this.getChild("n8"));
  13572. this.n41 = (this.getChild("n41"));
  13573. this.n40 = (this.getChild("n40"));
  13574. }
  13575. }
  13576. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13577. class ui_ModeSelection_com1 extends fgui.GButton {
  13578. static createInstance() {
  13579. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13580. }
  13581. onConstruct() {
  13582. this.n34 = (this.getChild("n34"));
  13583. this.n36 = (this.getChild("n36"));
  13584. this.n22 = (this.getChild("n22"));
  13585. this.n20 = (this.getChild("n20"));
  13586. this.n23 = (this.getChild("n23"));
  13587. this.n24 = (this.getChild("n24"));
  13588. this.n26 = (this.getChild("n26"));
  13589. this.n33 = (this.getChild("n33"));
  13590. this.coinImg = (this.getChild("coinImg"));
  13591. this.need = (this.getChild("need"));
  13592. this.n35 = (this.getChild("n35"));
  13593. this.n29 = (this.getChild("n29"));
  13594. this.tipsTxt = (this.getChild("tipsTxt"));
  13595. this.n30 = (this.getChild("n30"));
  13596. this.peopleTxt = (this.getChild("peopleTxt"));
  13597. this.t0 = this.getTransition("t0");
  13598. }
  13599. }
  13600. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13601. class ui_ModeSelection_com2 extends fgui.GButton {
  13602. static createInstance() {
  13603. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13604. }
  13605. onConstruct() {
  13606. this.n36 = (this.getChild("n36"));
  13607. this.n34 = (this.getChild("n34"));
  13608. this.n22 = (this.getChild("n22"));
  13609. this.n20 = (this.getChild("n20"));
  13610. this.n23 = (this.getChild("n23"));
  13611. this.n24 = (this.getChild("n24"));
  13612. this.n26 = (this.getChild("n26"));
  13613. this.n33 = (this.getChild("n33"));
  13614. this.coinImg = (this.getChild("coinImg"));
  13615. this.need = (this.getChild("need"));
  13616. this.n35 = (this.getChild("n35"));
  13617. this.n29 = (this.getChild("n29"));
  13618. this.tipsTxt = (this.getChild("tipsTxt"));
  13619. this.n30 = (this.getChild("n30"));
  13620. this.peopleTxt = (this.getChild("peopleTxt"));
  13621. this.t0 = this.getTransition("t0");
  13622. }
  13623. }
  13624. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13625. class ui_ModeSelection_com3 extends fgui.GButton {
  13626. static createInstance() {
  13627. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13628. }
  13629. onConstruct() {
  13630. this.n34 = (this.getChild("n34"));
  13631. this.n36 = (this.getChild("n36"));
  13632. this.n22 = (this.getChild("n22"));
  13633. this.n20 = (this.getChild("n20"));
  13634. this.n23 = (this.getChild("n23"));
  13635. this.n24 = (this.getChild("n24"));
  13636. this.n26 = (this.getChild("n26"));
  13637. this.n33 = (this.getChild("n33"));
  13638. this.coinImg = (this.getChild("coinImg"));
  13639. this.need = (this.getChild("need"));
  13640. this.n35 = (this.getChild("n35"));
  13641. this.n29 = (this.getChild("n29"));
  13642. this.tipsTxt = (this.getChild("tipsTxt"));
  13643. this.n30 = (this.getChild("n30"));
  13644. this.peopleTxt = (this.getChild("peopleTxt"));
  13645. this.t0 = this.getTransition("t0");
  13646. }
  13647. }
  13648. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13649. class ui_Invitation_com1 extends fgui.GComponent {
  13650. static createInstance() {
  13651. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13652. }
  13653. onConstruct() {
  13654. this.n14 = (this.getChild("n14"));
  13655. this.n13 = (this.getChild("n13"));
  13656. this.n3 = (this.getChild("n3"));
  13657. this.n1 = (this.getChild("n1"));
  13658. this.n6 = (this.getChild("n6"));
  13659. this.n7 = (this.getChild("n7"));
  13660. this.enterBtn = (this.getChild("enterBtn"));
  13661. this.n11 = (this.getChild("n11"));
  13662. this.n12 = (this.getChild("n12"));
  13663. this.n15 = (this.getChild("n15"));
  13664. this.t0 = this.getTransition("t0");
  13665. this.t1 = this.getTransition("t1");
  13666. }
  13667. }
  13668. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13669. class ui_Component87_1 extends fgui.GComponent {
  13670. static createInstance() {
  13671. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13672. }
  13673. onConstruct() {
  13674. this.n74 = (this.getChild("n74"));
  13675. this.n73 = (this.getChild("n73"));
  13676. this.ballTxt = (this.getChild("ballTxt"));
  13677. this.n76 = (this.getChild("n76"));
  13678. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13679. this.levelTxt = (this.getChild("levelTxt"));
  13680. this.n87 = (this.getChild("n87"));
  13681. this.n84 = (this.getChild("n84"));
  13682. this.hpTxt = (this.getChild("hpTxt"));
  13683. this.n89 = (this.getChild("n89"));
  13684. this.tipsTxt = (this.getChild("tipsTxt"));
  13685. }
  13686. }
  13687. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13688. class ui_sqg1 extends fgui.GComponent {
  13689. static createInstance() {
  13690. return (fgui.UIPackage.createObject("game", "sqg1"));
  13691. }
  13692. onConstruct() {
  13693. this.n1 = (this.getChild("n1"));
  13694. this.n0 = (this.getChild("n0"));
  13695. }
  13696. }
  13697. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13698. class ui_sqg2 extends fgui.GComponent {
  13699. static createInstance() {
  13700. return (fgui.UIPackage.createObject("game", "sqg2"));
  13701. }
  13702. onConstruct() {
  13703. this.n1 = (this.getChild("n1"));
  13704. this.n0 = (this.getChild("n0"));
  13705. }
  13706. }
  13707. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13708. class ui_sqg3 extends fgui.GComponent {
  13709. static createInstance() {
  13710. return (fgui.UIPackage.createObject("game", "sqg3"));
  13711. }
  13712. onConstruct() {
  13713. this.n1 = (this.getChild("n1"));
  13714. this.n0 = (this.getChild("n0"));
  13715. }
  13716. }
  13717. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13718. class ui_sqg4 extends fgui.GComponent {
  13719. static createInstance() {
  13720. return (fgui.UIPackage.createObject("game", "sqg4"));
  13721. }
  13722. onConstruct() {
  13723. this.n1 = (this.getChild("n1"));
  13724. this.n0 = (this.getChild("n0"));
  13725. }
  13726. }
  13727. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13728. class ui_Component36 extends fgui.GButton {
  13729. static createInstance() {
  13730. return (fgui.UIPackage.createObject("game", "Component36"));
  13731. }
  13732. onConstruct() {
  13733. this.c1 = this.getController("c1");
  13734. this.n53 = (this.getChild("n53"));
  13735. this.n56 = (this.getChild("n56"));
  13736. }
  13737. }
  13738. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13739. class ui_Component37 extends fgui.GButton {
  13740. static createInstance() {
  13741. return (fgui.UIPackage.createObject("game", "Component37"));
  13742. }
  13743. onConstruct() {
  13744. this.c1 = this.getController("c1");
  13745. this.n52 = (this.getChild("n52"));
  13746. this.n54 = (this.getChild("n54"));
  13747. }
  13748. }
  13749. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13750. class ui_UISetting extends fgui.GComponent {
  13751. static createInstance() {
  13752. return (fgui.UIPackage.createObject("game", "UISetting"));
  13753. }
  13754. onConstruct() {
  13755. this.c1 = this.getController("c1");
  13756. this.n4 = (this.getChild("n4"));
  13757. this.soundBtn = (this.getChild("soundBtn"));
  13758. this.shakeBtn = (this.getChild("shakeBtn"));
  13759. this.clickNode = (this.getChild("clickNode"));
  13760. this.xyBtn = (this.getChild("xyBtn"));
  13761. }
  13762. }
  13763. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13764. class ui_Component39 extends fgui.GComponent {
  13765. static createInstance() {
  13766. return (fgui.UIPackage.createObject("game", "Component39"));
  13767. }
  13768. onConstruct() {
  13769. this.n5 = (this.getChild("n5"));
  13770. this.n6 = (this.getChild("n6"));
  13771. this.n7 = (this.getChild("n7"));
  13772. this.t0 = this.getTransition("t0");
  13773. }
  13774. }
  13775. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13776. class ui_Component40 extends fgui.GButton {
  13777. static createInstance() {
  13778. return (fgui.UIPackage.createObject("game", "Component40"));
  13779. }
  13780. onConstruct() {
  13781. this.n46 = (this.getChild("n46"));
  13782. this.n47 = (this.getChild("n47"));
  13783. }
  13784. }
  13785. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13786. class ui_Component41 extends fgui.GComponent {
  13787. static createInstance() {
  13788. return (fgui.UIPackage.createObject("game", "Component41"));
  13789. }
  13790. onConstruct() {
  13791. this.c1 = this.getController("c1");
  13792. this.n0 = (this.getChild("n0"));
  13793. this.titleTxt = (this.getChild("titleTxt"));
  13794. this.n2 = (this.getChild("n2"));
  13795. this.msgTips = (this.getChild("msgTips"));
  13796. this.numTxt = (this.getChild("numTxt"));
  13797. this.n18 = (this.getChild("n18"));
  13798. this.cancelBtn = (this.getChild("cancelBtn"));
  13799. this.videoBtn = (this.getChild("videoBtn"));
  13800. this.n10 = (this.getChild("n10"));
  13801. }
  13802. }
  13803. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13804. class ui_Component42 extends fgui.GComponent {
  13805. static createInstance() {
  13806. return (fgui.UIPackage.createObject("game", "Component42"));
  13807. }
  13808. onConstruct() {
  13809. this.c1 = this.getController("c1");
  13810. this.n1 = (this.getChild("n1"));
  13811. this.n2 = (this.getChild("n2"));
  13812. this.n3 = (this.getChild("n3"));
  13813. this.tipsTxt = (this.getChild("tipsTxt"));
  13814. this.cancelBtn = (this.getChild("cancelBtn"));
  13815. this.sureBtn = (this.getChild("sureBtn"));
  13816. this.n11 = (this.getChild("n11"));
  13817. this.n13 = (this.getChild("n13"));
  13818. this.n14 = (this.getChild("n14"));
  13819. this.womanTxt = (this.getChild("womanTxt"));
  13820. this.t0 = this.getTransition("t0");
  13821. }
  13822. }
  13823. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13824. class ui_dh_js_shengli extends fgui.GComponent {
  13825. static createInstance() {
  13826. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13827. }
  13828. onConstruct() {
  13829. this.n3 = (this.getChild("n3"));
  13830. this.n4 = (this.getChild("n4"));
  13831. this.n1 = (this.getChild("n1"));
  13832. this.n2 = (this.getChild("n2"));
  13833. this.n5 = (this.getChild("n5"));
  13834. this.n6 = (this.getChild("n6"));
  13835. this.n7 = (this.getChild("n7"));
  13836. this.n8 = (this.getChild("n8"));
  13837. this.attack = this.getTransition("attack");
  13838. this.idle = this.getTransition("idle");
  13839. }
  13840. }
  13841. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13842. class ui_dh_js_shengli_g extends fgui.GComponent {
  13843. static createInstance() {
  13844. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13845. }
  13846. onConstruct() {
  13847. this.n3 = (this.getChild("n3"));
  13848. this.n1 = (this.getChild("n1"));
  13849. this.t0 = this.getTransition("t0");
  13850. }
  13851. }
  13852. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13853. class ui_dh_js_shibai extends fgui.GComponent {
  13854. static createInstance() {
  13855. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13856. }
  13857. onConstruct() {
  13858. this.n0 = (this.getChild("n0"));
  13859. this.n1 = (this.getChild("n1"));
  13860. this.n2 = (this.getChild("n2"));
  13861. this.n3 = (this.getChild("n3"));
  13862. this.idle = this.getTransition("idle");
  13863. this.attack = this.getTransition("attack");
  13864. }
  13865. }
  13866. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13867. class ui_dh_zy_ganfa extends fgui.GButton {
  13868. static createInstance() {
  13869. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13870. }
  13871. onConstruct() {
  13872. this.n0 = (this.getChild("n0"));
  13873. }
  13874. }
  13875. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13876. class ui_dh_zy_sc_guang extends fgui.GButton {
  13877. static createInstance() {
  13878. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13879. }
  13880. onConstruct() {
  13881. this.n0 = (this.getChild("n0"));
  13882. this.n2 = (this.getChild("n2"));
  13883. }
  13884. }
  13885. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13886. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13887. static createInstance() {
  13888. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13889. }
  13890. onConstruct() {
  13891. this.n0 = (this.getChild("n0"));
  13892. this.n3 = (this.getChild("n3"));
  13893. this.t0 = this.getTransition("t0");
  13894. }
  13895. }
  13896. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13897. class ui_dh_zy_wanfa extends fgui.GButton {
  13898. static createInstance() {
  13899. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13900. }
  13901. onConstruct() {
  13902. this.n0 = (this.getChild("n0"));
  13903. }
  13904. }
  13905. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13906. class ui_Component53_1 extends fgui.GComponent {
  13907. static createInstance() {
  13908. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13909. }
  13910. onConstruct() {
  13911. this.n0 = (this.getChild("n0"));
  13912. this.n1 = (this.getChild("n1"));
  13913. this.n2 = (this.getChild("n2"));
  13914. this.n3 = (this.getChild("n3"));
  13915. this.n4 = (this.getChild("n4"));
  13916. this.n5 = (this.getChild("n5"));
  13917. this.n6 = (this.getChild("n6"));
  13918. this.n7 = (this.getChild("n7"));
  13919. this.n8 = (this.getChild("n8"));
  13920. this.n9 = (this.getChild("n9"));
  13921. this.n10 = (this.getChild("n10"));
  13922. this.n11 = (this.getChild("n11"));
  13923. this.n12 = (this.getChild("n12"));
  13924. this.n13 = (this.getChild("n13"));
  13925. this.n14 = (this.getChild("n14"));
  13926. this.n15 = (this.getChild("n15"));
  13927. this.n16 = (this.getChild("n16"));
  13928. this.n19 = (this.getChild("n19"));
  13929. this.n20 = (this.getChild("n20"));
  13930. this.n21 = (this.getChild("n21"));
  13931. this.n22 = (this.getChild("n22"));
  13932. this.n23 = (this.getChild("n23"));
  13933. this.n24 = (this.getChild("n24"));
  13934. this.n25 = (this.getChild("n25"));
  13935. this.n26 = (this.getChild("n26"));
  13936. this.n27 = (this.getChild("n27"));
  13937. this.n28 = (this.getChild("n28"));
  13938. this.n29 = (this.getChild("n29"));
  13939. this.n30 = (this.getChild("n30"));
  13940. this.n31 = (this.getChild("n31"));
  13941. this.n32 = (this.getChild("n32"));
  13942. this.n33 = (this.getChild("n33"));
  13943. this.n34 = (this.getChild("n34"));
  13944. this.n35 = (this.getChild("n35"));
  13945. this.t0 = this.getTransition("t0");
  13946. }
  13947. }
  13948. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13949. class ui_Component30 extends fgui.GComponent {
  13950. static createInstance() {
  13951. return (fgui.UIPackage.createObject("game", "Component30"));
  13952. }
  13953. onConstruct() {
  13954. this.c1 = this.getController("c1");
  13955. this.n46 = (this.getChild("n46"));
  13956. this.n47 = (this.getChild("n47"));
  13957. this.numTxt = (this.getChild("numTxt"));
  13958. this.n50 = (this.getChild("n50"));
  13959. this.n53 = (this.getChild("n53"));
  13960. this.n54 = (this.getChild("n54"));
  13961. this.n55 = (this.getChild("n55"));
  13962. this.n56 = (this.getChild("n56"));
  13963. }
  13964. }
  13965. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13966. class ui_Component30_1 extends fgui.GComponent {
  13967. static createInstance() {
  13968. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13969. }
  13970. onConstruct() {
  13971. this.c1 = this.getController("c1");
  13972. this.n46 = (this.getChild("n46"));
  13973. this.n47 = (this.getChild("n47"));
  13974. this.numTxt = (this.getChild("numTxt"));
  13975. this.n50 = (this.getChild("n50"));
  13976. this.n51 = (this.getChild("n51"));
  13977. this.n52 = (this.getChild("n52"));
  13978. this.n53 = (this.getChild("n53"));
  13979. this.n54 = (this.getChild("n54"));
  13980. }
  13981. }
  13982. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13983. class ui_Component31 extends fgui.GComponent {
  13984. static createInstance() {
  13985. return (fgui.UIPackage.createObject("game", "Component31"));
  13986. }
  13987. onConstruct() {
  13988. this.n55 = (this.getChild("n55"));
  13989. this.n54 = (this.getChild("n54"));
  13990. this.conditionTxt = (this.getChild("conditionTxt"));
  13991. this.n57 = (this.getChild("n57"));
  13992. this.t0 = this.getTransition("t0");
  13993. }
  13994. }
  13995. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13996. class ui_Component32 extends fgui.GComponent {
  13997. static createInstance() {
  13998. return (fgui.UIPackage.createObject("game", "Component32"));
  13999. }
  14000. onConstruct() {
  14001. this.n5 = (this.getChild("n5"));
  14002. this.n6 = (this.getChild("n6"));
  14003. this.n7 = (this.getChild("n7"));
  14004. this.t0 = this.getTransition("t0");
  14005. }
  14006. }
  14007. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14008. class ui_AwardItem extends fgui.GComponent {
  14009. static createInstance() {
  14010. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14011. }
  14012. onConstruct() {
  14013. this.n9 = (this.getChild("n9"));
  14014. this.myIcon = (this.getChild("myIcon"));
  14015. this.numTxt = (this.getChild("numTxt"));
  14016. this.nameTxt = (this.getChild("nameTxt"));
  14017. this.n16 = (this.getChild("n16"));
  14018. this.n17 = (this.getChild("n17"));
  14019. }
  14020. }
  14021. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14022. class ui_ranking_com1 extends fgui.GButton {
  14023. static createInstance() {
  14024. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14025. }
  14026. onConstruct() {
  14027. this.c1 = this.getController("c1");
  14028. this.n49 = (this.getChild("n49"));
  14029. this.n18 = (this.getChild("n18"));
  14030. this.n46 = (this.getChild("n46"));
  14031. this.n48 = (this.getChild("n48"));
  14032. this.n50 = (this.getChild("n50"));
  14033. }
  14034. }
  14035. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14036. class ui_ranking_com2 extends fgui.GButton {
  14037. static createInstance() {
  14038. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14039. }
  14040. onConstruct() {
  14041. this.c1 = this.getController("c1");
  14042. this.n49 = (this.getChild("n49"));
  14043. this.n18 = (this.getChild("n18"));
  14044. this.n46 = (this.getChild("n46"));
  14045. this.n48 = (this.getChild("n48"));
  14046. this.n50 = (this.getChild("n50"));
  14047. }
  14048. }
  14049. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14050. class ui_ranking_com3 extends fgui.GComponent {
  14051. static createInstance() {
  14052. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14053. }
  14054. onConstruct() {
  14055. this.n17 = (this.getChild("n17"));
  14056. this.myIcon = (this.getChild("myIcon"));
  14057. }
  14058. }
  14059. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14060. class ui_ranking_com4 extends fgui.GComponent {
  14061. static createInstance() {
  14062. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14063. }
  14064. onConstruct() {
  14065. this.n16 = (this.getChild("n16"));
  14066. this.head = (this.getChild("head"));
  14067. }
  14068. }
  14069. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14070. class ui_ranking_com5 extends fgui.GComponent {
  14071. static createInstance() {
  14072. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14073. }
  14074. onConstruct() {
  14075. this.c1 = this.getController("c1");
  14076. this.c2 = this.getController("c2");
  14077. this.n2 = (this.getChild("n2"));
  14078. this.n3 = (this.getChild("n3"));
  14079. this.levelBtn = (this.getChild("levelBtn"));
  14080. this.starBtn = (this.getChild("starBtn"));
  14081. this.n23 = (this.getChild("n23"));
  14082. this.n24 = (this.getChild("n24"));
  14083. this.n25 = (this.getChild("n25"));
  14084. this.myList = (this.getChild("myList"));
  14085. this.selfNode = (this.getChild("selfNode"));
  14086. this.n9 = (this.getChild("n9"));
  14087. this.n12 = (this.getChild("n12"));
  14088. this.n13 = (this.getChild("n13"));
  14089. this.n14 = (this.getChild("n14"));
  14090. this.n39 = (this.getChild("n39"));
  14091. this.n41 = (this.getChild("n41"));
  14092. this.n42 = (this.getChild("n42"));
  14093. this.n45 = (this.getChild("n45"));
  14094. this.changeBtn = (this.getChild("changeBtn"));
  14095. this.closeBtn = (this.getChild("closeBtn"));
  14096. this.t0 = this.getTransition("t0");
  14097. }
  14098. }
  14099. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14100. class ui_RankItem extends fgui.GComponent {
  14101. static createInstance() {
  14102. return (fgui.UIPackage.createObject("game", "RankItem"));
  14103. }
  14104. onConstruct() {
  14105. this.n10 = (this.getChild("n10"));
  14106. this.n11 = (this.getChild("n11"));
  14107. this.rankTxt = (this.getChild("rankTxt"));
  14108. this.headNode = (this.getChild("headNode"));
  14109. this.nameTxt = (this.getChild("nameTxt"));
  14110. this.n19 = (this.getChild("n19"));
  14111. this.valueTxt = (this.getChild("valueTxt"));
  14112. this.img1 = (this.getChild("img1"));
  14113. this.img2 = (this.getChild("img2"));
  14114. this.img3 = (this.getChild("img3"));
  14115. }
  14116. }
  14117. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  14118. class ui_ranking_com9 extends fgui.GComponent {
  14119. static createInstance() {
  14120. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  14121. }
  14122. onConstruct() {
  14123. this.c1 = this.getController("c1");
  14124. this.n27 = (this.getChild("n27"));
  14125. this.n28 = (this.getChild("n28"));
  14126. this.headNode = (this.getChild("headNode"));
  14127. this.rankTxt = (this.getChild("rankTxt"));
  14128. this.nameTxt = (this.getChild("nameTxt"));
  14129. this.n34 = (this.getChild("n34"));
  14130. this.valueTxt = (this.getChild("valueTxt"));
  14131. this.n36 = (this.getChild("n36"));
  14132. this.n37 = (this.getChild("n37"));
  14133. this.n38 = (this.getChild("n38"));
  14134. this.n39 = (this.getChild("n39"));
  14135. this.n40 = (this.getChild("n40"));
  14136. }
  14137. }
  14138. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  14139. class ui_ranking_com10 extends fgui.GComponent {
  14140. static createInstance() {
  14141. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  14142. }
  14143. onConstruct() {
  14144. this.n23 = (this.getChild("n23"));
  14145. this.n24 = (this.getChild("n24"));
  14146. }
  14147. }
  14148. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  14149. class ui_ranking_com11 extends fgui.GComponent {
  14150. static createInstance() {
  14151. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  14152. }
  14153. onConstruct() {
  14154. this.n24 = (this.getChild("n24"));
  14155. this.n25 = (this.getChild("n25"));
  14156. this.t0 = this.getTransition("t0");
  14157. }
  14158. }
  14159. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  14160. class ui_ranking_com13 extends fgui.GButton {
  14161. static createInstance() {
  14162. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  14163. }
  14164. onConstruct() {
  14165. this.c1 = this.getController("c1");
  14166. this.n44 = (this.getChild("n44"));
  14167. this.n45 = (this.getChild("n45"));
  14168. this.n46 = (this.getChild("n46"));
  14169. }
  14170. }
  14171. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  14172. class ui_Component122 extends fgui.GComponent {
  14173. static createInstance() {
  14174. return (fgui.UIPackage.createObject("game", "Component122"));
  14175. }
  14176. onConstruct() {
  14177. this.gameNode3 = (this.getChild("gameNode3"));
  14178. }
  14179. }
  14180. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  14181. class ui_skillItem extends fgui.GComponent {
  14182. static createInstance() {
  14183. return (fgui.UIPackage.createObject("game", "skillItem"));
  14184. }
  14185. onConstruct() {
  14186. this.c1 = this.getController("c1");
  14187. this.n31 = (this.getChild("n31"));
  14188. this.n6 = (this.getChild("n6"));
  14189. this.skillImg = (this.getChild("skillImg"));
  14190. this.nameTxt = (this.getChild("nameTxt"));
  14191. this.levelTxt = (this.getChild("levelTxt"));
  14192. this.n28 = (this.getChild("n28"));
  14193. this.describeTxt = (this.getChild("describeTxt"));
  14194. this.n32 = (this.getChild("n32"));
  14195. this.mutiBtn = (this.getChild("mutiBtn"));
  14196. this.tryNode = (this.getChild("tryNode"));
  14197. this.normalBtn = (this.getChild("normalBtn"));
  14198. this.startBtn = (this.getChild("startBtn"));
  14199. this.n42 = (this.getChild("n42"));
  14200. this.n43 = (this.getChild("n43"));
  14201. this.n44 = (this.getChild("n44"));
  14202. }
  14203. }
  14204. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  14205. class ui_Component26 extends fgui.GButton {
  14206. static createInstance() {
  14207. return (fgui.UIPackage.createObject("game", "Component26"));
  14208. }
  14209. onConstruct() {
  14210. this.n11 = (this.getChild("n11"));
  14211. this.n30 = (this.getChild("n30"));
  14212. this.n34 = (this.getChild("n34"));
  14213. }
  14214. }
  14215. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  14216. class ui_Component28 extends fgui.GButton {
  14217. static createInstance() {
  14218. return (fgui.UIPackage.createObject("game", "Component28"));
  14219. }
  14220. onConstruct() {
  14221. this.n12 = (this.getChild("n12"));
  14222. this.n31 = (this.getChild("n31"));
  14223. this.curTxt = (this.getChild("curTxt"));
  14224. this.n33 = (this.getChild("n33"));
  14225. }
  14226. }
  14227. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  14228. class ui_Component1302 extends fgui.GComponent {
  14229. static createInstance() {
  14230. return (fgui.UIPackage.createObject("game", "Component1302"));
  14231. }
  14232. onConstruct() {
  14233. this.n2 = (this.getChild("n2"));
  14234. this.n3 = (this.getChild("n3"));
  14235. }
  14236. }
  14237. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  14238. class ui_Component113 extends fgui.GComponent {
  14239. static createInstance() {
  14240. return (fgui.UIPackage.createObject("game", "Component113"));
  14241. }
  14242. onConstruct() {
  14243. this.n85 = (this.getChild("n85"));
  14244. this.n86 = (this.getChild("n86"));
  14245. this.n77 = (this.getChild("n77"));
  14246. this.n79 = (this.getChild("n79"));
  14247. this.n80 = (this.getChild("n80"));
  14248. this.n81 = (this.getChild("n81"));
  14249. this.n82 = (this.getChild("n82"));
  14250. this.n84 = (this.getChild("n84"));
  14251. this.n87 = (this.getChild("n87"));
  14252. this.t0 = this.getTransition("t0");
  14253. }
  14254. }
  14255. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  14256. class ui_Component114 extends fgui.GComponent {
  14257. static createInstance() {
  14258. return (fgui.UIPackage.createObject("game", "Component114"));
  14259. }
  14260. onConstruct() {
  14261. this.n77 = (this.getChild("n77"));
  14262. this.t0 = this.getTransition("t0");
  14263. }
  14264. }
  14265. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  14266. class ui_Component115 extends fgui.GComponent {
  14267. static createInstance() {
  14268. return (fgui.UIPackage.createObject("game", "Component115"));
  14269. }
  14270. onConstruct() {
  14271. this.n83 = (this.getChild("n83"));
  14272. this.fingerNode = (this.getChild("fingerNode"));
  14273. this.n84 = (this.getChild("n84"));
  14274. }
  14275. }
  14276. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  14277. class ui_Component117 extends fgui.GComponent {
  14278. static createInstance() {
  14279. return (fgui.UIPackage.createObject("game", "Component117"));
  14280. }
  14281. onConstruct() {
  14282. this.n87 = (this.getChild("n87"));
  14283. this.n88 = (this.getChild("n88"));
  14284. this.n84 = (this.getChild("n84"));
  14285. this.n85 = (this.getChild("n85"));
  14286. this.n86 = (this.getChild("n86"));
  14287. this.t0 = this.getTransition("t0");
  14288. }
  14289. }
  14290. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  14291. class ui_Component98_1 extends fgui.GButton {
  14292. static createInstance() {
  14293. return (fgui.UIPackage.createObject("game", "Component98_1"));
  14294. }
  14295. onConstruct() {
  14296. this.c1 = this.getController("c1");
  14297. this.n8 = (this.getChild("n8"));
  14298. this.n41 = (this.getChild("n41"));
  14299. this.n40 = (this.getChild("n40"));
  14300. }
  14301. }
  14302. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  14303. class ui_Component61 extends fgui.GComponent {
  14304. static createInstance() {
  14305. return (fgui.UIPackage.createObject("game", "Component61"));
  14306. }
  14307. onConstruct() {
  14308. this.n14 = (this.getChild("n14"));
  14309. this.n6 = (this.getChild("n6"));
  14310. this.t0 = this.getTransition("t0");
  14311. }
  14312. }
  14313. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  14314. class ui_Component62 extends fgui.GComponent {
  14315. static createInstance() {
  14316. return (fgui.UIPackage.createObject("game", "Component62"));
  14317. }
  14318. onConstruct() {
  14319. this.n66 = (this.getChild("n66"));
  14320. this.n56 = (this.getChild("n56"));
  14321. this.n63 = (this.getChild("n63"));
  14322. this.n65 = (this.getChild("n65"));
  14323. this.t0 = this.getTransition("t0");
  14324. }
  14325. }
  14326. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  14327. class ui_d3Root extends fgui.GComponent {
  14328. static createInstance() {
  14329. return (fgui.UIPackage.createObject("game", "d3Root"));
  14330. }
  14331. onConstruct() {
  14332. }
  14333. }
  14334. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  14335. class ui_d2Root extends fgui.GComponent {
  14336. static createInstance() {
  14337. return (fgui.UIPackage.createObject("game", "d2Root"));
  14338. }
  14339. onConstruct() {
  14340. }
  14341. }
  14342. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  14343. class ui_ballNode extends fgui.GComponent {
  14344. static createInstance() {
  14345. return (fgui.UIPackage.createObject("game", "ballNode"));
  14346. }
  14347. onConstruct() {
  14348. }
  14349. }
  14350. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  14351. class ui_border extends fgui.GComponent {
  14352. static createInstance() {
  14353. return (fgui.UIPackage.createObject("game", "border"));
  14354. }
  14355. onConstruct() {
  14356. this.bar1 = (this.getChild("bar1"));
  14357. this.bar2 = (this.getChild("bar2"));
  14358. this.bar3 = (this.getChild("bar3"));
  14359. this.bar4 = (this.getChild("bar4"));
  14360. this.bar5 = (this.getChild("bar5"));
  14361. this.bar6 = (this.getChild("bar6"));
  14362. this.circle1 = (this.getChild("circle1"));
  14363. this.circle2 = (this.getChild("circle2"));
  14364. this.circle3 = (this.getChild("circle3"));
  14365. this.circle4 = (this.getChild("circle4"));
  14366. this.circle5 = (this.getChild("circle5"));
  14367. this.circle6 = (this.getChild("circle6"));
  14368. this.n28 = (this.getChild("n28"));
  14369. }
  14370. }
  14371. ui_border.URL = "ui://isxx5ak7sdh33qq";
  14372. class ui_Component41_2 extends fgui.GComponent {
  14373. static createInstance() {
  14374. return (fgui.UIPackage.createObject("game", "Component41_2"));
  14375. }
  14376. onConstruct() {
  14377. this.c1 = this.getController("c1");
  14378. this.n0 = (this.getChild("n0"));
  14379. this.n2 = (this.getChild("n2"));
  14380. this.n19 = (this.getChild("n19"));
  14381. this.cancelBtn = (this.getChild("cancelBtn"));
  14382. this.videoBtn = (this.getChild("videoBtn"));
  14383. this.n9 = (this.getChild("n9"));
  14384. this.n22 = (this.getChild("n22"));
  14385. this.tipsTxt = (this.getChild("tipsTxt"));
  14386. this.n23 = (this.getChild("n23"));
  14387. this.n24 = (this.getChild("n24"));
  14388. this.n26 = (this.getChild("n26"));
  14389. this.n27 = (this.getChild("n27"));
  14390. this.titleTxt = (this.getChild("titleTxt"));
  14391. }
  14392. }
  14393. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  14394. class ui_Component41_1 extends fgui.GComponent {
  14395. static createInstance() {
  14396. return (fgui.UIPackage.createObject("game", "Component41_1"));
  14397. }
  14398. onConstruct() {
  14399. this.c1 = this.getController("c1");
  14400. this.n0 = (this.getChild("n0"));
  14401. this.n2 = (this.getChild("n2"));
  14402. this.cancelBtn = (this.getChild("cancelBtn"));
  14403. this.videoBtn = (this.getChild("videoBtn"));
  14404. this.n27 = (this.getChild("n27"));
  14405. this.n30 = (this.getChild("n30"));
  14406. this.n31 = (this.getChild("n31"));
  14407. this.n32 = (this.getChild("n32"));
  14408. this.n33 = (this.getChild("n33"));
  14409. this.n34 = (this.getChild("n34"));
  14410. this.n35 = (this.getChild("n35"));
  14411. this.n36 = (this.getChild("n36"));
  14412. this.n1 = (this.getChild("n1"));
  14413. this.n37 = (this.getChild("n37"));
  14414. this.t0 = this.getTransition("t0");
  14415. this.t1 = this.getTransition("t1");
  14416. this.t2 = this.getTransition("t2");
  14417. this.t3 = this.getTransition("t3");
  14418. }
  14419. }
  14420. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  14421. class ui_againBtn extends fgui.GButton {
  14422. static createInstance() {
  14423. return (fgui.UIPackage.createObject("game", "againBtn"));
  14424. }
  14425. onConstruct() {
  14426. this.n2 = (this.getChild("n2"));
  14427. this.n1 = (this.getChild("n1"));
  14428. this.n5 = (this.getChild("n5"));
  14429. }
  14430. }
  14431. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  14432. class ui_Component118 extends fgui.GButton {
  14433. static createInstance() {
  14434. return (fgui.UIPackage.createObject("game", "Component118"));
  14435. }
  14436. onConstruct() {
  14437. this.c1 = this.getController("c1");
  14438. this.n14 = (this.getChild("n14"));
  14439. this.n9 = (this.getChild("n9"));
  14440. this.n10 = (this.getChild("n10"));
  14441. this.diamondTxt = (this.getChild("diamondTxt"));
  14442. this.n13 = (this.getChild("n13"));
  14443. this.n15 = (this.getChild("n15"));
  14444. }
  14445. }
  14446. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  14447. class ui_Component119 extends fgui.GComponent {
  14448. static createInstance() {
  14449. return (fgui.UIPackage.createObject("game", "Component119"));
  14450. }
  14451. onConstruct() {
  14452. this.n1 = (this.getChild("n1"));
  14453. this.n2 = (this.getChild("n2"));
  14454. this.n13 = (this.getChild("n13"));
  14455. this.n6 = (this.getChild("n6"));
  14456. this.screenNode = (this.getChild("screenNode"));
  14457. this.n15 = (this.getChild("n15"));
  14458. this.closeBtn = (this.getChild("closeBtn"));
  14459. this.share2Btn = (this.getChild("share2Btn"));
  14460. this.shareBtn = (this.getChild("shareBtn"));
  14461. this.tipsNode = (this.getChild("tipsNode"));
  14462. this.awardNode = (this.getChild("awardNode"));
  14463. }
  14464. }
  14465. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  14466. class ui_Component132_1 extends fgui.GComponent {
  14467. static createInstance() {
  14468. return (fgui.UIPackage.createObject("game", "Component132_1"));
  14469. }
  14470. onConstruct() {
  14471. this.n25 = (this.getChild("n25"));
  14472. this.n26 = (this.getChild("n26"));
  14473. this.n27 = (this.getChild("n27"));
  14474. this.t0 = this.getTransition("t0");
  14475. }
  14476. }
  14477. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  14478. class ui_SecretaryDisplay extends fgui.GComponent {
  14479. static createInstance() {
  14480. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  14481. }
  14482. onConstruct() {
  14483. this.n2 = (this.getChild("n2"));
  14484. this.levelTxt = (this.getChild("levelTxt"));
  14485. this.n4 = (this.getChild("n4"));
  14486. this.secretary = (this.getChild("secretary"));
  14487. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14488. this.n16 = (this.getChild("n16"));
  14489. this.n37 = (this.getChild("n37"));
  14490. this.n41 = (this.getChild("n41"));
  14491. this.n14 = (this.getChild("n14"));
  14492. this.n17 = (this.getChild("n17"));
  14493. this.heightTxt = (this.getChild("heightTxt"));
  14494. this.n46 = (this.getChild("n46"));
  14495. this.n36 = (this.getChild("n36"));
  14496. this.n38 = (this.getChild("n38"));
  14497. this.foodTxt = (this.getChild("foodTxt"));
  14498. this.n47 = (this.getChild("n47"));
  14499. this.n40 = (this.getChild("n40"));
  14500. this.n42 = (this.getChild("n42"));
  14501. this.historyTxt = (this.getChild("historyTxt"));
  14502. this.n48 = (this.getChild("n48"));
  14503. this.nameImg = (this.getChild("nameImg"));
  14504. this.n12 = (this.getChild("n12"));
  14505. this.n49 = (this.getChild("n49"));
  14506. this.t0 = this.getTransition("t0");
  14507. }
  14508. }
  14509. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14510. class ui_BallRodDisplay extends fgui.GComponent {
  14511. static createInstance() {
  14512. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14513. }
  14514. onConstruct() {
  14515. this.c1 = this.getController("c1");
  14516. this.n31 = (this.getChild("n31"));
  14517. this.n6 = (this.getChild("n6"));
  14518. this.nameTxt = (this.getChild("nameTxt"));
  14519. this.rodImg = (this.getChild("rodImg"));
  14520. this.levelNode = (this.getChild("levelNode"));
  14521. this.eftRod = (this.getChild("eftRod"));
  14522. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14523. }
  14524. }
  14525. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14526. class ui_Component111_11 extends fgui.GComponent {
  14527. static createInstance() {
  14528. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14529. }
  14530. onConstruct() {
  14531. this.n68 = (this.getChild("n68"));
  14532. this.n69 = (this.getChild("n69"));
  14533. }
  14534. }
  14535. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14536. class ui_Component112 extends fgui.GComponent {
  14537. static createInstance() {
  14538. return (fgui.UIPackage.createObject("game", "Component112"));
  14539. }
  14540. onConstruct() {
  14541. this.n68 = (this.getChild("n68"));
  14542. this.n70 = (this.getChild("n70"));
  14543. this.myMask = (this.getChild("myMask"));
  14544. }
  14545. }
  14546. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14547. class ui_Component111 extends fgui.GComponent {
  14548. static createInstance() {
  14549. return (fgui.UIPackage.createObject("game", "Component111"));
  14550. }
  14551. onConstruct() {
  14552. this.n68 = (this.getChild("n68"));
  14553. this.myMask = (this.getChild("myMask"));
  14554. }
  14555. }
  14556. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14557. class ui_Component144 extends fgui.GButton {
  14558. static createInstance() {
  14559. return (fgui.UIPackage.createObject("game", "Component144"));
  14560. }
  14561. onConstruct() {
  14562. this.n8 = (this.getChild("n8"));
  14563. }
  14564. }
  14565. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14566. class ui_Sign_com2 extends fgui.GComponent {
  14567. static createInstance() {
  14568. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14569. }
  14570. onConstruct() {
  14571. this.n0 = (this.getChild("n0"));
  14572. this.n1 = (this.getChild("n1"));
  14573. this.t0 = this.getTransition("t0");
  14574. }
  14575. }
  14576. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14577. class ui_Sign_guang extends fgui.GComponent {
  14578. static createInstance() {
  14579. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14580. }
  14581. onConstruct() {
  14582. this.n1 = (this.getChild("n1"));
  14583. this.n2 = (this.getChild("n2"));
  14584. this.n3 = (this.getChild("n3"));
  14585. this.n4 = (this.getChild("n4"));
  14586. this.n5 = (this.getChild("n5"));
  14587. this.n6 = (this.getChild("n6"));
  14588. this.n8 = (this.getChild("n8"));
  14589. }
  14590. }
  14591. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14592. class ui_SignMax extends fgui.GComponent {
  14593. static createInstance() {
  14594. return (fgui.UIPackage.createObject("game", "SignMax"));
  14595. }
  14596. onConstruct() {
  14597. this.c1 = this.getController("c1");
  14598. this.n7 = (this.getChild("n7"));
  14599. this.n15 = (this.getChild("n15"));
  14600. this.n8 = (this.getChild("n8"));
  14601. this.titleTxt = (this.getChild("titleTxt"));
  14602. this.myIcon1 = (this.getChild("myIcon1"));
  14603. this.numTxt1 = (this.getChild("numTxt1"));
  14604. this.myIcon2 = (this.getChild("myIcon2"));
  14605. this.n20 = (this.getChild("n20"));
  14606. this.n17 = (this.getChild("n17"));
  14607. this.numTxt2 = (this.getChild("numTxt2"));
  14608. this.n12 = (this.getChild("n12"));
  14609. this.n13 = (this.getChild("n13"));
  14610. this.n21 = (this.getChild("n21"));
  14611. this.n14 = (this.getChild("n14"));
  14612. }
  14613. }
  14614. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14615. class ui_Sign_com2_1 extends fgui.GComponent {
  14616. static createInstance() {
  14617. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14618. }
  14619. onConstruct() {
  14620. this.n0 = (this.getChild("n0"));
  14621. this.n1 = (this.getChild("n1"));
  14622. this.t0 = this.getTransition("t0");
  14623. }
  14624. }
  14625. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14626. class ui_Sign_com5 extends fgui.GComponent {
  14627. static createInstance() {
  14628. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14629. }
  14630. onConstruct() {
  14631. this.n3 = (this.getChild("n3"));
  14632. this.n29 = (this.getChild("n29"));
  14633. this.n4 = (this.getChild("n4"));
  14634. this.day1 = (this.getChild("day1"));
  14635. this.day2 = (this.getChild("day2"));
  14636. this.day3 = (this.getChild("day3"));
  14637. this.day4 = (this.getChild("day4"));
  14638. this.day5 = (this.getChild("day5"));
  14639. this.day6 = (this.getChild("day6"));
  14640. this.day7 = (this.getChild("day7"));
  14641. this.t0 = this.getTransition("t0");
  14642. }
  14643. }
  14644. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14645. class ui_Sign_com8 extends fgui.GComponent {
  14646. static createInstance() {
  14647. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14648. }
  14649. onConstruct() {
  14650. this.n48 = (this.getChild("n48"));
  14651. this.womanTxt = (this.getChild("womanTxt"));
  14652. this.t0 = this.getTransition("t0");
  14653. }
  14654. }
  14655. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14656. class ui_Sign_com6 extends fgui.GComponent {
  14657. static createInstance() {
  14658. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14659. }
  14660. onConstruct() {
  14661. this.n2 = (this.getChild("n2"));
  14662. this.n3 = (this.getChild("n3"));
  14663. this.t0 = this.getTransition("t0");
  14664. }
  14665. }
  14666. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14667. class ui_Sign_com7 extends fgui.GComponent {
  14668. static createInstance() {
  14669. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14670. }
  14671. onConstruct() {
  14672. this.n29 = (this.getChild("n29"));
  14673. this.n2 = (this.getChild("n2"));
  14674. }
  14675. }
  14676. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14677. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14678. static createInstance() {
  14679. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14680. }
  14681. onConstruct() {
  14682. this.n5 = (this.getChild("n5"));
  14683. this.n4 = (this.getChild("n4"));
  14684. this.t0 = this.getTransition("t0");
  14685. }
  14686. }
  14687. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14688. class ui_UITurntable_com2 extends fgui.GComponent {
  14689. static createInstance() {
  14690. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14691. }
  14692. onConstruct() {
  14693. this.c1 = this.getController("c1");
  14694. this.n4 = (this.getChild("n4"));
  14695. this.n6 = (this.getChild("n6"));
  14696. this.n10 = (this.getChild("n10"));
  14697. this.n11 = (this.getChild("n11"));
  14698. this.n12 = (this.getChild("n12"));
  14699. this.n13 = (this.getChild("n13"));
  14700. this.n14 = (this.getChild("n14"));
  14701. this.n15 = (this.getChild("n15"));
  14702. this.n16 = (this.getChild("n16"));
  14703. this.n17 = (this.getChild("n17"));
  14704. this.n18 = (this.getChild("n18"));
  14705. this.n19 = (this.getChild("n19"));
  14706. this.n20 = (this.getChild("n20"));
  14707. this.n21 = (this.getChild("n21"));
  14708. this.n22 = (this.getChild("n22"));
  14709. this.n23 = (this.getChild("n23"));
  14710. this.n24 = (this.getChild("n24"));
  14711. this.n25 = (this.getChild("n25"));
  14712. this.n26 = (this.getChild("n26"));
  14713. this.n27 = (this.getChild("n27"));
  14714. this.n28 = (this.getChild("n28"));
  14715. this.n29 = (this.getChild("n29"));
  14716. this.n30 = (this.getChild("n30"));
  14717. this.n31 = (this.getChild("n31"));
  14718. this.n32 = (this.getChild("n32"));
  14719. this.n33 = (this.getChild("n33"));
  14720. }
  14721. }
  14722. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14723. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14724. static createInstance() {
  14725. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14726. }
  14727. onConstruct() {
  14728. this.n5 = (this.getChild("n5"));
  14729. this.n4 = (this.getChild("n4"));
  14730. this.t0 = this.getTransition("t0");
  14731. }
  14732. }
  14733. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14734. class ui_UITurntable_com5 extends fgui.GComponent {
  14735. static createInstance() {
  14736. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14737. }
  14738. onConstruct() {
  14739. this.flashNode = (this.getChild("flashNode"));
  14740. this.rotNode = (this.getChild("rotNode"));
  14741. this.n3 = (this.getChild("n3"));
  14742. this.n21 = (this.getChild("n21"));
  14743. this.t0 = this.getTransition("t0");
  14744. }
  14745. }
  14746. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14747. class ui_UITurntable_com7 extends fgui.GComponent {
  14748. static createInstance() {
  14749. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14750. }
  14751. onConstruct() {
  14752. this.n2 = (this.getChild("n2"));
  14753. this.n35 = (this.getChild("n35"));
  14754. this.img1 = (this.getChild("img1"));
  14755. this.img2 = (this.getChild("img2"));
  14756. this.img3 = (this.getChild("img3"));
  14757. this.img4 = (this.getChild("img4"));
  14758. this.img6 = (this.getChild("img6"));
  14759. this.img5 = (this.getChild("img5"));
  14760. this.txt1 = (this.getChild("txt1"));
  14761. this.txt2 = (this.getChild("txt2"));
  14762. this.txt3 = (this.getChild("txt3"));
  14763. this.txt4 = (this.getChild("txt4"));
  14764. this.txt5 = (this.getChild("txt5"));
  14765. this.txt6 = (this.getChild("txt6"));
  14766. }
  14767. }
  14768. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14769. class ui_UITurntable_com9 extends fgui.GComponent {
  14770. static createInstance() {
  14771. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14772. }
  14773. onConstruct() {
  14774. this.n38 = (this.getChild("n38"));
  14775. this.n39 = (this.getChild("n39"));
  14776. }
  14777. }
  14778. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14779. class ui_UITurntable_com10 extends fgui.GComponent {
  14780. static createInstance() {
  14781. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14782. }
  14783. onConstruct() {
  14784. this.n39 = (this.getChild("n39"));
  14785. this.n40 = (this.getChild("n40"));
  14786. this.t0 = this.getTransition("t0");
  14787. }
  14788. }
  14789. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14790. class ui_UITurntable_com11 extends fgui.GComponent {
  14791. static createInstance() {
  14792. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14793. }
  14794. onConstruct() {
  14795. this.n38 = (this.getChild("n38"));
  14796. this.n39 = (this.getChild("n39"));
  14797. this.n40 = (this.getChild("n40"));
  14798. this.t0 = this.getTransition("t0");
  14799. }
  14800. }
  14801. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14802. class ui_UITurntable_com12 extends fgui.GComponent {
  14803. static createInstance() {
  14804. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14805. }
  14806. onConstruct() {
  14807. this.n43 = (this.getChild("n43"));
  14808. this.barNode = (this.getChild("barNode"));
  14809. this.tipsTxt = (this.getChild("tipsTxt"));
  14810. this.n45 = (this.getChild("n45"));
  14811. this.boxBtn = (this.getChild("boxBtn"));
  14812. }
  14813. }
  14814. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14815. class ui_UITurntable_com1 extends fgui.GButton {
  14816. static createInstance() {
  14817. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14818. }
  14819. onConstruct() {
  14820. this.n41 = (this.getChild("n41"));
  14821. this.n42 = (this.getChild("n42"));
  14822. this.t0 = this.getTransition("t0");
  14823. }
  14824. }
  14825. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14826. class ui_UITurntable_com3 extends fgui.GComponent {
  14827. static createInstance() {
  14828. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14829. }
  14830. onConstruct() {
  14831. this.n48 = (this.getChild("n48"));
  14832. this.womanTxt = (this.getChild("womanTxt"));
  14833. this.t0 = this.getTransition("t0");
  14834. }
  14835. }
  14836. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14837. class ui_cancelBtn2 extends fgui.GButton {
  14838. static createInstance() {
  14839. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14840. }
  14841. onConstruct() {
  14842. this.c1 = this.getController("c1");
  14843. this.n0 = (this.getChild("n0"));
  14844. this.n1 = (this.getChild("n1"));
  14845. this.n2 = (this.getChild("n2"));
  14846. this.n3 = (this.getChild("n3"));
  14847. this.n4 = (this.getChild("n4"));
  14848. this.n5 = (this.getChild("n5"));
  14849. this.n6 = (this.getChild("n6"));
  14850. this.n7 = (this.getChild("n7"));
  14851. this.n8 = (this.getChild("n8"));
  14852. this.powerEft = (this.getChild("powerEft"));
  14853. }
  14854. }
  14855. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14856. class ui_shareBtn2 extends fgui.GButton {
  14857. static createInstance() {
  14858. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14859. }
  14860. onConstruct() {
  14861. this.c1 = this.getController("c1");
  14862. this.n2 = (this.getChild("n2"));
  14863. this.n24 = (this.getChild("n24"));
  14864. this.n1 = (this.getChild("n1"));
  14865. this.n3 = (this.getChild("n3"));
  14866. this.n23 = (this.getChild("n23"));
  14867. this.n4 = (this.getChild("n4"));
  14868. this.n5 = (this.getChild("n5"));
  14869. this.n6 = (this.getChild("n6"));
  14870. this.n20 = (this.getChild("n20"));
  14871. this.n21 = (this.getChild("n21"));
  14872. this.n22 = (this.getChild("n22"));
  14873. this.powerEft = (this.getChild("powerEft"));
  14874. }
  14875. }
  14876. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14877. class ui_UIMoney extends fgui.GComponent {
  14878. static createInstance() {
  14879. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14880. }
  14881. onConstruct() {
  14882. this.c1 = this.getController("c1");
  14883. this.n4 = (this.getChild("n4"));
  14884. this.coinImg = (this.getChild("coinImg"));
  14885. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14886. this.coinTxt = (this.getChild("coinTxt"));
  14887. this.n7 = (this.getChild("n7"));
  14888. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14889. this.diamondTxt = (this.getChild("diamondTxt"));
  14890. this.diamondImg = (this.getChild("diamondImg"));
  14891. this.n12 = (this.getChild("n12"));
  14892. this.powerImg = (this.getChild("powerImg"));
  14893. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14894. this.powerTxt = (this.getChild("powerTxt"));
  14895. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14896. }
  14897. }
  14898. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14899. class ui_backBtn extends fgui.GButton {
  14900. static createInstance() {
  14901. return (fgui.UIPackage.createObject("game", "backBtn"));
  14902. }
  14903. onConstruct() {
  14904. this.n0 = (this.getChild("n0"));
  14905. this.t0 = this.getTransition("t0");
  14906. this.t1 = this.getTransition("t1");
  14907. }
  14908. }
  14909. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14910. class ui_MoneyBtn extends fgui.GButton {
  14911. static createInstance() {
  14912. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14913. }
  14914. onConstruct() {
  14915. this.button = this.getController("button");
  14916. this.n0 = (this.getChild("n0"));
  14917. }
  14918. }
  14919. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14920. class ui_UIMoneyBtn extends fgui.GComponent {
  14921. static createInstance() {
  14922. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14923. }
  14924. onConstruct() {
  14925. this.n1 = (this.getChild("n1"));
  14926. this.closeBtn = (this.getChild("closeBtn"));
  14927. }
  14928. }
  14929. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14930. class ui_Component64 extends fgui.GComponent {
  14931. static createInstance() {
  14932. return (fgui.UIPackage.createObject("game", "Component64"));
  14933. }
  14934. onConstruct() {
  14935. this.n57 = (this.getChild("n57"));
  14936. this.n54 = (this.getChild("n54"));
  14937. this.n55 = (this.getChild("n55"));
  14938. this.n56 = (this.getChild("n56"));
  14939. this.t1 = this.getTransition("t1");
  14940. }
  14941. }
  14942. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14943. class ui_Component41_3 extends fgui.GComponent {
  14944. static createInstance() {
  14945. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14946. }
  14947. onConstruct() {
  14948. this.c1 = this.getController("c1");
  14949. this.n0 = (this.getChild("n0"));
  14950. this.n2 = (this.getChild("n2"));
  14951. this.cancelBtn = (this.getChild("cancelBtn"));
  14952. this.videoBtn = (this.getChild("videoBtn"));
  14953. this.n9 = (this.getChild("n9"));
  14954. this.n24 = (this.getChild("n24"));
  14955. this.n27 = (this.getChild("n27"));
  14956. this.titleTxt = (this.getChild("titleTxt"));
  14957. this.n28 = (this.getChild("n28"));
  14958. this.t0 = this.getTransition("t0");
  14959. }
  14960. }
  14961. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14962. class ui_dh_zs_4 extends fgui.GComponent {
  14963. static createInstance() {
  14964. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14965. }
  14966. onConstruct() {
  14967. this.n1 = (this.getChild("n1"));
  14968. this.n2 = (this.getChild("n2"));
  14969. this.n3 = (this.getChild("n3"));
  14970. this.n4 = (this.getChild("n4"));
  14971. this.n5 = (this.getChild("n5"));
  14972. this.n6 = (this.getChild("n6"));
  14973. this.n8 = (this.getChild("n8"));
  14974. this.t0 = this.getTransition("t0");
  14975. }
  14976. }
  14977. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14978. class ui_Component71_1 extends fgui.GButton {
  14979. static createInstance() {
  14980. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14981. }
  14982. onConstruct() {
  14983. this.n17 = (this.getChild("n17"));
  14984. this.t0 = this.getTransition("t0");
  14985. }
  14986. }
  14987. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14988. class ui_Component83 extends fgui.GComponent {
  14989. static createInstance() {
  14990. return (fgui.UIPackage.createObject("game", "Component83"));
  14991. }
  14992. onConstruct() {
  14993. this.c1 = this.getController("c1");
  14994. this.n17 = (this.getChild("n17"));
  14995. this.n19 = (this.getChild("n19"));
  14996. this.n20 = (this.getChild("n20"));
  14997. }
  14998. }
  14999. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15000. class ui_Component84 extends fgui.GComponent {
  15001. static createInstance() {
  15002. return (fgui.UIPackage.createObject("game", "Component84"));
  15003. }
  15004. onConstruct() {
  15005. this.c1 = this.getController("c1");
  15006. this.n4 = (this.getChild("n4"));
  15007. this.n22 = (this.getChild("n22"));
  15008. this.n23 = (this.getChild("n23"));
  15009. this.numTxt = (this.getChild("numTxt"));
  15010. this.n25 = (this.getChild("n25"));
  15011. this.n26 = (this.getChild("n26"));
  15012. }
  15013. }
  15014. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15015. class ui_Component84_1 extends fgui.GComponent {
  15016. static createInstance() {
  15017. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15018. }
  15019. onConstruct() {
  15020. this.c1 = this.getController("c1");
  15021. this.n4 = (this.getChild("n4"));
  15022. this.n22 = (this.getChild("n22"));
  15023. this.n23 = (this.getChild("n23"));
  15024. this.numTxt = (this.getChild("numTxt"));
  15025. this.n25 = (this.getChild("n25"));
  15026. this.n26 = (this.getChild("n26"));
  15027. }
  15028. }
  15029. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15030. class ui_Component85 extends fgui.GComponent {
  15031. static createInstance() {
  15032. return (fgui.UIPackage.createObject("game", "Component85"));
  15033. }
  15034. onConstruct() {
  15035. this.n1 = (this.getChild("n1"));
  15036. this.n6 = (this.getChild("n6"));
  15037. this.n2 = (this.getChild("n2"));
  15038. this.n3 = (this.getChild("n3"));
  15039. this.levelTxt = (this.getChild("levelTxt"));
  15040. this.n10 = (this.getChild("n10"));
  15041. this.n11 = (this.getChild("n11"));
  15042. this.n12 = (this.getChild("n12"));
  15043. this.n13 = (this.getChild("n13"));
  15044. this.n14 = (this.getChild("n14"));
  15045. this.modeNode = (this.getChild("modeNode"));
  15046. this.n18 = (this.getChild("n18"));
  15047. this.conditionTxt = (this.getChild("conditionTxt"));
  15048. this.diamondNode = (this.getChild("diamondNode"));
  15049. this.coinNode = (this.getChild("coinNode"));
  15050. this.startBtn = (this.getChild("startBtn"));
  15051. this.n28 = (this.getChild("n28"));
  15052. this.displayRoot = (this.getChild("displayRoot"));
  15053. this.t0 = this.getTransition("t0");
  15054. }
  15055. }
  15056. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15057. class ui_Component86 extends fgui.GButton {
  15058. static createInstance() {
  15059. return (fgui.UIPackage.createObject("game", "Component86"));
  15060. }
  15061. onConstruct() {
  15062. this.n15 = (this.getChild("n15"));
  15063. this.t0 = this.getTransition("t0");
  15064. }
  15065. }
  15066. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  15067. class ui_Component87 extends fgui.GComponent {
  15068. static createInstance() {
  15069. return (fgui.UIPackage.createObject("game", "Component87"));
  15070. }
  15071. onConstruct() {
  15072. this.n66 = (this.getChild("n66"));
  15073. this.myProgress = (this.getChild("myProgress"));
  15074. this.starAni = (this.getChild("starAni"));
  15075. this.hpTxt = (this.getChild("hpTxt"));
  15076. this.n74 = (this.getChild("n74"));
  15077. this.n73 = (this.getChild("n73"));
  15078. this.ballTxt = (this.getChild("ballTxt"));
  15079. this.n76 = (this.getChild("n76"));
  15080. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15081. this.levelTxt = (this.getChild("levelTxt"));
  15082. this.star1 = (this.getChild("star1"));
  15083. this.star2 = (this.getChild("star2"));
  15084. this.star3 = (this.getChild("star3"));
  15085. }
  15086. }
  15087. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  15088. class ui_Component88 extends fgui.GProgressBar {
  15089. static createInstance() {
  15090. return (fgui.UIPackage.createObject("game", "Component88"));
  15091. }
  15092. onConstruct() {
  15093. this.n68 = (this.getChild("n68"));
  15094. this.bar = (this.getChild("bar"));
  15095. }
  15096. }
  15097. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  15098. class ui_Component89 extends fgui.GComponent {
  15099. static createInstance() {
  15100. return (fgui.UIPackage.createObject("game", "Component89"));
  15101. }
  15102. onConstruct() {
  15103. this.c1 = this.getController("c1");
  15104. this.n71 = (this.getChild("n71"));
  15105. this.n72 = (this.getChild("n72"));
  15106. }
  15107. }
  15108. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  15109. class ui_Component90 extends fgui.GComponent {
  15110. static createInstance() {
  15111. return (fgui.UIPackage.createObject("game", "Component90"));
  15112. }
  15113. onConstruct() {
  15114. this.c1 = this.getController("c1");
  15115. this.n64 = (this.getChild("n64"));
  15116. this.n65 = (this.getChild("n65"));
  15117. this.n66 = (this.getChild("n66"));
  15118. this.t0 = this.getTransition("t0");
  15119. }
  15120. }
  15121. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  15122. class ui_Component127 extends fgui.GButton {
  15123. static createInstance() {
  15124. return (fgui.UIPackage.createObject("game", "Component127"));
  15125. }
  15126. onConstruct() {
  15127. this.n5 = (this.getChild("n5"));
  15128. }
  15129. }
  15130. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  15131. class gameBinder {
  15132. static bindAll() {
  15133. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  15134. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  15135. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  15136. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  15137. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  15138. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  15139. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  15140. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  15141. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  15142. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  15143. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  15144. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  15145. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  15146. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  15147. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  15148. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  15149. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  15150. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  15151. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  15152. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  15153. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  15154. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  15155. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  15156. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  15157. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  15158. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  15159. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  15160. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  15161. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  15162. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  15163. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  15164. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  15165. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  15166. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  15167. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  15168. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  15169. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  15170. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  15171. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  15172. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  15173. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  15174. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  15175. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  15176. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  15177. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  15178. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  15179. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  15180. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  15181. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  15182. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  15183. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  15184. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  15185. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  15186. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  15187. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  15188. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  15189. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  15190. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  15191. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  15192. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  15193. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  15194. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  15195. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  15196. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  15197. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  15198. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  15199. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  15200. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  15201. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  15202. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  15203. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  15204. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  15205. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  15206. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  15207. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  15208. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  15209. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  15210. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  15211. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  15212. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  15213. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  15214. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  15215. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  15216. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  15217. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  15218. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  15219. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  15220. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  15221. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  15222. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  15223. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  15224. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  15225. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  15226. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  15227. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  15228. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  15229. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  15230. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  15231. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  15232. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  15233. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  15234. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  15235. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  15236. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  15237. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  15238. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  15239. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  15240. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  15241. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  15242. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  15243. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  15244. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  15245. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  15246. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  15247. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  15248. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  15249. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  15250. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  15251. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  15252. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  15253. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  15254. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  15255. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  15256. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  15257. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  15258. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  15259. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  15260. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  15261. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  15262. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  15263. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  15264. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  15265. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  15266. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  15267. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  15268. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  15269. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  15270. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  15271. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  15272. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  15273. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  15274. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  15275. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  15276. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  15277. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  15278. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  15279. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  15280. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  15281. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  15282. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  15283. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  15284. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  15285. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  15286. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  15287. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  15288. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  15289. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  15290. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  15291. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  15292. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  15293. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  15294. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  15295. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  15296. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  15297. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  15298. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  15299. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  15300. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  15301. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  15302. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  15303. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  15304. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  15305. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  15306. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  15307. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  15308. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  15309. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  15310. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  15311. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  15312. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  15313. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  15314. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  15315. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  15316. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  15317. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  15318. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  15319. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  15320. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  15321. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  15322. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  15323. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  15324. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  15325. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  15326. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  15327. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  15328. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  15329. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  15330. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  15331. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  15332. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  15333. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  15334. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  15335. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  15336. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  15337. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  15338. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  15339. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  15340. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  15341. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  15342. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  15343. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  15344. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  15345. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  15346. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  15347. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  15348. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  15349. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  15350. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  15351. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  15352. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  15353. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  15354. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  15355. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  15356. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  15357. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  15358. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  15359. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  15360. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  15361. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  15362. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  15363. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  15364. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  15365. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  15366. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  15367. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  15368. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  15369. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  15370. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  15371. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  15372. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  15373. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  15374. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  15375. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  15376. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  15377. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  15378. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  15379. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  15380. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  15381. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  15382. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  15383. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  15384. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  15385. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  15386. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  15387. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  15388. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  15389. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  15390. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  15391. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  15392. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  15393. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  15394. }
  15395. }
  15396. class ui_btn6 extends fgui.GButton {
  15397. static createInstance() {
  15398. return (fgui.UIPackage.createObject("loading", "btn6"));
  15399. }
  15400. onConstruct() {
  15401. this.n6 = (this.getChild("n6"));
  15402. this.n1 = (this.getChild("n1"));
  15403. }
  15404. }
  15405. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  15406. class ui_xyItem extends fgui.GComponent {
  15407. static createInstance() {
  15408. return (fgui.UIPackage.createObject("loading", "xyItem"));
  15409. }
  15410. onConstruct() {
  15411. this.xyItem = (this.getChild("xyItem"));
  15412. }
  15413. }
  15414. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  15415. class ui_loadinfo extends fgui.GProgressBar {
  15416. static createInstance() {
  15417. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  15418. }
  15419. onConstruct() {
  15420. this.bg = (this.getChild("bg"));
  15421. this.bar = (this.getChild("bar"));
  15422. this.title = (this.getChild("title"));
  15423. this.ani = (this.getChild("ani"));
  15424. }
  15425. }
  15426. ui_loadinfo.URL = "ui://37nctnhwis36c";
  15427. class ui_xyNode extends fgui.GComponent {
  15428. static createInstance() {
  15429. return (fgui.UIPackage.createObject("loading", "xyNode"));
  15430. }
  15431. onConstruct() {
  15432. this.n0 = (this.getChild("n0"));
  15433. this.btnYes = (this.getChild("btnYes"));
  15434. this.btnNo = (this.getChild("btnNo"));
  15435. this.btnKnown = (this.getChild("btnKnown"));
  15436. this.btnSure = (this.getChild("btnSure"));
  15437. this.txtWelcom = (this.getChild("txtWelcom"));
  15438. this.txtXy = (this.getChild("txtXy"));
  15439. this.n75 = (this.getChild("n75"));
  15440. this.btnXy1 = (this.getChild("btnXy1"));
  15441. this.btnXy3 = (this.getChild("btnXy3"));
  15442. this.btnXy2 = (this.getChild("btnXy2"));
  15443. this.n74 = (this.getChild("n74"));
  15444. this.xy1 = (this.getChild("xy1"));
  15445. this.txtTitle = (this.getChild("txtTitle"));
  15446. this.btnBack = (this.getChild("btnBack"));
  15447. this.xyList = (this.getChild("xyList"));
  15448. this.xy2 = (this.getChild("xy2"));
  15449. this.xyNode = (this.getChild("xyNode"));
  15450. }
  15451. }
  15452. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  15453. class ui_ageNode extends fgui.GComponent {
  15454. static createInstance() {
  15455. return (fgui.UIPackage.createObject("loading", "ageNode"));
  15456. }
  15457. onConstruct() {
  15458. this.n3 = (this.getChild("n3"));
  15459. this.n7 = (this.getChild("n7"));
  15460. this.n4 = (this.getChild("n4"));
  15461. this.btnAge = (this.getChild("btnAge"));
  15462. this.ageNode = (this.getChild("ageNode"));
  15463. }
  15464. }
  15465. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  15466. class ui_rnNode extends fgui.GComponent {
  15467. static createInstance() {
  15468. return (fgui.UIPackage.createObject("loading", "rnNode"));
  15469. }
  15470. onConstruct() {
  15471. this.n28 = (this.getChild("n28"));
  15472. this.n30 = (this.getChild("n30"));
  15473. this.n33 = (this.getChild("n33"));
  15474. this.rn1 = (this.getChild("rn1"));
  15475. this.n40 = (this.getChild("n40"));
  15476. this.n41 = (this.getChild("n41"));
  15477. this.rn3 = (this.getChild("rn3"));
  15478. this.n37 = (this.getChild("n37"));
  15479. this.n39 = (this.getChild("n39"));
  15480. this.rn2 = (this.getChild("rn2"));
  15481. this.n47 = (this.getChild("n47"));
  15482. this.n49 = (this.getChild("n49"));
  15483. this.n44 = (this.getChild("n44"));
  15484. this.inputCode = (this.getChild("inputCode"));
  15485. this.inputName = (this.getChild("inputName"));
  15486. this.n48 = (this.getChild("n48"));
  15487. this.n50 = (this.getChild("n50"));
  15488. this.rn4 = (this.getChild("rn4"));
  15489. this.btnCheck = (this.getChild("btnCheck"));
  15490. this.btnExit = (this.getChild("btnExit"));
  15491. this.btnDone = (this.getChild("btnDone"));
  15492. this.rnNode = (this.getChild("rnNode"));
  15493. }
  15494. }
  15495. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15496. class ui_tipNode extends fgui.GComponent {
  15497. static createInstance() {
  15498. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15499. }
  15500. onConstruct() {
  15501. this.bg = (this.getChild("bg"));
  15502. this.n55 = (this.getChild("n55"));
  15503. this.n56 = (this.getChild("n56"));
  15504. this.tipNode = (this.getChild("tipNode"));
  15505. }
  15506. }
  15507. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15508. class ui_fcmNode extends fgui.GComponent {
  15509. static createInstance() {
  15510. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15511. }
  15512. onConstruct() {
  15513. this.n63 = (this.getChild("n63"));
  15514. this.n62 = (this.getChild("n62"));
  15515. this.btnRn = (this.getChild("btnRn"));
  15516. this.n61 = (this.getChild("n61"));
  15517. this.n58 = (this.getChild("n58"));
  15518. this.fcmNode = (this.getChild("fcmNode"));
  15519. }
  15520. }
  15521. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15522. class ui_msgNode extends fgui.GComponent {
  15523. static createInstance() {
  15524. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15525. }
  15526. onConstruct() {
  15527. this.n69 = (this.getChild("n69"));
  15528. this.txtMsg = (this.getChild("txtMsg"));
  15529. this.msgNode = (this.getChild("msgNode"));
  15530. }
  15531. }
  15532. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15533. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15534. static createInstance() {
  15535. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15536. }
  15537. onConstruct() {
  15538. this.n1 = (this.getChild("n1"));
  15539. this.n13 = (this.getChild("n13"));
  15540. this.n14 = (this.getChild("n14"));
  15541. this.n15 = (this.getChild("n15"));
  15542. this.n3 = (this.getChild("n3"));
  15543. this.n4 = (this.getChild("n4"));
  15544. this.n5 = (this.getChild("n5"));
  15545. this.n6 = (this.getChild("n6"));
  15546. this.n7 = (this.getChild("n7"));
  15547. this.n8 = (this.getChild("n8"));
  15548. this.n9 = (this.getChild("n9"));
  15549. this.n10 = (this.getChild("n10"));
  15550. this.n12 = (this.getChild("n12"));
  15551. this.n11 = (this.getChild("n11"));
  15552. this.n16 = (this.getChild("n16"));
  15553. this.n17 = (this.getChild("n17"));
  15554. this.n18 = (this.getChild("n18"));
  15555. this.n20 = (this.getChild("n20"));
  15556. this.n21 = (this.getChild("n21"));
  15557. this.t0 = this.getTransition("t0");
  15558. }
  15559. }
  15560. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15561. class ui_btn5 extends fgui.GButton {
  15562. static createInstance() {
  15563. return (fgui.UIPackage.createObject("loading", "btn5"));
  15564. }
  15565. onConstruct() {
  15566. this.n9 = (this.getChild("n9"));
  15567. this.n1 = (this.getChild("n1"));
  15568. }
  15569. }
  15570. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15571. class ui_UILoading extends fgui.GComponent {
  15572. static createInstance() {
  15573. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15574. }
  15575. onConstruct() {
  15576. this.n12 = (this.getChild("n12"));
  15577. this.loadinfo = (this.getChild("loadinfo"));
  15578. this.n13 = (this.getChild("n13"));
  15579. this.txtLoad = (this.getChild("txtLoad"));
  15580. this.n18 = (this.getChild("n18"));
  15581. }
  15582. }
  15583. ui_UILoading.URL = "ui://37nctnhwphc33";
  15584. class ui_AgeItem extends fgui.GComponent {
  15585. static createInstance() {
  15586. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15587. }
  15588. onConstruct() {
  15589. this.txtAge = (this.getChild("txtAge"));
  15590. }
  15591. }
  15592. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15593. class ui_btn1 extends fgui.GButton {
  15594. static createInstance() {
  15595. return (fgui.UIPackage.createObject("loading", "btn1"));
  15596. }
  15597. onConstruct() {
  15598. this.n6 = (this.getChild("n6"));
  15599. this.n1 = (this.getChild("n1"));
  15600. }
  15601. }
  15602. ui_btn1.URL = "ui://37nctnhwxe622p";
  15603. class ui_btn3 extends fgui.GButton {
  15604. static createInstance() {
  15605. return (fgui.UIPackage.createObject("loading", "btn3"));
  15606. }
  15607. onConstruct() {
  15608. this.n9 = (this.getChild("n9"));
  15609. this.n1 = (this.getChild("n1"));
  15610. }
  15611. }
  15612. ui_btn3.URL = "ui://37nctnhwxe622s";
  15613. class ui_btn2 extends fgui.GButton {
  15614. static createInstance() {
  15615. return (fgui.UIPackage.createObject("loading", "btn2"));
  15616. }
  15617. onConstruct() {
  15618. this.n6 = (this.getChild("n6"));
  15619. this.n1 = (this.getChild("n1"));
  15620. }
  15621. }
  15622. ui_btn2.URL = "ui://37nctnhwxe622t";
  15623. class ui_btnBack extends fgui.GButton {
  15624. static createInstance() {
  15625. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15626. }
  15627. onConstruct() {
  15628. this.n6 = (this.getChild("n6"));
  15629. this.n7 = (this.getChild("n7"));
  15630. }
  15631. }
  15632. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15633. class ui_btnXy1 extends fgui.GButton {
  15634. static createInstance() {
  15635. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15636. }
  15637. onConstruct() {
  15638. this.n1 = (this.getChild("n1"));
  15639. }
  15640. }
  15641. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15642. class ui_btnXy2 extends fgui.GButton {
  15643. static createInstance() {
  15644. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15645. }
  15646. onConstruct() {
  15647. this.n1 = (this.getChild("n1"));
  15648. }
  15649. }
  15650. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15651. class ui_btnXy3 extends fgui.GButton {
  15652. static createInstance() {
  15653. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15654. }
  15655. onConstruct() {
  15656. this.n1 = (this.getChild("n1"));
  15657. }
  15658. }
  15659. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15660. class ui_btn4 extends fgui.GButton {
  15661. static createInstance() {
  15662. return (fgui.UIPackage.createObject("loading", "btn4"));
  15663. }
  15664. onConstruct() {
  15665. this.n9 = (this.getChild("n9"));
  15666. this.n1 = (this.getChild("n1"));
  15667. }
  15668. }
  15669. ui_btn4.URL = "ui://37nctnhwxe622z";
  15670. class loadingBinder {
  15671. static bindAll() {
  15672. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15673. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15674. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15675. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15676. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15677. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15678. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15679. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15680. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15681. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15682. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15683. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15684. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15685. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15686. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15687. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15688. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15689. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15690. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15691. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15692. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15693. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15694. }
  15695. }
  15696. class UIMgr {
  15697. constructor() {
  15698. this._stage = null;
  15699. this._uiList = [];
  15700. this._showList = [];
  15701. this._bindPkgList = [];
  15702. this.uiIndex = 0;
  15703. }
  15704. static get inst() {
  15705. if (UIMgr._inst == null) {
  15706. UIMgr._inst = new UIMgr();
  15707. }
  15708. return UIMgr._inst;
  15709. }
  15710. setStage(s) {
  15711. if (this._stage) {
  15712. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15713. return;
  15714. }
  15715. this._stage = s;
  15716. }
  15717. clearTempData() {
  15718. console.log('zh:clearTempData start');
  15719. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15720. console.log('zh:clearTempData end');
  15721. }
  15722. init() {
  15723. this.setStage(Laya.stage);
  15724. fairygui.UIConfig.defaultFont = "微软雅黑";
  15725. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15726. fairygui.UIConfig.packageFileExtension = "obj";
  15727. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15728. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15729. fairygui.GRoot.inst.width = Laya.stage.width;
  15730. fairygui.GRoot.inst.height = Laya.stage.height;
  15731. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15732. }
  15733. addAllUpdate() {
  15734. this.uiIndex = 0;
  15735. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15736. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15737. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15738. }
  15739. }
  15740. }
  15741. bindFUI(pkgname) {
  15742. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15743. return;
  15744. }
  15745. switch (pkgname) {
  15746. case fguiRes.loading:
  15747. fairygui.UIPackage.addPackage(pkgname);
  15748. loadingBinder.bindAll();
  15749. this._bindPkgList.push(pkgname);
  15750. break;
  15751. case fguiRes.game:
  15752. fairygui.UIPackage.addPackage(pkgname);
  15753. gameBinder.bindAll();
  15754. this._bindPkgList.push(pkgname);
  15755. break;
  15756. default:
  15757. break;
  15758. }
  15759. }
  15760. Show(cls, ...param) {
  15761. let nameStr = cls.uiName;
  15762. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15763. let temp = this._uiList[i];
  15764. let str = temp.className;
  15765. if (str == nameStr) {
  15766. if (temp.isMuti) {
  15767. if (temp.isHide) {
  15768. temp.show(...param);
  15769. this._uiList.splice(i, 1);
  15770. this._uiList.push(temp);
  15771. return temp;
  15772. }
  15773. }
  15774. else {
  15775. temp.show(...param);
  15776. this._uiList.splice(i, 1);
  15777. this._uiList.push(temp);
  15778. return temp;
  15779. }
  15780. }
  15781. }
  15782. let ui = new cls();
  15783. ui.className = nameStr;
  15784. this._showUI(ui, param);
  15785. return ui;
  15786. }
  15787. destroyUI(ui) {
  15788. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15789. let temp = this._uiList[i].className;
  15790. if (temp == ui.className) {
  15791. this._uiList.splice(i, 1);
  15792. break;
  15793. }
  15794. }
  15795. this.checkUIState();
  15796. }
  15797. _showUI(ui, param) {
  15798. this._uiList.push(ui);
  15799. ui.show(...param);
  15800. }
  15801. Hide(uiClass) {
  15802. let ui = this.getUI(uiClass);
  15803. if (ui && !ui.isHide) {
  15804. ui.hide();
  15805. }
  15806. }
  15807. getUI(ui) {
  15808. let nameStr = ui.uiName;
  15809. for (let index = 0; index < this._uiList.length; index++) {
  15810. let temp = this._uiList[index];
  15811. if (temp.className == nameStr) {
  15812. return temp;
  15813. }
  15814. }
  15815. return null;
  15816. }
  15817. isShow(cls) {
  15818. for (var i of this._uiList) {
  15819. if (i instanceof cls) {
  15820. return i.isShowing;
  15821. }
  15822. }
  15823. return false;
  15824. }
  15825. showUINum() {
  15826. let num = 0;
  15827. for (var i of this._uiList) {
  15828. if (i.isShowing) {
  15829. num++;
  15830. }
  15831. }
  15832. return num;
  15833. }
  15834. checkUIState() {
  15835. Laya.timer.clear(this, this._uiCheck);
  15836. Laya.timer.once(400, this, this._uiCheck);
  15837. }
  15838. _uiCheck() {
  15839. let showList = [];
  15840. for (var i of this._uiList) {
  15841. if (!i.isHide) {
  15842. showList.push(i);
  15843. }
  15844. }
  15845. for (let index = 0; index < showList.length; index++) {
  15846. if (index == showList.length - 1) {
  15847. showList[index].checkActive(true);
  15848. }
  15849. else {
  15850. showList[index].checkActive(false);
  15851. }
  15852. }
  15853. }
  15854. showTip(msg, time = 600, size = 30) {
  15855. }
  15856. }
  15857. class UIShowList {
  15858. }
  15859. class SoundMgr {
  15860. constructor() {
  15861. this.soundMax = 4;
  15862. this.isLoad = false;
  15863. this.soundMap = {};
  15864. this.isSound = true;
  15865. this.openShake = true;
  15866. SoundMgr._instance = this;
  15867. }
  15868. static getInstance() {
  15869. if (!this._instance) {
  15870. this._instance = new SoundMgr();
  15871. }
  15872. return this._instance;
  15873. }
  15874. init() {
  15875. console.log('zh:sm init 1');
  15876. Laya.SoundManager.autoReleaseSound = true;
  15877. Laya.SoundManager.autoStopMusic = true;
  15878. Laya.SoundManager.musicVolume = 0.3;
  15879. Laya.SoundManager.soundVolume = 0.5;
  15880. this.musicPlayed = false;
  15881. this.audioUrl = "asset/sound/ogg/";
  15882. console.log('zh:sm init 2');
  15883. console.log('zh:dev type ');
  15884. if (Laya.Browser.onAndroid) {
  15885. console.log('zh:dev type android');
  15886. this.audioUrl = "asset/sound/ogg/";
  15887. this.isLoad = true;
  15888. }
  15889. else {
  15890. console.log('zh:dev type not android');
  15891. this.audioUrl = "asset/sound/mp3/";
  15892. this.isLoad = true;
  15893. }
  15894. }
  15895. onSetting(isS) {
  15896. this.isSound = isS;
  15897. this.mute(!this.isSound);
  15898. }
  15899. clearCount() {
  15900. for (var key in this.soundMap) {
  15901. delete this.soundMap[key];
  15902. }
  15903. }
  15904. playMusic(path, loop = 0) {
  15905. console.log('zh:playMusic 1 PATH=' + path);
  15906. this.musicPath = path;
  15907. if (!this.isLoad) {
  15908. return;
  15909. }
  15910. if (!path || path == "") {
  15911. return;
  15912. }
  15913. if (!this.isSound) {
  15914. return;
  15915. }
  15916. this.musicPlayed = true;
  15917. let url = this.getUrl(path);
  15918. if (!Laya.Browser.onAndroid) {
  15919. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15920. this.play(url, loop);
  15921. }));
  15922. }
  15923. else {
  15924. this.play(url, loop);
  15925. }
  15926. }
  15927. play(url, loop) {
  15928. Laya.SoundManager.playMusic(url, loop);
  15929. }
  15930. getUrl(path) {
  15931. let url = this.audioUrl + path;
  15932. if (Laya.Browser.onAndroid) {
  15933. url += ".ogg";
  15934. }
  15935. else {
  15936. url += ".mp3";
  15937. }
  15938. return url;
  15939. }
  15940. pauseMusic(pause) {
  15941. if (pause) {
  15942. this.mute(true);
  15943. }
  15944. else if (this.isSound)
  15945. this.mute(false);
  15946. }
  15947. stopMusic() {
  15948. Laya.SoundManager.stopMusic();
  15949. if (Moyu.isNeedPlatAudio) {
  15950. Moyu.stopMusic();
  15951. }
  15952. }
  15953. mute(mute) {
  15954. if (Moyu.isNeedPlatAudio) {
  15955. Moyu.pauseMusic(mute);
  15956. }
  15957. else {
  15958. Laya.SoundManager.musicMuted = mute;
  15959. if (!mute && !this.musicPlayed && this.musicPath) {
  15960. this.playMusic(this.musicPath);
  15961. }
  15962. }
  15963. }
  15964. stopSound(path) {
  15965. let url = this.getUrl(path);
  15966. Laya.SoundManager.stopSound(url);
  15967. }
  15968. playSound(path, loop = 1, soundMax = this.soundMax) {
  15969. if (!this.isLoad)
  15970. return;
  15971. if (!this.isSound)
  15972. return;
  15973. if (!path || path == "")
  15974. return;
  15975. let url = this.getUrl(path);
  15976. if (Moyu.isNeedPlatAudio) {
  15977. Moyu.playSound(path, loop == 0);
  15978. }
  15979. else {
  15980. let count = 1;
  15981. if (this.soundMap[path])
  15982. count = this.soundMap[path] + 1;
  15983. if (count > soundMax)
  15984. return;
  15985. this.soundMap[path] = count;
  15986. Laya.SoundManager.playSound(url, loop);
  15987. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15988. }
  15989. }
  15990. removePath(path) {
  15991. if (this.soundMap[path]) {
  15992. let count = this.soundMap[path];
  15993. count--;
  15994. if (count < 1)
  15995. delete this.soundMap[path];
  15996. else
  15997. this.soundMap[path] = count;
  15998. }
  15999. }
  16000. playBtnSound() {
  16001. this.playSound("btn");
  16002. }
  16003. playGetSound() {
  16004. }
  16005. playCloseUISound() {
  16006. }
  16007. }
  16008. SoundMgr._instance = null;
  16009. var Handler$1 = Laya.Handler;
  16010. var EResType;
  16011. (function (EResType) {
  16012. EResType[EResType["none"] = 0] = "none";
  16013. EResType[EResType["nromal"] = 1] = "nromal";
  16014. EResType[EResType["td"] = 2] = "td";
  16015. EResType[EResType["sk"] = 3] = "sk";
  16016. })(EResType || (EResType = {}));
  16017. class CResLoader {
  16018. constructor(doneCall, proCall) {
  16019. this.completrCall = doneCall;
  16020. this.progressCall = proCall;
  16021. this.progressHander = new Handler$1(this, this.onProgress);
  16022. this.tdResMap = {};
  16023. }
  16024. load(resList) {
  16025. this.resCount = 0;
  16026. this.loadCount = 0;
  16027. for (let i = 0; i < resList.length; i++) {
  16028. let path = resList[i];
  16029. if (!path)
  16030. continue;
  16031. this.resCount++;
  16032. let type = this.getResType(path);
  16033. if (type == EResType.nromal)
  16034. this.loadNromal(path);
  16035. else if (type == EResType.td)
  16036. this.loadTd(path);
  16037. }
  16038. }
  16039. getRes(path) {
  16040. let type = this.getResType(path);
  16041. if (type == EResType.nromal)
  16042. return Laya.loader.getRes(path);
  16043. else if (type == EResType.td) {
  16044. let res = this.tdResMap[path];
  16045. if (res)
  16046. return res.clone();
  16047. return null;
  16048. }
  16049. }
  16050. destroy() {
  16051. this.progressHander.clear();
  16052. this.progressHander = null;
  16053. }
  16054. clearRes(path) {
  16055. let type = this.getResType(path);
  16056. if (type == EResType.nromal)
  16057. Laya.loader.clearRes(path);
  16058. else if (type == EResType.td) {
  16059. let obj = this.tdResMap[path];
  16060. if (obj)
  16061. obj.destroy();
  16062. delete this.tdResMap[path];
  16063. }
  16064. }
  16065. getResType(path) {
  16066. let exs = this.getExtension(path);
  16067. if (exs == "sk")
  16068. return EResType.sk;
  16069. if (exs == "ls" || exs == "lh" || exs == "lm")
  16070. return EResType.td;
  16071. else
  16072. return EResType.nromal;
  16073. }
  16074. getExtension(res) {
  16075. var index = res.lastIndexOf(".");
  16076. return res.substr(index + 1);
  16077. }
  16078. loadNromal(path) {
  16079. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  16080. if (res) {
  16081. this.onLoad();
  16082. }
  16083. else
  16084. console.log("load res fail:" + path);
  16085. }), this.progressHander);
  16086. }
  16087. loadSk() {
  16088. }
  16089. loadTd(path) {
  16090. if (this.tdResMap[path]) {
  16091. this.onLoad();
  16092. return;
  16093. }
  16094. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  16095. if (res) {
  16096. this.tdResMap[path] = res;
  16097. this.onLoad();
  16098. }
  16099. else
  16100. console.log("load res fail:" + path);
  16101. }));
  16102. }
  16103. onLoad() {
  16104. this.loadCount++;
  16105. this.onProgress(1);
  16106. if (this.loadCount >= this.resCount) {
  16107. this.completrCall.run();
  16108. }
  16109. }
  16110. onProgress(pro) {
  16111. let progress = (this.loadCount + pro) / this.resCount;
  16112. this.progressCall.runWith(progress);
  16113. }
  16114. }
  16115. var Handler$2 = Laya.Handler;
  16116. class ResInfo {
  16117. constructor() {
  16118. this.index = 0;
  16119. }
  16120. }
  16121. class ResMgr {
  16122. constructor() {
  16123. this.resList = [];
  16124. this.doneList = [];
  16125. this.resMap = {};
  16126. this.currentLoad = null;
  16127. this.completeHandler = new Handler$2(this, this.onComplete);
  16128. this.progressHandler = new Handler$2(this, this.onProgress);
  16129. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  16130. }
  16131. static getInstance() {
  16132. if (ResMgr._instance == null) {
  16133. ResMgr._instance = new ResMgr();
  16134. }
  16135. return ResMgr._instance;
  16136. }
  16137. loadList(list, completeHandler, progressHandler) {
  16138. if (list.length < 1) {
  16139. completeHandler.run();
  16140. return;
  16141. }
  16142. let info = this.getResInfo();
  16143. info.resList = list;
  16144. info.completeHandler = completeHandler;
  16145. info.progressHandler = progressHandler;
  16146. this.resList.push(info);
  16147. this.startLoad();
  16148. }
  16149. loadFguiRes(list, completeHandler, progressHandler) {
  16150. Laya.loader.load(list, completeHandler, progressHandler);
  16151. }
  16152. loadAny(list, completeHandler, progressHandler) {
  16153. Laya.loader.load(list, completeHandler, progressHandler);
  16154. }
  16155. load(path, completeHandler, progressHandler) {
  16156. let count = this.resMap[path];
  16157. if (count && count > 0) {
  16158. if (completeHandler)
  16159. completeHandler.run();
  16160. }
  16161. else
  16162. this.loadList([path], completeHandler, progressHandler);
  16163. }
  16164. getRes(path) {
  16165. let res = this.resMap[path];
  16166. if (!res)
  16167. this.showLog("资源不存在:" + path);
  16168. else
  16169. return this.loader.getRes(path);
  16170. }
  16171. clearList(list, force = false) {
  16172. if (!list || list.length < 1)
  16173. return;
  16174. let cr = () => {
  16175. for (const k in list) {
  16176. let v = list[k];
  16177. if (!v)
  16178. continue;
  16179. if (force) {
  16180. this.loader.clearRes(v);
  16181. delete this.resMap[v];
  16182. }
  16183. else {
  16184. let count = this.resMap[v];
  16185. if (count && count > 1) {
  16186. count--;
  16187. this.resMap[v] = count;
  16188. }
  16189. else {
  16190. this.loader.clearRes(v);
  16191. delete this.resMap[v];
  16192. }
  16193. }
  16194. }
  16195. if (!window.hasOwnProperty("ks"))
  16196. Laya.Resource.destroyUnusedResources();
  16197. };
  16198. Laya.timer.clearAll(this);
  16199. Laya.timer.once(2000, this, cr);
  16200. }
  16201. clear3D() {
  16202. for (const k in this.loader.tdResMap) {
  16203. this.loader.clearRes(k);
  16204. if (this.resMap[k])
  16205. delete this.resMap[k];
  16206. }
  16207. if (!window.hasOwnProperty("ks"))
  16208. Laya.Resource.destroyUnusedResources();
  16209. }
  16210. clear(path, force = false) {
  16211. this.clearList([path], force);
  16212. }
  16213. getResInfo() {
  16214. if (this.doneList.length > 0)
  16215. return this.doneList.pop();
  16216. else
  16217. return new ResInfo();
  16218. }
  16219. startLoad() {
  16220. if (this.currentLoad)
  16221. return;
  16222. this.currentLoad = this.resList.pop();
  16223. if (this.currentLoad) {
  16224. this.loader.load(this.currentLoad.resList);
  16225. }
  16226. }
  16227. onComplete() {
  16228. if (!this.currentLoad)
  16229. return;
  16230. for (const k in this.currentLoad.resList) {
  16231. let v = this.currentLoad.resList[k];
  16232. let count = this.resMap[v];
  16233. if (count)
  16234. count++;
  16235. else
  16236. count = 1;
  16237. this.resMap[v] = count;
  16238. }
  16239. if (this.currentLoad.completeHandler)
  16240. this.currentLoad.completeHandler.run();
  16241. this.doneList.push(this.currentLoad);
  16242. this.currentLoad = null;
  16243. this.startLoad();
  16244. }
  16245. onProgress(pro) {
  16246. if (!this.currentLoad)
  16247. return;
  16248. if (this.currentLoad.progressHandler)
  16249. this.currentLoad.progressHandler.runWith(pro);
  16250. }
  16251. showLog(str, ...args) {
  16252. console.log("[ResLoader] " + str);
  16253. }
  16254. }
  16255. ResMgr._instance = null;
  16256. class EventMgr extends Laya.EventDispatcher {
  16257. }
  16258. let eventMgr = new EventMgr();
  16259. class ConfigMgr {
  16260. static getInstance() {
  16261. if (!this._instance) {
  16262. this._instance = new ConfigMgr();
  16263. }
  16264. return this._instance;
  16265. }
  16266. init() {
  16267. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  16268. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  16269. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  16270. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  16271. }
  16272. getUserInfoByIndex(index) {
  16273. return this.npcJson[index];
  16274. }
  16275. getRandomUserInfo() {
  16276. let index = xGame.tools.random(0, this.npcJson.length);
  16277. return this.npcJson[index];
  16278. }
  16279. getMaxBigMoveLength() {
  16280. return Object.keys(this.levelCfg).length;
  16281. }
  16282. getBigMoveLevelByIndex(index) {
  16283. let cfg = this.levelCfg;
  16284. cfg = cfg[index];
  16285. return cfg;
  16286. }
  16287. getRandomClassicLevel() {
  16288. let cfg = this.classicCfg;
  16289. let num = Object.keys(cfg).length;
  16290. let rand = xGame.common.randomNum(1, num);
  16291. return cfg[rand];
  16292. }
  16293. getPlaceBallByLevel(level) {
  16294. return this.placeBallCfg[level];
  16295. }
  16296. getMaxPlaceBall() {
  16297. return Object.keys(this.placeBallCfg).length;
  16298. }
  16299. }
  16300. class PoolD3Mgr {
  16301. constructor() {
  16302. this.pool = {};
  16303. }
  16304. static get ins() {
  16305. return this._ins || (this._ins = new PoolD3Mgr);
  16306. }
  16307. createList(key, prefab, parent) {
  16308. if (!this.pool[key]) {
  16309. this.pool[key] = {};
  16310. this.pool[key].prefab = prefab;
  16311. this.pool[key].list = [];
  16312. this.pool[key].parent = parent;
  16313. }
  16314. }
  16315. getItem(key) {
  16316. if (!this.pool[key]) {
  16317. return;
  16318. }
  16319. let temp;
  16320. if (this.pool[key].list.length > 0) {
  16321. temp = this.pool[key].list.pop();
  16322. }
  16323. else {
  16324. temp = this.pool[key].prefab.clone();
  16325. if (this.pool[key].parent) {
  16326. this.pool[key].parent.addChild(temp);
  16327. }
  16328. }
  16329. temp.active = true;
  16330. return temp;
  16331. }
  16332. putItem(key, obj) {
  16333. if (!this.pool[key]) {
  16334. return;
  16335. }
  16336. obj.active = false;
  16337. this.pool[key].list.push(obj);
  16338. }
  16339. }
  16340. let context$1 = context;
  16341. let uiMgr = UIMgr.inst;
  16342. let soundMgr = SoundMgr.getInstance();
  16343. let resMgr = ResMgr.getInstance();
  16344. let httpMgr = HttpMgr.getInstance();
  16345. let common = Common.getInstance();
  16346. let cfgMgr = ConfigMgr.getInstance();
  16347. let poolD3Mgr = PoolD3Mgr.ins;
  16348. let d3TexUrl = "res/d3Res/";
  16349. let d3ModeUrl = "res/unityRes/";
  16350. function setStageSize(view) {
  16351. if (view.width) {
  16352. view.width = Laya.stage.width;
  16353. view.height = Laya.stage.height;
  16354. }
  16355. }
  16356. function filledBg(view) {
  16357. let wh = Laya.stage.height / Laya.stage.width;
  16358. if (wh > 16 / 9) {
  16359. view.height = Laya.stage.height;
  16360. view.width = Laya.stage.height / 1334 * 750;
  16361. }
  16362. else {
  16363. view.width = Laya.stage.width;
  16364. view.height = Laya.stage.width / 750 * 1334;
  16365. }
  16366. }
  16367. function setNotch(view) {
  16368. if (view.height) {
  16369. view.y += context$1.notchHeight;
  16370. }
  16371. }
  16372. function showTip(str) {
  16373. uiMgr.Show(UIMsg, str);
  16374. }
  16375. function log(...args) {
  16376. console.log(args);
  16377. }
  16378. let xGame = {
  16379. context: context$1,
  16380. eventMgr,
  16381. resMgr,
  16382. uiMgr,
  16383. soundMgr,
  16384. define,
  16385. tools,
  16386. httpMgr,
  16387. d3TexUrl,
  16388. d3ModeUrl,
  16389. common,
  16390. cfgMgr,
  16391. poolD3Mgr,
  16392. setStageSize,
  16393. filledBg,
  16394. setNotch,
  16395. showTip,
  16396. log,
  16397. };
  16398. window["xGame"] = xGame;
  16399. let dataName = 'tBall_';
  16400. class UserData {
  16401. constructor() {
  16402. this.userId = "";
  16403. this.isAgree = false;
  16404. this.coinNum = 0;
  16405. this.gemNum = 0;
  16406. this.sound = true;
  16407. this.vibration = true;
  16408. this.currentDate = 0;
  16409. this.createTime = 0;
  16410. this.awardTime = 0;
  16411. this.roleId = 1;
  16412. this.roleList = [];
  16413. this.roleAds = [];
  16414. this.dressId = 101;
  16415. this.itemId = 201;
  16416. this.bigSkills = [1, 1, 1, 1, 1];
  16417. this.coin = 4000;
  16418. this.diamond = 0;
  16419. this.skillSuccessTimes = 0;
  16420. this.skillGuide = 0;
  16421. this.skillAccTimes = 0;
  16422. this.placeBallData = [];
  16423. this.shareDiamondTimes = 0;
  16424. this.dailyVideoShareTimes = 0;
  16425. this.secretary = [1, 0];
  16426. this.curSecretary = 0;
  16427. this.ballRod = [1, 0, 0, 0, 0, 1];
  16428. this.curBallRod = 5;
  16429. this.signData = 0;
  16430. this.signTime = 0;
  16431. this.drawTimes = 0;
  16432. this.drawAwardTimes = 0;
  16433. this.dailyfreeDrawTimes = 1;
  16434. this.power = 5;
  16435. this.powerTime = 0;
  16436. this.challengeTimes = 0;
  16437. this.extraSign = 0;
  16438. this.classicTimes = 0;
  16439. this.guideHelpLine = 0;
  16440. this.newUser = true;
  16441. this.rootBallFoul = 0;
  16442. this.timeoutFoul = 0;
  16443. this.roleList = [1];
  16444. }
  16445. saveData() {
  16446. let data = {};
  16447. for (let k in this) {
  16448. data[k.toString()] = this[k];
  16449. }
  16450. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  16451. }
  16452. getData() {
  16453. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  16454. if (ld) {
  16455. let localData = JSON.parse(ld);
  16456. if (localData) {
  16457. for (let k in this) {
  16458. let key = k.toString();
  16459. let data = localData[key];
  16460. if (data != undefined) {
  16461. this[k] = data;
  16462. }
  16463. }
  16464. }
  16465. }
  16466. }
  16467. }
  16468. class ItemData {
  16469. constructor() {
  16470. this.itemList = {};
  16471. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  16472. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  16473. }
  16474. saveData() {
  16475. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  16476. }
  16477. getData() {
  16478. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  16479. if (ld) {
  16480. let localData = JSON.parse(ld);
  16481. if (localData) {
  16482. this.itemList = localData;
  16483. }
  16484. }
  16485. }
  16486. }
  16487. class GameData {
  16488. constructor() {
  16489. this.curLevel = 0;
  16490. this.gameType = 1;
  16491. this.signIdx = 0;
  16492. this.signMax = 0;
  16493. this.rotaryTime = 0;
  16494. this.rotaryCount = 0;
  16495. this.rotaryList = [];
  16496. this.diyCount = 3;
  16497. this.awardIdx = 0;
  16498. this.shareNum = 2;
  16499. this.rankWeek = 0;
  16500. this.rankScore = 0;
  16501. this.gameCount = 0;
  16502. this.trySkill = -1;
  16503. this.tryTime = 0;
  16504. }
  16505. saveData() {
  16506. let data = {};
  16507. for (let k in this) {
  16508. data[k.toString()] = this[k];
  16509. }
  16510. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16511. }
  16512. getData() {
  16513. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16514. if (ld) {
  16515. let localData = JSON.parse(ld);
  16516. if (localData) {
  16517. for (let k in this) {
  16518. let key = k.toString();
  16519. let data = localData[key];
  16520. if (data != undefined) {
  16521. this[k] = data;
  16522. }
  16523. }
  16524. }
  16525. }
  16526. }
  16527. }
  16528. class Diy2025GameData {
  16529. constructor() {
  16530. this.challengeMode_overLev = 0;
  16531. this.xszyForClassic = false;
  16532. this.xszyForChallenge = false;
  16533. }
  16534. saveData() {
  16535. let data = {};
  16536. for (let k in this) {
  16537. data[k.toString()] = this[k];
  16538. }
  16539. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  16540. }
  16541. getData() {
  16542. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  16543. if (ld) {
  16544. let localData = JSON.parse(ld);
  16545. if (localData) {
  16546. for (let k in this) {
  16547. let key = k.toString();
  16548. let data = localData[key];
  16549. if (data != undefined) {
  16550. this[k] = data;
  16551. }
  16552. }
  16553. }
  16554. }
  16555. }
  16556. }
  16557. class DataMgr {
  16558. static Init() {
  16559. this.userData = new UserData();
  16560. this.gameData = new GameData();
  16561. this.itemData = new ItemData();
  16562. this.diyGameData = new Diy2025GameData();
  16563. this.userData.getData();
  16564. this.gameData.getData();
  16565. this.itemData.getData();
  16566. this.diyGameData.getData();
  16567. this.roleId = this.userData.roleId;
  16568. this.resetUse();
  16569. }
  16570. static isNewDay() {
  16571. Moyu.isNewDay(this, (isnew) => {
  16572. xGame.common.isNewDay = isnew;
  16573. if (!isnew)
  16574. return;
  16575. DataMgr.setShareDiamondTimes(0, false);
  16576. DataMgr.setDailyVideoShareTimes(0, false);
  16577. DataMgr.setDailyfreeDrawTimes(1);
  16578. DataMgr.setExtraSign(0);
  16579. });
  16580. }
  16581. static deletData() {
  16582. Laya.LocalStorage.clear();
  16583. }
  16584. static upRankData() {
  16585. let num = xGame.common.getAllStarNum();
  16586. if (num > 0)
  16587. Moyu.upRankData(xGame.common.curRankID, num);
  16588. }
  16589. static addItem(id, count = 1) {
  16590. let v = this.itemData.itemList[id];
  16591. if (!v)
  16592. v = { id: id, count: count, adnum: 0, active: true };
  16593. else {
  16594. if (v.active) {
  16595. v.count += count;
  16596. }
  16597. else {
  16598. v.count = count;
  16599. v.active = true;
  16600. }
  16601. }
  16602. this.itemData.itemList[id] = v;
  16603. xGame.soundMgr.playGetSound();
  16604. this.saveItemData();
  16605. }
  16606. static hasItem(id) {
  16607. let v = this.itemData.itemList[id];
  16608. if (v && v.active)
  16609. return true;
  16610. return false;
  16611. }
  16612. static getItem(id) {
  16613. let v = this.itemData.itemList[id];
  16614. return v;
  16615. }
  16616. static getItemCount(id) {
  16617. let v = this.itemData.itemList[id];
  16618. if (v && v.active)
  16619. return v.count;
  16620. return 0;
  16621. }
  16622. static getItemAd(id) {
  16623. let v = this.itemData.itemList[id];
  16624. if (v) {
  16625. return v.adnum;
  16626. }
  16627. return 0;
  16628. }
  16629. static onItemAd(id, num = 1) {
  16630. let v = this.itemData.itemList[id];
  16631. if (!v)
  16632. v = { id: id, count: 1, adnum: num, active: false };
  16633. else
  16634. v.adnum += num;
  16635. this.itemData.itemList[id] = v;
  16636. this.saveItemData();
  16637. }
  16638. static costItem(id, count) {
  16639. let v = this.itemData.itemList[id];
  16640. if (v && v.active) {
  16641. if (v.count < count)
  16642. return false;
  16643. else {
  16644. v.count -= count;
  16645. this.itemData.itemList[id] = v;
  16646. return true;
  16647. }
  16648. }
  16649. return false;
  16650. }
  16651. static resetUse() {
  16652. this.dressId = this.userData.dressId;
  16653. this.itemId = this.userData.itemId;
  16654. }
  16655. static passLevel() {
  16656. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  16657. this.gameData.curLevel++;
  16658. this.curLevel = this.gameData.curLevel;
  16659. this.saveGameData();
  16660. }
  16661. static useRole(id) {
  16662. this.roleId = id;
  16663. if (this.hasRole(id)) {
  16664. this.userData.roleId = id;
  16665. this.saveUserData();
  16666. }
  16667. }
  16668. static addRole(id) {
  16669. if (this.hasRole(id))
  16670. return;
  16671. this.userData.roleList.push(id);
  16672. this.saveUserData();
  16673. }
  16674. static hasRole(id) {
  16675. return this.userData.roleList.indexOf(id) >= 0;
  16676. }
  16677. static gemEnough(num) {
  16678. return this.userData.gemNum >= num;
  16679. }
  16680. static roleHasAd(id) {
  16681. let count = this.userData.roleAds[id];
  16682. if (count != undefined && count >= 0)
  16683. return true;
  16684. else
  16685. return false;
  16686. }
  16687. static saveUserData(time = 500, event, arg) {
  16688. if (this.userSaving)
  16689. return;
  16690. this.userSaving = true;
  16691. Laya.timer.once(time, this, () => {
  16692. this.userSaving = false;
  16693. this.userData.saveData();
  16694. if (event)
  16695. xGame.eventMgr.event(event, arg);
  16696. });
  16697. }
  16698. static saveGameData() {
  16699. if (this.gameSaving)
  16700. return;
  16701. this.gameSaving = true;
  16702. Laya.timer.once(1000, this, () => {
  16703. this.gameSaving = false;
  16704. this.gameData.saveData();
  16705. });
  16706. }
  16707. static saveItemData() {
  16708. let fun = () => {
  16709. this.itemData.saveData();
  16710. };
  16711. Laya.timer.clear(this, fun);
  16712. Laya.timer.once(500, this, fun);
  16713. }
  16714. static saveData() {
  16715. this.saveUserData();
  16716. this.saveGameData();
  16717. }
  16718. static getBigSkillList() {
  16719. return this.userData.bigSkills;
  16720. }
  16721. static getBigSkillByIndex(index) {
  16722. return this.userData.bigSkills[index];
  16723. }
  16724. static setBigSkill(index, val, addUp = true) {
  16725. if (addUp) {
  16726. this.userData.bigSkills[index] += val;
  16727. }
  16728. else {
  16729. this.userData.bigSkills[index] = val;
  16730. }
  16731. this.saveUserData();
  16732. }
  16733. static coinEnough(need) {
  16734. if (typeof need != "number") {
  16735. console.error("金币格式错误");
  16736. return;
  16737. }
  16738. return this.userData.coin >= need;
  16739. }
  16740. static setCoin(val) {
  16741. if (typeof val != "number") {
  16742. return;
  16743. }
  16744. this.userData.coin += val;
  16745. this.saveUserData();
  16746. xGame.eventMgr.event(COIN_CHANGE);
  16747. }
  16748. static getCoin() {
  16749. return this.userData.coin;
  16750. }
  16751. static diamondEnough(need) {
  16752. if (typeof need != "number") {
  16753. console.error("金币格式错误");
  16754. return;
  16755. }
  16756. return this.userData.diamond >= need;
  16757. }
  16758. static setDiamond(val) {
  16759. if (typeof val != "number") {
  16760. return;
  16761. }
  16762. this.userData.diamond += val;
  16763. this.saveUserData();
  16764. xGame.eventMgr.event(DIAMOND_CHANGE);
  16765. }
  16766. static getDiamond() {
  16767. return this.userData.diamond;
  16768. }
  16769. static getSkillSuccessTimes() {
  16770. return this.userData.skillSuccessTimes;
  16771. }
  16772. static setSkillSuccessTimes(val, addUp = true) {
  16773. if (addUp)
  16774. this.userData.skillSuccessTimes += val;
  16775. else
  16776. this.userData.skillSuccessTimes = val;
  16777. this.saveUserData();
  16778. }
  16779. static getSkillAccTimes() {
  16780. return this.userData.skillAccTimes;
  16781. }
  16782. static setSkillAccTimes(val) {
  16783. this.userData.skillAccTimes += val;
  16784. this.saveUserData();
  16785. }
  16786. static getSkillGuide() {
  16787. if (!xGame.common.openGuide) {
  16788. return 1;
  16789. }
  16790. return this.userData.skillGuide;
  16791. }
  16792. static setSkillGuide(val) {
  16793. this.userData.skillGuide = val;
  16794. this.saveUserData();
  16795. }
  16796. static getPlaceBallLevelList() {
  16797. return this.userData.placeBallData;
  16798. }
  16799. static getPlaceBallLevel(level) {
  16800. let arr = this.userData.placeBallData;
  16801. let index = level - 1;
  16802. let out;
  16803. if (arr[index]) {
  16804. out = arr[index];
  16805. }
  16806. else {
  16807. let max = arr.length;
  16808. if (max == index) {
  16809. out = {
  16810. star: 0,
  16811. play: true,
  16812. isCur: true,
  16813. getAward: false
  16814. };
  16815. }
  16816. else {
  16817. out = {
  16818. star: 0,
  16819. play: false,
  16820. getAward: false
  16821. };
  16822. }
  16823. }
  16824. return out;
  16825. }
  16826. static setPlaceBallLevel(level, star) {
  16827. let arr = this.userData.placeBallData;
  16828. let index = level - 1;
  16829. if (arr[index]) {
  16830. arr[index].star = Math.max(arr[index].star, star);
  16831. }
  16832. else {
  16833. let max = arr.length;
  16834. if (max == index) {
  16835. arr.push({
  16836. star: star,
  16837. play: true,
  16838. getAward: false
  16839. });
  16840. }
  16841. else {
  16842. console.error("关卡存储出错");
  16843. }
  16844. }
  16845. this.saveUserData();
  16846. }
  16847. static setPlaceBallAward(level) {
  16848. let arr = this.userData.placeBallData;
  16849. let index = level - 1;
  16850. if (arr[index]) {
  16851. arr[index].getAward = true;
  16852. }
  16853. this.saveUserData();
  16854. }
  16855. static getShareDiamondTimes() {
  16856. return this.userData.shareDiamondTimes;
  16857. }
  16858. static setShareDiamondTimes(val, addUp = true) {
  16859. if (addUp) {
  16860. this.userData.shareDiamondTimes += val;
  16861. }
  16862. else {
  16863. this.userData.shareDiamondTimes = val;
  16864. }
  16865. this.saveUserData();
  16866. }
  16867. static getDailyVideoShareTimes() {
  16868. return this.userData.dailyVideoShareTimes;
  16869. }
  16870. static setDailyVideoShareTimes(val, addUp = true) {
  16871. if (addUp) {
  16872. this.userData.dailyVideoShareTimes += val;
  16873. }
  16874. else {
  16875. this.userData.dailyVideoShareTimes = val;
  16876. }
  16877. this.saveUserData();
  16878. }
  16879. static getSecretary(index) {
  16880. return this.userData.secretary[index];
  16881. }
  16882. static setSecretary(index, val) {
  16883. this.userData.secretary[index] = val;
  16884. this.saveUserData();
  16885. }
  16886. static getCurSecretary() {
  16887. return this.userData.curSecretary;
  16888. }
  16889. static setCurSecretary(index) {
  16890. this.userData.curSecretary = index;
  16891. this.saveUserData();
  16892. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16893. }
  16894. static getBallRod(index) {
  16895. return this.userData.ballRod[index];
  16896. }
  16897. static setBallRod(index, val) {
  16898. this.userData.ballRod[index] = val;
  16899. this.saveUserData();
  16900. }
  16901. static getCurBallRod() {
  16902. return this.userData.curBallRod;
  16903. }
  16904. static setCurBallRod(index) {
  16905. this.userData.curBallRod = index;
  16906. this.saveUserData();
  16907. }
  16908. static setSignData(val) {
  16909. this.userData.signData = val;
  16910. this.saveUserData();
  16911. }
  16912. static getSignData() {
  16913. return this.userData.signData;
  16914. }
  16915. static setSignTime(val) {
  16916. this.userData.signTime = val;
  16917. this.saveUserData();
  16918. }
  16919. static getSignTime() {
  16920. return this.userData.signTime;
  16921. }
  16922. static getDrawTimes() {
  16923. return this.userData.drawTimes;
  16924. }
  16925. static setDrawTimes(val, addUp = true) {
  16926. if (addUp) {
  16927. this.userData.drawTimes += val;
  16928. }
  16929. else {
  16930. this.userData.drawTimes = val;
  16931. }
  16932. this.saveUserData();
  16933. }
  16934. static getDrawAwardTimes() {
  16935. return this.userData.drawAwardTimes;
  16936. }
  16937. static setDrawAwardTimes(val) {
  16938. this.userData.drawAwardTimes = val;
  16939. this.saveUserData();
  16940. }
  16941. static getDailyfreeDrawTimes() {
  16942. return this.userData.dailyfreeDrawTimes;
  16943. }
  16944. static setDailyfreeDrawTimes(val) {
  16945. this.userData.dailyfreeDrawTimes = val;
  16946. this.saveUserData();
  16947. }
  16948. static setPower(val, addUp = true) {
  16949. if (addUp)
  16950. this.userData.power += val;
  16951. else
  16952. this.userData.power = val;
  16953. if (this.userData.power >= xGame.common.maxPower) {
  16954. this.userData.power = xGame.common.maxPower;
  16955. }
  16956. xGame.eventMgr.event(POWER_CHANGE, val);
  16957. this.saveUserData();
  16958. }
  16959. static getPower() {
  16960. return this.userData.power;
  16961. }
  16962. static setPowerTime(val) {
  16963. this.userData.powerTime = val;
  16964. this.saveUserData();
  16965. }
  16966. static getPowerTime() {
  16967. return this.userData.powerTime;
  16968. }
  16969. static powerEnough() {
  16970. return this.getPower() > 0;
  16971. }
  16972. static getChallengeTimes() {
  16973. return this.userData.challengeTimes;
  16974. }
  16975. static setChallengeTimes(val) {
  16976. this.userData.challengeTimes += val;
  16977. this.saveUserData();
  16978. }
  16979. static getExtraSign() {
  16980. return this.userData.extraSign;
  16981. }
  16982. static setExtraSign(val) {
  16983. this.userData.extraSign = val;
  16984. this.saveUserData();
  16985. }
  16986. static getClassicTimes() {
  16987. return this.userData.classicTimes;
  16988. }
  16989. static setClassicTimes() {
  16990. this.userData.classicTimes += 1;
  16991. this.saveUserData();
  16992. }
  16993. static getGuideHelpLine() {
  16994. return this.userData.guideHelpLine;
  16995. }
  16996. static setGuideHelpLine() {
  16997. this.userData.guideHelpLine = 1;
  16998. this.saveUserData();
  16999. }
  17000. static getNewUser() {
  17001. return this.userData.newUser;
  17002. }
  17003. static setNewUser() {
  17004. this.userData.newUser = false;
  17005. this.saveUserData();
  17006. }
  17007. static getRootBallFoul() {
  17008. return this.userData.rootBallFoul;
  17009. }
  17010. static setRootBallFoul() {
  17011. this.userData.rootBallFoul = 1;
  17012. this.saveUserData();
  17013. }
  17014. static getTimeoutFoul() {
  17015. return this.userData.timeoutFoul;
  17016. }
  17017. static setTimeoutFoul() {
  17018. this.userData.timeoutFoul = 1;
  17019. this.saveUserData();
  17020. }
  17021. static saveDiyGameData() {
  17022. if (this.diyGameSaving)
  17023. return;
  17024. this.diyGameSaving = true;
  17025. Laya.timer.once(500, this, () => {
  17026. this.diyGameSaving = false;
  17027. this.diyGameData.saveData();
  17028. });
  17029. }
  17030. static getChallengeMode_overLev() {
  17031. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  17032. return this.challengeMode_overLev;
  17033. }
  17034. static setChallengeMode_overLev(levNum) {
  17035. this.diyGameData.challengeMode_overLev = levNum;
  17036. this.saveDiyGameData();
  17037. }
  17038. }
  17039. DataMgr.isNewUser = false;
  17040. DataMgr.fristEnter = true;
  17041. DataMgr.levelType = 0;
  17042. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  17043. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  17044. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  17045. DataMgr.challengeMode_overLev = 0;
  17046. DataMgr.xszyForClassic = false;
  17047. DataMgr.xszyForChallenge = false;
  17048. DataMgr.awardId = 0;
  17049. DataMgr.awardCoin = 0;
  17050. DataMgr.sceneId = -1;
  17051. DataMgr.tryId = 0;
  17052. DataMgr.curLevel = 1;
  17053. DataMgr.vipLevel = 0;
  17054. DataMgr.maxLevel = 0;
  17055. DataMgr.awardRatio = 1;
  17056. DataMgr.gameList = [];
  17057. DataMgr.rankList = [];
  17058. DataMgr.recoverTime = 480000;
  17059. DataMgr.minScore = 0;
  17060. DataMgr.rankDis = 0;
  17061. DataMgr.userSaving = false;
  17062. DataMgr.gameSaving = false;
  17063. DataMgr.diyGameSaving = false;
  17064. class D3Tween extends Laya.Script3D {
  17065. constructor() {
  17066. super();
  17067. this.isInited = false;
  17068. }
  17069. ;
  17070. init() {
  17071. if (this.isInited)
  17072. return;
  17073. this.isInited = true;
  17074. this.gameObj = this.owner;
  17075. this.transform = this.gameObj.transform;
  17076. }
  17077. get rotX() {
  17078. return this.transform.localRotationEulerX;
  17079. }
  17080. set rotX(v) {
  17081. this.transform.localRotationEulerX = v;
  17082. }
  17083. get rotY() {
  17084. return this.transform.localRotationEulerY;
  17085. }
  17086. set rotY(v) {
  17087. this.transform.localRotationEulerY = v;
  17088. }
  17089. get rotZ() {
  17090. return this.transform.localRotationEulerZ;
  17091. }
  17092. set rotZ(v) {
  17093. this.transform.localRotationEulerZ = v;
  17094. }
  17095. get posX() {
  17096. return this.transform.localPositionX;
  17097. }
  17098. set posX(v) {
  17099. this.transform.localPositionX = v;
  17100. }
  17101. get posY() {
  17102. return this.transform.localPositionY;
  17103. }
  17104. set posY(v) {
  17105. this.transform.localPositionY = v;
  17106. }
  17107. get posZ() {
  17108. return this.transform.localPositionZ;
  17109. }
  17110. set posZ(v) {
  17111. this.transform.localPositionZ = v;
  17112. }
  17113. get rotation() {
  17114. return this.transform.localRotation;
  17115. }
  17116. set rotation(v) {
  17117. this.transform.localRotation = v;
  17118. }
  17119. }
  17120. class D2Hole extends Laya.Script {
  17121. constructor() { super(); }
  17122. onTriggerEnter(collider) {
  17123. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  17124. return;
  17125. }
  17126. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  17127. if (collider.owner["mySrc"].isRunSkillAni) {
  17128. return;
  17129. }
  17130. if (collider.owner["mySrc"].number != 0) {
  17131. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  17132. }
  17133. xGame.common.ballColliHole(collider);
  17134. xGame.common.recoverCameraView();
  17135. }
  17136. }
  17137. }
  17138. class Table extends Laya.Script3D {
  17139. constructor() {
  17140. super();
  17141. this.isSetBorder = false;
  17142. this.inited = false;
  17143. }
  17144. ;
  17145. onAwake() {
  17146. this.init();
  17147. }
  17148. init() {
  17149. if (this.inited)
  17150. return;
  17151. this.inited = true;
  17152. this.gameObj = this.owner;
  17153. this.border = this.gameObj.getChildByName("border");
  17154. }
  17155. setBorderPos() {
  17156. if (this.isSetBorder)
  17157. return;
  17158. this.isSetBorder = true;
  17159. let ui = xGame.common.gameUI.ui;
  17160. let bar1 = this.border.getChildByName("bar1");
  17161. let bar2 = this.border.getChildByName("bar2");
  17162. let bar3 = this.border.getChildByName("bar3");
  17163. let bar4 = this.border.getChildByName("bar4");
  17164. let bar5 = this.border.getChildByName("bar5");
  17165. let bar6 = this.border.getChildByName("bar6");
  17166. this.setInfo(bar1, ui.border.bar1, "box");
  17167. this.setInfo(bar2, ui.border.bar2, "box");
  17168. this.setInfo(bar3, ui.border.bar3, "box");
  17169. this.setInfo(bar4, ui.border.bar4, "box");
  17170. this.setInfo(bar5, ui.border.bar5, "box");
  17171. this.setInfo(bar6, ui.border.bar6, "box");
  17172. let circle1 = this.border.getChildByName("circle1");
  17173. let circle2 = this.border.getChildByName("circle2");
  17174. let circle3 = this.border.getChildByName("circle3");
  17175. let circle4 = this.border.getChildByName("circle4");
  17176. let circle5 = this.border.getChildByName("circle5");
  17177. let circle6 = this.border.getChildByName("circle6");
  17178. this.setInfo(circle1, ui.border.circle1, "circle");
  17179. this.setInfo(circle2, ui.border.circle2, "circle");
  17180. this.setInfo(circle3, ui.border.circle3, "circle");
  17181. this.setInfo(circle4, ui.border.circle4, "circle");
  17182. this.setInfo(circle5, ui.border.circle5, "circle");
  17183. this.setInfo(circle6, ui.border.circle6, "circle");
  17184. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  17185. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  17186. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  17187. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  17188. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  17189. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  17190. let arr = xGame.common.gameMgr.holePosList;
  17191. xGame.common.gameMgr.posObj = {
  17192. "1": arr[0],
  17193. "3": arr[2],
  17194. "4": arr[3],
  17195. "6": arr[5]
  17196. };
  17197. }
  17198. initHolePos(x, y) {
  17199. if (x < 300)
  17200. x += 25;
  17201. else if (x > 1000)
  17202. x -= 25;
  17203. else if (y > 200)
  17204. y -= 10;
  17205. else
  17206. y += 10;
  17207. if (y < 200)
  17208. y += 30;
  17209. else if (y > 500)
  17210. y -= 30;
  17211. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  17212. }
  17213. setInfo(d3Obj, d2Obj, type) {
  17214. let ui = xGame.common.gameUI.ui;
  17215. let sprite = new Laya.Sprite();
  17216. ui.border.displayObject.addChild(sprite);
  17217. let colli = xGame.common.getCollider(type);
  17218. sprite.addComponentIntance(colli);
  17219. let rigy = xGame.common.getRigbody();
  17220. rigy.type = "static";
  17221. sprite.addComponentIntance(rigy);
  17222. let d3Pos = d3Obj.transform.position;
  17223. xGame.common.pos3to2Convert(d3Pos);
  17224. let scaleX = d3Obj.transform.localScaleX;
  17225. let scaleZ = d3Obj.transform.localScaleZ;
  17226. let width = xGame.common.scale3to2Convert(scaleZ);
  17227. let height = xGame.common.scale3to2Convert(scaleX);
  17228. sprite.pivotX = width / 2;
  17229. sprite.pivotY = height / 2;
  17230. sprite.x = d3Pos.x;
  17231. sprite.y = d3Pos.y;
  17232. sprite.width = width;
  17233. sprite.height = height;
  17234. d2Obj.x = d3Pos.x;
  17235. d2Obj.y = d3Pos.y;
  17236. d2Obj.width = width;
  17237. d2Obj.height = height;
  17238. if (type == "box") {
  17239. colli.width = width;
  17240. colli.height = height;
  17241. colli.isSensor = false;
  17242. colli.label = "border";
  17243. }
  17244. else {
  17245. colli.radius = width / 2;
  17246. colli.isSensor = true;
  17247. colli.label = "hole";
  17248. sprite.addComponent(D2Hole);
  17249. }
  17250. }
  17251. }
  17252. class D3World extends Laya.Script3D {
  17253. constructor() {
  17254. super();
  17255. this.loadNum = 0;
  17256. this.setLoadNum = 7;
  17257. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  17258. }
  17259. onAwake() {
  17260. }
  17261. loadScene() {
  17262. this.scene = this.owner;
  17263. let url = `res/unityRes/root.lh`;
  17264. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  17265. this.scene.addChild(prefab);
  17266. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  17267. this.putCameraInfo();
  17268. this.camera.enableHDR = false;
  17269. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  17270. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  17271. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  17272. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  17273. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  17274. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  17275. this.knife.active = false;
  17276. this.loadD3Obj();
  17277. }));
  17278. }
  17279. putCameraInfo() {
  17280. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  17281. this.cameraObj = new cameraType();
  17282. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  17283. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  17284. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  17285. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  17286. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  17287. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  17288. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  17289. this.visitAngleChild.init();
  17290. this.visitRootObj.posX = this.visitAngleChild.posX;
  17291. this.visitRootObj.posY = this.visitAngleChild.posY;
  17292. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  17293. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  17294. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  17295. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  17296. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  17297. xGame.common.showOneCamera("mainCamera");
  17298. }
  17299. loadD3Obj() {
  17300. this.loadTable();
  17301. this.loadRoom();
  17302. this.loadInHoleParticial();
  17303. this.loadIceParticial();
  17304. this.loadHitParticial();
  17305. this.loadFireworksParticial();
  17306. this.loadBall();
  17307. }
  17308. loadInHoleParticial() {
  17309. this.loadD3Res("inHoleEft", "", (prefab) => {
  17310. prefab.addComponent(Partical);
  17311. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  17312. });
  17313. }
  17314. loadIceParticial() {
  17315. this.loadD3Res("iceEft", "", (prefab) => {
  17316. prefab.addComponent(Partical);
  17317. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  17318. });
  17319. }
  17320. loadHitParticial() {
  17321. this.loadD3Res("hitEft", "", (prefab) => {
  17322. prefab.addComponent(Partical);
  17323. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  17324. });
  17325. }
  17326. loadFireworksParticial() {
  17327. this.loadD3Res("fireworksEft", "", (prefab) => {
  17328. prefab.addComponent(Partical);
  17329. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  17330. });
  17331. }
  17332. loadBall(index = 1) {
  17333. this.loadD3Res("ball", index, (prefab) => {
  17334. this.ballPrefab = prefab;
  17335. this.ballPrefab.addComponent(Ball);
  17336. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  17337. });
  17338. }
  17339. loadTable(index = 1) {
  17340. this.loadD3Res("table", index, (prefab) => {
  17341. this.tableSrc = prefab.addComponent(Table);
  17342. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  17343. this.d3Hand.init();
  17344. this.tableRoot.addChild(prefab);
  17345. });
  17346. }
  17347. loadRoom(index = 1) {
  17348. this.loadD3Res("room", index, (prefab) => {
  17349. this.roomRoot.addChild(prefab);
  17350. });
  17351. }
  17352. loadD3Res(type, index, callback) {
  17353. let url = `res/unityRes/${type}${index}.lh`;
  17354. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  17355. callback && callback(prefab);
  17356. this.checkResLoad();
  17357. }));
  17358. }
  17359. checkResLoad() {
  17360. this.loadNum++;
  17361. if (this.loadNum >= this.setLoadNum) {
  17362. xGame.eventMgr.event(D3RES_LOADED);
  17363. }
  17364. }
  17365. prePlayEft() {
  17366. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  17367. eft.transform.localPositionX = 0;
  17368. eft.transform.localPositionY = -5;
  17369. eft.transform.localPositionZ = 0;
  17370. eft.active = true;
  17371. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  17372. ice.transform.localPositionX = 0;
  17373. ice.transform.localPositionY = -5;
  17374. ice.transform.localPositionZ = 0;
  17375. ice.active = true;
  17376. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  17377. hit.transform.localPositionX = 0;
  17378. hit.transform.localPositionY = -5;
  17379. hit.transform.localPositionZ = 0;
  17380. hit.active = true;
  17381. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  17382. fireworks.transform.localPositionX = 0;
  17383. fireworks.transform.localPositionY = -5;
  17384. fireworks.transform.localPositionZ = 0;
  17385. fireworks.active = true;
  17386. }
  17387. }
  17388. class cameraType {
  17389. }
  17390. class MoyuMgr$1 {
  17391. static initMoyu() {
  17392. this.moyuView = new MoyuView$1();
  17393. Laya.stage.addChild(this.moyuView.ui.displayObject);
  17394. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  17395. this.moyuView.ui.displayObject.zOrder = 1000;
  17396. this.moyuView.init();
  17397. this.moyuView.showTip(true);
  17398. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  17399. window['XApk'] = this;
  17400. }
  17401. static showAge(show) {
  17402. if (this.moyuView)
  17403. this.moyuView.showAge(show);
  17404. }
  17405. static onPlatMsg(idx) {
  17406. if (!MoyuMgr$1.moyuView)
  17407. return;
  17408. if (idx == '0') {
  17409. MoyuMgr$1.moyuView.showTip(false);
  17410. }
  17411. }
  17412. static showAgree(call) {
  17413. if (this.moyuView)
  17414. this.moyuView.showAgree(call);
  17415. else
  17416. call && call();
  17417. }
  17418. static showXy(type = 1) {
  17419. if (this.moyuView)
  17420. this.moyuView.showXy(type);
  17421. }
  17422. }
  17423. MoyuMgr$1.isAdvise = false;
  17424. class MoyuView$1 {
  17425. constructor() {
  17426. this.ysxyNum = 1;
  17427. this.ysJson = null;
  17428. this.ui = ui_UIMoyu.createInstance();
  17429. }
  17430. init() {
  17431. this.ui.mainBg.visible = false;
  17432. this.ui.xyNode.visible = false;
  17433. this.ui.ageNode.visible = false;
  17434. this.ui.tipNode.visible = false;
  17435. this.ui.rnNode.visible = false;
  17436. this.ui.fcmNode.visible = false;
  17437. this.ui.ageTip.visible = false;
  17438. this.ui.msgNode.visible = false;
  17439. this.ui.visible = false;
  17440. this.ui.xyNode.xyList.setVirtual();
  17441. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  17442. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  17443. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  17444. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  17445. this.ui.xyNode.btnKnown.visible = false;
  17446. this.ui.xyNode.xy1.visible = false;
  17447. this.ui.xyNode.xy2.visible = false;
  17448. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  17449. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  17450. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  17451. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  17452. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  17453. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  17454. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  17455. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  17456. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  17457. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  17458. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  17459. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  17460. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  17461. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  17462. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  17463. this.ysxyNum = 2;
  17464. }
  17465. }
  17466. onClick(obj) {
  17467. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  17468. switch (obj) {
  17469. case this.ui.ageTip:
  17470. if (Moyu.isTTApk) {
  17471. this.ui.ageNode.visible = true;
  17472. this.ui.mainBg.visible = true;
  17473. }
  17474. break;
  17475. case this.ui.tipNode:
  17476. this.showTip(false);
  17477. break;
  17478. case this.ui.ageNode.btnAge:
  17479. this.ui.ageNode.visible = false;
  17480. this.ui.mainBg.visible = false;
  17481. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  17482. this.ui.visible = false;
  17483. break;
  17484. case this.ui.xyNode.btnXy3:
  17485. case this.ui.xyNode.btnXy1:
  17486. this.loadXy(1);
  17487. break;
  17488. case this.ui.xyNode.btnXy2:
  17489. this.loadXy(2);
  17490. break;
  17491. case this.ui.xyNode.btnBack:
  17492. this.ui.xyNode.xy1.visible = true;
  17493. this.ui.xyNode.xy2.visible = false;
  17494. break;
  17495. case this.ui.xyNode.btnKnown:
  17496. this.ui.xyNode.visible = false;
  17497. this.ui.mainBg.visible = false;
  17498. this.ui.visible = false;
  17499. break;
  17500. case this.ui.rnNode.btnCheck:
  17501. this.check();
  17502. break;
  17503. case this.ui.rnNode.btnExit:
  17504. case this.ui.xyNode.btnNo:
  17505. this.ysxyNum--;
  17506. if (this.ysxyNum > 0)
  17507. this.showMsg("Refuse to quit the game once again");
  17508. else {
  17509. Moyu.userAgree(false);
  17510. Moyu.exit();
  17511. }
  17512. break;
  17513. case this.ui.xyNode.btnSure:
  17514. case this.ui.xyNode.btnYes:
  17515. DataMgr.userData.isAgree = true;
  17516. DataMgr.saveUserData();
  17517. this.onAgree();
  17518. break;
  17519. case this.ui.rnNode.btnDone:
  17520. this.ui.rnNode.visible = false;
  17521. this.ui.visible = false;
  17522. break;
  17523. case this.ui.fcmNode.btnRn:
  17524. this.showRn();
  17525. break;
  17526. }
  17527. }
  17528. showTip(show) {
  17529. if (!Moyu.isVVApk && !Moyu.isOPApk)
  17530. return;
  17531. if (show) {
  17532. MoyuMgr$1.isAdvise = true;
  17533. this.ui.visible = true;
  17534. this.ui.tipNode.visible = true;
  17535. this.ui.tipNode.alpha = 1;
  17536. Laya.timer.once(1000, this, this.showTip, [false]);
  17537. }
  17538. else {
  17539. this.ui.tipNode.alpha = 1;
  17540. this.ui.tipNode.visible = true;
  17541. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  17542. this.ui.tipNode.visible = false;
  17543. MoyuMgr$1.isAdvise = false;
  17544. }), 1000);
  17545. }
  17546. }
  17547. showAge(show, px = 0, py = 0) {
  17548. if (Moyu.platType > 10 && !Moyu.isIos) {
  17549. this.ui.ageTip.x = px;
  17550. this.ui.ageTip.y = py;
  17551. this.ui.ageTip.visible = show;
  17552. if (show)
  17553. this.ui.visible = true;
  17554. }
  17555. }
  17556. showAgree(call) {
  17557. this.agreeCall = call;
  17558. this.onAgree();
  17559. return;
  17560. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  17561. this.showXy(0);
  17562. }
  17563. else
  17564. this.onAgree();
  17565. }
  17566. onAgree() {
  17567. if (!this.ui.ageNode.visible)
  17568. this.ui.visible = false;
  17569. this.ui.xyNode.visible = false;
  17570. Moyu.userAgree(true);
  17571. this.showAge(false);
  17572. this.agreeCall && this.agreeCall();
  17573. this.showRn();
  17574. }
  17575. showMsg(txt) {
  17576. this.ui.msgNode.txtMsg.text = txt;
  17577. this.ui.msgNode.visible = true;
  17578. this.ui.msgNode.alpha = 1;
  17579. this.ui.visible = true;
  17580. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17581. this.ui.msgNode.visible = false;
  17582. }), 2500, true);
  17583. }
  17584. showRn() {
  17585. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17586. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17587. this.ui.rnNode.rn1.visible = true;
  17588. this.ui.rnNode.rn2.visible = false;
  17589. this.ui.rnNode.rn3.visible = false;
  17590. this.ui.rnNode.rn4.visible = false;
  17591. this.ui.rnNode.visible = true;
  17592. this.ui.mainBg.visible = true;
  17593. this.ui.rnNode.btnDone.visible = false;
  17594. this.ui.rnNode.btnExit.visible = true;
  17595. this.ui.rnNode.btnCheck.visible = true;
  17596. this.ui.fcmNode.visible = false;
  17597. this.ui.visible = true;
  17598. return;
  17599. }
  17600. }
  17601. this.showFcm();
  17602. }
  17603. showFcm() {
  17604. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17605. Moyu.initFCM(true);
  17606. if (Moyu.gameTime < 1)
  17607. this.fcmLoop();
  17608. else if (Moyu.gameTime < 999)
  17609. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17610. }
  17611. }
  17612. fcmLoop() {
  17613. if (Moyu.gameTime < 1) {
  17614. this.ui.rnNode.visible = false;
  17615. this.ui.fcmNode.visible = true;
  17616. this.ui.mainBg.visible = true;
  17617. this.ui.visible = true;
  17618. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17619. Laya.timer.clear(this.ui, this.fcmLoop);
  17620. }
  17621. }
  17622. check() {
  17623. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  17624. this.ui.rnNode.rn1.visible = false;
  17625. this.ui.rnNode.rn2.visible = false;
  17626. this.ui.rnNode.rn4.visible = true;
  17627. }
  17628. else if (this.ui.rnNode.rn4.visible) {
  17629. let name = this.ui.rnNode.inputName.text;
  17630. let code = this.ui.rnNode.inputCode.text;
  17631. if (code && code.length == 18) {
  17632. this.ui.rnNode.rn1.visible = false;
  17633. this.ui.rnNode.rn4.visible = false;
  17634. Moyu.authenticate(name, code, (res) => {
  17635. this.ui.rnNode.rn2.visible = !res;
  17636. this.ui.rnNode.rn3.visible = res;
  17637. this.ui.rnNode.btnDone.visible = res;
  17638. this.ui.rnNode.btnExit.visible = !res;
  17639. this.ui.rnNode.btnCheck.visible = !res;
  17640. if (res)
  17641. this.showFcm();
  17642. });
  17643. }
  17644. else
  17645. this.showMsg("信息填写不完整");
  17646. }
  17647. }
  17648. loadXy(type = 0) {
  17649. this.ui.xyNode.xy1.visible = false;
  17650. this.ui.xyNode.xy2.visible = true;
  17651. this.ui.xyNode.xyList.scrollToView(0);
  17652. if (type == 1) {
  17653. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  17654. }
  17655. else if (type == 2) {
  17656. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  17657. }
  17658. }
  17659. showXy(type = 0) {
  17660. this.xyBtn();
  17661. if (type == 0) {
  17662. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  17663. this.ui.xyNode.btnSure.visible = true;
  17664. }
  17665. else {
  17666. this.ui.xyNode.btnYes.visible = true;
  17667. this.ui.xyNode.btnNo.visible = true;
  17668. }
  17669. }
  17670. else {
  17671. this.ui.xyNode.btnKnown.visible = true;
  17672. this.ui.mainBg.visible = true;
  17673. }
  17674. this.ui.xyNode.xy1.visible = true;
  17675. this.ui.xyNode.xy2.visible = false;
  17676. this.ui.xyNode.visible = true;
  17677. this.ui.visible = true;
  17678. }
  17679. xyBtn() {
  17680. this.ui.xyNode.btnSure.visible = false;
  17681. this.ui.xyNode.btnYes.visible = false;
  17682. this.ui.xyNode.btnNo.visible = false;
  17683. this.ui.xyNode.btnKnown.visible = false;
  17684. {
  17685. this.ui.xyNode.btnXy3.visible = false;
  17686. this.ui.xyNode.btnXy2.visible = true;
  17687. this.ui.xyNode.btnXy1.visible = true;
  17688. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  17689. }
  17690. }
  17691. createXY(json) {
  17692. this.ysJson = json.content;
  17693. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  17694. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  17695. this.ui.xyNode.xy2.visible = true;
  17696. }
  17697. renderListItem(idx, cell) {
  17698. let xy = this.ysJson[idx];
  17699. cell.height = xy.line * 30;
  17700. cell.xyItem.text = xy.text;
  17701. }
  17702. onDestroy() {
  17703. this.agreeCall = null;
  17704. }
  17705. }
  17706. class UILoading extends UIBase {
  17707. constructor() {
  17708. super();
  17709. this.accTime = 0;
  17710. this.curNum = 0;
  17711. this.rate = 1;
  17712. this.loadSubOk = false;
  17713. this.loadResOK = false;
  17714. this.openLoading = true;
  17715. this.beginLoadRes = false;
  17716. this.finishD2 = false;
  17717. this.finishD3 = false;
  17718. }
  17719. onConstructor() {
  17720. this.ui = ui_UILoading.createInstance();
  17721. this.contentPane = this.ui;
  17722. this.isEject = false;
  17723. this._initUI();
  17724. this._addEvent();
  17725. }
  17726. _initUI() {
  17727. MoyuMgr$1.initMoyu();
  17728. }
  17729. _addEvent() {
  17730. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17731. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17732. }
  17733. show() {
  17734. super.show();
  17735. console.log('zh:加载分包资源');
  17736. loadSubRes(this.subResProgress.bind(this));
  17737. this.ui.txtLoad.text = "Loading...";
  17738. }
  17739. subResProgress(pro, finish) {
  17740. this.curNum = pro;
  17741. if (finish) {
  17742. this.curNum = 1;
  17743. this.loadSubOk = true;
  17744. }
  17745. }
  17746. laodD3Res() {
  17747. let scene3D = new Laya.Scene3D();
  17748. xGame.common.d3Scene = scene3D;
  17749. xGame.common.d3World = scene3D.addComponent(D3World);
  17750. xGame.common.d3World.loadScene();
  17751. }
  17752. loadD2Res() {
  17753. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17754. this.finishD2 = true;
  17755. this.checkLoadAll();
  17756. this.curNum = 1;
  17757. }), Laya.Handler.create(this, (pro) => {
  17758. this.curNum = pro;
  17759. }, null, false));
  17760. }
  17761. d3ResFinish() {
  17762. this.finishD3 = true;
  17763. this.checkLoadAll();
  17764. }
  17765. checkLoadAll() {
  17766. if (this.finishD2 && this.finishD3) {
  17767. this.loadResOK = true;
  17768. }
  17769. }
  17770. loadRes() {
  17771. this.laodD3Res();
  17772. this.loadD2Res();
  17773. }
  17774. myUpdate(dt) {
  17775. if (!this.openLoading)
  17776. return;
  17777. this.accTime += dt * this.rate;
  17778. if (this.accTime >= this.curNum)
  17779. this.accTime = this.curNum;
  17780. this.ui.loadinfo.value = this.accTime * 100;
  17781. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17782. if (!this.beginLoadRes) {
  17783. this.beginLoadRes = true;
  17784. this.ui.txtLoad.text = "Loading...";
  17785. this.curNum = 0;
  17786. this.accTime = 0;
  17787. this.loadRes();
  17788. }
  17789. if (this.loadResOK) {
  17790. this.openLoading = false;
  17791. Laya.timer.once(300, this, () => {
  17792. xGame.common.d3Scene.active = false;
  17793. MoyuMgr$1.showAgree(enterGame);
  17794. });
  17795. }
  17796. }
  17797. }
  17798. release() {
  17799. }
  17800. hide() {
  17801. super.hide();
  17802. this.release();
  17803. }
  17804. onClose() {
  17805. this.hide();
  17806. }
  17807. }
  17808. UILoading.uiName = "UILoading";
  17809. class UIRepentProp$1 extends UIBase {
  17810. constructor() {
  17811. super();
  17812. this.viewType = 0;
  17813. this.regretType = 0;
  17814. }
  17815. onConstructor() {
  17816. this.ui = ui_UIRepentProp.createInstance();
  17817. this.contentPane = this.ui;
  17818. this.isEject = false;
  17819. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17820. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17821. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17822. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17823. }
  17824. show(viewType, regretType, callback) {
  17825. PlatMgr.showInsert(true);
  17826. this.viewType = viewType;
  17827. this.regretType = regretType;
  17828. this.callback = callback;
  17829. super.show();
  17830. this.ui.t0.play();
  17831. this.ui.c1.selectedIndex = this.viewType;
  17832. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17833. if (this.viewType == 0) {
  17834. let guide = DataMgr.getGuideHelpLine();
  17835. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17836. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17837. }
  17838. xGame.common.gameMgr.gamePause = true;
  17839. }
  17840. hideSelf() {
  17841. xGame.common.gameMgr.gamePause = false;
  17842. this.callback && this.callback(false);
  17843. this.hide();
  17844. }
  17845. videoRegret() {
  17846. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  17847. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  17848. }
  17849. else {
  17850. console.log('zh:AD 失败,直接发放奖励');
  17851. this.qjff_AD_for_UIrepentProp_videoRegret();
  17852. }
  17853. }
  17854. qjff_AD_for_UIrepentProp_videoRegret() {
  17855. this.callback && this.callback(true);
  17856. this.hideSelf();
  17857. }
  17858. videoAddHelpLine() {
  17859. let guide = DataMgr.getGuideHelpLine();
  17860. if (guide == 0) {
  17861. this.callback && this.callback(true);
  17862. this.hideSelf();
  17863. DataMgr.setGuideHelpLine();
  17864. xGame.common.gameUI.ui.guideNode.visible = false;
  17865. }
  17866. else {
  17867. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  17868. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  17869. }
  17870. else {
  17871. console.log('zh:AD 失败,直接发放奖励');
  17872. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  17873. }
  17874. }
  17875. }
  17876. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  17877. this.callback && this.callback(true);
  17878. this.hideSelf();
  17879. }
  17880. }
  17881. UIRepentProp$1.uiName = "UIRepentProp";
  17882. class UIRodMethod$1 extends UIBase {
  17883. constructor() {
  17884. super();
  17885. this.isPressd = false;
  17886. }
  17887. onConstructor() {
  17888. this.ui = ui_UIRodMethod.createInstance();
  17889. this.contentPane = this.ui;
  17890. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17891. this.moveDir = new Laya.Vector2();
  17892. this.moveDest = new Laya.Vector2();
  17893. this.centerPos = new Laya.Vector2();
  17894. xGame.common.uiRodMethod = this;
  17895. }
  17896. show() {
  17897. super.show();
  17898. xGame.common.gameMgr.gamePause = true;
  17899. this.openPressDotEvent();
  17900. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17901. this.centerPos.x = this.ui.white.x;
  17902. this.centerPos.y = this.ui.white.y;
  17903. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17904. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17905. this.setDot();
  17906. }
  17907. setDot() {
  17908. this.ui.dot.x = this.moveDest.x;
  17909. this.ui.dot.y = this.moveDest.y;
  17910. }
  17911. closeSelf() {
  17912. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17913. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17914. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17915. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17916. xGame.common.gameMgr.gamePause = false;
  17917. this.hide();
  17918. }
  17919. openPressDotEvent() {
  17920. this.closePressDotEvent();
  17921. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17922. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17923. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17924. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17925. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17926. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17927. }
  17928. closePressDotEvent() {
  17929. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17930. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17931. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17932. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17933. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17934. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17935. }
  17936. onDown(e) {
  17937. if (e.type == Laya.Event.MOUSE_DOWN)
  17938. this.isPressd = true;
  17939. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17940. this.isPressd = false;
  17941. if (!this.isPressd)
  17942. return;
  17943. this.moveDest.x = e.stageX;
  17944. this.moveDest.y = e.stageY;
  17945. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17946. if (dis > 6724) {
  17947. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17948. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17949. }
  17950. this.setDot();
  17951. }
  17952. resetRod() {
  17953. this.ui.dot.x = this.ui.white.x;
  17954. this.ui.dot.y = this.ui.white.y;
  17955. this.gameRod.dot.x = this.gameRod.bg.x;
  17956. this.gameRod.dot.y = this.gameRod.bg.y;
  17957. xGame.common.rodOffest.x = 0;
  17958. xGame.common.rodOffest.y = 0;
  17959. }
  17960. }
  17961. UIRodMethod$1.uiName = "UIRodMethod";
  17962. class UIMsg$1 extends UIBase {
  17963. constructor() {
  17964. super();
  17965. }
  17966. onConstructor() {
  17967. this.ui = ui_UIMsg.createInstance();
  17968. this.contentPane = this.ui;
  17969. this.isEject = false;
  17970. this.isMuti = true;
  17971. }
  17972. show(msg, callback) {
  17973. super.show();
  17974. this.ui.tipsNode.msgTxt.text = msg;
  17975. this.ui.alpha = 1;
  17976. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17977. this.hide();
  17978. callback && callback();
  17979. }), 1000);
  17980. }
  17981. }
  17982. UIMsg$1.uiName = "UIMsg";
  17983. class UITips$1 extends UIBase {
  17984. constructor() {
  17985. super();
  17986. this.type = 0;
  17987. }
  17988. onConstructor() {
  17989. this.ui = ui_UITips.createInstance();
  17990. this.contentPane = this.ui;
  17991. this.isEject = false;
  17992. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17993. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17994. }
  17995. show(tipsTxt, womanTxt, type) {
  17996. super.show();
  17997. this.ui.t0.play();
  17998. this.ui.myNode.tipsTxt.text = tipsTxt;
  17999. this.ui.myNode.womanTxt.text = womanTxt;
  18000. PlatMgr.showInsert(true);
  18001. this.ui.myNode.c1.selectedIndex = type;
  18002. this.type = type;
  18003. switch (this.type) {
  18004. case TipsType.exitGame:
  18005. xGame.common.gameMgr.gamePause = true;
  18006. break;
  18007. case TipsType.foul:
  18008. Laya.timer.once(200, this, () => {
  18009. xGame.common.gameMgr.gamePause = true;
  18010. });
  18011. break;
  18012. default:
  18013. break;
  18014. }
  18015. }
  18016. clickLeftBtn() {
  18017. this.hide();
  18018. xGame.common.gameMgr.gamePause = false;
  18019. switch (this.type) {
  18020. case TipsType.exitGame:
  18021. break;
  18022. case TipsType.foul:
  18023. break;
  18024. default:
  18025. break;
  18026. }
  18027. }
  18028. clickRightBtn() {
  18029. this.hide();
  18030. switch (this.type) {
  18031. case TipsType.exitGame:
  18032. xGame.eventMgr.event(RESET_GAME);
  18033. xGame.uiMgr.Show(UIMain$1);
  18034. Moyu.recordEnd(this, null);
  18035. xGame.common.longHelpLine = false;
  18036. break;
  18037. case TipsType.foul:
  18038. xGame.common.gameMgr.gamePause = false;
  18039. Laya.timer.clearAll(this);
  18040. break;
  18041. default:
  18042. break;
  18043. }
  18044. }
  18045. }
  18046. UITips$1.uiName = "UITips";
  18047. class UIGame$1 extends UIBase {
  18048. constructor() {
  18049. super();
  18050. this.powerNum = 0;
  18051. this.isD3Inited = false;
  18052. this.isPrePlay = false;
  18053. this.isMoveRod = false;
  18054. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  18055. this.rulerDis = 20;
  18056. this.rulerOffset = 0;
  18057. }
  18058. onConstructor() {
  18059. this.ui = ui_UIGame.createInstance();
  18060. this.contentPane = this.ui;
  18061. this.ui.x += xGame.common.sysOffestNum;
  18062. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  18063. this.isEject = false;
  18064. xGame.common.gameUI = this;
  18065. this.initSelf();
  18066. }
  18067. isTurnSelf() {
  18068. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  18069. return true;
  18070. }
  18071. }
  18072. initSelf() {
  18073. let topUI = this.ui.topNode;
  18074. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  18075. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  18076. this.barInfo = {};
  18077. this.barInfo.curY = 0;
  18078. this.barInfo.height = this.ui.powerNode.height;
  18079. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  18080. this.barInfo.powerStartY = this.ui.powerNode.y;
  18081. xGame.common.aiPlayer = new AIPlayer();
  18082. xGame.common.gameMgr = new GameMgr();
  18083. xGame.common.skillMgr = new SkillMgr();
  18084. xGame.common.wordsMgr = new WordsMgr();
  18085. xGame.common.talkMgr = new TalkMgr();
  18086. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  18087. console.log("加载经典模式表情文件chenggon !");
  18088. });
  18089. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  18090. console.log("挑战模式奖励模式spine加载成功!");
  18091. });
  18092. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  18093. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  18094. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  18095. this.addUIClick(this.ui.returnBtn, this.returnHome);
  18096. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  18097. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  18098. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  18099. }
  18100. getGanZiImg() {
  18101. let index = DataMgr.getCurBallRod();
  18102. let data = cfgTable.ballrodData[index + 1];
  18103. let gan_url = xGame.common.getGameIconUrl(data.img);
  18104. console.log('zh:getGanZiImg gan_url==' + gan_url);
  18105. this.ui.powerNode.showImg.url = gan_url;
  18106. console.log('zh:修改杆子图标O K');
  18107. }
  18108. returnHome() {
  18109. let tips = "Are you sure to exit the game?";
  18110. let woman = "Boss, why don't you play for a while longer?";
  18111. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  18112. }
  18113. addRodMethodClick() {
  18114. if (this.isTurnSelf()) {
  18115. xGame.uiMgr.Show(UIRodMethod$1);
  18116. }
  18117. }
  18118. clickHelpLineBtn(force = false) {
  18119. if (!this.isTurnSelf())
  18120. return;
  18121. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  18122. if (success) {
  18123. xGame.common.longHelpLine = true;
  18124. xGame.common.d2World.getHelpLine();
  18125. Moyu.sendDataEvent("guideNum");
  18126. }
  18127. else {
  18128. }
  18129. });
  18130. }
  18131. renderSelfDisplayBalls(index, target) {
  18132. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  18133. target.myImg.url = xGame.common.getGameIconUrl(str);
  18134. }
  18135. renderAIDisplayBalls(index, target) {
  18136. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  18137. target.myImg.url = xGame.common.getGameIconUrl(str);
  18138. ;
  18139. }
  18140. updateMode() {
  18141. if (xGame.common.gameMode == GameMode.classic) {
  18142. this.ui.topNode.scoreNode.visible = false;
  18143. }
  18144. else if (xGame.common.gameMode == GameMode.bigMove) {
  18145. this.ui.topNode.scoreNode.visible = true;
  18146. }
  18147. }
  18148. show() {
  18149. super.show();
  18150. console.log("zh:uigame show AADD");
  18151. this.ui.alpha = 0;
  18152. this.updateSelf();
  18153. xGame.common.gameMgr.gamePause = false;
  18154. xGame.common.gameUI.ui.blackAni.visible = false;
  18155. xGame.common.gameUI.ui.whiteAni.visible = false;
  18156. this.ui.powerEft.visible = false;
  18157. this.ui.colorNode.visible = false;
  18158. this.updateHead();
  18159. let curUse = DataMgr.getCurBallRod();
  18160. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  18161. this.getGanZiImg();
  18162. }
  18163. updateSelf() {
  18164. if (xGame.common.gameMode == GameMode.classic) {
  18165. this.ui.c1.selectedIndex = 0;
  18166. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  18167. this.ui.topNode.middleNode.visible = true;
  18168. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  18169. }
  18170. else if (xGame.common.gameMode == GameMode.bigMove) {
  18171. this.ui.c1.selectedIndex = 0;
  18172. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  18173. this.ui.topNode.middleNode.visible = false;
  18174. let max = xGame.cfgMgr.getMaxBigMoveLength();
  18175. let rand = xGame.common.randomNum(1, max);
  18176. let guide = DataMgr.getSkillGuide();
  18177. if (guide == 0)
  18178. rand = 1;
  18179. xGame.common.bigMoveLevelIndex = rand;
  18180. }
  18181. else if (xGame.common.gameMode == GameMode.placeBall) {
  18182. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18183. this.ui.c1.selectedIndex = 1 + data.type;
  18184. this.ui.alpha = 1;
  18185. this.startGame();
  18186. }
  18187. this.updateMode();
  18188. this.initD3world();
  18189. this.initD2world();
  18190. }
  18191. startGame() {
  18192. this.ui.snowNode.visible = Math.random() <= 0.1;
  18193. this.ui.d2Node.visible = false;
  18194. xGame.common.d3World.d3Hand.gameObj.active = false;
  18195. xGame.common.d3World.tableSrc.init();
  18196. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18197. this.cameraViewChange(() => {
  18198. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  18199. switch (xGame.common.gameMode) {
  18200. case GameMode.classic:
  18201. xGame.common.d3World.d3Hand.gameObj.active = true;
  18202. this.playPutBallD3Ani();
  18203. break;
  18204. case GameMode.bigMove:
  18205. this.enterGame();
  18206. Laya.timer.once(500, this, () => {
  18207. this.ui.topNode.middleNode.visible = true;
  18208. this.ui.topNode.middleNode.t0.play();
  18209. });
  18210. break;
  18211. case GameMode.placeBall:
  18212. this.enterGame();
  18213. break;
  18214. default:
  18215. break;
  18216. }
  18217. });
  18218. PlatMgr.showBanner(false);
  18219. }
  18220. enterGame() {
  18221. this.ui.d2Node.visible = true;
  18222. xGame.common.d3World.d3Hand.gameObj.active = false;
  18223. xGame.common.showOneCamera("mainCamera");
  18224. Moyu.recordGame(30, true);
  18225. if (!this.isPrePlay) {
  18226. this.isPrePlay = true;
  18227. xGame.common.d3World.prePlayEft();
  18228. }
  18229. xGame.common.gameMgr.gameReady();
  18230. this.openAllEvent();
  18231. this.ui.snowNode.visible = false;
  18232. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  18233. this.ui.helpBtn.visible = condition;
  18234. }
  18235. showHelpLineGuide() {
  18236. let longGuide = DataMgr.getGuideHelpLine();
  18237. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  18238. this.ui.helpBtn.visible = true;
  18239. this.ui.guideNode.visible = true;
  18240. }
  18241. }
  18242. setTurnAlpha(alpha) {
  18243. this.ui.keduNode.alpha = alpha;
  18244. this.ui.ganNode.alpha = alpha;
  18245. this.ui.rodMethodNode.alpha = alpha;
  18246. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  18247. }
  18248. cameraViewChange(callback) {
  18249. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18250. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  18251. xGame.common.showOneCamera("visitAngle");
  18252. cameraSrc.localRotationEulerY = 180;
  18253. cameraSrc.localRotationEulerZ = 0;
  18254. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  18255. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  18256. callback && callback();
  18257. }));
  18258. }));
  18259. }
  18260. playPutBallD3Ani() {
  18261. xGame.common.showOneCamera("mainCamera");
  18262. let handSrc = xGame.common.d3World.d3Hand;
  18263. handSrc.gameObj.active = true;
  18264. handSrc.transform.localPositionZ = 3;
  18265. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  18266. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  18267. handSrc.gameObj.active = false;
  18268. this.enterGame();
  18269. }), 400);
  18270. }));
  18271. }
  18272. updateHead() {
  18273. let user = Moyu.getUserInfo();
  18274. this.ui.topNode.selfNameTxt.text = user.nickName;
  18275. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  18276. let aiData = xGame.cfgMgr.getRandomUserInfo();
  18277. if (DataMgr.getSkillGuide() < 1) {
  18278. this.ui.topNode.aiNameTxt.text = 'billiards';
  18279. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  18280. }
  18281. else {
  18282. this.ui.topNode.aiNameTxt.text = aiData.name;
  18283. let randNo = Math.floor(Math.random() * 10) + 1;
  18284. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  18285. }
  18286. }
  18287. initD2world() {
  18288. let node = this.ui.d2Root.displayObject;
  18289. let src = node.getComponent(D2World);
  18290. if (!src) {
  18291. xGame.common.d2World = node.addComponent(D2World);
  18292. }
  18293. xGame.common.d2World.initSelf();
  18294. }
  18295. initD3world() {
  18296. if (this.isD3Inited)
  18297. return;
  18298. this.isD3Inited = true;
  18299. let scene3D = xGame.common.d3Scene;
  18300. this.ui.d3Root.displayObject.addChild(scene3D);
  18301. scene3D.active = true;
  18302. xGame.common.d3World.tableSrc.setBorderPos();
  18303. }
  18304. onRootMove(e) {
  18305. let rootBall = xGame.common.d2World.rootBall;
  18306. this.ui.moveNode.x = e.x;
  18307. this.ui.moveNode.y = e.y;
  18308. rootBall.gameObj.x = e.x;
  18309. rootBall.gameObj.y = e.y;
  18310. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  18311. }
  18312. aiRootMove(move) {
  18313. if (move)
  18314. this.hideBallUI();
  18315. else {
  18316. this.showBallUI();
  18317. xGame.common.d2World.getHelpLine();
  18318. }
  18319. }
  18320. aiForce(type, force = 0) {
  18321. this.pressTarget = PressType.powerNode;
  18322. if (type == 1)
  18323. this.onEventUp({ force: true });
  18324. else if (type == 2)
  18325. this.onEventMove({ stageY: force, force: true });
  18326. }
  18327. onEventPress(e) {
  18328. if (e.stopPropagation)
  18329. e.stopPropagation();
  18330. if (!this.isTurnSelf())
  18331. return;
  18332. let target = e.target;
  18333. switch (target) {
  18334. case this.ui.myPowerNode.displayObject:
  18335. this.pressTarget = PressType.powerNode;
  18336. this.barInfo.curY = e.stageY;
  18337. this.updateBarInfo();
  18338. break;
  18339. case this.ui.moveNode.displayObject:
  18340. this.pressTarget = PressType.moveNode;
  18341. this.hideBallUI();
  18342. this.eventObj.curX = this.ui.moveNode.x;
  18343. this.eventObj.curY = this.ui.moveNode.y;
  18344. this.ui.moveNode.finger.visible = false;
  18345. this.eventObj.lastX = e.stageX;
  18346. this.eventObj.lastY = e.stageY;
  18347. break;
  18348. case this.ui.rulerClickNode.displayObject:
  18349. this.pressTarget = PressType.rulerNode;
  18350. this.eventObj.lastY = e.stageY;
  18351. break;
  18352. case this.ui.d2Root.displayObject:
  18353. this.pressTarget = PressType.d2Root;
  18354. this.eventObj.lastX = e.stageX;
  18355. this.eventObj.lastY = e.stageY;
  18356. this.eventObj.starX = e.stageX;
  18357. this.eventObj.starY = e.stageY;
  18358. this.eventObj.curX = 0;
  18359. this.eventObj.curY = 0;
  18360. xGame.common.d2World.d2Gan.setGanLastInfo();
  18361. this.rulerOffset = 0;
  18362. break;
  18363. default:
  18364. break;
  18365. }
  18366. }
  18367. onEventMove(e) {
  18368. if (e.stopPropagation)
  18369. e.stopPropagation();
  18370. if (e && e.force) {
  18371. }
  18372. else {
  18373. if (!this.isTurnSelf())
  18374. return;
  18375. }
  18376. switch (this.pressTarget) {
  18377. case PressType.powerNode:
  18378. this.barInfo.curY = e.stageY;
  18379. this.updateBarInfo();
  18380. this.isMoveRod = true;
  18381. break;
  18382. case PressType.moveNode:
  18383. let rootBall = xGame.common.d2World.rootBall;
  18384. let radius = rootBall.gameObj.width / 2;
  18385. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  18386. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  18387. let border = xGame.common.d2World.borderRect;
  18388. if (curX <= border.x + radius)
  18389. curX = border.x + radius;
  18390. else if (curX >= border.x + border.width - radius)
  18391. curX = border.x + border.width - radius;
  18392. if (curY <= border.y + radius)
  18393. curY = border.y + radius;
  18394. else if (curY >= border.y + border.height - radius)
  18395. curY = border.y + border.height - radius;
  18396. if (xGame.common.gameMgr.isOpenBall) {
  18397. if (curX >= border.x + border.openBallW - radius)
  18398. curX = border.x + border.openBallW - radius;
  18399. }
  18400. this.ui.moveNode.x = curX;
  18401. this.ui.moveNode.y = curY;
  18402. rootBall.gameObj.x = curX;
  18403. rootBall.gameObj.y = curY;
  18404. rootBall.d3BallSrc.setTransPos(curX, curY);
  18405. this.isMoveRod = true;
  18406. break;
  18407. case PressType.rulerNode:
  18408. let yy = e.stageY - this.eventObj.lastY;
  18409. this.eventObj.lastY = e.stageY;
  18410. let ruler1 = this.ui.rulerNode.img1;
  18411. let ruler2 = this.ui.rulerNode.img2;
  18412. ruler1.y += yy;
  18413. ruler2.y += yy;
  18414. this.rulerOffset += yy;
  18415. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  18416. this.rulerOffset = 0;
  18417. xGame.soundMgr.playSound("inch", 1, 10);
  18418. }
  18419. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  18420. let h = ruler1.height;
  18421. this.checkGuide();
  18422. this.isMoveRod = true;
  18423. if (ruler1.y >= h) {
  18424. ruler1.y = -h;
  18425. ruler2.y = 0;
  18426. return;
  18427. }
  18428. else if (ruler1.y <= -h) {
  18429. ruler1.y = h;
  18430. ruler2.y = 0;
  18431. return;
  18432. }
  18433. if (ruler2.y >= h) {
  18434. ruler2.y = -h;
  18435. ruler1.y = 0;
  18436. return;
  18437. }
  18438. else if (ruler2.y <= -h) {
  18439. ruler2.y = h;
  18440. ruler1.y = 0;
  18441. return;
  18442. }
  18443. break;
  18444. case PressType.d2Root:
  18445. this.eventObj.curX = e.stageX;
  18446. this.eventObj.curY = e.stageY;
  18447. let offset = this.checkRodMoveDir();
  18448. xGame.common.d2World.d2Gan.rotateSelf(offset);
  18449. this.eventObj.lastX = e.stageX;
  18450. this.eventObj.lastY = e.stageY;
  18451. break;
  18452. default:
  18453. break;
  18454. }
  18455. }
  18456. onEventUp(e) {
  18457. if (e.stopPropagation)
  18458. e.stopPropagation();
  18459. if (e && e.force) {
  18460. }
  18461. else {
  18462. if (!this.isTurnSelf())
  18463. return;
  18464. }
  18465. switch (this.pressTarget) {
  18466. case PressType.powerNode:
  18467. this.ui.powerNode.value = 0;
  18468. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18469. this.ui.powerTxt.text = "";
  18470. if (this.powerNum > 0) {
  18471. xGame.eventMgr.event(BALL_SHOOT);
  18472. xGame.common.d2World.shoot(this.powerNum);
  18473. xGame.common.d2World.d2Gan.shoot();
  18474. xGame.common.d2World.d2HelpLine.shoot();
  18475. this.finishGuide();
  18476. this.ui.powerEft.visible = false;
  18477. this.ui.colorNode.visible = false;
  18478. let ganStr = "";
  18479. if (this.powerNum <= 30) {
  18480. ganStr = "gan_30";
  18481. }
  18482. else if (this.powerNum <= 60) {
  18483. ganStr = "gan_50";
  18484. }
  18485. else {
  18486. ganStr = "gan_80";
  18487. }
  18488. xGame.soundMgr.playSound(ganStr);
  18489. }
  18490. break;
  18491. case PressType.moveNode:
  18492. let rootBall = xGame.common.d2World.rootBall;
  18493. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  18494. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  18495. let isIntersect = this.judgeBallIntersect();
  18496. if (isIntersect) {
  18497. this.ui.moveNode.x = lastX;
  18498. this.ui.moveNode.y = lastY;
  18499. rootBall.gameObj.x = lastX;
  18500. rootBall.gameObj.y = lastY;
  18501. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  18502. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  18503. }
  18504. else {
  18505. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  18506. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  18507. }
  18508. this.showBallUI();
  18509. this.ui.moveNode.finger.visible = true;
  18510. xGame.common.d2World.getHelpLine();
  18511. break;
  18512. case PressType.rulerNode:
  18513. break;
  18514. case PressType.d2Root:
  18515. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  18516. if (dis <= 25) {
  18517. this.moveToClickDot(e);
  18518. }
  18519. break;
  18520. default:
  18521. break;
  18522. }
  18523. this.pressTarget = -1;
  18524. }
  18525. checkGuide() {
  18526. let guide = DataMgr.getSkillGuide();
  18527. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  18528. xGame.common.guideStep++;
  18529. xGame.common.gameUI.ui.guide2.visible = false;
  18530. xGame.common.gameUI.ui.guide3.visible = true;
  18531. }
  18532. }
  18533. finishGuide() {
  18534. let guide = DataMgr.getSkillGuide();
  18535. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  18536. xGame.common.guideStep = 10;
  18537. this.closeAllGuide();
  18538. console.log('zh: 新手引导完毕');
  18539. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  18540. }
  18541. }
  18542. closeAllGuide() {
  18543. xGame.common.gameUI.ui.guide1.visible = false;
  18544. xGame.common.gameUI.ui.guide2.visible = false;
  18545. xGame.common.gameUI.ui.guide3.visible = false;
  18546. }
  18547. updateBarInfo() {
  18548. let star = this.ui.powerNode.y;
  18549. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  18550. if (rate >= 1)
  18551. rate = 1;
  18552. if (rate <= 0)
  18553. rate = 0;
  18554. this.powerNum = Math.ceil(rate * 100);
  18555. this.ui.powerNode.value = this.powerNum;
  18556. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  18557. this.ui.colorNode.value = this.powerNum;
  18558. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  18559. this.ui.powerEft.visible = this.powerNum != 0;
  18560. this.ui.colorNode.visible = this.powerNum != 0;
  18561. this.ui.powerTxt.text = this.powerNum + "";
  18562. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  18563. }
  18564. forceCancel() {
  18565. this.ui.powerNode.value = 0;
  18566. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18567. this.ui.powerTxt.text = "";
  18568. }
  18569. checkRodMoveDir() {
  18570. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  18571. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18572. if (tempX >= 0 && tempY <= 0) {
  18573. return this.checkDir();
  18574. }
  18575. else if (tempX < 0 && tempY < 0) {
  18576. return this.checkDir(1, -1);
  18577. }
  18578. else if (tempX < 0 && tempY > 0) {
  18579. return this.checkDir(-1, -1);
  18580. }
  18581. else {
  18582. return this.checkDir(-1, 1);
  18583. }
  18584. }
  18585. checkDir(flagX = 1, flagY = 1) {
  18586. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18587. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18588. if (offsetY == 0) {
  18589. return offsetX * flagX;
  18590. }
  18591. if (offsetX == 0) {
  18592. return offsetY * flagY;
  18593. }
  18594. let angle = offsetY / offsetX;
  18595. if (Math.abs(angle) >= 1) {
  18596. return offsetY * flagY;
  18597. }
  18598. else {
  18599. return offsetX * flagX;
  18600. }
  18601. }
  18602. judgeBallIntersect() {
  18603. let rootBall = xGame.common.d2World.rootBall;
  18604. let ballArr = xGame.common.d2World.ballArr;
  18605. let radius = rootBall.gameObj.width / 2;
  18606. let temp;
  18607. let isIntersect = false;
  18608. for (let index = 0; index < ballArr.length; index++) {
  18609. temp = ballArr[index];
  18610. if (temp.number == rootBall.number)
  18611. continue;
  18612. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18613. if (isIntersect) {
  18614. break;
  18615. }
  18616. }
  18617. return isIntersect;
  18618. }
  18619. hideBallUI() {
  18620. let d2Gan = xGame.common.d2World.d2Gan;
  18621. if (!d2Gan.ui.isDisposed)
  18622. d2Gan.ui.visible = false;
  18623. let d2Help = xGame.common.d2World.d2HelpLine;
  18624. if (!d2Help.ui.isDisposed)
  18625. d2Help.ui.visible = false;
  18626. let rootBall = xGame.common.d2World.rootBall;
  18627. if (!rootBall.destroyed) {
  18628. rootBall.gameObj.active = false;
  18629. }
  18630. }
  18631. showBallUI() {
  18632. let d2Gan = xGame.common.d2World.d2Gan;
  18633. if (!d2Gan.ui.isDisposed)
  18634. d2Gan.ui.visible = true;
  18635. let d2Help = xGame.common.d2World.d2HelpLine;
  18636. if (!d2Help.ui.isDisposed)
  18637. d2Help.ui.visible = true;
  18638. let rootBall = xGame.common.d2World.rootBall;
  18639. if (!rootBall.destroyed) {
  18640. rootBall.gameObj.active = true;
  18641. }
  18642. }
  18643. moveToClickDot(e) {
  18644. if (!this.isMoveRod && !xGame.common.clickedBall) {
  18645. let root = xGame.common.d2World.rootBall.gameObj;
  18646. let xx = e.stageX - xGame.common.sysOffestNum;
  18647. let yy = e.stageY;
  18648. let x = xx - root.x;
  18649. let y = yy - root.y;
  18650. let angle = xGame.common.getfguiRotation(x, y);
  18651. xGame.common.d2World.d2Gan.ui.rotation = angle;
  18652. xGame.common.d2World.getHelpLine();
  18653. }
  18654. this.isMoveRod = false;
  18655. xGame.common.clickedBall = false;
  18656. }
  18657. openAllEvent() {
  18658. this.closeAllEvent();
  18659. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18660. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18661. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18662. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18663. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18664. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18665. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18666. }
  18667. closeAllEvent() {
  18668. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18669. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18670. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18671. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18672. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18673. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18674. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18675. }
  18676. resetGame() {
  18677. this.closeAllEvent();
  18678. this.hideBallUI();
  18679. xGame.common.gameMgr.gamePause = true;
  18680. }
  18681. }
  18682. UIGame$1.uiName = "UIGame";
  18683. class UIAddCoin$1 extends UIBase {
  18684. constructor() {
  18685. super();
  18686. this.coinNum = 2000;
  18687. }
  18688. onConstructor() {
  18689. this.ui = ui_UIAddCoin.createInstance();
  18690. this.contentPane = this.ui;
  18691. this.isEject = false;
  18692. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18693. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  18694. }
  18695. show() {
  18696. super.show();
  18697. this.ui.t0.play();
  18698. }
  18699. videoAddCoin() {
  18700. console.log('zh:qjff_AD_for_UIAddCoin');
  18701. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  18702. }
  18703. else {
  18704. console.log('zh:AD 失败,直接发放奖励');
  18705. this.qjff_AD_for_UIAddCoin();
  18706. }
  18707. }
  18708. qjff_AD_for_UIAddCoin() {
  18709. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  18710. this.hide();
  18711. }
  18712. }
  18713. UIAddCoin$1.uiName = "UIAddCoin";
  18714. class UIInvitation$1 extends UIBase {
  18715. constructor() {
  18716. super();
  18717. }
  18718. onConstructor() {
  18719. this.ui = ui_UIInvitation.createInstance();
  18720. this.contentPane = this.ui;
  18721. this.isEject = false;
  18722. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  18723. }
  18724. show() {
  18725. super.show();
  18726. }
  18727. enterGame() {
  18728. xGame.common.gameMode = GameMode.classic;
  18729. DataMgr.setChallengeTimes(1);
  18730. xGame.common.passAwardCoin = 2000;
  18731. let need = xGame.common.classicNiceNeddCoin;
  18732. if (DataMgr.coinEnough(need)) {
  18733. DataMgr.setCoin(-need);
  18734. xGame.eventMgr.event(RESTART_GAME, true);
  18735. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  18736. }
  18737. else {
  18738. xGame.eventMgr.event(RESTART_GAME, true);
  18739. }
  18740. this.hide();
  18741. }
  18742. hide() {
  18743. super.hide();
  18744. }
  18745. }
  18746. UIInvitation$1.uiName = "UIInvitation";
  18747. class UIPower$1 extends UIBase {
  18748. constructor() {
  18749. super();
  18750. }
  18751. onConstructor() {
  18752. this.ui = ui_UIPower.createInstance();
  18753. this.contentPane = this.ui;
  18754. this.isEject = false;
  18755. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18756. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18757. }
  18758. show() {
  18759. super.show();
  18760. this.ui.t0.play();
  18761. }
  18762. videoGetPower() {
  18763. console.log('zh:qjff_AD_for_uipower');
  18764. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  18765. }
  18766. else {
  18767. console.log('zh:AD 失败,直接发放奖励');
  18768. this.qjff_AD_for_uipower();
  18769. }
  18770. }
  18771. qjff_AD_for_uipower() {
  18772. DataMgr.setPower(xGame.common.videoPower, true);
  18773. xGame.eventMgr.event(POWER_TIME);
  18774. this.hide();
  18775. }
  18776. }
  18777. UIPower$1.uiName = "UIPower";
  18778. class UIGameEnd$1 extends UIBase {
  18779. constructor() {
  18780. super();
  18781. this.success = false;
  18782. this.awardCoinNum = 1000;
  18783. this.awardDiamondNum = 10;
  18784. }
  18785. onConstructor() {
  18786. this.ui = ui_UIGameEnd.createInstance();
  18787. this.contentPane = this.ui;
  18788. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18789. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18790. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18791. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18792. this.ui.talkNode.visible = false;
  18793. if (Moyu.isKs)
  18794. this.ui.closeNode.closeBtn.x += 100;
  18795. }
  18796. updateType() {
  18797. switch (xGame.common.gameMode) {
  18798. case GameMode.classic:
  18799. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18800. this.ui.coinNode.visible = this.success;
  18801. if (!this.success) {
  18802. Laya.timer.once(500, this, () => {
  18803. xGame.uiMgr.Show(UIAddCoin$1);
  18804. });
  18805. }
  18806. else {
  18807. this.logEventForClassic_win();
  18808. }
  18809. this.logEventForClassic_complete();
  18810. this.ui.isGetAward.visible = false;
  18811. this.ui.leftBtn.c1.selectedIndex = 3;
  18812. this.ui.rightBtn.c1.selectedIndex = 0;
  18813. this.moneyNode.ui.c1.selectedIndex = 1;
  18814. break;
  18815. case GameMode.bigMove:
  18816. console.log('zh:招法模式 aaaaaa bigMove');
  18817. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18818. this.ui.coinNode.visible = this.success;
  18819. if (xGame.common.gameMode == GameMode.bigMove) {
  18820. if (this.success) {
  18821. DataMgr.setSkillSuccessTimes(1, true);
  18822. DataMgr.setSkillAccTimes(1);
  18823. }
  18824. else {
  18825. DataMgr.setSkillSuccessTimes(0, false);
  18826. }
  18827. }
  18828. this.logEventForRod_complete_N();
  18829. if (!this.success) {
  18830. Laya.timer.once(500, this, () => {
  18831. xGame.uiMgr.Show(UIAddCoin$1);
  18832. });
  18833. }
  18834. else {
  18835. this.logEventForRod_win();
  18836. }
  18837. this.ui.isGetAward.visible = false;
  18838. this.ui.leftBtn.c1.selectedIndex = 3;
  18839. this.ui.rightBtn.c1.selectedIndex = 0;
  18840. this.moneyNode.ui.c1.selectedIndex = 1;
  18841. break;
  18842. case GameMode.placeBall:
  18843. this.ui.coinNode.visible = false;
  18844. if (this.success) {
  18845. if (xGame.common.placeBallStarNum == 3) {
  18846. this.ui.c1.selectedIndex = 2;
  18847. }
  18848. else {
  18849. this.ui.c1.selectedIndex = 3;
  18850. }
  18851. let level = xGame.common.placeBallCurLevel;
  18852. if (level > 59) {
  18853. this.logEventForChallenge_level_complete(level);
  18854. }
  18855. else {
  18856. this.logEventForChallenge_level_N(level);
  18857. }
  18858. }
  18859. else {
  18860. this.ui.c1.selectedIndex = 4;
  18861. }
  18862. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18863. if (cfg.type == PlaceBallType.challenge) {
  18864. this.ui.c1.selectedIndex = 2;
  18865. }
  18866. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18867. this.updatePlaceBallBtn();
  18868. this.updatePlaceBallStarNum();
  18869. this.updatePlaceBallAwardState();
  18870. this.moneyNode.ui.c1.selectedIndex = 2;
  18871. this.moneyNode.checkPowerTime();
  18872. this.moneyNode.powerChange();
  18873. DataMgr.upRankData();
  18874. break;
  18875. default:
  18876. break;
  18877. }
  18878. }
  18879. logEventForRod_complete_N() {
  18880. let gfmsIdx = xGame.common.curPlayerSkillType;
  18881. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  18882. let gfmc = 'Skyfall Shot';
  18883. if (gfmsIdx == 0) {
  18884. gfmc = 'Skyfall Shot';
  18885. }
  18886. if (gfmsIdx == 1) {
  18887. gfmc = 'Surging break';
  18888. }
  18889. if (gfmsIdx == 2) {
  18890. gfmc = 'Frost Lock';
  18891. }
  18892. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  18893. console.log('zh:logEventForRod_complete_N level = ' + level);
  18894. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  18895. let jsonStr = {
  18896. "count": 0,
  18897. "name": gfmc
  18898. };
  18899. if (LocalStorageManager.hasJosnKey(keyStr)) {
  18900. const d = LocalStorageManager.getItem(keyStr);
  18901. jsonStr.count = d.count + 1;
  18902. LocalStorageManager.setItem(keyStr, jsonStr);
  18903. }
  18904. else {
  18905. LocalStorageManager.setItem(keyStr, jsonStr);
  18906. }
  18907. const d2 = LocalStorageManager.getItem(keyStr);
  18908. let count = d2.count;
  18909. console.log('zh:logEventForRod_complete_N count = ' + count);
  18910. if (count % 5 == 0) {
  18911. const reqStr = JSON.stringify(jsonStr);
  18912. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  18913. }
  18914. }
  18915. logEventForRod_win() {
  18916. console.log('zh:logEventForRod_win,胜利');
  18917. let gfmsIdx = xGame.common.curPlayerSkillType;
  18918. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  18919. let gfmc = 'Skyfall Shot';
  18920. if (gfmsIdx == 0) {
  18921. gfmc = 'Skyfall Shot';
  18922. }
  18923. if (gfmsIdx == 1) {
  18924. gfmc = 'Surging break';
  18925. }
  18926. if (gfmsIdx == 2) {
  18927. gfmc = 'Frost Lock';
  18928. }
  18929. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  18930. console.log('zh:logEventForRod_win level = ' + level);
  18931. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  18932. let jsonStr = {
  18933. "count": 1,
  18934. "name": gfmc + ' Lev' + level
  18935. };
  18936. if (LocalStorageManager.hasJosnKey(keyStr)) {
  18937. const d = LocalStorageManager.getItem(keyStr);
  18938. jsonStr.count = d.count + 1;
  18939. LocalStorageManager.setItem(keyStr, jsonStr);
  18940. }
  18941. else {
  18942. LocalStorageManager.setItem(keyStr, jsonStr);
  18943. }
  18944. const reqStr = JSON.stringify(jsonStr);
  18945. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  18946. }
  18947. logEventForClassic_win() {
  18948. console.log('zh:logEventForClassic_win,胜利');
  18949. let rtype = xGame.common.classicRoomType;
  18950. let msmc = '';
  18951. if (rtype == 1) {
  18952. msmc = 'beginner';
  18953. }
  18954. if (rtype == 2) {
  18955. msmc = 'expert';
  18956. }
  18957. if (rtype == 3) {
  18958. msmc = 'master';
  18959. }
  18960. let keyStr = 'sjmd_classic_win_' + rtype;
  18961. let jsonStr = {
  18962. "difficulty": msmc,
  18963. "classic_count": 1,
  18964. "difficulty_count": 1
  18965. };
  18966. if (LocalStorageManager.hasJosnKey(keyStr)) {
  18967. const d = LocalStorageManager.getItem(keyStr);
  18968. jsonStr.classic_count = d.classic_count + 1;
  18969. jsonStr.difficulty_count = d.difficulty_count + 1;
  18970. LocalStorageManager.setItem(keyStr, jsonStr);
  18971. }
  18972. else {
  18973. LocalStorageManager.setItem(keyStr, jsonStr);
  18974. }
  18975. const reqStr = JSON.stringify(jsonStr);
  18976. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  18977. }
  18978. logEventForClassic_complete() {
  18979. console.log('zh:logEventForClassic_complete,胜利');
  18980. let rtype = xGame.common.classicRoomType;
  18981. let msmc = '';
  18982. if (rtype == 1) {
  18983. msmc = 'beginner';
  18984. }
  18985. if (rtype == 2) {
  18986. msmc = 'expert';
  18987. }
  18988. if (rtype == 3) {
  18989. msmc = 'master';
  18990. }
  18991. let keyStr = 'sjmd_classic_complete_' + rtype;
  18992. let jsonStr = {
  18993. "msmc": msmc,
  18994. "count": 0
  18995. };
  18996. if (LocalStorageManager.hasJosnKey(keyStr)) {
  18997. const d = LocalStorageManager.getItem(keyStr);
  18998. jsonStr.count = d.count + 1;
  18999. LocalStorageManager.setItem(keyStr, jsonStr);
  19000. }
  19001. else {
  19002. LocalStorageManager.setItem(keyStr, jsonStr);
  19003. }
  19004. if (jsonStr.count % 5 == 0) {
  19005. const reqStr = JSON.stringify(jsonStr);
  19006. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  19007. }
  19008. }
  19009. updatePlaceBallBtn() {
  19010. this.ui.leftBtn.c1.selectedIndex = 5;
  19011. if (this.success) {
  19012. this.ui.rightBtn.c1.selectedIndex = 14;
  19013. }
  19014. else {
  19015. if (xGame.common.placeBallStarNum == 3) {
  19016. this.ui.rightBtn.c1.selectedIndex = 14;
  19017. }
  19018. else {
  19019. this.ui.rightBtn.c1.selectedIndex = 1;
  19020. }
  19021. }
  19022. }
  19023. updatePlaceBallStarNum() {
  19024. let starNum = xGame.common.placeBallStarNum;
  19025. if (starNum == 0)
  19026. this.ui.starNumNode.c1.selectedIndex = 3;
  19027. else {
  19028. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  19029. }
  19030. }
  19031. updatePlaceBallAwardState() {
  19032. let level = xGame.common.placeBallCurLevel;
  19033. let starNum = xGame.common.placeBallStarNum;
  19034. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19035. let data = cfgTable.placeballData[level].award;
  19036. let cfg = cfgTable.placeballData[level];
  19037. this.awardDiamondNum = data[1];
  19038. this.awardCoinNum = data[0];
  19039. if (cfg.type == PlaceBallType.challenge) {
  19040. this.awardDiamondNum = 0;
  19041. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19042. }
  19043. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  19044. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  19045. if (cfg.type == PlaceBallType.challenge) {
  19046. this.ui.awardNode.coinNode.visible = true;
  19047. }
  19048. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  19049. this.ui.awardNode.diamondNode.x = 265;
  19050. this.ui.awardNode.coinNode.x = 354;
  19051. }
  19052. else {
  19053. this.ui.awardNode.diamondNode.x = 291;
  19054. this.ui.awardNode.coinNode.x = 291;
  19055. }
  19056. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  19057. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  19058. if (this.awardCoinNum == 0) {
  19059. this.ui.awardNode.coinNode.numTxt.text = "";
  19060. }
  19061. if (getAward) {
  19062. this.ui.isGetAward.visible = true;
  19063. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  19064. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  19065. }
  19066. else {
  19067. this.ui.isGetAward.visible = false;
  19068. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  19069. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  19070. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  19071. }
  19072. else {
  19073. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  19074. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  19075. }
  19076. }
  19077. }
  19078. show(success) {
  19079. super.show();
  19080. xGame.eventMgr.event(RESET_GAME);
  19081. this.success = success;
  19082. Laya.timer.clearAll(this);
  19083. this.playSecretaryAni();
  19084. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  19085. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  19086. offsetTime = Math.floor(offsetTime / 1000);
  19087. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  19088. this.updateType();
  19089. Laya.timer.once(200, this, () => {
  19090. this.addAward(() => {
  19091. this.updateType();
  19092. Laya.timer.once(500, this, () => {
  19093. this.showChallengeLevel();
  19094. });
  19095. });
  19096. });
  19097. if (this.success) {
  19098. JSBridgeUtils.instance.showInternAd('gameend_success');
  19099. console.log('zh:game end 成功');
  19100. xGame.soundMgr.playSound('slots_roll01');
  19101. xGame.soundMgr.playSound("s_win");
  19102. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19103. this.diyGameDataUtilForGameWin();
  19104. }
  19105. else {
  19106. JSBridgeUtils.instance.showInternAd('gameend_faill');
  19107. console.log('zh:game end失败');
  19108. xGame.soundMgr.playSound('matchwin01');
  19109. xGame.soundMgr.playSound("s_lose");
  19110. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19111. }
  19112. let challengeNum = DataMgr.getChallengeTimes();
  19113. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  19114. DataMgr.setChallengeTimes(1);
  19115. }
  19116. if (this.success && xGame.common.gameMode == GameMode.classic) {
  19117. DataMgr.setClassicTimes();
  19118. }
  19119. }
  19120. diyGameDataUtilForGameWin() {
  19121. console.log('zh: DiyGameDataUtilForGameWin diy ');
  19122. switch (xGame.common.gameMode) {
  19123. case GameMode.classic:
  19124. console.log('zh:DiyGameDataUtilForGameWin 111');
  19125. case GameMode.bigMove:
  19126. console.log('zh:DiyGameDataUtilForGameWin 222');
  19127. this.restartGame();
  19128. break;
  19129. case GameMode.placeBall:
  19130. console.log('zh:DiyGameDataUtilForGameWin 333');
  19131. var level = xGame.common.placeBallCurLevel;
  19132. console.log('zh:练习模式 联系了多少LEV=' + level);
  19133. let db_over_lev = DataMgr.getChallengeMode_overLev();
  19134. if (level > db_over_lev) {
  19135. DataMgr.setChallengeMode_overLev(level);
  19136. }
  19137. break;
  19138. default:
  19139. console.log('zh:DiyGameDataUtilForGameWin 444');
  19140. break;
  19141. }
  19142. }
  19143. showChallengeLevel() {
  19144. if (DataMgr.getChallengeTimes() != 0)
  19145. return;
  19146. let skill = DataMgr.getSkillAccTimes();
  19147. let put = DataMgr.getPlaceBallLevelList().length;
  19148. if (skill >= 3 || put >= 5) {
  19149. xGame.uiMgr.Show(UIInvitation$1);
  19150. this.hide();
  19151. }
  19152. }
  19153. addAward(callback) {
  19154. if (!this.success) {
  19155. callback && callback();
  19156. return;
  19157. }
  19158. switch (xGame.common.gameMode) {
  19159. case GameMode.classic:
  19160. this.awardCoinNum = xGame.common.passAwardCoin;
  19161. this.awardDiamondNum = 0;
  19162. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19163. break;
  19164. case GameMode.bigMove:
  19165. this.awardCoinNum = xGame.common.passAwardCoin;
  19166. this.awardDiamondNum = 0;
  19167. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19168. callback && callback();
  19169. break;
  19170. case GameMode.placeBall:
  19171. let level = xGame.common.placeBallCurLevel;
  19172. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  19173. if (xGame.common.placeBallStarNum != 3) {
  19174. callback && callback();
  19175. return;
  19176. }
  19177. else {
  19178. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19179. if (getAward) {
  19180. callback && callback();
  19181. return;
  19182. }
  19183. }
  19184. let cfg = cfgTable.placeballData[level];
  19185. let data = cfgTable.placeballData[level].award;
  19186. this.awardCoinNum = data[0];
  19187. this.awardDiamondNum = data[1];
  19188. if (cfg.type == PlaceBallType.challenge) {
  19189. this.awardDiamondNum = 0;
  19190. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19191. }
  19192. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  19193. let diamondAward;
  19194. if (this.awardDiamondNum > 0) {
  19195. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  19196. xGame.common.getAward([diamondAward, coinAward], callback);
  19197. }
  19198. else {
  19199. xGame.common.getAward([coinAward], callback);
  19200. }
  19201. if (cfg.type == PlaceBallType.normal) {
  19202. DataMgr.setPlaceBallAward(level);
  19203. }
  19204. break;
  19205. default:
  19206. break;
  19207. }
  19208. }
  19209. playSecretaryAni_old() {
  19210. let parent = this.ui.secretary.displayObject;
  19211. parent.destroyChildren();
  19212. let xx = this.ui.secretary.width / 2;
  19213. let yy = this.ui.secretary.height;
  19214. let scale = xGame.common.getSecretaryScale();
  19215. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19216. if (this.success) {
  19217. let rand = Math.random() <= 0.5 ? 2 : 3;
  19218. xGame.common.secretary.play(data, rand, false, parent, () => {
  19219. xGame.common.secretary.play(data, 1, true, parent);
  19220. });
  19221. }
  19222. else {
  19223. xGame.common.secretary.play(data, 0, true, parent);
  19224. }
  19225. }
  19226. playSecretaryAni() {
  19227. let parent = this.ui.secretary.displayObject;
  19228. parent.destroyChildren();
  19229. let xx = this.ui.secretary.width / 2;
  19230. let yy = this.ui.secretary.height;
  19231. let scale = xGame.common.getSecretaryScale();
  19232. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19233. if (this.success) {
  19234. let rand = 0;
  19235. xGame.common.secretary.play(data, 0, true, parent);
  19236. }
  19237. else {
  19238. xGame.common.secretary.play(data, 0, true, parent);
  19239. }
  19240. }
  19241. restartGame() {
  19242. switch (xGame.common.gameMode) {
  19243. case GameMode.classic:
  19244. xGame.eventMgr.event(RESTART_GAME);
  19245. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19246. break;
  19247. case GameMode.bigMove:
  19248. this.hide();
  19249. xGame.eventMgr.event(RESTART_GAME);
  19250. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19251. break;
  19252. default:
  19253. break;
  19254. }
  19255. }
  19256. hide() {
  19257. super.hide();
  19258. xGame.common.stopGirlPop(this.ui.talkNode);
  19259. PlatMgr.showBanner(false);
  19260. }
  19261. returnHome() {
  19262. this.hide();
  19263. let showFailWords = !this.success;
  19264. xGame.uiMgr.Show(UIMain$1, showFailWords);
  19265. }
  19266. clickLeftBtn() {
  19267. switch (xGame.common.gameMode) {
  19268. case GameMode.classic:
  19269. case GameMode.bigMove:
  19270. this.returnHome();
  19271. break;
  19272. case GameMode.placeBall:
  19273. let level = xGame.common.placeBallCurLevel;
  19274. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  19275. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19276. break;
  19277. default:
  19278. break;
  19279. }
  19280. }
  19281. powerStartPlaceBallLevel(level, btn) {
  19282. if (DataMgr.powerEnough()) {
  19283. btn.touchable = false;
  19284. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  19285. btn.touchable = true;
  19286. DataMgr.setPower(-1);
  19287. xGame.eventMgr.event(POWER_TIME);
  19288. this.startPlaceBallLevel(level);
  19289. this.logEventForChallenge_level_start(level);
  19290. }));
  19291. }
  19292. else {
  19293. xGame.uiMgr.Show(UIPower$1, 0);
  19294. }
  19295. }
  19296. clickRightBtn() {
  19297. switch (xGame.common.gameMode) {
  19298. case GameMode.classic:
  19299. console.log('zh:clickRightBtn 111');
  19300. case GameMode.bigMove:
  19301. console.log('zh:clickRightBtn 222');
  19302. this.restartGame();
  19303. break;
  19304. case GameMode.placeBall:
  19305. console.log('zh:clickRightBtn 333');
  19306. let level = xGame.common.placeBallCurLevel;
  19307. let data = DataMgr.getPlaceBallLevel(level);
  19308. let curPss = data.play && !data.isCur;
  19309. if (curPss) {
  19310. console.log('zh:clickRightBtn 333-111');
  19311. console.log('zh:当前LV=' + level);
  19312. if (level == 60) {
  19313. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  19314. Laya.timer.once(3000, this, () => {
  19315. this.returnHome();
  19316. });
  19317. }
  19318. else {
  19319. let lev = level + 1;
  19320. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  19321. }
  19322. }
  19323. else {
  19324. console.log('zh:clickRightBtn 333-000');
  19325. Moyu.sendDataEvent("placeBallNextLevel");
  19326. console.log('zh:qjff_AD_for_uiGameEnd');
  19327. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  19328. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  19329. }
  19330. else {
  19331. console.log('zh:AD 失败,直接发放奖励');
  19332. this.qjff_AD_for_uiGameEnd(level);
  19333. }
  19334. }
  19335. break;
  19336. default:
  19337. console.log('zh:clickRightBtn 444');
  19338. break;
  19339. }
  19340. }
  19341. logEventForChallenge_level_start(level) {
  19342. let keyStr = 'sjmd_challenge_level_start';
  19343. let jsonStr = {
  19344. "count": 0,
  19345. "gold_balance ": DataMgr.getCoin(),
  19346. "level": level,
  19347. "diamond_balance ": DataMgr.getDiamond()
  19348. };
  19349. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19350. const d = LocalStorageManager.getItem(keyStr);
  19351. if (level > d.level) {
  19352. jsonStr.count = d.count + 1;
  19353. LocalStorageManager.setItem(keyStr, jsonStr);
  19354. }
  19355. else {
  19356. }
  19357. }
  19358. else {
  19359. LocalStorageManager.setItem(keyStr, jsonStr);
  19360. }
  19361. const reqStr = JSON.stringify(jsonStr);
  19362. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  19363. }
  19364. qjff_AD_for_uiGameEnd(level) {
  19365. DataMgr.setPlaceBallLevel(level, 1);
  19366. this.startPlaceBallLevel(level + 1);
  19367. }
  19368. startPlaceBallLevel(level) {
  19369. xGame.common.gameMode = GameMode.placeBall;
  19370. xGame.common.placeBallCurLevel = level;
  19371. xGame.uiMgr.Show(UIGame$1);
  19372. this.hide();
  19373. }
  19374. logEventForChallenge_level_complete(level) {
  19375. let keyStr = 'sjmd_challenge_level_complete';
  19376. let jsonStr = {
  19377. "count": 1,
  19378. "gold_balance ": DataMgr.getCoin(),
  19379. "level": level,
  19380. "diamond_balance ": DataMgr.getDiamond()
  19381. };
  19382. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19383. const d = LocalStorageManager.getItem(keyStr);
  19384. jsonStr.count = d.count + 1;
  19385. LocalStorageManager.setItem(keyStr, jsonStr);
  19386. }
  19387. else {
  19388. LocalStorageManager.setItem(keyStr, jsonStr);
  19389. }
  19390. const reqStr = JSON.stringify(jsonStr);
  19391. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  19392. }
  19393. logEventForChallenge_level_N(level) {
  19394. console.log('zh:logEventForChallenge_level_N ' + level);
  19395. let keyStr = 'sjmd_challenge_level_N';
  19396. if (LocalStorageManager.hasKey(keyStr)) {
  19397. let lev = LocalStorageManager.getItem(keyStr);
  19398. if (level > lev) {
  19399. LocalStorageManager.setItem(keyStr, level);
  19400. }
  19401. if ((level) % 5 == 0) {
  19402. console.log('zh:每5关上报1次');
  19403. let sjmc = 'challenge_level_' + level;
  19404. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  19405. }
  19406. else {
  19407. console.log('zh:5 no 上报');
  19408. }
  19409. }
  19410. else {
  19411. LocalStorageManager.setItem(keyStr, level);
  19412. }
  19413. }
  19414. }
  19415. UIGameEnd$1.uiName = "UIGameEnd";
  19416. class ShowItem$1 {
  19417. constructor() {
  19418. this.ui = ui_ShowItem.createInstance();
  19419. }
  19420. destroySelf() {
  19421. if (!this.ui.isDisposed) {
  19422. this.ui.removeFromParent();
  19423. this.ui.dispose();
  19424. }
  19425. }
  19426. setParent(parent) {
  19427. parent.addChild(this.ui);
  19428. }
  19429. setPos(x, y) {
  19430. this.ui.x = x;
  19431. this.ui.y = y;
  19432. }
  19433. setUrl(index) {
  19434. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  19435. }
  19436. }
  19437. class UILevelProp$1 extends UIBase {
  19438. constructor() {
  19439. super();
  19440. this.firstPos = 385;
  19441. this.secondPos = 467;
  19442. this.showItemArr = [];
  19443. }
  19444. onFontLoaded() {
  19445. try {
  19446. this.ui.myNode.conditionTxt.font = "arial";
  19447. console.log("zh: onFontLoaded 设置arial字体成功");
  19448. }
  19449. catch (error) {
  19450. console.log("zh: constructor onFontLoaded加载arial字体失败");
  19451. }
  19452. }
  19453. onConstructor() {
  19454. this.ui = ui_UILevelProp.createInstance();
  19455. this.contentPane = this.ui;
  19456. this.isEject = false;
  19457. this.addUIClick(this.ui.closeBtn, this.hide);
  19458. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19459. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  19460. }
  19461. show(level) {
  19462. super.show();
  19463. this.ui.t1.play();
  19464. this.level = level;
  19465. this.data = cfgTable.placeballData[this.level];
  19466. this.updateSelf();
  19467. this.showPreView();
  19468. this.moneyNode.ui.c1.selectedIndex = 2;
  19469. this.moneyNode.checkPowerTime();
  19470. this.moneyNode.powerChange();
  19471. }
  19472. showPreView() {
  19473. let item;
  19474. let data;
  19475. for (let index = 0; index < this.showItemArr.length; index++) {
  19476. item = this.showItemArr[index];
  19477. item.destroySelf();
  19478. }
  19479. this.showItemArr = [];
  19480. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  19481. for (const key in cfgData) {
  19482. data = cfgData[key];
  19483. item = new ShowItem$1();
  19484. item.setParent(this.ui.myNode.displayRoot);
  19485. item.setPos(data.x, data.y);
  19486. item.setUrl(data.value);
  19487. this.showItemArr.push(item);
  19488. }
  19489. }
  19490. updateSelf() {
  19491. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  19492. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  19493. if (this.data.ball == -1) {
  19494. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  19495. }
  19496. else {
  19497. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  19498. }
  19499. let localData = DataMgr.getPlaceBallLevel(this.level);
  19500. let getAward = localData.getAward;
  19501. let cfg = cfgTable.placeballData[this.level];
  19502. let coin = this.data.award[0];
  19503. let diamond = this.data.award[1];
  19504. if (cfg.type == PlaceBallType.challenge) {
  19505. diamond = 0;
  19506. coin = 100;
  19507. }
  19508. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  19509. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  19510. this.ui.myNode.coinNode.numTxt.text = coin + "";
  19511. if (cfg.type == PlaceBallType.challenge) {
  19512. this.ui.myNode.coinNode.numTxt.text = "";
  19513. }
  19514. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  19515. if (coin > 0 && diamond > 0) {
  19516. this.ui.myNode.diamondNode.x = 385;
  19517. this.ui.myNode.coinNode.x = 467;
  19518. }
  19519. else {
  19520. this.ui.myNode.diamondNode.x = 385;
  19521. this.ui.myNode.coinNode.x = 385;
  19522. }
  19523. if (!getAward) {
  19524. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  19525. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  19526. }
  19527. else {
  19528. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  19529. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  19530. }
  19531. }
  19532. startGame() {
  19533. if (DataMgr.powerEnough()) {
  19534. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  19535. this.ui.myNode.startBtn.touchable = false;
  19536. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  19537. console.log('zh:startGame ');
  19538. this.ui.myNode.startBtn.touchable = true;
  19539. DataMgr.setPower(-1);
  19540. xGame.eventMgr.event(POWER_TIME);
  19541. xGame.common.gameMode = GameMode.placeBall;
  19542. xGame.common.placeBallCurLevel = this.level;
  19543. xGame.uiMgr.Show(UIGame$1);
  19544. this.logEventForChallenge_level_start(this.level);
  19545. xGame.uiMgr.Hide(UILevelDisplay$1);
  19546. xGame.uiMgr.Hide(UIMain$1);
  19547. this.hide();
  19548. }));
  19549. }
  19550. else {
  19551. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  19552. xGame.uiMgr.Show(UIPower$1);
  19553. }
  19554. }
  19555. logEventForChallenge_level_start(level) {
  19556. let keyStr = 'sjmd_challenge_level_start';
  19557. let jsonStr = {
  19558. "count": 1,
  19559. "gold_balance ": DataMgr.getCoin(),
  19560. "level": level,
  19561. "diamond_balance ": DataMgr.getDiamond()
  19562. };
  19563. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19564. const d = LocalStorageManager.getItem(keyStr);
  19565. if (level > d.level) {
  19566. jsonStr.count = d.count + 1;
  19567. LocalStorageManager.setItem(keyStr, jsonStr);
  19568. }
  19569. else {
  19570. }
  19571. }
  19572. else {
  19573. LocalStorageManager.setItem(keyStr, jsonStr);
  19574. }
  19575. const reqStr = JSON.stringify(jsonStr);
  19576. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  19577. }
  19578. hide() {
  19579. super.hide();
  19580. }
  19581. }
  19582. UILevelProp$1.uiName = "UILevelProp";
  19583. class PutBallLevelDisplay$1 {
  19584. constructor(ui, index) {
  19585. this.index = 0;
  19586. this.ui = ui;
  19587. this.index = index;
  19588. this.ui.onClick(this, this.clickSelf);
  19589. this.updateSelf();
  19590. this.ui.levelTxt.text = (this.index + 1) + "";
  19591. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  19592. this.ui.special.levelTxt.text = (this.index + 1) + "";
  19593. }
  19594. updateSelf() {
  19595. let level = this.index + 1;
  19596. this.data = DataMgr.getPlaceBallLevel(level);
  19597. this.ui.starNode.c1.selectedIndex = this.data.star;
  19598. let isChallenge = cfgTable.placeballData[level].type;
  19599. if (this.data.isCur) {
  19600. if (isChallenge) {
  19601. this.ui.c1.selectedIndex = 5;
  19602. }
  19603. else {
  19604. this.ui.c1.selectedIndex = 2;
  19605. }
  19606. }
  19607. else {
  19608. if (this.data.play) {
  19609. if (this.data.star == 3) {
  19610. this.ui.c1.selectedIndex = 0;
  19611. }
  19612. else {
  19613. this.ui.c1.selectedIndex = 1;
  19614. }
  19615. }
  19616. else {
  19617. if (isChallenge) {
  19618. this.ui.c1.selectedIndex = 4;
  19619. }
  19620. else {
  19621. this.ui.c1.selectedIndex = 3;
  19622. }
  19623. }
  19624. }
  19625. }
  19626. clickSelf() {
  19627. if (!this.data.play)
  19628. return;
  19629. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19630. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  19631. }
  19632. }
  19633. class UILevelDisplay$1 extends UIBase {
  19634. constructor() {
  19635. super();
  19636. }
  19637. onConstructor() {
  19638. this.ui = ui_UILevelDisplay.createInstance();
  19639. this.contentPane = this.ui;
  19640. this.isEject = false;
  19641. this.myList = this.ui.myNode.myList;
  19642. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  19643. this.levelItemArr = [];
  19644. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  19645. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  19646. this.myList.numItems = levelNum;
  19647. if (Moyu.isKs)
  19648. this.ui.closeNode.closeBtn.x += 100;
  19649. }
  19650. levelItemRender(index, target) {
  19651. let item = new PutBallLevelDisplay$1(target, index);
  19652. this.levelItemArr.push(item);
  19653. }
  19654. show() {
  19655. super.show();
  19656. this.updateLevel();
  19657. this.scrollToPlace();
  19658. }
  19659. updateLevel() {
  19660. let temp;
  19661. for (let index = 0; index < this.levelItemArr.length; index++) {
  19662. temp = this.levelItemArr[index];
  19663. temp.updateSelf();
  19664. }
  19665. }
  19666. scrollToPlace() {
  19667. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  19668. let passArr = DataMgr.getPlaceBallLevelList();
  19669. let offest = passArr.length;
  19670. if (offest >= maxNum - 1)
  19671. offest = maxNum - 1;
  19672. this.myList.scrollToView(offest, true, true);
  19673. }
  19674. hide() {
  19675. super.hide();
  19676. }
  19677. }
  19678. UILevelDisplay$1.uiName = "UILevelDisplay";
  19679. class UIMatching$1 extends UIBase {
  19680. constructor() {
  19681. super();
  19682. }
  19683. onConstructor() {
  19684. this.ui = ui_UIMatching.createInstance();
  19685. this.contentPane = this.ui;
  19686. this.isEject = false;
  19687. }
  19688. show(callback) {
  19689. super.show();
  19690. PlatMgr.showBanner(true);
  19691. this.callback = callback;
  19692. let user = Moyu.getUserInfo();
  19693. if (!this.selfPot) {
  19694. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  19695. }
  19696. if (!this.aiPot) {
  19697. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  19698. }
  19699. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  19700. this.ui.selfHead.nameTxt.text = user.nickName;
  19701. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  19702. this.ui.aiHead.nameTxt.text = "???";
  19703. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  19704. this.ui.selfHead.c1.selectedIndex = 0;
  19705. this.ui.aiHead.c1.selectedIndex = 0;
  19706. this.ui.selfHead.x = this.selfPot.x;
  19707. this.ui.selfHead.y = this.selfPot.y;
  19708. this.ui.aiHead.x = this.aiPot.x;
  19709. this.ui.aiHead.y = this.aiPot.y;
  19710. switch (xGame.common.gameMode) {
  19711. case GameMode.classic:
  19712. break;
  19713. case GameMode.bigMove:
  19714. this.initSkillData();
  19715. break;
  19716. default:
  19717. break;
  19718. }
  19719. this.ui.t1.play(Laya.Handler.create(this, () => {
  19720. this.ui.t2.play(Laya.Handler.create(this, () => {
  19721. switch (xGame.common.gameMode) {
  19722. case GameMode.classic:
  19723. this.waitingPeople();
  19724. break;
  19725. case GameMode.bigMove:
  19726. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  19727. break;
  19728. default:
  19729. break;
  19730. }
  19731. }));
  19732. }));
  19733. }
  19734. initSkillData() {
  19735. this.skillSelectData = [];
  19736. let skillUrl = xGame.common.skillIconList;
  19737. let skillName = xGame.common.skillNameList;
  19738. let skillLevel = DataMgr.getBigSkillList();
  19739. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  19740. for (let index = 0; index < 5; index++) {
  19741. let obj = {};
  19742. obj.skillImg = skillUrl[index];
  19743. obj.skillName = skillName[index];
  19744. obj.skillType = skillType[index];
  19745. obj.skillLevel = skillLevel[index];
  19746. this.skillSelectData.push(obj);
  19747. }
  19748. }
  19749. getAISkillLevel(myLevel) {
  19750. let video = xGame.common.upSkillLevel;
  19751. let aiLevel;
  19752. let temp;
  19753. if (video) {
  19754. temp = xGame.common.randomNum(-2, -1);
  19755. }
  19756. else {
  19757. if (myLevel <= 5) {
  19758. temp = xGame.common.randomNum(1, 3);
  19759. }
  19760. else if (myLevel <= 9) {
  19761. temp = xGame.common.randomNum(-2, 1);
  19762. }
  19763. else {
  19764. temp = xGame.common.randomNum(-4, 0);
  19765. }
  19766. }
  19767. aiLevel = temp + myLevel;
  19768. if (aiLevel <= 1)
  19769. aiLevel = 1;
  19770. if (aiLevel >= 10)
  19771. aiLevel = 10;
  19772. return aiLevel;
  19773. }
  19774. getAISkillType() {
  19775. return xGame.common.randomNum(1, 4);
  19776. let successTimes = DataMgr.getSkillSuccessTimes();
  19777. let info = cfgTable.aiskillData[successTimes];
  19778. if (!info) {
  19779. let max = Object.keys(cfgTable.aiskillData).length - 1;
  19780. info = cfgTable.aiskillData[max];
  19781. }
  19782. let dataArr = info.skillselect;
  19783. let myCfg = {};
  19784. for (let index = 0; index < dataArr.length; index++) {
  19785. let temp = dataArr[index].split('-');
  19786. myCfg[temp[0]] = {};
  19787. myCfg[temp[0]].id = parseInt(temp[0]);
  19788. myCfg[temp[0]].weight = parseInt(temp[1]);
  19789. }
  19790. let aiCfg = xGame.common.initWeight(myCfg);
  19791. let curData = xGame.common.getRandomWeightData(aiCfg);
  19792. return parseInt(curData.id);
  19793. }
  19794. getAISkillData(index) {
  19795. let myLevel = this.skillSelectData[index].skillLevel;
  19796. let aiLevel = this.getAISkillLevel(myLevel);
  19797. let aiType = this.getAISkillType() - 1;
  19798. return { aiLevel, aiType } = { aiLevel, aiType };
  19799. }
  19800. skillSelectFinish(index) {
  19801. let aiInfo = this.getAISkillData(index);
  19802. xGame.common.gameMgr.selfCurSkill = index;
  19803. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  19804. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  19805. this.ui.selfHead.c1.selectedIndex = 1;
  19806. this.ui.aiHead.c1.selectedIndex = 1;
  19807. let myData = this.skillSelectData[index];
  19808. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  19809. let guide = DataMgr.getSkillGuide();
  19810. if (guide == 0) {
  19811. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  19812. }
  19813. else {
  19814. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  19815. }
  19816. let aiData = this.skillSelectData[aiInfo.aiType];
  19817. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  19818. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  19819. this.waitingPeople();
  19820. }
  19821. waitingPeople() {
  19822. let time = xGame.common.randomNum(1000, 3000);
  19823. time += 1000;
  19824. Laya.timer.once(time, this, () => {
  19825. this.matchingSuccess();
  19826. });
  19827. }
  19828. matchingSuccess() {
  19829. let gameUI = xGame.common.gameUI;
  19830. let name = gameUI.ui.topNode.aiNameTxt.text;
  19831. let url = gameUI.ui.topNode.aiHeadLoader.url;
  19832. this.ui.aiHead.nameTxt.text = name;
  19833. this.ui.aiHead.headImg.url = url;
  19834. name = gameUI.ui.topNode.selfNameTxt.text;
  19835. url = gameUI.ui.topNode.selfHeadLoader.url;
  19836. this.ui.selfHead.nameTxt.text = name;
  19837. this.ui.selfHead.headImg.url = url;
  19838. this.ui.t3.play(Laya.Handler.create(this, () => {
  19839. this.callback && this.callback();
  19840. this.ui.t4.play(Laya.Handler.create(this, () => {
  19841. this.destroySelf();
  19842. }));
  19843. }));
  19844. }
  19845. destroySelf() {
  19846. this.callback = null;
  19847. this.skillSelectData = null;
  19848. this.selfPot = null;
  19849. this.aiPot = null;
  19850. if (!this.ui.isDisposed) {
  19851. this.ui.removeFromParent();
  19852. this.ui.dispose();
  19853. }
  19854. xGame.uiMgr.destroyUI(this);
  19855. }
  19856. }
  19857. UIMatching$1.uiName = "UIMatching";
  19858. class SkillDisplay$1 {
  19859. constructor(ui, data, uiIndex) {
  19860. this.starX = 0;
  19861. this.starY = 0;
  19862. this.index = 0;
  19863. this.ui = ui;
  19864. this.data = data;
  19865. this.index = uiIndex;
  19866. this.initSelf();
  19867. console.log('zh:SkillDisplay constructor this.skillData=', data);
  19868. }
  19869. initSelf() {
  19870. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  19871. this.ui.nameTxt.text = this.data.name;
  19872. this.ui.describeTxt.text = this.data.describe;
  19873. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  19874. this.ui.startBtn.onClick(this, this.startGame);
  19875. this.updateSelf();
  19876. }
  19877. updateSelf() {
  19878. this.checkTry();
  19879. let level = DataMgr.getBigSkillByIndex(this.index);
  19880. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  19881. }
  19882. checkTry() {
  19883. let index = this.index;
  19884. let level = DataMgr.getBigSkillByIndex(index);
  19885. if (level == null) {
  19886. DataMgr.setBigSkill(index, 1, false);
  19887. level = 1;
  19888. }
  19889. this.ui.levelTxt.text = "LV." + level;
  19890. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  19891. this.ui.tryNode.visible = true;
  19892. else
  19893. this.ui.tryNode.visible = false;
  19894. }
  19895. clickAddLevel() {
  19896. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19897. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  19898. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  19899. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  19900. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19901. }
  19902. else {
  19903. console.log('zh:AD 失败,直接发放奖励');
  19904. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19905. }
  19906. }
  19907. qjff_AD_for_skilldisplay_clickAddLevel() {
  19908. DataMgr.setBigSkill(this.data.index, 1);
  19909. this.updateSelf();
  19910. xGame.common.upSkillLevel = true;
  19911. }
  19912. startGame() {
  19913. console.log('zh:rod skill startgame');
  19914. if (this.data.index == 3) {
  19915. alert('Coming soon!');
  19916. return;
  19917. }
  19918. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19919. let needCoin = xGame.common.bigMoveNeedCoin;
  19920. xGame.common.passAwardCoin = 2000;
  19921. let guide = DataMgr.getSkillGuide();
  19922. console.log('zh:startGame guide=' + guide);
  19923. xGame.common.temSelfLevel = 0;
  19924. if (guide == 0) {
  19925. needCoin = 0;
  19926. xGame.common.temSelfLevel = 100;
  19927. }
  19928. if (DataMgr.coinEnough(needCoin)) {
  19929. DataMgr.setCoin(-needCoin);
  19930. xGame.common.curPlayerSkillType = this.index;
  19931. if (guide == 0)
  19932. xGame.common.curPlayerSkillType = 0;
  19933. console.log('zh: skilldisplay 1');
  19934. xGame.uiMgr.Show(UIGame$1);
  19935. xGame.uiMgr.Hide(UIMain$1);
  19936. xGame.uiMgr.Show(UIMatching$1, () => {
  19937. xGame.common.gameUI.ui.alpha = 1;
  19938. xGame.common.gameUI.startGame();
  19939. xGame.uiMgr.Hide(UISkill$1);
  19940. });
  19941. this.logEventForRod_start();
  19942. }
  19943. else {
  19944. console.log('zh: skilldisplay 2');
  19945. xGame.uiMgr.Show(UIAddProp$1, 0);
  19946. Moyu.sendDataEvent("AddCoinVideo");
  19947. }
  19948. }
  19949. logEventForRod_start() {
  19950. let gfmsIdx = xGame.common.curPlayerSkillType;
  19951. console.log('zh:选择的技能=' + gfmsIdx);
  19952. let gfmc = 'Skyfall Shot';
  19953. if (gfmsIdx == 0) {
  19954. gfmc = 'Skyfall Shot';
  19955. }
  19956. if (gfmsIdx == 1) {
  19957. gfmc = 'Surging break';
  19958. }
  19959. if (gfmsIdx == 2) {
  19960. gfmc = 'Frost Lock';
  19961. }
  19962. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  19963. let jsonStr = {
  19964. "count": 0,
  19965. "name": gfmc
  19966. };
  19967. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19968. const d = LocalStorageManager.getItem(keyStr);
  19969. jsonStr.count = d.count + 1;
  19970. LocalStorageManager.setItem(keyStr, jsonStr);
  19971. }
  19972. else {
  19973. LocalStorageManager.setItem(keyStr, jsonStr);
  19974. }
  19975. const reqStr = JSON.stringify(jsonStr);
  19976. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  19977. }
  19978. }
  19979. class UISkill$1 extends UIBase {
  19980. constructor() {
  19981. super();
  19982. this.skillData = [];
  19983. }
  19984. onConstructor() {
  19985. this.ui = ui_UISkill.createInstance();
  19986. this.contentPane = this.ui;
  19987. this.isEject = false;
  19988. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19989. this.initSkillData();
  19990. console.log('zh:aaaaaa1111111111');
  19991. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  19992. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  19993. console.log('zh:aaaaaa22222222');
  19994. this.displayList = [];
  19995. this.ui.skillNode.skillList.numItems = 3;
  19996. this.addUIClick(this.ui, this.interuptSecretary);
  19997. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  19998. this.ui.talkNode.visible = false;
  19999. if (Moyu.isKs)
  20000. this.ui.closeNode.closeBtn.x += 100;
  20001. }
  20002. show() {
  20003. super.show();
  20004. this.playSecretaryIdle();
  20005. this.moneyNode.ui.c1.selectedIndex = 1;
  20006. Laya.timer.clearAll(this);
  20007. xGame.soundMgr.playSound("s_start");
  20008. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20009. let guide = DataMgr.getSkillGuide();
  20010. this.ui.guideNode.visible = guide == 0;
  20011. let item = this.getSkillItemByUIIndex(0);
  20012. if (guide == 0) {
  20013. item.ui.c1.selectedIndex = 1;
  20014. }
  20015. else {
  20016. item.ui.c1.selectedIndex = 0;
  20017. }
  20018. this.ui.guideNode.guideBtn.visible = guide == 0;
  20019. for (let index = 0; index < this.displayList.length; index++) {
  20020. this.displayList[index].checkTry();
  20021. }
  20022. }
  20023. getSkillItemByUIIndex(cur) {
  20024. for (let index = 0; index < this.displayList.length; index++) {
  20025. if (this.displayList[index].index == cur) {
  20026. return this.displayList[index];
  20027. }
  20028. }
  20029. }
  20030. enterGuideLevel() {
  20031. let item = this.getSkillItemByUIIndex(0);
  20032. item.startGame();
  20033. if (DataMgr.getNewUser())
  20034. Moyu.sendDataEvent("gameStart1");
  20035. }
  20036. initSkillData() {
  20037. this.skillData = [];
  20038. let nameList = xGame.common.skillNameList;
  20039. let iconList = xGame.common.skillIconList;
  20040. let describeList = [
  20041. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  20042. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  20043. "The power of frost descends—freezing the flow and taking full control of the game!"
  20044. ];
  20045. console.log('zh:initSkillData 111111111');
  20046. let data;
  20047. for (let index = 0; index < nameList.length; index++) {
  20048. data = {};
  20049. data.name = nameList[index];
  20050. data.icon = iconList[index];
  20051. data.describe = describeList[index];
  20052. data.index = index;
  20053. this.skillData.push(data);
  20054. }
  20055. }
  20056. updateSkillItem(index, target) {
  20057. if (this.displayList[index] == null) {
  20058. let uiIndex;
  20059. switch (index) {
  20060. case 0:
  20061. uiIndex = 1;
  20062. break;
  20063. case 1:
  20064. uiIndex = 0;
  20065. break;
  20066. case 2:
  20067. uiIndex = 2;
  20068. break;
  20069. case 3:
  20070. uiIndex = 3;
  20071. break;
  20072. default:
  20073. break;
  20074. }
  20075. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  20076. this.displayList.push(temp);
  20077. }
  20078. }
  20079. playSecretaryIdle() {
  20080. let parent = this.ui.secretary.displayObject;
  20081. parent.destroyChildren();
  20082. let xx = this.ui.secretary.width / 2;
  20083. let yy = this.ui.secretary.height;
  20084. let scale = xGame.common.getSecretaryScale();
  20085. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20086. xGame.common.secretary.play(data, 0, true, parent);
  20087. }
  20088. returnUIMain() {
  20089. this.hide();
  20090. xGame.common.stopGirlPop(this.ui.talkNode);
  20091. xGame.uiMgr.Show(UIMain$1);
  20092. }
  20093. interuptSecretary() {
  20094. Laya.timer.clearAll(this);
  20095. this.playSecretaryRandomSound();
  20096. }
  20097. playSecretaryRandomSound() {
  20098. if (this.isHide)
  20099. return;
  20100. let time = xGame.common.randomNum(45000, 60000);
  20101. Laya.timer.once(time, this, () => {
  20102. if (this.isHide)
  20103. return;
  20104. let index = xGame.common.randomNum(4, 7);
  20105. xGame.soundMgr.playSound("s_main0" + index);
  20106. let words = 1;
  20107. switch (index) {
  20108. case 4:
  20109. words = 5;
  20110. break;
  20111. case 5:
  20112. words = 3;
  20113. break;
  20114. case 6:
  20115. words = 6;
  20116. break;
  20117. case 7:
  20118. words = 7;
  20119. break;
  20120. default:
  20121. break;
  20122. }
  20123. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20124. this.playSecretaryRandomSound();
  20125. });
  20126. }
  20127. }
  20128. UISkill$1.uiName = "UISkill";
  20129. class UIAddProp$1 extends UIBase {
  20130. constructor() {
  20131. super();
  20132. this.curType = "";
  20133. }
  20134. onConstructor() {
  20135. this.ui = ui_UIAddProp.createInstance();
  20136. this.contentPane = this.ui;
  20137. this.isEject = false;
  20138. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  20139. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  20140. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  20141. this.updateUI();
  20142. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  20143. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  20144. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  20145. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  20146. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  20147. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  20148. }
  20149. show(type) {
  20150. super.show();
  20151. this.curType = type == 0 ? "coin" : "diamond";
  20152. this.switchBtn("");
  20153. this.ui.t0.play();
  20154. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  20155. PlatMgr.showInsert(true);
  20156. }
  20157. closeSelf() {
  20158. this.hide();
  20159. }
  20160. updateUI() {
  20161. let data = cfgTable.moneyData;
  20162. let temp;
  20163. let obj;
  20164. for (const key in data) {
  20165. temp = data[key];
  20166. obj = this.ui.myNode["node" + key];
  20167. if (parseInt(key) <= 2) {
  20168. obj.diamondTxt.text = "+" + temp.num;
  20169. }
  20170. else {
  20171. obj.coinTxt.text = temp.num;
  20172. obj.diamondTxt.text = temp.get.split('_')[1];
  20173. }
  20174. }
  20175. this.updateDiamondShare();
  20176. }
  20177. updateDiamondShare() {
  20178. let data = DataMgr.getShareDiamondTimes();
  20179. if (data >= xGame.common.maxShareDiamondTimes) {
  20180. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  20181. this.ui.myNode.node1.touchable = false;
  20182. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20183. }
  20184. else {
  20185. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  20186. this.ui.myNode.node1.touchable = true;
  20187. }
  20188. }
  20189. switchBtn(type) {
  20190. if (type == "")
  20191. type = this.curType;
  20192. else {
  20193. if (this.curType == type) {
  20194. return;
  20195. }
  20196. else {
  20197. this.curType = type;
  20198. }
  20199. }
  20200. if (type == "coin") {
  20201. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  20202. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  20203. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  20204. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  20205. this.ui.myNode.c1.selectedIndex = 0;
  20206. }
  20207. else {
  20208. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  20209. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  20210. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  20211. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  20212. this.ui.myNode.c1.selectedIndex = 1;
  20213. }
  20214. }
  20215. convertCoin(index) {
  20216. let data = cfgTable.moneyData[index];
  20217. let coinNum = data.num;
  20218. let str = data.get.split('_')[1];
  20219. let needDiamond = parseInt(str);
  20220. if (DataMgr.diamondEnough(needDiamond)) {
  20221. DataMgr.setDiamond(-needDiamond);
  20222. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  20223. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  20224. }
  20225. else {
  20226. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  20227. this.switchBtn("diamond");
  20228. }
  20229. }
  20230. videoGetDiamond() {
  20231. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  20232. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  20233. }
  20234. else {
  20235. console.log('zh:AD 失败,直接发放奖励');
  20236. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  20237. }
  20238. }
  20239. qjff_AD_for_uiAddProp_videoGetDiamond() {
  20240. let num = cfgTable.moneyData[2].num;
  20241. xGame.common.playObjFlyAnim(num, Prop.diamond);
  20242. this.closeSelf();
  20243. }
  20244. videoGetCoin() {
  20245. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  20246. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  20247. }
  20248. else {
  20249. console.log('zh:AD 失败,直接发放奖励');
  20250. this.qjff_AD_for_uiAddProp_videoGetCoin();
  20251. }
  20252. }
  20253. qjff_AD_for_uiAddProp_videoGetCoin() {
  20254. xGame.common.playObjFlyAnim(2000, Prop.coin);
  20255. this.closeSelf();
  20256. }
  20257. shareGetDiamond() {
  20258. let times = DataMgr.getShareDiamondTimes();
  20259. if (times >= xGame.common.maxShareDiamondTimes) {
  20260. console.log('zh: 233333333333 maxShareDiamondTimes');
  20261. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20262. }
  20263. else {
  20264. console.log('zh:33333333333333ad');
  20265. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  20266. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  20267. }
  20268. else {
  20269. console.log('zh:AD 失败,直接发放奖励');
  20270. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  20271. }
  20272. }
  20273. }
  20274. qjff_AD_for_uiAddProp_shareGetDiamond() {
  20275. let diamond = xGame.common.randomNum(50, 100);
  20276. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  20277. DataMgr.setShareDiamondTimes(1);
  20278. this.updateDiamondShare();
  20279. }
  20280. openPutBallView() {
  20281. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  20282. let skill = xGame.uiMgr.getUI(UISkill$1);
  20283. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  20284. let uigame = xGame.uiMgr.getUI(UIGame$1);
  20285. if (end && !end.isHide) {
  20286. xGame.uiMgr.Hide(UIGameEnd$1);
  20287. xGame.uiMgr.Show(UIMain$1);
  20288. }
  20289. if (skill && !skill.isHide)
  20290. xGame.uiMgr.Hide(UISkill$1);
  20291. if (uigame && !uigame.isHide)
  20292. xGame.uiMgr.Hide(UIGame$1);
  20293. if (level && !level.isHide) {
  20294. }
  20295. else {
  20296. xGame.uiMgr.Show(UILevelDisplay$1);
  20297. }
  20298. this.closeSelf();
  20299. }
  20300. }
  20301. UIAddProp$1.uiName = "UIAddProp";
  20302. class MoneyNode$1 {
  20303. constructor(ui) {
  20304. this.leftTime = 0;
  20305. this.ui = ui;
  20306. this.ui.addCoinBtn.onClick(this, this.addCoin);
  20307. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  20308. this.ui.addPowerBtn.onClick(this, this.addPower);
  20309. this.ui.c1.selectedIndex = 1;
  20310. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  20311. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  20312. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  20313. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  20314. this.coinChange();
  20315. this.diamondChange();
  20316. this.powerChange();
  20317. }
  20318. addPower() {
  20319. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20320. xGame.uiMgr.Show(UIPower$1);
  20321. }
  20322. powerChange() {
  20323. let powerNum = DataMgr.getPower();
  20324. this.ui.powerTxt.text = powerNum + "";
  20325. }
  20326. checkPowerTime() {
  20327. let cur = new Date().getTime();
  20328. let last = DataMgr.getPowerTime();
  20329. if (last == 0) {
  20330. last = cur;
  20331. DataMgr.setPowerTime(cur);
  20332. }
  20333. let power = DataMgr.getPower();
  20334. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  20335. Laya.timer.clearAll(this);
  20336. if (power >= xGame.common.natureMaxPower) {
  20337. this.ui.powerTimeTxt.text = "";
  20338. DataMgr.setPowerTime(cur);
  20339. return;
  20340. }
  20341. if (power + offset >= xGame.common.natureMaxPower) {
  20342. DataMgr.setPower(xGame.common.natureMaxPower, false);
  20343. this.ui.powerTimeTxt.text = "";
  20344. DataMgr.setPowerTime(cur);
  20345. }
  20346. else {
  20347. if (offset > 0) {
  20348. DataMgr.setPower(offset);
  20349. DataMgr.setPowerTime(cur);
  20350. }
  20351. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  20352. this.leftTime = xGame.common.powerRecoverNum - time;
  20353. if (this.leftTime <= 0)
  20354. this.leftTime = 0;
  20355. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  20356. Laya.timer.loop(1000, this, this.updatePowerTime);
  20357. }
  20358. }
  20359. updatePowerTime() {
  20360. this.leftTime -= 1;
  20361. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  20362. if (this.leftTime <= 0) {
  20363. this.checkPowerTime();
  20364. }
  20365. }
  20366. coinChange() {
  20367. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  20368. }
  20369. diamondChange() {
  20370. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  20371. }
  20372. addCoin() {
  20373. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20374. Moyu.sendDataEvent("AddCoinBtn");
  20375. xGame.uiMgr.Show(UIAddProp$1, 0);
  20376. }
  20377. addDiamond() {
  20378. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20379. Moyu.sendDataEvent("AddDiamondBtn");
  20380. xGame.uiMgr.Show(UIAddProp$1, 1);
  20381. }
  20382. }
  20383. class SettingNode$1 {
  20384. constructor(ui) {
  20385. this.showSetting = false;
  20386. this.openSound = true;
  20387. this.openShake = true;
  20388. this.ui = ui;
  20389. this.ui.soundBtn.onClick(this, this.switchSound);
  20390. this.ui.shakeBtn.onClick(this, this.switchShake);
  20391. this.ui.xyBtn.onClick(this, this.onXy);
  20392. this.ui.clickNode.onClick(this, this.changeSetting);
  20393. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  20394. this.ui.xyBtn.visible = false;
  20395. this.ui.shakeBtn.visible = false;
  20396. }
  20397. changeSetting() {
  20398. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20399. this.showSetting = !this.showSetting;
  20400. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  20401. }
  20402. switchSound() {
  20403. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20404. this.openSound = !this.openSound;
  20405. Moyu.onSetting(this.openSound, this.openShake);
  20406. xGame.soundMgr.onSetting(this.openSound);
  20407. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  20408. }
  20409. switchShake() {
  20410. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20411. this.openShake = !this.openShake;
  20412. Moyu.onSetting(this.openSound, this.openShake);
  20413. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  20414. }
  20415. onXy() {
  20416. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20417. MoyuMgr$1.showXy(1);
  20418. }
  20419. }
  20420. class UIDraw$1 extends UIBase {
  20421. constructor() {
  20422. super();
  20423. this.curKey = 0;
  20424. }
  20425. onConstructor() {
  20426. this.ui = ui_UIDraw.createInstance();
  20427. this.contentPane = this.ui;
  20428. this.isEject = false;
  20429. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20430. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20431. this.addUIClick(this.ui.drawBtn, this.startDraw);
  20432. this.initDraw();
  20433. this.initUI();
  20434. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  20435. if (Moyu.isKs)
  20436. this.ui.closeNode.closeBtn.x += 100;
  20437. }
  20438. show() {
  20439. super.show();
  20440. this.ui.t0.play();
  20441. this.playSecretaryIdle();
  20442. this.updateDraw();
  20443. this.checkFree();
  20444. if (PlatMgr.bannerDelay > 0) {
  20445. this.ui.closeNode.closeBtn.visible = false;
  20446. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  20447. this.ui.closeNode.closeBtn.visible = true;
  20448. });
  20449. }
  20450. PlatMgr.showRateBanner();
  20451. }
  20452. hide() {
  20453. Laya.timer.clearAll(this);
  20454. super.hide();
  20455. }
  20456. checkFree() {
  20457. let isFree = DataMgr.getDailyfreeDrawTimes();
  20458. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  20459. }
  20460. initDraw() {
  20461. this.drawObj = [];
  20462. let data = cfgTable.drawData;
  20463. let temp;
  20464. let weight = 0;
  20465. for (const key in data) {
  20466. temp = data[key];
  20467. weight += temp.weight;
  20468. this.drawObj.push(weight);
  20469. }
  20470. this.allWeight = weight;
  20471. }
  20472. initUI() {
  20473. let data = cfgTable.drawData;
  20474. let temp;
  20475. let img;
  20476. let txt;
  20477. for (const key in data) {
  20478. temp = data[key];
  20479. img = this.ui.myNode.rotNode["img" + key];
  20480. txt = this.ui.myNode.rotNode["txt" + key];
  20481. img.url = xGame.common.getGameIconUrl(temp.icon);
  20482. txt.visible = true;
  20483. if (temp.award > 2) {
  20484. img.rotation = 0;
  20485. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  20486. }
  20487. else {
  20488. img.rotation = temp.rotation;
  20489. txt.text = temp.num;
  20490. }
  20491. }
  20492. }
  20493. getCurkey() {
  20494. let rand = Math.random() * this.allWeight;
  20495. let temp;
  20496. for (let index = 0; index < this.drawObj.length - 1; index++) {
  20497. temp = this.drawObj[index];
  20498. if (index == 0) {
  20499. if (rand < temp) {
  20500. return index + 1;
  20501. }
  20502. }
  20503. else {
  20504. if (rand >= temp && rand < this.drawObj[index + 1]) {
  20505. return index + 1;
  20506. }
  20507. }
  20508. }
  20509. return 2;
  20510. }
  20511. startDraw() {
  20512. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  20513. if (freeTimes > 0) {
  20514. this.beginDraw();
  20515. DataMgr.setDailyfreeDrawTimes(0);
  20516. this.checkFree();
  20517. }
  20518. else {
  20519. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  20520. }
  20521. else {
  20522. console.log('zh:AD 失败,直接发放奖励');
  20523. this.qjff_chouJiang();
  20524. }
  20525. }
  20526. }
  20527. qjff_chouJiang() {
  20528. this.beginDraw();
  20529. }
  20530. beginDraw() {
  20531. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  20532. this.ui.drawBtn.touchable = false;
  20533. this.curKey = this.getCurkey();
  20534. console.log("当前key", this.curKey);
  20535. let cell = 60;
  20536. let lap = 3;
  20537. let angle = cell * (this.curKey - 1) + lap * 360;
  20538. let target = this.ui.myNode.rotNode;
  20539. target.rotation = 0;
  20540. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  20541. console.log("旋转完成");
  20542. this.ui.drawBtn.touchable = true;
  20543. this.getAward();
  20544. }));
  20545. }
  20546. getAward() {
  20547. let data = cfgTable.drawData[this.curKey];
  20548. let temp = new AwardType();
  20549. temp.type = data.award;
  20550. temp.num = data.num;
  20551. xGame.common.getAward([temp], () => {
  20552. DataMgr.setDrawTimes(1);
  20553. this.updateDraw();
  20554. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  20555. });
  20556. }
  20557. updateDraw() {
  20558. let drawTimes = DataMgr.getDrawTimes();
  20559. let awardTimes = DataMgr.getDrawAwardTimes();
  20560. if (Math.floor(drawTimes / 3) > awardTimes) {
  20561. this.ui.extraNode.boxBtn.t0.play(null, -1);
  20562. this.ui.extraNode.boxBtn.touchable = true;
  20563. this.ui.extraNode.tipsTxt.text = "3/3";
  20564. this.ui.extraNode.barNode.width = 265;
  20565. this.getExtraAward();
  20566. }
  20567. else {
  20568. this.ui.extraNode.boxBtn.t0.stop();
  20569. this.ui.extraNode.boxBtn.touchable = false;
  20570. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  20571. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  20572. }
  20573. let data = cfgTable.drawData[1];
  20574. if (awardTimes == 0) {
  20575. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  20576. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  20577. this.ui.myNode.rotNode.img1.rotation = 0;
  20578. }
  20579. else {
  20580. let award = data.nextid;
  20581. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  20582. this.ui.myNode.rotNode.txt1.text = award[1];
  20583. this.ui.myNode.rotNode.img1.rotation = 0;
  20584. }
  20585. }
  20586. getExtraAward() {
  20587. let drawTimes = DataMgr.getDrawTimes();
  20588. let awardTimes = DataMgr.getDrawAwardTimes();
  20589. let data = cfgTable.drawData[1];
  20590. let award = new AwardType();
  20591. if (awardTimes == 0) {
  20592. award.num = data.num;
  20593. award.type = data.award;
  20594. xGame.common.getAward([award], () => {
  20595. let all = Math.floor(drawTimes / 3);
  20596. DataMgr.setDrawAwardTimes(all);
  20597. this.updateDraw();
  20598. });
  20599. }
  20600. else {
  20601. award.num = parseInt(data.nextid[1]);
  20602. award.type = parseInt(data.nextid[0]);
  20603. xGame.common.getAward([award], () => {
  20604. let all = Math.floor(drawTimes / 3);
  20605. DataMgr.setDrawAwardTimes(all);
  20606. this.updateDraw();
  20607. });
  20608. }
  20609. }
  20610. closeSelf() {
  20611. this.hide();
  20612. }
  20613. playSecretaryIdle() {
  20614. let parent = this.ui.secretary.displayObject;
  20615. parent.destroyChildren();
  20616. let xx = this.ui.secretary.width / 2;
  20617. let yy = this.ui.secretary.height;
  20618. let scale = xGame.common.getSecretaryScale();
  20619. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20620. xGame.common.secretary.play(data, 0, true, parent);
  20621. }
  20622. }
  20623. UIDraw$1.uiName = "UIDraw";
  20624. class UIRanking$1 extends UIBase {
  20625. constructor() {
  20626. super();
  20627. this.showSelf = true;
  20628. this.rankType = 1;
  20629. this.rankList = [];
  20630. this.topX = 10;
  20631. this.myIndex = this.topX + 1;
  20632. this.myStar = 0;
  20633. }
  20634. onConstructor() {
  20635. this.ui = ui_UIRanking.createInstance();
  20636. this.contentPane = this.ui;
  20637. this.isEject = false;
  20638. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  20639. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  20640. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  20641. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  20642. this.ui.myNode.myList.setVirtual();
  20643. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  20644. }
  20645. show() {
  20646. super.show();
  20647. this.getPaiHangBangDataFormJosnFile();
  20648. this.updateSelf();
  20649. let self = Moyu.getUserInfo();
  20650. if (!self.isAuth) {
  20651. Moyu.initUser(this, () => {
  20652. DataMgr.upRankData();
  20653. });
  20654. }
  20655. }
  20656. getPaiHangBangDataFormJosnFile() {
  20657. const rankingList = cfgTable.paiHangBangData.list;
  20658. this.updateItemData(rankingList);
  20659. }
  20660. updateSelfItem() {
  20661. console.log('zh:Moyu.platType =' + Moyu.platType);
  20662. let self = Moyu.getUserInfo();
  20663. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  20664. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  20665. if (this.myIndex > this.topX) {
  20666. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  20667. }
  20668. else {
  20669. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  20670. }
  20671. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  20672. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  20673. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  20674. }
  20675. updateItemData(data) {
  20676. this.myStar = xGame.common.getAllStarNum();
  20677. if (this.rankList.length < 2) {
  20678. this.rankList = data;
  20679. let self = Moyu.getUserInfo();
  20680. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  20681. self.headIcon = self.headIcon;
  20682. for (let i = 0; i < data.length; i++) {
  20683. let data = this.rankList[i];
  20684. if (data.userId == self.userId) {
  20685. this.rankList.splice(i, 1);
  20686. break;
  20687. }
  20688. }
  20689. for (let i = 0; i < data.length; i++) {
  20690. let data = this.rankList[i];
  20691. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  20692. this.myIndex = i + 1;
  20693. let user = { headIcon: self.headIcon, nickName: "myself" };
  20694. let ud = { user: user, data: {} };
  20695. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  20696. console.log('zh:Moyu.platType = ' + Moyu.platType);
  20697. if (Moyu.platType < 11) {
  20698. user.headIcon = self.headIcon;
  20699. user.nickName = self.nickName;
  20700. }
  20701. this.rankList.splice(i, 0, md);
  20702. break;
  20703. }
  20704. }
  20705. }
  20706. this.updateSelfItem();
  20707. this.ui.myNode.myList.numItems = this.rankList.length;
  20708. }
  20709. updateItemUI(index, obj) {
  20710. let data = this.rankList[index];
  20711. let userData = JSON.parse(data.userData).user;
  20712. obj.nameTxt.text = userData.nickName.toString();
  20713. obj.valueTxt.text = data.rankScore;
  20714. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  20715. obj.rankTxt.text = index + 1;
  20716. switch (index) {
  20717. case 0:
  20718. this.setImg(obj, 1, 0, 0);
  20719. obj.rankTxt.color = "#FFC047";
  20720. break;
  20721. case 1:
  20722. this.setImg(obj, 0, 1, 0);
  20723. obj.rankTxt.color = "#ACACAC";
  20724. break;
  20725. case 2:
  20726. this.setImg(obj, 0, 0, 1);
  20727. obj.rankTxt.color = "#D09672";
  20728. break;
  20729. default:
  20730. this.setImg(obj, 0, 0, 0);
  20731. obj.rankTxt.color = "#496FAB";
  20732. break;
  20733. }
  20734. }
  20735. setImg(obj, a, b, c) {
  20736. obj.img1.visible = a ? true : false;
  20737. obj.img2.visible = b ? true : false;
  20738. obj.img3.visible = c ? true : false;
  20739. }
  20740. changeList(type) {
  20741. this.rankType = type;
  20742. this.updateSelf();
  20743. }
  20744. changeSelfNode() {
  20745. this.showSelf = !this.showSelf;
  20746. this.updateSelf();
  20747. }
  20748. updateSelf() {
  20749. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  20750. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  20751. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  20752. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  20753. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  20754. }
  20755. }
  20756. UIRanking$1.uiName = "UIRanking";
  20757. class UISecretary$1 extends UIBase {
  20758. constructor() {
  20759. super();
  20760. this.curIndex = 1;
  20761. }
  20762. onConstructor() {
  20763. this.ui = ui_UISecretary.createInstance();
  20764. this.contentPane = this.ui;
  20765. this.isEject = false;
  20766. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  20767. this.nodeObj = { left: null, right: null, cur: null };
  20768. this.nodeObj.cur = this.ui.myNode.gameNode3;
  20769. }
  20770. show() {
  20771. super.show();
  20772. this.ui.t0.play();
  20773. this.updateData();
  20774. }
  20775. addSecretarySpine(node, spineName) {
  20776. if (spineName == "mishu") {
  20777. if (this.secretarySpine1) {
  20778. node.displayObject.destroyChildren();
  20779. this.playWoman(this.secretarySpine1, node.displayObject);
  20780. }
  20781. else {
  20782. let spine1 = new SpineMgr("mishu", () => {
  20783. this.secretarySpine1 = spine1;
  20784. this.playWoman(this.secretarySpine1, node.displayObject);
  20785. });
  20786. }
  20787. }
  20788. else {
  20789. if (this.secretarySpine2) {
  20790. node.displayObject.destroyChildren();
  20791. this.playWoman(this.secretarySpine2, node.displayObject);
  20792. }
  20793. else {
  20794. let spine2 = new SpineMgr("xiaomishu2", () => {
  20795. this.secretarySpine2 = spine2;
  20796. this.playWoman(this.secretarySpine2, node.displayObject);
  20797. });
  20798. }
  20799. }
  20800. }
  20801. playWoman(node, parent) {
  20802. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  20803. let yy = this.ui.myNode.gameNode3.secretary.height;
  20804. let scale = 1.5;
  20805. if (node == this.secretarySpine2) {
  20806. scale = 1.2;
  20807. }
  20808. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20809. node.play(data, 0, true, parent);
  20810. }
  20811. turnLeft() {
  20812. this.curIndex--;
  20813. if (this.curIndex < 1) {
  20814. this.curIndex = 2;
  20815. }
  20816. let left = this.nodeObj.left;
  20817. let right = this.nodeObj.right;
  20818. let cur = this.nodeObj.cur;
  20819. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  20820. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  20821. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  20822. this.updateData();
  20823. }));
  20824. this.ui.myNode.setChildIndex(right, 2);
  20825. this.nodeObj.left = cur;
  20826. this.nodeObj.right = left;
  20827. this.nodeObj.cur = right;
  20828. }
  20829. turnRight() {
  20830. this.curIndex++;
  20831. if (this.curIndex > 2) {
  20832. this.curIndex = 1;
  20833. }
  20834. let left = this.nodeObj.left;
  20835. let right = this.nodeObj.right;
  20836. let cur = this.nodeObj.cur;
  20837. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  20838. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  20839. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  20840. this.updateData();
  20841. }));
  20842. this.ui.myNode.setChildIndex(left, 2);
  20843. this.nodeObj.left = right;
  20844. this.nodeObj.right = cur;
  20845. this.nodeObj.cur = left;
  20846. }
  20847. updateData() {
  20848. console.log('zh: updateData FFFFFFFFFF');
  20849. let data = cfgTable.secretaryshopData;
  20850. let children = this.ui.myNode._children;
  20851. let temp;
  20852. let curData;
  20853. for (let index = 0; index < children.length; index++) {
  20854. temp = children[index];
  20855. curData = data[1];
  20856. temp.heightTxt.text = curData.height;
  20857. temp.foodTxt.text = curData.food;
  20858. temp.historyTxt.text = curData.history;
  20859. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  20860. this.addSecretarySpine(temp.secretary, curData.spine);
  20861. let womanIndex = curData.id - 1;
  20862. let getWoman = DataMgr.getSecretary(womanIndex);
  20863. let curUse = DataMgr.getCurSecretary();
  20864. if (getWoman) {
  20865. if (curUse == womanIndex) {
  20866. temp.purchaseBtn.c1.selectedIndex = 1;
  20867. }
  20868. else {
  20869. temp.purchaseBtn.c1.selectedIndex = 2;
  20870. }
  20871. }
  20872. else {
  20873. temp.purchaseBtn.c1.selectedIndex = 0;
  20874. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  20875. }
  20876. temp.purchaseBtn.visible = false;
  20877. }
  20878. }
  20879. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  20880. console.log('zh: 点击了clickSecretary ');
  20881. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20882. if (getWoman) {
  20883. if (curUse != womanIndex) {
  20884. console.log();
  20885. DataMgr.setCurSecretary(womanIndex);
  20886. this.updateData();
  20887. }
  20888. }
  20889. else {
  20890. console.log('zh:点击购买了');
  20891. let need = needDiamond;
  20892. if (DataMgr.diamondEnough(need)) {
  20893. DataMgr.setDiamond(-need);
  20894. DataMgr.setSecretary(womanIndex, 1);
  20895. DataMgr.setCurSecretary(womanIndex);
  20896. this.updateData();
  20897. }
  20898. else {
  20899. xGame.uiMgr.Show(UIAddProp$1, 1);
  20900. }
  20901. }
  20902. }
  20903. closeSelf() {
  20904. this.hide();
  20905. }
  20906. }
  20907. UISecretary$1.uiName = "UISecretary";
  20908. class BallRodDisplay$1 {
  20909. constructor(ui, index) {
  20910. this.index = 0;
  20911. this.uiIndex = 0;
  20912. this.ui = ui;
  20913. this.index = index;
  20914. this.initData();
  20915. }
  20916. initData() {
  20917. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  20918. let data = cfgTable.ballrodData[this.index + 1];
  20919. this.ui.nameTxt.text = data.name;
  20920. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  20921. this.ui.levelNode.c1.selectedIndex = data.quality;
  20922. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  20923. if (data.spine) {
  20924. this.mySpine = new SpineMgr(data.spine, () => {
  20925. let xx = 150;
  20926. let yy = 70;
  20927. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  20928. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  20929. });
  20930. }
  20931. }
  20932. updateSelf() {
  20933. console.log('zh:updateSelf -------------- ');
  20934. let get = DataMgr.getBallRod(this.index);
  20935. if (get == null)
  20936. get = 1;
  20937. let curUse = DataMgr.getCurBallRod();
  20938. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20939. if (get) {
  20940. if (curUse == this.index) {
  20941. this.ui.purchaseBtn.c1.selectedIndex = 0;
  20942. }
  20943. else {
  20944. this.ui.purchaseBtn.c1.selectedIndex = 1;
  20945. }
  20946. }
  20947. else {
  20948. this.ui.purchaseBtn.c1.selectedIndex = 2;
  20949. }
  20950. }
  20951. buyBallRod() {
  20952. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20953. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  20954. switch (selectedIndex) {
  20955. case 0:
  20956. break;
  20957. case 1:
  20958. console.log('zh:点击了 USE THIS');
  20959. DataMgr.setCurBallRod(this.index);
  20960. DataMgr.setDiamond(99999);
  20961. let curUse = DataMgr.getCurBallRod();
  20962. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20963. let ui = xGame.uiMgr.getUI(UIShop$1);
  20964. ui.updateBallRod();
  20965. break;
  20966. case 2:
  20967. let data = cfgTable.ballrodData[this.index + 1];
  20968. let need = data.price;
  20969. if (DataMgr.diamondEnough(need)) {
  20970. DataMgr.setDiamond(-need);
  20971. DataMgr.setBallRod(this.index, 1);
  20972. DataMgr.setCurBallRod(this.index);
  20973. let ui = xGame.uiMgr.getUI(UIShop$1);
  20974. ui.updateBallRod();
  20975. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  20976. }
  20977. else {
  20978. xGame.uiMgr.Show(UIAddProp$1, 1);
  20979. }
  20980. break;
  20981. default:
  20982. break;
  20983. }
  20984. }
  20985. logEventForGouMaiGan(qiuGanName) {
  20986. const ev = {
  20987. value: qiuGanName
  20988. };
  20989. const jsonStr = JSON.stringify(ev);
  20990. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  20991. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  20992. }
  20993. }
  20994. class UIShop$1 extends UIBase {
  20995. constructor() {
  20996. super();
  20997. this.itemNums = 0;
  20998. }
  20999. onConstructor() {
  21000. this.ui = ui_UIShop.createInstance();
  21001. this.contentPane = this.ui;
  21002. this.isEject = false;
  21003. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21004. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21005. this.addUIClick(this.ui, this.interuptSecretary);
  21006. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  21007. this.ballRodArr = [];
  21008. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  21009. this.ui.myNode.myList.numItems = this.itemNums;
  21010. if (Moyu.isKs)
  21011. this.ui.closeNode.closeBtn.x += 100;
  21012. }
  21013. show() {
  21014. super.show();
  21015. this.playSecretaryIdle();
  21016. this.updateBallRod();
  21017. }
  21018. updateBallRod() {
  21019. for (let index = 0; index < this.ballRodArr.length; index++) {
  21020. this.ballRodArr[index].updateSelf();
  21021. }
  21022. }
  21023. renderBallRod(sort, obj) {
  21024. let index = this.getIndexBySort(sort + 1) - 1;
  21025. let ballRod = new BallRodDisplay$1(obj, index);
  21026. this.ballRodArr.push(ballRod);
  21027. }
  21028. getIndexBySort(sort) {
  21029. let object = cfgTable.ballrodData;
  21030. for (const key in object) {
  21031. if (object[key].sort == sort) {
  21032. return parseInt(key);
  21033. }
  21034. }
  21035. }
  21036. playSecretaryIdle() {
  21037. let parent = this.ui.secretary.displayObject;
  21038. parent.destroyChildren();
  21039. let xx = this.ui.secretary.width / 2;
  21040. let yy = this.ui.secretary.height;
  21041. let scale = xGame.common.getSecretaryScale();
  21042. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21043. xGame.common.secretary.play(data, 0, true, parent);
  21044. }
  21045. interuptSecretary() {
  21046. Laya.timer.clearAll(this);
  21047. this.playSecretaryRandomSound();
  21048. }
  21049. playSecretaryRandomSound() {
  21050. if (this.isHide)
  21051. return;
  21052. let time = xGame.common.randomNum(45000, 60000);
  21053. Laya.timer.once(time, this, () => {
  21054. if (this.isHide)
  21055. return;
  21056. let index = xGame.common.randomNum(4, 7);
  21057. xGame.soundMgr.playSound("s_main0" + index);
  21058. let words = 1;
  21059. switch (index) {
  21060. case 4:
  21061. words = 5;
  21062. break;
  21063. case 5:
  21064. words = 3;
  21065. break;
  21066. case 6:
  21067. words = 6;
  21068. break;
  21069. case 7:
  21070. words = 7;
  21071. break;
  21072. default:
  21073. break;
  21074. }
  21075. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21076. this.playSecretaryRandomSound();
  21077. });
  21078. }
  21079. closeSelf() {
  21080. this.hide();
  21081. }
  21082. }
  21083. UIShop$1.uiName = "UIShop";
  21084. class SignMax$1 {
  21085. constructor(ui) {
  21086. this.ui = ui;
  21087. }
  21088. updateSelf(index, sameDay, curDayIndex) {
  21089. let data = cfgTable.signData[index + 1];
  21090. this.ui.titleTxt.text = data.title;
  21091. let arr1 = data.award[0].split('-');
  21092. let arr2 = data.award[1].split('-');
  21093. let num1 = parseInt(arr1[1]);
  21094. let num2 = parseInt(arr2[1]);
  21095. this.ui.numTxt1.text = num1 + "";
  21096. this.ui.numTxt2.text = num2 + "";
  21097. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  21098. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  21099. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  21100. this.ui.numTxt1.visible = false;
  21101. }
  21102. else {
  21103. this.ui.numTxt1.visible = true;
  21104. }
  21105. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  21106. this.ui.numTxt2.visible = false;
  21107. }
  21108. else {
  21109. this.ui.numTxt2.visible = true;
  21110. }
  21111. if (index < curDayIndex) {
  21112. this.ui.c1.selectedIndex = 1;
  21113. }
  21114. else if (index == curDayIndex) {
  21115. if (sameDay) {
  21116. this.ui.c1.selectedIndex = 2;
  21117. }
  21118. else {
  21119. this.ui.c1.selectedIndex = 2;
  21120. }
  21121. }
  21122. else {
  21123. this.ui.c1.selectedIndex = 0;
  21124. }
  21125. }
  21126. }
  21127. class SignNormal$1 {
  21128. constructor(ui) {
  21129. this.ui = ui;
  21130. }
  21131. updateSelf(index, sameDay, curDayIndex) {
  21132. let data = cfgTable.signData[index + 1];
  21133. this.ui.titleTxt.text = data.title;
  21134. let arr = data.award[0].split('-');
  21135. let type = parseInt(arr[0]);
  21136. let num = parseInt(arr[1]);
  21137. this.ui.numTxt.text = num + "";
  21138. if (type > 2) {
  21139. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  21140. this.ui.myIcon.rotation = 0;
  21141. }
  21142. else {
  21143. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  21144. this.ui.myIcon.rotation = 0;
  21145. }
  21146. if (xGame.common.signAwardContainsRod(data.award)) {
  21147. this.ui.numTxt.visible = false;
  21148. }
  21149. else {
  21150. this.ui.numTxt.visible = true;
  21151. }
  21152. if (index < curDayIndex) {
  21153. this.ui.c1.selectedIndex = 1;
  21154. }
  21155. else if (index == curDayIndex) {
  21156. if (sameDay) {
  21157. this.ui.c1.selectedIndex = 2;
  21158. }
  21159. else {
  21160. this.ui.c1.selectedIndex = 2;
  21161. }
  21162. }
  21163. else {
  21164. this.ui.c1.selectedIndex = 0;
  21165. }
  21166. }
  21167. }
  21168. class UISign$1 extends UIBase {
  21169. constructor() {
  21170. super();
  21171. this.curDayIndex = 0;
  21172. this.starX = 0;
  21173. }
  21174. onConstructor() {
  21175. this.ui = ui_UISign.createInstance();
  21176. this.contentPane = this.ui;
  21177. this.isEject = false;
  21178. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21179. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21180. this.initSignItem();
  21181. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  21182. this.addUIClick(this.ui.againBtn, this.againGetAward);
  21183. }
  21184. show() {
  21185. super.show();
  21186. this.ui.t0.play();
  21187. this.playSecretaryIdle();
  21188. this.updateSign();
  21189. }
  21190. initSignItem() {
  21191. this.signArr = [];
  21192. for (let index = 0; index < 6; index++) {
  21193. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  21194. this.signArr.push(temp);
  21195. }
  21196. this.signMax = new SignMax$1(this.ui.myNode.day7);
  21197. if (Moyu.isKs)
  21198. this.ui.closeNode.closeBtn.x += 100;
  21199. }
  21200. updateSign() {
  21201. let sameDay = xGame.common.judgeSameDay();
  21202. let max = 7;
  21203. this.curDayIndex = DataMgr.getSignData();
  21204. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  21205. this.curDayIndex = 0;
  21206. if (!sameDay) {
  21207. this.ui.normalBtn.visible = true;
  21208. this.ui.tipsNode.visible = false;
  21209. this.ui.againBtn.visible = false;
  21210. }
  21211. else {
  21212. this.ui.normalBtn.visible = false;
  21213. let again = DataMgr.getExtraSign();
  21214. let isCurrency = false;
  21215. let index = this.curDayIndex;
  21216. if (index == 0)
  21217. index = 7;
  21218. let award = cfgTable.signData[index].award;
  21219. let num = award[0].split("-")[0];
  21220. if (num == "1" || num == "2")
  21221. isCurrency = true;
  21222. let showAgain = again == 0 && isCurrency;
  21223. this.ui.againBtn.visible = showAgain;
  21224. this.ui.tipsNode.visible = !showAgain;
  21225. }
  21226. for (let index = 0; index < this.signArr.length; index++) {
  21227. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  21228. }
  21229. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  21230. }
  21231. playSecretaryIdle() {
  21232. let parent = this.ui.secretary.displayObject;
  21233. parent.destroyChildren();
  21234. let xx = this.ui.secretary.width / 2;
  21235. let yy = this.ui.secretary.height;
  21236. let scale = xGame.common.getSecretaryScale();
  21237. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21238. xGame.common.secretary.play(data, 0, true, parent);
  21239. }
  21240. closeSelf() {
  21241. this.hide();
  21242. }
  21243. normalGetAward() {
  21244. let sameDay = xGame.common.judgeSameDay();
  21245. if (!sameDay) {
  21246. let award = cfgTable.signData[this.curDayIndex + 1].award;
  21247. let temp;
  21248. let type;
  21249. let num;
  21250. let arr = [];
  21251. for (let index = 0; index < award.length; index++) {
  21252. temp = award[index].split("-");
  21253. type = parseInt(temp[0]);
  21254. num = parseInt(temp[1]);
  21255. let awardType = new AwardType();
  21256. awardType.num = num;
  21257. awardType.type = type;
  21258. arr.push(awardType);
  21259. }
  21260. xGame.common.getAward(arr, (watchVideo) => {
  21261. this.curDayIndex++;
  21262. if (this.curDayIndex > 7)
  21263. this.curDayIndex = 0;
  21264. DataMgr.setSignData(this.curDayIndex);
  21265. DataMgr.setSignTime(new Date().getTime());
  21266. if (watchVideo) {
  21267. DataMgr.setExtraSign(1);
  21268. Moyu.sendDataEvent("signIn1");
  21269. }
  21270. this.updateSign();
  21271. });
  21272. }
  21273. }
  21274. againGetAward() {
  21275. Moyu.sendDataEvent("signIn2");
  21276. console.log('zh:qjff_AD_for_uisign');
  21277. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  21278. }
  21279. else {
  21280. console.log('zh:AD 失败,直接发放奖励');
  21281. this.qjff_AD_for_uisign();
  21282. }
  21283. }
  21284. qjff_AD_for_uisign() {
  21285. let index = this.curDayIndex;
  21286. if (index == 0)
  21287. index = 7;
  21288. let award = cfgTable.signData[index].award;
  21289. let temp;
  21290. let type;
  21291. let num;
  21292. for (let index = 0; index < award.length; index++) {
  21293. temp = award[index].split("-");
  21294. type = parseInt(temp[0]);
  21295. num = parseInt(temp[1]) * 3;
  21296. xGame.common.playObjFlyAnim(num, type);
  21297. }
  21298. DataMgr.setExtraSign(1);
  21299. this.updateSign();
  21300. }
  21301. }
  21302. UISign$1.uiName = "UISign";
  21303. class UIModeSelection$1 extends UIBase {
  21304. constructor() {
  21305. super();
  21306. }
  21307. onConstructor() {
  21308. this.ui = ui_UIModeSelection.createInstance();
  21309. this.contentPane = this.ui;
  21310. this.isEject = false;
  21311. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  21312. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  21313. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  21314. this.addUIClick(this.ui.closeBtn, this.hide);
  21315. this.peopleArr = [650, 6900, 3800];
  21316. this.peopleOffest = [50, 500, 200];
  21317. this.updateSelf();
  21318. }
  21319. show(callback) {
  21320. super.show();
  21321. this.ui.t0.play();
  21322. this.callback = callback;
  21323. }
  21324. updateSelf() {
  21325. let cfg = cfgTable.modeselectData;
  21326. for (let index = 1; index <= 3; index++) {
  21327. let node = this.ui.myNode["type" + index];
  21328. node.need.text = cfg[index].need;
  21329. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  21330. node.peopleTxt.text = this.getRandPeople(index - 1);
  21331. }
  21332. }
  21333. enterGame(type) {
  21334. console.log('zh: 进入经典模式 type: ' + type);
  21335. xGame.common.classicRoomType = type;
  21336. let cfg = cfgTable.modeselectData[type];
  21337. let need = cfg.need;
  21338. xGame.common.passAwardCoin = cfg.award;
  21339. if (DataMgr.coinEnough(need)) {
  21340. DataMgr.setCoin(-need);
  21341. this.ui.myNode["type" + type].t0.play();
  21342. Laya.timer.once(200, this, () => {
  21343. this.callback && this.callback();
  21344. });
  21345. this.logEventForClassic_start();
  21346. }
  21347. else {
  21348. Moyu.sendDataEvent("AddCoinVideo");
  21349. xGame.uiMgr.Show(UIAddProp$1, 0);
  21350. }
  21351. }
  21352. getRandPeople(index) {
  21353. let rand = this.peopleOffest[index];
  21354. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  21355. }
  21356. logEventForClassic_start() {
  21357. let rtype = xGame.common.classicRoomType;
  21358. let msmc = '';
  21359. if (rtype == 1) {
  21360. msmc = 'beginner';
  21361. }
  21362. if (rtype == 2) {
  21363. msmc = 'expert';
  21364. }
  21365. if (rtype == 3) {
  21366. msmc = 'master';
  21367. }
  21368. let keyStr = 'sjmd_classic_start_' + rtype;
  21369. let jsonStr = {
  21370. "difficulty": msmc,
  21371. "classic_count": 1,
  21372. "difficulty_count": 1
  21373. };
  21374. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21375. const d = LocalStorageManager.getItem(keyStr);
  21376. jsonStr.classic_count = d.classic_count + 1;
  21377. jsonStr.difficulty_count = d.difficulty_count + 1;
  21378. LocalStorageManager.setItem(keyStr, jsonStr);
  21379. }
  21380. else {
  21381. LocalStorageManager.setItem(keyStr, jsonStr);
  21382. }
  21383. const reqStr = JSON.stringify(jsonStr);
  21384. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  21385. }
  21386. }
  21387. UIModeSelection$1.uiName = "UIModeSelection";
  21388. class UITry$1 extends UIBase {
  21389. constructor() {
  21390. super();
  21391. this.closeTime = 0;
  21392. this.closeNum = 0;
  21393. this.skillUrl = xGame.common.skillIconList;
  21394. }
  21395. onConstructor() {
  21396. this.ui = ui_UITry.createInstance();
  21397. this.contentPane = this.ui;
  21398. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  21399. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  21400. }
  21401. show() {
  21402. super.show();
  21403. this.closeNum = 0;
  21404. this.closeTime = 15;
  21405. this.ui.t0.play();
  21406. PlatMgr.showRateBanner();
  21407. this.ui.myNode.txtTime.text = this.closeTime.toString();
  21408. Laya.timer.loop(1000, this, this.updateTime);
  21409. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  21410. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  21411. xGame.common.gameMgr.gamePause = true;
  21412. }
  21413. updateTime() {
  21414. if (this.closeTime > 1) {
  21415. this.closeTime--;
  21416. this.ui.myNode.txtTime.text = this.closeTime.toString();
  21417. }
  21418. else
  21419. this.hide();
  21420. }
  21421. hide() {
  21422. Laya.timer.clearAll(this);
  21423. Moyu.showBannerAd(false);
  21424. super.hide();
  21425. xGame.common.gameMgr.gamePause = false;
  21426. }
  21427. onTry() {
  21428. console.log('zh:qjff_AD_for_uitry');
  21429. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  21430. }
  21431. else {
  21432. console.log('zh:AD 失败,直接发放奖励');
  21433. this.qjff_AD_for_uitry();
  21434. }
  21435. }
  21436. qjff_AD_for_uitry() {
  21437. let select = xGame.common.curPlayerSkillType;
  21438. DataMgr.gameData.trySkill = select;
  21439. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  21440. DataMgr.saveGameData();
  21441. DataMgr.setBigSkill(select, 1);
  21442. xGame.showTip("Trial Successful");
  21443. this.hide();
  21444. }
  21445. onCancel() {
  21446. if (this.closeNum > 0) {
  21447. this.closeNum--;
  21448. if (this.closeNum < 2)
  21449. this.hide();
  21450. return;
  21451. }
  21452. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  21453. this.onTry();
  21454. }
  21455. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  21456. this.closeNum = 3;
  21457. }
  21458. else
  21459. this.hide();
  21460. }
  21461. }
  21462. UITry$1.uiName = "UITry";
  21463. class UIGetAward$1 extends UIBase {
  21464. constructor() {
  21465. super();
  21466. this.showTriple = true;
  21467. }
  21468. onConstructor() {
  21469. this.ui = ui_UIGetAward.createInstance();
  21470. this.contentPane = this.ui;
  21471. this.isEject = false;
  21472. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  21473. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  21474. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  21475. }
  21476. show(arr, showTriple, callback) {
  21477. super.show();
  21478. this.ui.t0.play();
  21479. this.ui.eftNode.visible = true;
  21480. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  21481. this.ui.eftNode.visible = false;
  21482. }), 1, 0, 0, 0.9);
  21483. this.awardArr = arr;
  21484. this.showTriple = showTriple;
  21485. this.callback = callback;
  21486. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  21487. this.ui.myList.numItems = arr.length;
  21488. xGame.soundMgr.playSound("getaward");
  21489. }
  21490. updateSelf(index, obj) {
  21491. let temp = this.awardArr[index];
  21492. let icon = this.getIcon(temp.type);
  21493. let str = icon;
  21494. if (temp.type > 2) {
  21495. str = "s" + icon;
  21496. }
  21497. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  21498. obj.myIcon.rotation = 0;
  21499. obj.numTxt.text = temp.num + "";
  21500. obj.numTxt.visible = temp.type > 2 ? false : true;
  21501. obj.nameTxt.text = this.getNameStr(temp.type);
  21502. }
  21503. renderItem(index, obj) {
  21504. this.updateSelf(index, obj);
  21505. }
  21506. tripleGetAward() {
  21507. console.log('zh:qjff_AD_for_uigetAward');
  21508. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  21509. }
  21510. else {
  21511. console.log('zh:AD 失败,直接发放奖励');
  21512. this.qjff_AD_for_uigetAward();
  21513. }
  21514. }
  21515. qjff_AD_for_uigetAward() {
  21516. this.getAward(3);
  21517. }
  21518. normalGetAward() {
  21519. if (PlatMgr.isMisVideo())
  21520. this.tripleGetAward();
  21521. else
  21522. this.getAward();
  21523. }
  21524. getAward(times = 1) {
  21525. this.hide();
  21526. for (let index = 0; index < this.awardArr.length; index++) {
  21527. this.awardArr[index].num *= times;
  21528. }
  21529. this.callback && this.callback(times != 1);
  21530. }
  21531. getIcon(type) {
  21532. switch (type) {
  21533. case Prop.diamond:
  21534. return "ty_zs";
  21535. case Prop.coin:
  21536. return "ty_jb";
  21537. case Prop.gan1:
  21538. return "qg1";
  21539. case Prop.gan2:
  21540. return "qg2";
  21541. case Prop.gan3:
  21542. return "qg3";
  21543. case Prop.gan4:
  21544. return "qg4";
  21545. default:
  21546. break;
  21547. }
  21548. }
  21549. getNameStr(type) {
  21550. switch (type) {
  21551. case Prop.diamond:
  21552. return "Diamond";
  21553. case Prop.coin:
  21554. return "Coins";
  21555. case Prop.gan1:
  21556. case Prop.gan2:
  21557. case Prop.gan3:
  21558. case Prop.gan4:
  21559. return cfgTable.ballrodData[type - 1].name;
  21560. default:
  21561. break;
  21562. }
  21563. }
  21564. }
  21565. UIGetAward$1.uiName = "UIGetAward";
  21566. class UIBox$1 extends UIBase {
  21567. constructor() {
  21568. super();
  21569. this.boxNum = 0;
  21570. this.boxMax = 10;
  21571. this.inAd = false;
  21572. this.isClose = false;
  21573. }
  21574. onConstructor() {
  21575. this.ui = ui_UIBox.createInstance();
  21576. this.contentPane = this.ui;
  21577. this.isEject = false;
  21578. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  21579. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  21580. Laya.timer.loop(1000, this, this.update);
  21581. }
  21582. update() {
  21583. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  21584. this.boxNum -= 1;
  21585. this.upBar();
  21586. }
  21587. }
  21588. upBar() {
  21589. if (this.boxNum > this.boxMax)
  21590. this.boxNum = this.boxMax;
  21591. this.ui.bar.value = this.boxNum * 10;
  21592. }
  21593. show() {
  21594. super.show();
  21595. this.isClose = false;
  21596. this.boxNum = 0;
  21597. this.inAd = false;
  21598. this.upBar();
  21599. this.ui.t0.play();
  21600. this.ui.closeBtn.visible = false;
  21601. Laya.timer.once(3000, this, () => {
  21602. this.ui.closeBtn.visible = true;
  21603. this.ui.bar.alpha = 1;
  21604. });
  21605. Laya.timer.once(500, this, () => {
  21606. this.ui.t1.play();
  21607. });
  21608. }
  21609. hide() {
  21610. Laya.timer.clearAll(this);
  21611. Moyu.showBannerAd(false);
  21612. super.hide();
  21613. }
  21614. onOpenBox() {
  21615. this.boxNum++;
  21616. if (this.boxNum < this.boxMax) {
  21617. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  21618. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  21619. }
  21620. }
  21621. else if (this.boxNum == this.boxMax) {
  21622. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  21623. this.ui.openBtn.c1.selectedIndex = 13;
  21624. this.inAd = true;
  21625. }
  21626. else
  21627. this.getAward();
  21628. }
  21629. else if (this.inAd) {
  21630. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  21631. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  21632. }
  21633. else {
  21634. console.log('zh:AD 失败,直接发放奖励');
  21635. this.qjff_AD_for_UIBOX_onOpenBox();
  21636. }
  21637. }
  21638. this.upBar();
  21639. }
  21640. qjff_AD_for_UIBOX_onOpenBox() {
  21641. this.getAward();
  21642. }
  21643. onCloseBox() {
  21644. if (this.isClose)
  21645. this.hide();
  21646. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  21647. this.isClose = true;
  21648. PlatMgr.showBanner(true, 0, 3000);
  21649. }
  21650. else
  21651. this.hide();
  21652. }
  21653. getAward() {
  21654. let str = "";
  21655. if (Math.random() < 0.5) {
  21656. let max = Moyu.isLegal ? 500 : 2500;
  21657. let num = xGame.tools.random(max, 500 + max);
  21658. DataMgr.setCoin(num);
  21659. str = "金币x" + num;
  21660. }
  21661. else {
  21662. let max = Moyu.isLegal ? 10 : 30;
  21663. let num = xGame.tools.random(max, 30 + max);
  21664. DataMgr.setDiamond(num);
  21665. str = "钻石x" + num;
  21666. }
  21667. xGame.showTip("恭喜获得-" + str);
  21668. this.hide();
  21669. }
  21670. }
  21671. UIBox$1.uiName = "UIBox";
  21672. class UIMain$1 extends UIBase {
  21673. constructor() {
  21674. super();
  21675. this.firstEnter = true;
  21676. }
  21677. nativeCallJs(msg) {
  21678. let t = msg;
  21679. console.log("zh: nativeCallJs 奖励开始发放:", t);
  21680. switch (t) {
  21681. case 'qjff_chouJiang':
  21682. let dui = xGame.uiMgr.getUI(UIDraw$1);
  21683. dui.qjff_chouJiang();
  21684. break;
  21685. case 'qjff_AD_for_uisign':
  21686. let dui2 = xGame.uiMgr.getUI(UISign$1);
  21687. dui2.qjff_AD_for_uisign();
  21688. break;
  21689. case 'qjff_AD_for_uitry':
  21690. let dui3 = xGame.uiMgr.getUI(UITry$1);
  21691. dui3.qjff_AD_for_uitry();
  21692. break;
  21693. case 'qjff_AD_for_uipower':
  21694. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  21695. dui4.qjff_AD_for_uipower();
  21696. break;
  21697. case 'qjff_AD_for_uigetAward':
  21698. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  21699. dui5.qjff_AD_for_uigetAward();
  21700. break;
  21701. case 'qjff_AD_for_uiGameEnd':
  21702. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  21703. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  21704. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  21705. break;
  21706. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  21707. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  21708. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  21709. break;
  21710. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  21711. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  21712. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  21713. break;
  21714. case 'qjff_AD_for_UIrepentProp_videoRegret':
  21715. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  21716. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  21717. break;
  21718. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  21719. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  21720. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  21721. break;
  21722. case 'qjff_AD_for_UIBOX_onOpenBox':
  21723. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  21724. dui11.qjff_AD_for_UIBOX_onOpenBox();
  21725. break;
  21726. case 'qjff_AD_for_UIAddCoin':
  21727. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  21728. dui12.qjff_AD_for_UIAddCoin();
  21729. break;
  21730. case '111a':
  21731. let dui14 = xGame.uiMgr.getUI(UISign$1);
  21732. dui14.qjff_AD_for_uisign();
  21733. break;
  21734. case '222a':
  21735. let dui15 = xGame.uiMgr.getUI(UISign$1);
  21736. dui15.qjff_AD_for_uisign();
  21737. break;
  21738. case '333a':
  21739. let dui16 = xGame.uiMgr.getUI(UISign$1);
  21740. dui16.qjff_AD_for_uisign();
  21741. break;
  21742. default:
  21743. console.log('zh:未知的方法名字' + t);
  21744. break;
  21745. }
  21746. }
  21747. onConstructor() {
  21748. console.log('zh: UIMain onConstructor');
  21749. this.ui = ui_UIMain.createInstance();
  21750. this.contentPane = this.ui;
  21751. this.isEject = false;
  21752. this.addEvent();
  21753. this.addClickSpine();
  21754. this.settingNode = new SettingNode$1(this.ui.settingNode);
  21755. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21756. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  21757. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  21758. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  21759. let curUse = DataMgr.getCurSecretary();
  21760. this.changeSecretary(curUse);
  21761. this.ui.talkNode.visible = false;
  21762. let guide = DataMgr.getSkillGuide();
  21763. if (xGame.common.isNewDay && guide == 1) {
  21764. xGame.common.isNewDay = false;
  21765. xGame.soundMgr.playSound("s_main01");
  21766. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21767. console.log("zh:播放小秘书每天语音");
  21768. }
  21769. this.ui.n83.visible = false;
  21770. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  21771. }
  21772. changeSecretary(curUse) {
  21773. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  21774. xGame.common.secretary && xGame.common.secretary.dispose();
  21775. this.addSecretarySpine(name);
  21776. }
  21777. addSecretarySpine(name) {
  21778. let spine = new SpineMgr(name, () => {
  21779. this.playSecretaryIdle();
  21780. });
  21781. xGame.common.secretary = spine;
  21782. }
  21783. addClickSpine() {
  21784. let clickSpine = new SpineMgr("dianji", () => {
  21785. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  21786. let parent = Laya.stage;
  21787. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  21788. clickSpine.play(data, 0, false, parent, (spine) => {
  21789. spine.destroy(true);
  21790. });
  21791. });
  21792. });
  21793. }
  21794. addEvent() {
  21795. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  21796. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  21797. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  21798. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  21799. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  21800. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  21801. this.addUIClick(this.ui, this.interuptSecretary);
  21802. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  21803. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  21804. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  21805. this.addUIClick(this.ui.shopBtn, this.openShopView);
  21806. this.addUIClick(this.ui.signBtn, this.openSignView);
  21807. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  21808. this.addUIClick(this.ui.rankBtn, this.openRanking);
  21809. }
  21810. show(showFailWords) {
  21811. super.show();
  21812. this.moneyNode.ui.c1.selectedIndex = 1;
  21813. this.playSecretaryIdle();
  21814. xGame.soundMgr.playMusic("caromhall01", 0);
  21815. Laya.timer.clearAll(this);
  21816. this.playSecretaryRandomSound();
  21817. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  21818. if (showFailWords) {
  21819. console.log('zh:uimain.ts ');
  21820. setTimeout(() => {
  21821. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  21822. let words = -1;
  21823. if (str == "s_main02") {
  21824. words = 2;
  21825. }
  21826. else {
  21827. words = 3;
  21828. }
  21829. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21830. xGame.soundMgr.playSound(str);
  21831. }, 300);
  21832. }
  21833. this.showGuide();
  21834. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  21835. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  21836. let guide = DataMgr.getSkillGuide();
  21837. if (guide == 1) {
  21838. let randTime = xGame.common.randomNum(300, 800);
  21839. if (this.firstEnter) {
  21840. console.log("zh: firstEnter");
  21841. this.firstEnter = false;
  21842. randTime += 900;
  21843. }
  21844. else {
  21845. console.log("zh: no firstEnter");
  21846. }
  21847. Laya.timer.once(randTime, this, () => {
  21848. xGame.common.autoPopUIView();
  21849. });
  21850. }
  21851. }
  21852. checkActive(show) {
  21853. }
  21854. showGuide() {
  21855. let guide = DataMgr.getSkillGuide();
  21856. this.ui.guideBtn.visible = guide == 0;
  21857. this.ui.enterGuide.visible = false;
  21858. this.ui.secretaryGuide.visible = guide == 0;
  21859. if (guide == 0) {
  21860. console.log("zh:显示引导");
  21861. xGame.soundMgr.playSound("s_guide");
  21862. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21863. }
  21864. else {
  21865. console.log("zh:不需要显示引导");
  21866. }
  21867. }
  21868. ensureSecretary() {
  21869. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  21870. this.ui.secretaryGuide.visible = false;
  21871. this.ui.enterGuide.visible = true;
  21872. this.ui.wordsNode.t0.play();
  21873. if (DataMgr.getNewUser())
  21874. Moyu.sendDataEvent("gameReady");
  21875. }
  21876. playSecretaryIdle() {
  21877. let parent = this.ui.secretary.displayObject;
  21878. parent.destroyChildren();
  21879. let xx = this.ui.secretary.width / 2;
  21880. let yy = this.ui.secretary.height;
  21881. let scale = xGame.common.getSecretaryScale();
  21882. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21883. console.log("zh:playSecretaryIdle", data);
  21884. xGame.common.secretary.play(data, 0, true, parent);
  21885. }
  21886. startGame(type) {
  21887. xGame.common.gameMode = type;
  21888. Moyu.sendDataEvent("PlayGame", { type: type });
  21889. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  21890. switch (xGame.common.gameMode) {
  21891. case GameMode.classic:
  21892. console.log('zh:进入经典模式111111111');
  21893. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  21894. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21895. console.log('zh:classic db_over_lev=', db_over_lev);
  21896. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  21897. console.log('zh:判断是否可以玩该模式classic =NO');
  21898. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  21899. xGame.uiMgr.Show(UIMsg$1, tipStr);
  21900. console.log('zh:返回');
  21901. return;
  21902. }
  21903. else {
  21904. console.log('zh:可以玩该模式classic 66666666666666');
  21905. this.beginGame();
  21906. }
  21907. }
  21908. else {
  21909. console.log('zh:不需要判断是否可以玩该classic');
  21910. let challengeTimes = DataMgr.getChallengeTimes();
  21911. if (challengeTimes == 0) {
  21912. xGame.uiMgr.Show(UIInvitation$1);
  21913. }
  21914. else {
  21915. this.beginGame();
  21916. }
  21917. break;
  21918. }
  21919. case GameMode.bigMove:
  21920. console.error('zh:bigMove check');
  21921. let guide = DataMgr.getSkillGuide();
  21922. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  21923. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21924. console.log('zh:bigMove db_over_lev=', db_over_lev);
  21925. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  21926. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  21927. xGame.uiMgr.Show(UIMsg$1, tipStr);
  21928. return;
  21929. }
  21930. else {
  21931. console.log('zh:可以玩该模式 bigMove');
  21932. this.beginGame();
  21933. if (DataMgr.getNewUser())
  21934. Moyu.sendDataEvent("gameStart0");
  21935. }
  21936. }
  21937. else {
  21938. this.beginGame();
  21939. if (DataMgr.getNewUser())
  21940. Moyu.sendDataEvent("gameStart0");
  21941. }
  21942. break;
  21943. default:
  21944. console.error('zh:未知错误!!!!');
  21945. break;
  21946. }
  21947. }
  21948. beginGame(isNice = false) {
  21949. console.log('zh:beginGame ');
  21950. let guide = DataMgr.getSkillGuide();
  21951. if (guide == 1) {
  21952. console.log('zh:非新手引导,showInternAd ');
  21953. JSBridgeUtils.instance.showInternAd('beginGame');
  21954. }
  21955. else {
  21956. console.log('zh:新手引导,不显示AD ');
  21957. }
  21958. console.log('zh:beginGame 2 go');
  21959. if (xGame.common.gameMode == GameMode.classic) {
  21960. if (isNice) {
  21961. this.enterClassic();
  21962. }
  21963. else {
  21964. xGame.uiMgr.Show(UIModeSelection$1, () => {
  21965. console.log('zh:BBBBBBBBBBBBBBB');
  21966. this.enterClassic();
  21967. });
  21968. }
  21969. }
  21970. else if (xGame.common.gameMode == GameMode.bigMove) {
  21971. this.ui.enterGuide.visible = false;
  21972. xGame.uiMgr.Show(UISkill$1);
  21973. }
  21974. }
  21975. enterClassic() {
  21976. xGame.uiMgr.Show(UIGame$1);
  21977. xGame.uiMgr.Show(UIMatching$1, () => {
  21978. if (!this.isHide)
  21979. this.hide();
  21980. xGame.common.gameUI.ui.alpha = 1;
  21981. xGame.common.gameUI.startGame();
  21982. xGame.uiMgr.Hide(UIGameEnd$1);
  21983. });
  21984. }
  21985. startGlobal() {
  21986. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21987. }
  21988. startWeekly() {
  21989. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21990. }
  21991. zhouSaiMonth() {
  21992. console.log('zh: zhouSaiMonth 被调用');
  21993. }
  21994. startPlaceBall() {
  21995. xGame.uiMgr.Show(UILevelDisplay$1);
  21996. }
  21997. hide() {
  21998. console.log('zh:uimain hide ...');
  21999. super.hide();
  22000. xGame.common.stopGirlPop(this.ui.talkNode);
  22001. }
  22002. onGetUserInfo(force = false) {
  22003. if (Moyu.isWx) {
  22004. let info = Moyu.getSystemInfo();
  22005. if (info)
  22006. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  22007. }
  22008. else {
  22009. Moyu.initUser(this, this.freshUser, force);
  22010. }
  22011. if (!Moyu.hasUserInfo) {
  22012. let user = Moyu.getUserInfo();
  22013. user.headIcon = 'res/ty_touxiang.png';
  22014. }
  22015. this.freshUser();
  22016. }
  22017. freshUser() {
  22018. let user = Moyu.getUserInfo();
  22019. if (!user.isAuth) {
  22020. user.headIcon = 'res/ty_touxiang.png';
  22021. }
  22022. else
  22023. DataMgr.upRankData();
  22024. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  22025. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  22026. }
  22027. interuptSecretary() {
  22028. Laya.timer.clearAll(this);
  22029. this.playSecretaryRandomSound();
  22030. }
  22031. playSecretaryRandomSound() {
  22032. if (this.isHide)
  22033. return;
  22034. let time = xGame.common.randomNum(45000, 60000);
  22035. Laya.timer.once(time, this, () => {
  22036. if (this.isHide)
  22037. return;
  22038. let index = xGame.common.randomNum(4, 7);
  22039. xGame.soundMgr.playSound("s_main0" + index);
  22040. let words = 1;
  22041. switch (index) {
  22042. case 4:
  22043. words = 5;
  22044. break;
  22045. case 5:
  22046. words = 3;
  22047. break;
  22048. case 6:
  22049. words = 6;
  22050. break;
  22051. case 7:
  22052. words = 7;
  22053. break;
  22054. default:
  22055. break;
  22056. }
  22057. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22058. this.playSecretaryRandomSound();
  22059. });
  22060. }
  22061. openSecretaryView() {
  22062. xGame.uiMgr.Show(UISecretary$1);
  22063. Moyu.sendDataEvent("secretary");
  22064. }
  22065. openShopView() {
  22066. xGame.uiMgr.Show(UIShop$1);
  22067. }
  22068. openSignView() {
  22069. xGame.uiMgr.Show(UISign$1);
  22070. }
  22071. openDrawView() {
  22072. xGame.uiMgr.Show(UIDraw$1);
  22073. }
  22074. openRanking() {
  22075. console.log('zh:phb openRanking');
  22076. xGame.uiMgr.Show(UIRanking$1);
  22077. Moyu.sendDataEvent("rankingList");
  22078. }
  22079. }
  22080. UIMain$1.uiName = "UIMain";
  22081. function InitShader() {
  22082. }
  22083. function appInit() {
  22084. xGame.context.init(getLoadingResList(), initCallback);
  22085. }
  22086. function getLoadingResList() {
  22087. return [
  22088. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  22089. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  22090. ];
  22091. }
  22092. function getGameResList() {
  22093. return [
  22094. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  22095. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  22096. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  22097. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  22098. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  22099. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  22100. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  22101. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  22102. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  22103. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  22104. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  22105. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  22106. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  22107. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  22108. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  22109. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  22110. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  22111. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  22112. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  22113. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  22114. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  22115. ];
  22116. }
  22117. function initCallback() {
  22118. window["DataMgr"] = DataMgr;
  22119. DataMgr.Init();
  22120. Moyu.init(getPlat(), this, () => {
  22121. DataMgr.isNewDay();
  22122. PlatMgr.initConfig();
  22123. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  22124. }, true);
  22125. console.log('zh:开始sm init1 start');
  22126. xGame.soundMgr.init();
  22127. console.log('zh:开始sm init1 end');
  22128. xGame.uiMgr.init();
  22129. xGame.uiMgr.clearTempData();
  22130. xGame.uiMgr.bindFUI(fguiRes.loading);
  22131. xGame.uiMgr.Show(UILoading);
  22132. }
  22133. function loadSubRes(callback) {
  22134. var tab = ["asset", "res", "spine"];
  22135. let subDone = 0;
  22136. for (var i = 0; i < tab.length; i++) {
  22137. let sub = tab[i];
  22138. Moyu.loadSubRes(sub, (pro) => {
  22139. callback && callback(pro, false);
  22140. }).then(() => {
  22141. subDone++;
  22142. if (subDone >= tab.length)
  22143. callback && callback(1, true);
  22144. });
  22145. }
  22146. }
  22147. function enterGame() {
  22148. xGame.cfgMgr.init();
  22149. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  22150. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  22151. xGame.uiMgr.Hide(UILoading);
  22152. fgui.UIPackage.removePackage(fguiRes.loading);
  22153. xGame.uiMgr.bindFUI(fguiRes.game);
  22154. xGame.uiMgr.Show(UIMain$1);
  22155. if (DataMgr.getNewUser())
  22156. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  22157. }
  22158. function getPlat() {
  22159. let cfg = new MoyuCfg();
  22160. cfg.plat = MoyuPlat.web;
  22161. cfg.myId = 180;
  22162. cfg.myKey = '8848a885774230a4';
  22163. cfg.version = 0;
  22164. if (window.hasOwnProperty("gamebox")) {
  22165. cfg.plat = MoyuPlat.f399;
  22166. cfg.version = 0;
  22167. }
  22168. else if (window.hasOwnProperty("ks")) {
  22169. cfg.plat = MoyuPlat.ks;
  22170. cfg.version = 0;
  22171. cfg.ads.ksVideoId = '2300002254_01';
  22172. cfg.ads.ksInsertId = '2300002254_02';
  22173. }
  22174. else if (Laya.Browser.onTTMiniGame) {
  22175. cfg.plat = MoyuPlat.tt;
  22176. cfg.version = 0;
  22177. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  22178. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  22179. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  22180. }
  22181. else if (Laya.Browser.onMiniGame) {
  22182. cfg.plat = MoyuPlat.wx;
  22183. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  22184. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  22185. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  22186. }
  22187. else if (Laya.Browser.onQQMiniGame) {
  22188. cfg.plat = MoyuPlat.qq;
  22189. }
  22190. else if (Laya.Browser.onQGMiniGame) {
  22191. cfg.plat = MoyuPlat.op;
  22192. cfg.ads.opVideoId = '455502';
  22193. cfg.ads.opBannerId = '455507';
  22194. }
  22195. else if (Laya.Browser.onVVMiniGame) {
  22196. cfg.plat = MoyuPlat.vv;
  22197. cfg.version = 0;
  22198. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  22199. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  22200. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  22201. }
  22202. else if (Laya.Browser.onHWMiniGame) {
  22203. cfg.plat = MoyuPlat.hw;
  22204. }
  22205. else if (window["mz"]) {
  22206. cfg.plat = MoyuPlat.mz;
  22207. }
  22208. else {
  22209. let cfg = window['conchConfig'];
  22210. if (cfg) {
  22211. var os = cfg.getOS();
  22212. if (os == "Conch-ios") {
  22213. cfg.plat = MoyuPlat.ios;
  22214. }
  22215. else if (os == "Conch-android") {
  22216. }
  22217. }
  22218. }
  22219. return cfg;
  22220. }
  22221. class Main {
  22222. constructor() {
  22223. if (window["Laya3D"])
  22224. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  22225. else {
  22226. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  22227. this.initMain();
  22228. }
  22229. }
  22230. initMain() {
  22231. Laya["Physics"] && Laya["Physics"].enable();
  22232. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  22233. Laya.stage.scaleMode = GameConfig.scaleMode;
  22234. Laya.stage.screenMode = GameConfig.screenMode;
  22235. Laya.stage.alignV = GameConfig.alignV;
  22236. Laya.stage.alignH = GameConfig.alignH;
  22237. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  22238. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  22239. Laya.enableDebugPanel();
  22240. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  22241. Laya["PhysicsDebugDraw"].enable();
  22242. if (GameConfig.stat)
  22243. Laya.Stat.show();
  22244. Laya.alertGlobalError(true);
  22245. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  22246. }
  22247. onVersionLoaded() {
  22248. appInit();
  22249. }
  22250. }
  22251. new Main();
  22252. }());
  22253. //# sourceMappingURL=bundle.js.map