加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
updates.js 228.12 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746
/* Trimps
Copyright (C) 2016 Zach Hood
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program (if you are reading this on the original
author's website, you can find a copy at
<trimps.github.io/license.txt>). If not, see
<http://www.gnu.org/licenses/>. */
var customUp;
var tooltipUpdateFunction = "";
var lastMousePos = [];
var lastTooltipFrom = "";
var onShift;
var openTooltip = null;
//"onmouseover="tooltip('*TOOLTIP_TITLE*', 'customText', event, '*TOOLTIP_TEXT*');" onmouseout="tooltip('hide')""
//in the event of what == 'confirm', numCheck works as a Title! Exciting, right?
function tooltip(what, isItIn, event, textString, attachFunction, numCheck, renameBtn, noHide, hideCancel, ignoreShift) { //Now 20% less menacing. Work in progress.
checkAlert(what, isItIn);
if (game.global.lockTooltip && event != 'update') return;
if (game.global.lockTooltip && isItIn && event == 'update') return;
var elem = document.getElementById("tooltipDiv");
swapClass("tooltipExtra", "tooltipExtraNone", elem);
var ondisplay = null; // if non-null, called after the tooltip is displayed
openTooltip = null;
if (what == "hide"){
elem.style.display = "none";
tooltipUpdateFunction = "";
onShift = null;
return;
}
if ((event != 'update' || isItIn) && !game.options.menu.tooltips.enabled && !shiftPressed && what != "Well Fed" && what != 'Perk Preset' && what != 'Activate Portal' && !ignoreShift) {
var whatU = what, isItInU = isItIn, eventU = event, textStringU = textString, attachFunctionU = attachFunction, numCheckU = numCheck, renameBtnU = renameBtn, noHideU = noHide;
var newFunction = function () {
tooltip(whatU, isItInU, eventU, textStringU, attachFunctionU, numCheckU, renameBtnU, noHideU);
};
onShift = newFunction;
return;
}
if (event != "update"){
var whatU = what, isItInU = isItIn, eventU = event, textStringU = textString, attachFunctionU = attachFunction, numCheckU = numCheck, renameBtnU = renameBtn, noHideU = noHide;
var newFunction = function () {
tooltip(whatU, isItInU, eventU, textStringU, attachFunctionU, numCheckU, renameBtnU, noHideU);
};
tooltipUpdateFunction = newFunction;
}
var tooltipText;
var costText = "";
var toTip;
var titleText;
var tip2 = false;
var noExtraCheck = false;
if (isItIn !== null && isItIn != "maps" && isItIn != "customText" && isItIn != "dailyStack" && isItIn != "advMaps"){
toTip = game[isItIn];
toTip = toTip[what];
if (typeof toTip === 'undefined') console.log(what);
else {
tooltipText = toTip.tooltip;
if (typeof tooltipText === 'function') tooltipText = tooltipText();
if (typeof toTip.cost !== 'undefined') costText = addTooltipPricing(toTip, what, isItIn);
}
}
if (isItIn == "advMaps"){
var advTips = {
Loot: "This slider allows you to fine tune the map Loot modifier. Moving this slider from left to right will guarantee more loot from the map, but increase the cost.",
Size: "This slider allows you to fine tune the map Size modifier. Moving this slider from left to right will guarantee a smaller map, but increase the cost.",
Difficulty: "This slider allows you to fine tune the map Difficulty modifier. Moving this slider from left to right will guarantee an easier map, but increase the cost.",
Biome: "If you're looking to farm something specific, you can select the biome here. Anything other than random will increase the cost of the map.",
get Special_Modifier() {
var text = "<p>Select a special modifier to add to your map from the drop-down below! You can only add one of these to each map. The following bonuses are currently available:</p><ul>"
for (var item in mapSpecialModifierConfig){
var bonusItem = mapSpecialModifierConfig[item];
if (game.global.highestLevelCleared + 1 < bonusItem.unlocksAt){
text += "<li><b>Next modifier unlocks at Z" + bonusItem.unlocksAt + "</b></li>";
break;
}
text += "<li><b>" + bonusItem.name + " (" + bonusItem.abv + ")</b> - " + bonusItem.description + "</li>";
}
return text;
},
Show_Hide_Map_Config: "点击可折叠/展开地图配置选项。",
Save_Map_Settings: "点击此按钮保存您当前的地图配置设置。 每次进入地图室时,这些设置都会默认加载。",
Reset_Map_Settings: "点击此按钮将所有设置重置为默认位置。 这将不会清除您保存的设置,下次您进入地图室时仍然会将其加载。",
Extra_Zones: "<p>Create a map up to 10 zones higher than your current zone number. This map will gain +10% loot per extra level (compounding), and can drop Prestige upgrades higher than you could get from a world level map.</p><p>You can only use this setting when creating a max level map.</p>",
Perfect_Sliders: "<p>This option takes all of the RNG out of map generation! If sliders are maxxed and the box is checked, you have a 100% chance to get a perfect roll on Loot, Size, and Difficulty.</p><p>You can only choose this setting if the sliders for Loot, Size, and Difficulty are at the max.</p>",
Map_Preset: "You can save up to 3 different map configurations to switch between at will. The most recently selected setting will load each time you enter your map chamber."
}
if (what == "Special Modifier" && game.global.highestLevelCleared >= 149) {
swapClass("tooltipExtra", "tooltipExtraLg", elem);
renameBtn = "forceLeft";
}
noExtraCheck = true;
tooltipText = advTips[what.replace(/ /g, '_').replace(/\//g, '_')];
}
if (isItIn == "dailyStack"){
tooltipText = dailyModifiers[what].stackDesc(game.global.dailyChallenge[what].strength, game.global.dailyChallenge[what].stacks);
costText = "";
what = what[0].toUpperCase() + what.substr(1)
}
if (what == "Confirm Purchase"){
if (attachFunction == "purchaseImport()" && !boneTemp.selectedImport) return;
if (game.options.menu.boneAlerts.enabled == 0 && numCheck){
eval(attachFunction);
return;
}
var btnText = "购买";
if (numCheck && game.global.b < numCheck){
if (typeof kongregate === 'undefined') return;
tooltipText = "你付不起这笔奖金。你想去参观商店吗?";
attachFunction = "showPurchaseBones()";
btnText = "访问商店";
}
else
tooltipText = textString;
costText += '<div class="maxCenter"><div id="confirmTooltipBtn" class="btn btn-info" onclick="' + attachFunction + '; cancelTooltip()">' + btnText + '</div><div class="btn btn-info" onclick="cancelTooltip()">取消</div></div>';
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "脆皮信息"){
var kongMode = (document.getElementById('boneBtn') !== null);
var text = '<div class="trimpsInfoPopup">需要帮助,发现错误或者只想谈谈脆皮? 请访问 <a href="https://www.reddit.com/r/trimps" target="_blank">脆皮论坛</a>';
if (kongMode) text += ' 或者 <a href="https://www.kongregate.com/forums/11405-trimps" target="_blank">Kongregate论坛</a>.<br/><br/>';
else text +=' 或者来新挂出去的 <a href="https://discord.gg/kSpNHte" target="_blank">脆皮官方</a>!<br/><br/>';
text += ' 如果你想阅读或讨论脆皮力学的更详细的细节,请访问 <a href="https://trimps.wikia.com/wiki/Trimps_Wiki" target="_blank">社区创建的脆皮Wiki!</a><br/><br/>';
if (kongMode) text += ' 如果您出于任何原因需要联系开发人员, <a target="_blank" href="https://www.kongregate.com/accounts/Greensatellite/private_messages?focus=true">发送一条悄悄话给GreenSatellite</a> 在Kongregate.';
else text += ' 如果您出于任何原因需要联系开发人员, <a href="https://www.reddit.com/message/compose/?to=Brownprobe" target="_blank">点击这里在Reddit上发送消息</a> 或在脆皮Discord中找到GreenSatellite。<hr/><br/>' + "如果您想捐款来帮助支持脆皮的发展,现在可以使用PayPal来实现这一点! 如果你想捐助,但无法承担捐款,你仍然可以通过加入社区,分享你的反馈意见或帮助他人。 谢谢你,你太棒了! <form id='donateForm' style='text-align: center' action='https://www.paypal.com/cgi-bin/webscr' method='post' target='_blank'><input type='hidden' name='cmd' value='_s-xclick'><input type='hidden' name='hosted_button_id' value='MGFEJS3VVJG6U'><input type='image' src='https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif' border='0' name='submit' alt='PayPal - The safer, easier way to pay online!'><img alt='' border='0' src='https://www.paypalobjects.com/en_US/i/scr/pixel.gif' width='1' height='1'></form>";
text += '</div>';
tooltipText = text;
costText = '<div class="btn btn-info" onclick="cancelTooltip()">关闭</div>';
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
noExtraCheck = true;
}
if (what == "Fluffy"){
if (event == 'update'){
//clicked
game.global.lockTooltip = true;
elem.style.top = "25%";
elem.style.left = "25%";
swapClass('tooltipExtra', 'tooltipExtraLg', elem);
tooltipText = Fluffy.tooltip(true);
costText = '<div class="btn btn-danger" onclick="cancelTooltip()">Close</div>';
openTooltip = "Fluffy";
setTimeout(Fluffy.refreshTooltip, 1000);
ondisplay = function(){
verticalCenterTooltip(true);
};
}
else {
//mouseover
tooltipText = Fluffy.tooltip();
costText = "Click for more detailed info"
}
}
if (what == "Empowerments of Nature"){
var active = getEmpowerment();
if (!active) return;
var emp = game.empowerments[active];
if (typeof emp.description === 'undefined') return;
var lvlsLeft = ((5 - ((game.global.world - 1) % 5)) + (game.global.world - 1)) + 1;
tooltipText = "<p>The " + active + " Empowerment is currently active!</p><p>" + emp.description() + "</p><p>This Empowerment will end on Z" + lvlsLeft + ", at which point you'll be able to fight a " + getEmpowerment(null, true) + " enemy to earn a Token of " + active + ".</p>";
costText = "";
}
if (what == "Finish Daily"){
var value = getDailyHeliumValue(countDailyWeight()) / 100;
var reward = game.resources.helium.owned + game.stats.spentOnWorms.value;
if (reward > 0) reward = Math.floor(reward * value);
tooltipText = "Clicking <b>Finish</b> below will end your daily challenge and you will be unable to attempt it again. You will earn <b>" + prettify(reward) + " extra Helium!</b>";
costText = '<div class="maxCenter"><div id="confirmTooltipBtn" class="btn btn-info" onclick="abandonChallenge(); cancelTooltip()">Finish</div><div class="btn btn-danger" onclick="cancelTooltip()">Cancel</div></div>';
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Switch Daily"){
var daysUntilReset = Math.floor(7 + textString);
tooltipText = "Click to view " + ((textString == 0) ? "today" : dayOfWeek(getDailyTimeString(textString, false, true))) + "s challenge, which resets in less than " + daysUntilReset + " day" + ((daysUntilReset == 1) ? "" : "s") + ".";
costText = "";
}
if (what == "Decay"){
var decayedAmt = ((1 - Math.pow(0.995, game.challenges.Decay.stacks)) * 100).toFixed(2);
tooltipText = "Things are quickly becoming tougher. Gathering, looting, and Trimp attack are reduced by " + decayedAmt + "%.";
costText = "";
}
if (what == "Heirloom"){
//attachFunction == location, numCheck == index
tooltipText = displaySelectedHeirloom(false, 0, true, numCheck, attachFunction)
costText = "";
renameBtn = what;
what = "";
swapClass("tooltipExtra", "tooltipExtraHeirloom", elem);
noExtraCheck = true;
}
if (what == "Respec"){
tooltipText = "您可以为每个传送门重新分配一次。 点击此按钮后点击取消将不会消耗您的洗点。";
costText = "";
}
if (what == "Well Fed"){
var tBonus = 50;
if (game.talents.turkimp4.purchased) tBonus = 100;
else if (game.talents.turkimp3.purchased) tBonus = 75;
tooltipText = "这Turkimp很可口,你有剩菜。 如果你设置自己收集食物,木头,或金属,而这个buff是积极的,你可以与你的工人分享,以提高他们的收集速度 " + tBonus + "%";
costText = "";
}
if (what == "Geneticistassist"){
tooltipText = "我是你的遗传学家! 我会雇用和解雇遗传学家,直到您的总繁殖时间尽可能接近您选择的目标时间。 如果没有足够的工作空间,我将随机发射一个农夫,伐木工人或矿工,我永远不会在遗传学家身上花费超过1%的食物,并且可以在设置中自定义我的目标时间选项 <b>或者按住Ctrl键并点击我</b>. 我已经上传自己的传送门,将永远不会离开你。";
costText = "";
}
if (what == "欢迎"){
tooltipText = "欢迎来到脆皮! 这个游戏会在浏览器中使用本地存储保存游戏进度。 清除您的Cookie或浏览器设置将导致您的游戏进度消失! 请确保您通过使用下面的栏中的“导出”按钮或“设置”下的“在线保存”选项来定期备份保存文件。<br/> <br/> <b> Chrome和Firefox目前是 唯一完全支持的浏览器。</ b> <br/> <b>您是否希望在开始之前启用在线保存?</b><br/><br/>";
if (document.getElementById('boneBtn') !== null){
tooltipText += "<b style='color: red'>注意:你期望在这里看到你的保存?</b><br/>如果这是你从2017 11月13日开始的第一次游戏,请检查 <a target='_blank' href='http://trimps.github.io'>http://trimps.github.io</a> (确定你用的是 http, 不是 https), 看看它在不在那里。有关更多信息,请参见 <a target='_blank' href='http://www.kongregate.com/forums/11406-general-discussion/topics/941201-if-your-save-is-missing-after-november-13th-click-here?page=1#posts-11719541'>这个论坛主题</a>.<br/><br/>";
}
tooltipText += "<b>您希望在开始之前启用在线存储吗?</b>";
game.global.lockTooltip = true;
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip(); toggleSetting(\"usePlayFab\");'>启用在线保存</div><div class='btn btn-danger' onclick='cancelTooltip()'>不启用</div></div>";
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "守信的脆皮"){
tooltipText = textString;
game.global.lockTooltip = true;
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>好的,谢谢。</div></div>";
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Configure AutoStructure"){
tooltipText = "<p>Here you can choose which structures will be automatically purchased when AutoStructure is toggled on. Check a box to enable the automatic purchasing of that structure, set the dropdown to specify the cost-to-resource % that the structure should be purchased below, and set the 'Up To:' box to the maximum number of that structure you'd like purchased <b>(0&nbsp;for&nbsp;no&nbsp;limit)</b>. For example, setting the dropdown to 10% and the 'Up To:' box to 50 for 'House' will cause a House to be automatically purchased whenever the costs of the next house are less than 10% of your Food, Metal, and Wood, as long as you have less than 50 houses.</p><table id='autoStructureConfigTable'><tbody><tr>";
var count = 0;
for (var item in game.buildings){
var building = game.buildings[item];
if (!building.AP) continue;
if (count != 0 && count % 2 == 0) tooltipText += "</tr><tr>";
var setting = game.global.autoStructureSetting[item];
var selectedPerc = (setting) ? setting.value : 0.1;
var checked = (setting && setting.enabled) ? "checked='true' " : "";
var options = "<option value='0.1'" + ((selectedPerc == 0.1) ? " selected" : "") + ">0.1%</option><option value='1'" + ((selectedPerc == 1) ? " selected" : "") + ">1%</option><option value='5'" + ((selectedPerc == 5) ? " selected" : "") + ">5%</option><option value='10'" + ((selectedPerc == 10) ? " selected" : "") + ">10%</option><option value='25'" + ((selectedPerc == 25) ? " selected" : "") + ">25%</option>";
tooltipText += "<td><div class='row'><div class='col-xs-5' style='padding-right: 5px'><input id='structConfig" + item + "' " + checked + "class='structConfigCheckbox' type='checkbox' />&nbsp;&nbsp;<span>" + item + "</span></div><div style='text-align: center; padding-left: 0px;' class='col-xs-2'><select id='structSelect" + item + "'>" + options + "</select></div><div class='col-xs-5 lowPad' style='text-align: right'>Up To: <input class='structConfigQuantity' id='structQuant" + item + "' type='number' value='" + ((setting && setting.buyMax) ? setting.buyMax : 0 ) + "'/></div></div></td>";
count++;
}
if (game.global.highestLevelCleared >= 229){
var nurserySetting = (typeof game.global.autoStructureSetting.NurseryZones !== 'undefined') ? game.global.autoStructureSetting.NurseryZones : 1;
tooltipText += "</tr><tr><td>&nbsp;</td><td><div class='row'><div class='col-xs-12' style='text-align: right; padding-right: 5px;'>Don't buy Nurseries Until Z: <input style='width: 20.8%; margin-right: 4%;' class='structConfigQuantity' id='structZoneNursery' type='number' value='" + nurserySetting + "'></div></div></td>";
}
tooltipText += "</tr></tbody></table>";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='saveAutoStructureConfig()'>Apply</div><div class='btn btn-danger' onclick='cancelTooltip()'>Cancel</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
ondisplay = function(){
verticalCenterTooltip(true);
};
}
if (what == "AutoStructure"){
tooltipText = "<p>Your mastery of this world has enabled your Foremen to handle fairly complicated orders regarding which buildings should be built. Click the cog icon on the right side of this button to tell your Foremen what you want and when you want it, then click the left side of the button to tell them to start or stop.</p>";
costText = "";
}
if (what == "AutoGolden"){
tooltipText = '<p>Thanks to your brilliant Scientists, you can designate Golden Upgrades to be purchased automatically! Toggle between: </p><p><b>自动黄金关闭</b> when you\'re not feeling particularly trusting.</p><p><b>AutoGolden Helium (' + game.goldenUpgrades.Helium.purchasedAt.length + '/' + Math.round(game.goldenUpgrades.Helium.currentBonus * 100) + '%)</b> when you\'re looking to boost your Perk game. 4/5 Trimps agree that this will increase your overall Helium earned, though none of the 5 really understood the question.</p><p><b>AutoGolden Battle (' + game.goldenUpgrades.Battle.purchasedAt.length + '/' + Math.round(game.goldenUpgrades.Battle.currentBonus * 100) + '%)</b> if your Trimps have a tendency to slack off when you turn your back.</p><p><b>AutoGolden Void (' + game.goldenUpgrades.Void.purchasedAt.length + '/' + Math.round(game.goldenUpgrades.Void.currentBonus * 100) + '%)</b> if you need some more purple in your life. This is your Trimps\' least favorite choice, but it\'s pretty lucrative so...</p><p>Please allow 4 seconds for Trimp retraining after clicking this button before any Golden Upgrades are automatically purchased, and don\'t forget to frequently thank your scientists! Seriously, they get moody.</p>';
costText = "";
}
if (what == "Unliving"){
var stacks = game.challenges.Life.stacks;
var mult = game.challenges.Life.getHealthMult(true);
if (stacks > 130) tooltipText = "Your Trimps are looking quite dead, which is very healthy in this dimension. You're doing a great job!";
else if (stacks > 75) tooltipText = "Your Trimps are starting to look more lively and slow down, but at least they're still fairly pale.";
else if (stacks > 30) tooltipText = "The bad guys in this dimension seem to be way more dead than your Trimps!";
else tooltipText = "Your Trimps look perfectly normal and healthy now, which is not what you want in this dimension.";
tooltipText += " <b>Trimp attack and health increased by " + mult + ".</b>";
costText = "";
}
if (what == "AutoGolden Unlocked"){
tooltipText = "<p>Your Trimps have extracted and processed hundreds of Golden Upgrades by now, and though you're still nervous to leave things completely to them, you figure they can probably handle doing this on their own as well. You find the nearest Trimp and ask if he could handle buying Golden Upgrades on his own, as long as you told him which ones to buy. You can tell by the puddle of drool rapidly gaining mass at his feet that this is going to take either magic or a lot of hard work.</p><p>You can't find any magic anywhere, so you decide to found Trimp University, a school dedicated to teaching Trimps how to extract the might of Golden Upgrades without any assistance. Weeks go by while you and your Trimps work tirelessly to set up the University, choosing only the finest building materials and hiring only the most renowned Foremen to draw the plans. Just as you're finishing up, a Scientist stops by, sees what you're doing, and offers to just handle the Golden Upgrades instead. Probably should have just asked one of them first.</p><p><b>You have unlocked AutoGolden!</b></p>";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='cancelTooltip()'>关闭</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Poisoned"){
tooltipText = "This enemy is harmed by the Empowerment of Poison, and is taking " + prettify(game.empowerments.Poison.currentDebuffPower) + " extra damage per turn.";
costText = "";
}
if (what == "Chilled"){
tooltipText = "This enemy has been chilled by the Empowerment of Ice, is taking " + prettify((1 - game.empowerments.Ice.getCombatModifier()) * 100) + "% more damage, and is dealing " + prettify((1 - game.empowerments.Ice.getCombatModifier()) * 100) + "% less damage with each normal attack.";
costText = "";
}
if (what == "Breezy"){
var heliumText = (!game.global.mapsActive)? "increasing all Helium gained by " + prettify(game.empowerments.Wind.getCombatModifier() * 100) + "% and all other" : "increasing all non-Helium ";
tooltipText = "There is a rather large amount of Wind swelling around this enemy, " + heliumText + " resources by " + prettify(game.empowerments.Wind.getCombatModifier() * 1000) + "%.";
costText = "";
}
if (what == "Perk Preset"){
if (textString == "Save"){
what = "保存额外福利预设";
tooltipText = "点击把你当前的额外福利放在选定的预设值上";
}
else if (textString == "Rename"){
what = "重命名额外福利预设";
tooltipText = "点击为当前选中的额外福利设置一个名称";
}
else if (textString == "Load"){
what = "加载额外福利预设";
tooltipText = "点击载入当前选中的额外福利预设。";
if (!game.global.respecActive) tooltipText += " <p class='red'>您必须有相应的激活才能加载预置!</p>";
}
else if (textString == "Import"){
what = "Import Perk Preset";
tooltipText = "Click to import a perk setup from a text string";
}
else if (textString == "Export"){
what = "Export Perk Setup";
tooltipText = "Click to export a copy of your current perk setup to share with friends, or to save and import later!"
}
else if (textString > 0 && textString <= 3){
var preset = game.global["perkPreset" + textString];
if (typeof preset === 'undefined') return;
what = (preset.Name) ? "预设: " + preset.Name : "预设 " + textString;
if (isObjectEmpty(preset)){
tooltipText = "<span class='red'>这个预设槽是空的!</span> 选择这个插槽,然后点击“保存”,将当前的额外福利配置保存到这个槽中。只要您愿意,您就可以随时加载该配置,只要您有您的响应。";
}
else{
tooltipText = "<p style='font-weight: bold'>这种预设:</p>";
var count = 0;
for (var item in preset){
if (item == "Name") continue;
tooltipText += (count > 0) ? ", " : "";
tooltipText += '<b>' + cntequan(item.replace('_', ' ')) + ":</b>&nbsp;" + preset[item];
count++;
}
}
}
}
if (what == "Rename Preset"){
what == "Rename Preset " + selectedPreset;
tooltipText = "为你的额外福利预设输入一个名字!这个名字会出现在预设的栏中,并且很容易识别哪个预设是哪个。"
if (textString) tooltipText += " <b>额外福利最多可以达到 1,000。</b>";
var preset = game.global["perkPreset" + selectedPreset];
var oldName = (preset && preset.Name) ? preset.Name : "";
tooltipText += "<br/><br/><input id='renamePresetBox' maxlength='25' style='width: 50%' value='" + oldName + "' />";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='renamePerkPreset()'>确认</div><div class='btn btn-info' onclick='cancelTooltip()'>取消</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
ondisplay = function() {
var box = document.getElementById("renamePresetBox");
// Chrome chokes on setSelectionRange on a number box; fall back to select()
try { box.setSelectionRange(0, box.value.length); }
catch (e) { box.select(); }
box.focus();
};
noExtraCheck = true;
}
if (what == "UnlockedChallenge2"){
what = "Unlocked Challenge<sup>2</sup>";
tooltipText = "You hear some strange noises behind you and turn around to see three excited scientists. They inform you that they've figured out a way to modify The Portal to take you to a new type of challenging dimension, a system they proudly call 'Challenge<sup>2</sup>'. You will be able to activate and check out their new technology by clicking the 'Challenge<sup>2</sup>' button next time you go to use The Portal.";
game.global.lockTooltip = true;
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>Thanks, Scientists</div></div>";
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Eggs"){
tooltipText = '<span class="eggMessage">It seems as if some sort of animal has placed a bunch of brightly colored eggs in the world. If you happen to see one, you can click on it to send a Trimp to pick it up! According to your scientists, they have a rare chance to contain some neat stuff, but they will not last forever...</span>';
game.global.lockTooltip = true;
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>I'll keep an eye out.</div></div>";
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Portal"){
tooltipText = "你找到的传送门装置在实验室里闪着绿光。 多么熟悉的画面...";
costText = "";
}
if (what == "Repeat Map"){
tooltipText = "允许异形们自己找到回广场的路,一旦他们在没有你的帮助下完成过后。他们成长的如此之快!<br/><br/>如果您<b>不</ b>重复,地图结束后,您当前的脆皮组将不会被放弃。 (热键:R)";
costText = "";
}
if (what == "Challenge2"){
what = "挑战<sup>2</sup>";
tooltipText = "";
if (!textString)
tooltipText = "<p>单击以切换到挑战模式,迎接您的挑战!</p>";
tooltipText += "<p>在挑战<sup>2</sup> 模式中, you can re-run some challenges in order to earn a permanent attack, health, and Helium bonus for your Trimps. MOST Challenge<sup>2</sup>s will grant <b>" + squaredConfig.rewardEach + "% attack and health and " + prettify(squaredConfig.rewardEach / 10) + "% increased Helium for every " + squaredConfig.rewardFreq + " zones reached. Every " + squaredConfig.thresh + " zones, the attack and health bonus will increase by an additional 1%, and the Helium bonus will increase by 0.1%</b>. This bonus is additive with all available Challenge<sup>2</sup>s, and your highest zone reached for each challenge is saved and used.</p><p><b>No Challenge<sup>2</sup>s end at any specific zone</b>, they can only be completed by using your portal or abandoning through the 'View Perks' menu. However, <b>no Helium can drop, and no bonus Helium will be earned during or after the run</b>. Void Maps will still drop heirlooms, and all other currency can still be earned.</p><p>You are currently gaining " + prettify(game.global.totalSquaredReward) + "% extra attack and health, and are gaining " + prettify(game.global.totalSquaredReward / 10) + "% extra Helium thanks to your Challenge<sup>2</sup> bonus.</p>";
if (game.talents.headstart.purchased) tooltipText += "<p><b>Note that your Headstart mastery will be disabled during Challenge<sup>2</sup> runs.</b></p>";
costText = "";
}
if (what == "Geneticistassist Settings"){
if (isItIn == null){
geneMenuOpen = true;
elem = document.getElementById('tooltipDiv2');
tip2 = true;
var steps = game.global.GeneticistassistSteps;
tooltipText = "<div id='GATargetError'></div><div>Customize the target thresholds for your Geneticistassist! Use a number between 0.5 and 60 seconds for all 3 boxes. Each box corresponds to a Geneticistassist toggle threshold.</div><div style='width: 100%'><input class='GACustomInput' id='target1' value='" + steps[1] + "'/><input class='GACustomInput' id='target2' value='" + steps[2] + "'/><input class='GACustomInput' id='target3' value='" + steps[3] + "'/><hr class='noBotMarg'/><div class='maxCenter'>" + getSettingHtml(game.options.menu.gaFire, 'gaFire') + getSettingHtml(game.options.menu.geneSend, 'geneSend') + "</div><hr class='noTopMarg'/><div id='GADisableCheck'><input type='checkbox'" + ((game.options.menu.GeneticistassistTarget.disableOnUnlock) ? " checked='true'" : "") + "' id='disableOnUnlockCheck' />&nbsp;Start disabled when unlocked each run</div></div>";
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='customizeGATargets();'>Confirm</div> <div class='btn btn-danger' onclick='cancelTooltip()'>Cancel</div>"
elem.style.left = "33.75%";
elem.style.top = "25%";
}
}
if (what == "Configure Maps"){
if (isItIn == null){
geneMenuOpen = true;
elem = document.getElementById('tooltipDiv2');
tip2 = true;
var steps = game.global.GeneticistassistSteps;
tooltipText = "<div id='GATargetError'></div><div>Customize your settings for running maps!</div>";
tooltipText += "<hr class='noBotMarg'/><div class='maxCenter'>"
var settingCount = 0;
if (game.global.totalPortals >= 1) {
tooltipText += getSettingHtml(game.options.menu.mapLoot, 'mapLoot', null, "CM");
settingCount++;
}
if (game.global.totalPortals >= 5){
tooltipText += getSettingHtml(game.options.menu.repeatVoids, 'repeatVoids', null, "CM");
settingCount++;
}
if (settingCount % 2 == 0) tooltipText += "<br/><br/>";
tooltipText += '<div class="optionContainer"><div class="noselect settingsBtn ' + ((game.global.repeatMap) ? "settingBtn1" : "settingBtn0") + '" id="repeatBtn2" onmouseover="tooltip(\'Repeat Map\', null, event)" onmouseout="tooltip(\'hide\')" onclick="repeatClicked()">' + ((game.global.repeatMap) ? "Repeat On" : "Repeat Off") + '</div></div>';
settingCount++;
if (settingCount % 2 == 0) tooltipText += "<br/><br/>";
tooltipText += getSettingHtml(game.options.menu.repeatUntil, 'repeatUntil', null, "CM");
settingCount++;
if (settingCount % 2 == 0) tooltipText += "<br/><br/>";
tooltipText += getSettingHtml(game.options.menu.exitTo, 'exitTo', null, "CM")
settingCount++;
if (game.options.menu.mapsOnSpire.lockUnless()){
if (settingCount % 2 == 0) tooltipText += "<br/><br/>";
tooltipText += getSettingHtml(game.options.menu.mapsOnSpire, 'mapsOnSpire', null, "CM");
settingCount++;
}
if (game.global.canMapAtZone){
if (settingCount % 2 == 0) tooltipText += "<br/><br/>";
tooltipText += getSettingHtml(game.options.menu.mapAtZone, 'mapAtZone', null, "CM");
settingCount++;
}
tooltipText += "</div>";
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip();'>Close</div></div>"
elem.style.left = "33.75%";
elem.style.top = "25%";
}
}
if (what == "Set Map At Zone"){
tooltipText = "Enter a number between 10 and 1000. Next time you reach this Zone number, you will automatically be pulled into the Map Chamber.<div id='mapAtZoneErrorText'></div><br/><br/><input id='mapAtZoneInput' value='" + game.options.menu.mapAtZone.setZone + "'/>";
costText = "<div class='maxCenter'><span class='btn btn-success btn-md' id='confirmTooltipBtn' onclick='saveMapAtZone()'>Confirm</span><span class='btn btn-danger btn-md' onclick='cancelTooltip(true)'>Cancel</span>"
game.global.lockTooltip = true;
elem.style.top = "25%";
elem.style.left = "25%";
}
if (what == "Message Config"){
tooltipText = "<div id='messageConfigMessage'>在这里,你可以微调你的消息设置,只看到你想要从每个类别。 将鼠标悬停在过滤器的名称上以获取更多信息。</div>";
var msgs = game.global.messages;
var toCheck = ["Loot", "Unlocks", "Combat"];
tooltipText += "<div class='row'>";
for (var x = 0; x < toCheck.length; x++){
var name = toCheck[x];
tooltipText += "<div class='col-xs-4'><span class='messageConfigTitle'>" + cnwhat(toCheck[x]) + "</span><br/>";
for (var item in msgs[name]){
if (item == "essence" && game.global.highestLevelCleared < 179) continue;
if (item == "magma" && game.global.highestLevelCleared < 229) continue;
if (item == "cache" && game.global.highestLevelCleared < 59) continue;
if (item == "token" && game.global.highestLevelCleared < 235) continue;
if (item == 'enabled') continue;
tooltipText += "<span class='messageConfigContainer'><span class='messageCheckboxHolder'><input id='" + name + item + "'" + ((msgs[name][item]) ? " checked='true'" : "") + "' type='checkbox' /></span><span onmouseover='messageConfigHover(\"" + name + item + "\", event)' onmouseout='tooltip(\"hide\")' class='messageNameHolder'> - " + cnitems(item) + "</span></span><br/>";
// item.charAt(0).toUpperCase() + item.substr(1)
}
tooltipText += "</div>";
}
tooltipText += "</div>";
ondisplay = function () {verticalCenterTooltip();};
game.global.lockTooltip = true;
elem.style.top = "25%";
elem.style.left = "25%";
swapClass('tooltipExtra', 'tooltipExtraLg', elem);
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip();configMessages();'>确定</div> <div class='btn btn-danger' onclick='cancelTooltip()'>取消</div>"
}
if (isItIn == "goldenUpgrades"){
var upgrade = game.goldenUpgrades[what];
var timesPurchased = upgrade.purchasedAt.length
var s = (timesPurchased == 1) ? "" : "s";
var three = (game.global.totalPortals >= 5) ? "three" : "two";
tooltipText += " <b>你只能选择其中之一 " + three + " 黄金升级。 做出明智的选择...</b><br/><br/> 黄金升级每解锁一次,他们的实力就会增加。 你正在获得 " + Math.round(upgrade.currentBonus * 100) + "% 从购买这个升级 " + timesPurchased + "" + s + " 从你上一个传送门。";
if (what == "Void" && (parseFloat((game.goldenUpgrades.Void.currentBonus + game.goldenUpgrades.Void.nextAmt()).toFixed(2)) > 0.60)) tooltipText += "<br/><br/><b class='red'>这个升级会让你超过60%的虚空地图机会,这会破坏宇宙的稳定。 你不想破坏宇宙,是吗?</b>";
if (what == "Helium" && game.global.runningChallengeSquared) tooltipText += "<br/><br/><b class='red'>运行挑战时无法获得氦气<sup>2</sup>!</b>";
costText = "免费";
if (getAvailableGoldenUpgrades() > 1) costText += " (" + getAvailableGoldenUpgrades() + " 剩余)";
what = "Golden " + what + " (Tier " + romanNumeral(game.global.goldenUpgrades + 1) + ")";
}
if (isItIn == "talents"){
var talent = game.talents[what];
tooltipText = talent.description;
var nextTalCost = getNextTalentCost();
if (getHighestTalentTier() < talent.tier) costText = "<span style='color: red'>未解锁</span>";
else if (typeof talent.requires !== 'undefined' && !game.talents[talent.requires].purchased)
costText = "<span style='color: red'>需要 " + game.talents[talent.requires].name + "</span>";
else if (talent.purchased)
costText = "<span style='color: green'>购买</span>";
else if (game.global.essence < nextTalCost)
costText = "<span style='color: red'>" + prettify(nextTalCost) + " 黑暗精华 (使用战利品赚取更多)</span>";
else costText = prettify(nextTalCost) + " 黑暗精华";
what = talent.name;
}
if (what == "The Improbability"){
if (!game.options.menu.bigPopups.enabled) return;
tooltipText = "<span class='planetBreakMessage'>这不应该发生。 这里应该是一个飞艇那里。 有些东西变得不稳定。</span>";
if (!game.global.autoUpgradesAvailable) tooltipText += "<br/><br/><span class='planetBreakMessage'><b>你的脆皮似乎明白,他们需要更多的帮助,并且你意识到如何永久使用它们来自动升级!<b></span><br/>";
costText = "<span class='planetBreakDescription'><span class='bad'>脆皮品种速度降低10倍。目前20%的敌人伤害可以穿透你的区域。</span><span class='good'> 你已经解锁了一个新的升级来学习一个队伍。 每个区域收获的氦气增加了5倍。设备成本大幅降低。 现在创建修改过的地图便宜了,而且您的科学家已经找到了改进地图的新方法! 您可以访问“脆皮”挑战!<span></span>";
if (game.global.challengeActive == "Corrupted") costText += "<br/><br/><span class='corruptedBadGuyName'>看起来腐败早就开始了...</span>";
costText += "<hr/><div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>我会没事儿的</div><div class='btn btn-danger' onclick='cancelTooltip(); message(\"Sorry\", \"Notices\")'>I'm Scared</div></div>"
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Corruption"){
if (!game.options.menu.bigPopups.enabled && game.global.highestLevelCleared >= 199) return;
if (game.global.challengeActive == "Corrupted"){
tooltipText = "<span class='planetBreakMessage'>Though you've seen the Corruption grow since the planet broke, you can now see a giant spire pumping out tons of the purple goo. Things seem to be absorbing it at a higher rate now.</span><br/>";
costText += "<span class='planetBreakDescription'><span class='bad'>Improbabilities and Void Maps are now more difficult.</span> <span class='good'>Improbabilities and Void Maps now drop 2x helium.</span></span>";
}
else {
tooltipText = (game.talents.headstart.purchased) ? "Off in the distance, you can see a giant spire grow larger as you approach it." : "You can now see a giant spire only about 20 zones ahead of you.";
tooltipText = "<span class='planetBreakMessage'>" + tooltipText + " Menacing plumes of some sort of goopy gas boil out of the spire and appear to be tainting the land even further. It looks to you like the zones are permanently damaged, poor planet. You know that if you want to reach the spire, you'll have to deal with the goo.</span><br/>";
costText = "<span class='planetBreakDescription'><span class='bad'>From now on as you press further through zones, more and more corrupted cells of higher and higher difficulty will begin to spawn. Improbabilities and Void Maps are now more difficult.</span> <span class='good'>Improbabilities and Void Maps now drop 2x helium. Each corrupted cell will drop 15% of that zone's helium reward.</span></span> ";
}
costText += "<hr/><div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>Bring it on</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Spire"){
if (!game.options.menu.bigPopups.enabled && game.global.highestLevelCleared >= 219) return;
tooltipText = "<span class='planetBreakMessage'>The Spire looms menacingly above you, and you take in a deep breath of corruption. You take a look back at your Trimps to help gather some courage, and you push the door open. You slowly walk inside and are greeted by an incredibly loud, deep, human voice.<br/><br/><b>Do you know what you face? If you are defeated ten times in this place, you shall be removed from this space. If you succeed, then you shall see the light of knowledge that you seek.</b><span>";
tooltipText += "<br/><hr/><span class='planetBreakDescription'><span class='bad'>This zone is considerably more difficult than the previous and next zones. If 10 groups of Trimps die in combat while in the spire, the world will return to normal.</span> <span class='good'>Each cell gives more and more helium. Every 10th cell gives a larger reward, and increases all loot gained until your next portal by 2% (including helium).</span>";
if (game.options.menu.mapsOnSpire.enabled) tooltipText += "<br/><hr/>You were moved to Maps to protect your limited chances at the spire. You can disable this in settings!";
costText = "<div class='maxCenter'><div class='btn btn-info' onclick='startSpire(true)'>Bring it on</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "The Magma"){
if (!game.options.menu.bigPopups.enabled && game.global.highestLevelCleared >= 249) return;
tooltipText = "<p>You stumble across a large locked chest, unlike anything you've ever seen. The lock looks rusty, you smack it with a rock, and it falls right off. Immediately the ground shakes and cracks beneath your feet, intense heat hits your face, and Magma boils up from the core.</p><p>Where one minute ago there was dirt, grass, and noxious fog, there are now rivers of molten rock (and noxious fog). You'd really like to try and repair the planet somehow, so you decide to keep pushing on. It's been working out well so far, there was some useful stuff in that chest!</p><hr/>";
tooltipText += "<span class='planetBreakDescription'><span class='bad'>The heat is tough on your Trimps, causing each zone to reduce their attack and health by 20% more than the last. 10% of your Nurseries will permanently close after each zone to avoid Magma flows, and Corruption has seeped into both Void and regular Maps, further increasing their difficulty. </span><span class='good'> However, the chest contained plans and materials for the <b>Dimensional Generator</b> building, <b>" + prettify(textString) + " Helium</b>, and <b>100 copies of Coordination</b>! In addition, all zones are now worth <b>3x Helium</b>!<span></span>";
costText += "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>K</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Exit Spire"){
tooltipText = "This will exit the spire, and you will be unable to re-enter until your next portal. Are you sure?";
costText = "<div class='maxCenter'><div class='btn btn-info' onclick='cancelTooltip(); endSpire()'>Exit Spire</div><div class='btn btn-danger' onclick='cancelTooltip()'>取消</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Respec Talents"){
tooltipText = "这将以20块骨头为代价,返回所有用于天赋的黑暗精华。 你确定吗?";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='cancelTooltip(); respecTalents(true)'>洗点</div><div class='btn btn-danger' onclick='cancelTooltip()'>取消</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "The Geneticistassist"){
tooltipText = "Greetings, friend! I'm your new robotic pal <b>The Geneticistassist</b> and I am here to assist you with your Geneticists. I will hang out in your Jobs tab, and will appear every run after Geneticists are unlocked. You can customize me in Settings under 'General'!";
costText = "<div class='maxCenter'><div class='btn btn-info' id='confirmTooltipBtn' onclick='cancelTooltip()'>Thanks, Geneticistassist!</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "MagnetoShriek"){
var shriekValue = ((1 - game.mapUnlocks.roboTrimp.getShriekValue()) * 100).toFixed(1);
tooltipText = "你的宠物机器人看起来很有天赋,它扭曲了某些坏人周围的磁场,尤其是不可能的能力。你可以每隔5个区域就激活这个能力,让你的脆皮减少受到 " + shriekValue + "% 的攻击伤害,这必须在每次冷却后重新启动。";
tooltipText += "<span id='roboTrimpTooltipActive' style='font-weight: bold'><br/><br/>";
tooltipText += (game.global.useShriek) ? "MagnetoShriek is currently active and will fire on the next Improbability." : "MagnetoShriek is NOT active and will not fire.";
tooltipText += "</span>";
costText = "";
//elem.style.top = "55%";
}
if (what == "Reset"){
tooltipText = "你确定要重置吗?这实际上真的会重置你的游戏。你不会得到任何好玩的东西,游戏记录将会消失。 <b style='color: red'>这不是你想要的软重置。 这将删除您的保存。</b>";
costText="<div class='maxCenter'><div class='btn btn-danger' onclick='resetGame();unlockTooltip();tooltip(\"hide\")'>删除存档</div> <div class='btn btn-info' onclick='cancelTooltip()'>取消</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "战斗"){
tooltipText = "你把这些可怜的异形们运送到战场上去遭受厄运。然而你会得到很酷的东西,他们会明白的。 (热键: F)";
var soldiers = (game.portal.Coordinated.level) ? game.portal.Coordinated.currentSend : game.resources.trimps.maxSoldiers;
costText = (soldiers > 1) ? "" : "";
costText = prettify(soldiers) + " 脆皮" + costText;
}
if (what == "自动战斗"){
tooltipText = "允许这些异形们开始自己去战斗,当他们的小镇变得拥挤不堪的时候。(热键: A)";
costText = "";
}
if (what == "New Achievements"){
tooltipText = "宇宙已对您的成就表示关注,并开始跟踪您的成就。你已经完成了一些之前的冒险,你想看看吗?";
costText = "<div class='maxCenter'><div class='btn btn-success' onclick='toggleAchievementWindow(); cancelTooltip()'>查看成就</div> <div class='btn btn-danger' onclick='cancelTooltip()'>不,听起来很蠢。</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Upgrade Generator"){
tooltipText = getGeneratorUpgradeHtml();
costText = "<b style='color: red'>These upgrades persist through portal and cannot be refunded. Choose wisely! " + getMagmiteDecayAmt() + "% of your unspent Magmite will decay on portal.</b><br/><br/><div class='maxCenter'><span class='btn btn-info' onclick='cancelTooltip()'>关闭</span></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
ondisplay = function(){
updateGeneratorUpgradeHtml();
};
titleText = "<div id='generatorUpgradeTitle'>升级生成器</div><div id='magmiteOwned'></div>";
}
if (what == "Queue"){
tooltipText = "在你的队列里有一个建筑,您需要点击 \"Build\" 去完成建造的工作。 点击队列里的项目将会取消它,并且资源将全额退还。";
costText = "";
}
if (what == "Toxic" && isItIn != "dailyStack"){
tooltipText = "This bad guy is toxic. You will obtain " + (game.challenges.Toxicity.lootMult * game.challenges.Toxicity.stacks).toFixed(1) + "% more resources! Oh, also, this bad guy has 5x attack, 2x health, your Trimps will lose 5% health each time they attack, and the toxic air is causing your Trimps to breed " + (100 - (Math.pow(game.challenges.Toxicity.stackMult, game.challenges.Toxicity.stacks) * 100)).toFixed(2) + "% slower. These stacks will reset after clearing the zone.";
costText = "";
}
if (what == "Momentum"){
var stacks = game.challenges.Lead.stacks;
tooltipText = "This bad guy has " + prettify(stacks * 4) + "% more damage and health, pierces an additional " + (stacks * 0.1).toFixed(1) + "% block, and each attack that does not kill it will cause your Trimps to lose " + (stacks * 0.03).toFixed(2) + "% of their health.";
costText = "";
}
if (what == "Custom"){
customUp = (textString) ? 2 : 1;
tooltipText = "在下方输入一个数字来自定义你购买的数量。您还可以使用2e5和200k的缩写来选择大量的数字,例如1/2和50%的分数来选择可用工作空间的一小部分。"
if (textString) tooltipText += " <b>最大补贴1,000</b>";
tooltipText += "<br/><br/><input id='customNumberBox' style='width: 50%' value='" + ((!isNumberBad(game.global.lastCustomExact)) ? prettify(game.global.lastCustomExact) : game.global.lastCustomExact) + "' />";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='numTab(5, " + textString + ")'>应用</div><div class='btn btn-info' onclick='cancelTooltip()'>取消</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
ondisplay = function() {
var box = document.getElementById("customNumberBox");
// Chrome chokes on setSelectionRange on a number box; fall back to select()
try { box.setSelectionRange(0, box.value.length); }
catch (e) { box.select(); }
box.focus();
};
noExtraCheck = true;
}
if (what == "Max"){
tooltipText = "没有理由把所有东西都花在一个地方!在这里你可以设置你的资源比花在使用“最大的按钮。把这个设置为0。5,最多只会花掉你50%的资源,等等。"
costText = "<ul id='buyMaxUl'><li onclick='setMax(1)'>最大</li><li onclick='setMax(0.5)'>0.5</li><li onclick='setMax(0.33)'>0.33</li><li onclick='setMax(0.25)'>0.25</li><li onclick='setMax(0.1)'>0.1</li></ul>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "导出"){
if (textString){
tooltipText = textString + "<br/><br/><textarea id='exportArea' spellcheck='false' style='width: 100%' rows='5'>" + save(true) + "</textarea>";
what = "感谢!";
}
else
tooltipText = "这是你的存档的字符串,有很多像这样的,但这一串是只属于你的。找个安全的地方保存起来,这样下次你玩的时候就能节省很多时间了。 <br/><br/><textarea spellcheck='false' id='exportArea' style='width: 100%' rows='5'>" + save(true) + "</textarea>";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='cancelTooltip()'>知道了</div>";
if (document.queryCommandSupported('copy')){
costText += "<div id='clipBoardBtn' class='btn btn-success'>复制到粘贴板</div>";
}
costText += "</div>";
ondisplay = tooltips.handleCopyButton();
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Export Perks"){
tooltipText = "It may not look like much, but all of your perks are in here! You can share this string with friends, or save it to your computer to import later!<br/><br/><textarea spellcheck='false' id='exportArea' style='width: 100%' rows='5'>" + exportPerks() + "</textarea>";
costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='cancelTooltip()'>Got it</div>";
if (document.queryCommandSupported('copy')){
costText += "<div id='clipBoardBtn' class='btn btn-success'>Copy to Clipboard</div>";
}
costText += "</div>";
ondisplay = tooltips.handleCopyButton();
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "导入"){
tooltipText = "导入你存档的字符串!很有趣,我保证!<br/><br/><textarea spellcheck='false' id='importBox' style='width: 100%' rows='5'></textarea>";
costText="<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='cancelTooltip(); load(true);'>导入</div>"
if (playFabId != -1) costText += "<div class='btn btn-primary' onclick='loadFromPlayFab()'>从PlayFab导入</div>";
costText += "<div class='btn btn-info' onclick='cancelTooltip()'>取消</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
ondisplay = function () {
document.getElementById('importBox').focus();
}
}
if (what == "Import Perks"){
tooltipText = "Import your perks from a text string!<br/><br/><textarea spellcheck='false' id='perkImportBox' style='width: 100%' rows='5'></textarea>";
costText = "<p class='red'></p>";
costText += "<div id='confirmTooltipBtn' class='btn btn-info' onclick='this.previousSibling.innerText = importPerks()'>Import</div>";
costText += "<div class='btn btn-info' onclick='cancelTooltip()'>Cancel</div></div>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
ondisplay = function () {
document.getElementById('perkImportBox').focus();
};
}
if (what == "AutoPrestige"){
tooltipText = '<p>Your scientists have come a long way since you first crashed here, and can now purchase prestige upgrades automatically for you with hardly any catastrophic mistakes. They understand the word "No" and the following three commands: </p><p><b>AutoPrestige All</b> will always purchase the cheapest prestige available first.</p><p><b>Weapons Only</b> as you may be able to guess, will only purchase Weapon prestiges.</p><p><b>Weapons First</b> will only purchase Weapon prestiges unless the cheapest Armor prestige is less than 5% of the cost of the cheapest Weapon.</p>';
}
if (what == "AutoUpgrade"){
tooltipText = "Your scientists can finally handle some upgrades on their own! Toggling this on will cause most upgrades to be purchased automatically. Does not include equipment prestiges or upgrades that would trigger a confirmation popup.";
}
if (what == "Recycle All"){
tooltipText = "回收所有在选定级别以下的地图。";
}
if (what == "PlayFab Login"){
var tipHtml = getPlayFabLoginHTML();
tooltipText = tipHtml[0];
costText = tipHtml[1];
game.global.lockTooltip = true;
elem.style.top = "15%";
elem.style.left = "25%";
swapClass('tooltipExtra', 'tooltipExtraLg', elem);
noExtraCheck = true;
}
if (what == "PlayFab Conflict"){
tooltipText = "It looks like your save stored at PlayFab is further along than the save on your computer.<br/><b>Your save on PlayFab has earned " + prettify(textString) + " total Helium, defeated Zone " + attachFunction + ", and cleared " + prettify(numCheck) + " total Zones. The save on your computer only has " + prettify(game.global.totalHeliumEarned) + " total Helium, has defeated Zone " + game.global.highestLevelCleared + ", and cleared " + prettify(game.stats.zonesCleared.value + game.stats.zonesCleared.valueTotal) + " total Zones.</b><br/>Would you like to Download your save from PlayFab, Overwrite your online save with this one, or Cancel and do nothing?";
costText = "<span class='btn btn-primary' onclick='playFabFinishLogin(true)'>Download From PlayFab</span><span class='btn btn-warning' onclick='playFabFinishLogin(false)'>Overwrite PlayFab Save</span><span class='btn btn-danger' onclick='cancelPlayFab();'>取消</span>";
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (what == "Fire Trimps"){
if (!game.global.firing)
tooltipText = "激活解雇模式,工作按钮将会变成红色并将会开始解雇异形们而不是雇佣他们。 被解雇的异形们将开始自我繁殖而不是工作, 但你不会得到任何资源的返还。";
else
tooltipText = "关闭解雇模式";
costText = "";
}
if (what == "Maps"){
if (!game.global.preMapsActive)
tooltipText = "前往地图室。 地图充满了好东西,对于每个最大级别的地图,您将清楚,您将获得该区域的20%叠加损伤加成(叠加多达10次)。(热键: M)";
else
tooltipText = "回到世界地图 (热键: M)";
costText = "";
}
if (what == 'Error') {
game.global.lockTooltip = true;
var returnObj = tooltips.showError(textString);
tooltipText = returnObj.tooltip;
costText = returnObj.costText;
ondisplay = tooltips.handleCopyButton();
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (isItIn == "jobs"){
var buyAmt = game.global.buyAmt;
if (buyAmt == "Max") buyAmt = calculateMaxAfford(game.jobs[what], false, false, true);
if (game.global.firing){
var firstChar = what.charAt(0);
var aAn = (firstChar == "A" || firstChar == "E" || firstChar == "I" || firstChar == "O" || firstChar == "U") ? " an " : " a ";
tooltipText = "Fire " + aAn + " " + what + ". Refunds no resources, but frees up some workspace for your Trimps.";
costText = "";
}
else{
var workspaces = game.workspaces;
var ignoreWorkspaces = (game.jobs[what].allowAutoFire && game.options.menu.fireForJobs.enabled);
if (workspaces < buyAmt && !ignoreWorkspaces) buyAmt = workspaces;
costText = getTooltipJobText(what, buyAmt);
}
if (buyAmt > 1){
var ewhat= cnwhat(what);
ewhat += " X " + prettify(buyAmt);
}
}
if (isItIn == "buildings"){
var awhat="";
costText = canAffordBuilding(what, false, true);
awhat=cnwhat(what);
if (game.global.buyAmt != 1) {
if (game.buildings[what].percent){
tooltipText += " <b>你只能购买 1 " + awhat + "同一时间.</b>";
what =awhat + " X 1";
}
else {
awhat += " X " + prettify((game.global.buyAmt == "Max") ? calculateMaxAfford(game.buildings[what], true) : game.global.buyAmt);
what=awhat;
}
}
}
if (isItIn == "portal"){
var resAppend = (game.global.kongBonusMode) ? " Bonus Points" : " Helium Canisters";
var perkItem = game.portal[what];
if (!perkItem.max || perkItem.max > perkItem.level + perkItem.levelTemp) costText = prettify(getPortalUpgradePrice(what)) + resAppend;
else costText = "";
if (game.global.buyAmt > 1){
var dwhat=cnwhat(what);
dwhat += " X " + game.global.buyAmt;
}
tooltipText += " <b>(你已经花费 " + prettify(perkItem.heliumSpent + perkItem.heliumSpentTemp) + " 氦在这个能力上)</b>";
what = what.replace("_", " ");
}
if (isItIn == "equipment"){
costText = canAffordBuilding(what, false, true, true);
if (what == "Shield" && game.equipment.Shield.blockNow){
var blockPerShield = game.equipment.Shield.blockCalculated + (game.equipment.Shield.blockCalculated * game.jobs.Trainer.owned * (game.jobs.Trainer.modifier / 100));
tooltipText += " (" + prettify(blockPerShield) + " 经过培训)";
}
if (game.global.buyAmt != 1) {
var cwhat=cnwhat(what);
cwhat += " X " + ((game.global.buyAmt == "Max") ? calculateMaxAfford(game.equipment[what], false, true) : game.global.buyAmt);
}
}
if (isItIn == "upgrades"){
var mouseOverElem = (lastMousePos[0] && lastMousePos[1]) ? document.elementFromPoint(lastMousePos[0], lastMousePos[1]) : null;
if (mouseOverElem && mouseOverElem.id == "upgradesHere"){
cancelTooltip();
return;
}
if (typeof tooltipText.split('@')[1] !== 'undefined'){
var prestigeCost = "<b>你可能不想这样做。</b> 你的下一 " + cntitle(game.upgrades[what].prestiges) + " 将授予 " + getNextPrestigeValue(what) + "";
tooltipText = tooltipText.replace('@', prestigeCost);
}
if (typeof tooltipText.split('$')[1] !== 'undefined'){
var upgradeTextSplit = tooltipText.split('$');
var color = game.upgrades[what].specialFilter();
color = color ? "green" : "red";
tooltipText = upgradeTextSplit[0] + "<span style='color: " + color + "; font-weight: bold;'>" + upgradeTextSplit[1] + "</span>";
}
if (typeof tooltipText.split('?')[1] !== 'undefined' && what != 'Dominance'){
var percentNum = (game.global.frugalDone) ? '60' : '50';
tooltipText = tooltipText.replace('?', percentNum);
}
if (what == "Coordination"){
var coordReplace = (game.portal.Coordinated.level) ? (25 * Math.pow(game.portal.Coordinated.modifier, game.portal.Coordinated.level)).toFixed(3) : 25;
tooltipText = tooltipText.replace('<coord>', coordReplace);
if (!canAffordCoordinationTrimps()){
var nextCount = (game.portal.Coordinated.level) ? game.portal.Coordinated.currentSend : game.resources.trimps.maxSoldiers;
var amtToGo = Math.floor((nextCount * 3) - game.resources.trimps.realMax());
var s = (amtToGo == 1) ? "" : "";
tooltipText += " <b>您需要足够的空间容纳最多 " + prettify(nextCount * 3) + " 的脆皮。 你现在缺少 " + prettify(Math.floor(amtToGo)) + " 脆皮" + s + "。</b>";
}
}
}
if (isItIn == "maps"){
tooltipText = "这是一张地图。 点击它来查看它的属性或运行它。 地图可以根据需要多次运行。";
costText = "";
}
if (what == 'confirm'){
if (!renameBtn) renameBtn = "Confirm";
what = numCheck;
tooltipText = textString;
if (attachFunction == null) attachFunction = "";
if (!noHide) attachFunction = attachFunction + "; cancelTooltip()";
attachFunction = (attachFunction) ? ' onclick="' + attachFunction + '"' : "";
costText = ' <div class="maxCenter" id="confirmTipCost"><div id="confirmTooltipBtn" class="btn btn-info"' + attachFunction + '>' + renameBtn + '</div>';
if (!hideCancel) costText += '<div class="btn btn-danger" onclick="cancelTooltip()">取消</div>';
costText += '</div>';
game.global.lockTooltip = true;
elem.style.left = "33.75%";
elem.style.top = "25%";
}
if (isItIn == 'customText') {
costText = (attachFunction) ? attachFunction : "";
tooltipText = textString;
noExtraCheck = true;
}
if (!noExtraCheck){
var tipSplit = tooltipText.split('$');
if (typeof tipSplit[1] !== 'undefined'){
if (tipSplit[1] == 'incby'){
var increase = toTip.increase.by;
if (game.portal.Carpentry.level && toTip.increase.what == "trimps.max") increase *= Math.pow(1.1, game.portal.Carpentry.level);
if (game.portal.Carpentry_II.level && toTip.increase.what == "trimps.max") increase *= (1 + (game.portal.Carpentry_II.modifier * game.portal.Carpentry_II.level));
tooltipText = tipSplit[0] + prettify(increase) + tipSplit[2];
}
else if (isItIn == "jobs" && toTip.increase != "custom"){
var newValue = toTip[tipSplit[1]];
if (game.portal.Motivation.level > 0) newValue *= (1 + (game.portal.Motivation.level * 0.05));
if (game.portal.Motivation_II.level > 0) newValue *= (1 + (game.portal.Motivation_II.level * game.portal.Motivation_II.modifier));
tooltipText = tipSplit[0] + prettify(newValue) + tipSplit[2];
}
else
tooltipText = tipSplit[0] + prettify(toTip[tipSplit[1]]) + tipSplit[2];
}
if (isItIn == "buildings" && what.split(' ')[0] == "Warpstation" && game.global.lastWarp) {
tooltipText += "<b> You had " + game.global.lastWarp + " Warpstations when you purchased your last Gigastation (" + game.upgrades.Gigastation.done + ").</b>";
}
if (typeof tooltipText.split('~') !== 'undefined') {
var percentIncrease = game.upgrades.Gymystic.done;
var text = ".";
if (percentIncrease > 0){
percentIncrease += 4;
text = " and increases the base block of all Gyms by " + percentIncrease + "% (compounding).";
}
tooltipText = tooltipText.replace('~', text);
}
}
titleText = (titleText) ? titleText : what;
var tipNum = (tip2) ? "2" : "";
document.getElementById("tipTitle" + tipNum).innerHTML = cntitle(titleText);
document.getElementById("tipText" + tipNum).innerHTML = tooltipText;
document.getElementById("tipCost" + tipNum).innerHTML = costText;
elem.style.display = "block";
if (ondisplay !== null)
ondisplay();
if (event != "update") positionTooltip(elem, event, renameBtn);
}
function checkAlert(what, isItIn){
if (document.getElementById(what + "Alert") === null) return;
if (typeof game[isItIn] !== 'undefined') game[isItIn][what].alert = false;
else return;
document.getElementById(what + "Alert").innerHTML = "";
if (document.getElementById(isItIn + "Alert") !== null) document.getElementById(isItIn + "Alert").innerHTML = "";
}
function countAlertsIn(where){
var count = 0;
where = game[where];
for (var item in where){
item = where[item];
if (item.alert) count++;
}
return count;
}
function positionTooltip(elem, event, extraInf){
var cordx = 0;
var cordy = 0;
var e = event || window.event;
if (!e) return;
if (e.pageX || e.pageY) {
cordx = e.pageX;
cordy = e.pageY;
} else if (e.clientX || e.clientY) {
cordx = e.clientX;
cordy = e.clientY;
}
lastMousePos = [cordx, cordy];
var bodw = Math.max(document.documentElement.clientWidth, window.innerWidth || 0),
bodh = Math.max(document.documentElement.clientHeight, window.innerHeight || 0),
tiph = Math.max(elem.clientHeight, elem.scrollHeight, elem.offsetHeight),
tipw = bodw * .325,
center = cordx - (tipw / 2),
spacing = bodh * 0.04,
setLeft,
setTop,
setting;
if (extraInf == "Heirloom") setting = 1;
else setting = game.options.menu.tooltipPosition.enabled;
if (extraInf == "forceLeft") {
elem.style.left = Math.floor(cordx - (bodw * .55)) + "px";
elem.style.top = Math.floor(cordy - (tiph * 0.5)) + "px";
return;
}
if (setting == 0) {
setLeft = cordx + spacing;
if ((setLeft + tipw) > bodw) setLeft = (bodw - tipw);
setTop = cordy - tiph - spacing;
}
if ((setting >= 1) || (setTop < 0)){
setLeft = center;
if (setLeft < 0)
setLeft = 0;
else if (setLeft > (bodw - tipw))
setLeft = bodw - tipw;
var maxAbove = (cordy - tiph - spacing);
if (setting == 1 || (maxAbove < 0)){
setTop = cordy + spacing;
if ((setTop + tiph) > bodh)
setTop = maxAbove;
}
else
setTop = maxAbove;
}
elem.style.left = Math.floor(setLeft) + "px";
elem.style.top = Math.floor(setTop) + "px";
}
function addTooltipPricing(toTip, what, isItIn) {
var costText = "";
var price;
var canAfford;
var percentOfTotal = "";
for (var cost in toTip.cost) {
if (typeof toTip.cost[cost] === 'object' && typeof toTip.cost[cost][1] === 'undefined') {
var costItem = toTip.cost[cost];
for (var item in costItem) {
price = costItem[item];
if (isItIn == "upgrades" && game.upgrades[what].prestiges && (item == "metal" || item == "wood")){
if (game.global.challengeActive == "Daily" && typeof game.global.dailyChallenge.metallicThumb !== 'undefined'){
price *= dailyModifiers.metallicThumb.getMult(game.global.dailyChallenge.metallicThumb.strength);
}
if (game.global.challengeActive == "Obliterated"){
price *= 1e12;
}
price *= Math.pow(1 - game.portal.Artisanistry.modifier, game.portal.Artisanistry.level);
}
if (typeof price === 'function') price = price();
if (typeof price[1] !== 'undefined') price = resolvePow(price, toTip);
var itemToCheck = game[cost];
if (typeof itemToCheck[item] !== 'undefined'){
canAfford = (itemToCheck[item].owned >= price) ? "green" : "red";
if ((item == "food" || item == "wood" || item == "metal") && price > getMaxForResource(item))
canAfford = "orange";
if (typeof itemToCheck[item].owned !== 'undefined'){
if (itemToCheck[item].owned < price && (typeof game.resources[item] !== 'undefined')){
var thisPs = getPsString(item, true);
if (thisPs > 0){
percentOfTotal = calculateTimeToMax(null, thisPs, (price - itemToCheck[item].owned));
percentOfTotal = "(" + percentOfTotal + ")";
}
else percentOfTotal = "(<span class='icomoon icon-infinity'></span>)"
}
else {
percentOfTotal = (itemToCheck[item].owned > 0) ? prettify(((price / itemToCheck[item].owned) * 100).toFixed(1)) : 0;
percentOfTotal = "(" + percentOfTotal + "%)";
}
}
costText += '<span class="' + canAfford + '">' + cnitems(item) + ':&nbsp;' + prettify(price) + '&nbsp;' + percentOfTotal + '</span>, ';
}
else
costText += cnitems(item) + ": " + prettify(price) + ", ";
}
continue;
}
}
costText = costText.slice(0, -2);
return costText;
}
function configMessages(){
var toCheck = ["Loot", "Unlocks", "Combat"];
for (var x = 0; x < toCheck.length; x++){
var name = toCheck[x];
for (var item in game.global.messages[name]){
if (item == "enabled") continue;
var checkbox = document.getElementById(name + item);
if (checkbox == null) continue;
game.global.messages[name][item] = checkbox.checked;
}
}
}
function messageConfigHover(what, event){
var text = "";
var title = "";
switch(what){
case 'Lootprimary':
text = "记录常见的物品:食物,木头和金属。";
title = "主要";
break;
case 'Lootsecondary':
text = "记录不太常见的物品掉落物品:宝石,碎片,领土奖金,等等。";
title = "次要";
break;
case 'Lootevents':
text = "记录来自临时事件(例如假期)的掉落和消息。";
title = "事件";
break;
case 'Lootexotic':
text = "记录异域的进口授予的奖励。";
title = "异域";
break;
case 'Loothelium':
text = "记录氦奖励。";
title = "";
break;
case 'Unlocksrepeated':
text = "记录所有每次运行下降超过一次的解锁,例如Speedfarming或Coordination。";
title = "重复";
break;
case 'Unlocksunique':
text = "记录所有解锁,只有每门降一次,如健身房或矿工。";
title = "独特";
break;
case 'Combattrimp':
text = "记录涉及您的脆皮的所有战斗消息。";
title = "脆皮";
break;
case 'Combatenemy':
text = "记录涉及敌人的所有战斗消息。";
title = "敌人";
break;
case 'Lootessence':
text = "记录所有发现的黑暗精华。";
title = "黑暗精华";
break;
case 'Lootmagma':
text = "记录微捷码的细胞,包括燃料和Magmite下降。";
title = "热门";
break;
case 'Loottoken':
text = "自然令牌日志。";
title = "Token";
break;
case 'Lootcache':
text = "地图掉落日志";
title = "Cache";
break;
case 'Lootbone':
text = "Log Bone drops from Skeletimps.";
title = "Bone";
break;
default: return;
}
document.getElementById('messageConfigMessage').innerHTML = "<b>" + title + "</b> - " + text;
tooltip(title, 'customText', event, text);
}
var geneMenuOpen = false;
// Correct function to call to cancel the current tooltip
function cancelTooltip(ignore2){
unlockTooltip();
tooltip("hide");
if (!ignore2){
document.getElementById('tooltipDiv2').style.display = 'none';
geneMenuOpen = false;
}
tooltipUpdateFunction = "";
document.getElementById("tipCost").innerHTML = "";
customUp = 0;
lastMousePos = [0, 0];
openTooltip = null;
}
function unlockTooltip(){
game.global.lockTooltip = false;
}
function getPsString(what, rawNum) {
if (what == "helium") return;
var resOrder = ["food", "wood", "metal", "science", "gems", "fragments"];
var books = ["farming", "lumber", "miner", "science"];
var jobs = ["Farmer", "Lumberjack", "Miner", "Scientist", "Dragimp", "Explorer"];
var index = resOrder.indexOf(what);
var job = game.jobs[jobs[index]];
var book = game.upgrades["Speed" + books[index]];
var mBook = game.upgrades["Mega" + books[index]];
var base = (what == "fragments") ? 0.4 : 0.5;
var textString = "<table class='bdTable table table-striped'><tbody>";
//Add base
textString += "<tr><td class='bdTitle'>基础</td><td class='bdPercent'></td><td class='bdNumber'>" + prettify(base) + "</td></tr>";
//Add job count
var currentCalc = job.owned * base;
//总览
textString += "<tr><td class='bdTitle'>" + cnjob(jobs[index]) + "</td><td class='bdPercent'>" + prettify(job.owned) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
//Add books
if (typeof book !== 'undefined' && book.done > 0){
var bookStrength = Math.pow(1.25, book.done);
currentCalc *= bookStrength;
bookStrength = prettify((bookStrength - 1) * 100) + "%";
textString += "<tr><td class='bdTitle'>速度" + cnbook(books[index]) + "</td><td class='bdPercent'>+ " + bookStrength + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add Megabooks
if (typeof mBook !== 'undefined' && mBook.done > 0){
var mod = (game.global.frugalDone) ? 1.6 : 1.5;
var mBookStrength = Math.pow(mod, mBook.done);
currentCalc *= mBookStrength;
mBookStrength = prettify((mBookStrength - 1) * 100) + "%";
textString += "<tr><td class='bdTitle'>巨型" + cnbook(books[index]) + "</td><td class='bdPercent'>+ " + mBookStrength + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add bounty
if (what != "gems" && game.upgrades.Bounty.done > 0){
currentCalc *= 2;
textString += "<tr><td class='bdTitle'>奖金</td><td class='bdPercent'>+ 100%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add Tribute
if (what == "gems" && game.buildings.Tribute.owned > 0){
var tributeStrength = Math.pow(game.buildings.Tribute.increase.by, game.buildings.Tribute.owned);
currentCalc *= tributeStrength;
tributeStrength = prettify((tributeStrength - 1) * 100) + "%";
textString += "<tr><td class='bdTitle'>贡品</td><td class='bdPercent'>+ " + tributeStrength + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add Whipimp
if (game.unlocks.impCount.Whipimp > 0){
var whipStrength = Math.pow(1.003, game.unlocks.impCount.Whipimp);
currentCalc *= (whipStrength);
whipStrength = prettify((whipStrength - 1) * 100) + "%";
textString += "<tr><td class='bdTitle'>Whipimp</td><td class='bdPercent'>+ " + whipStrength + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add motivation
if (game.portal.Motivation.level > 0){
var motivationStrength = (game.portal.Motivation.level * game.portal.Motivation.modifier);
currentCalc *= (motivationStrength + 1);
motivationStrength = prettify(motivationStrength * 100) + "%";
textString += "<tr><td class='bdTitle'>激励</td><td class='bdPercent'>+ " + motivationStrength + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (game.portal.Motivation_II.level > 0){
var motivationStrength = (game.portal.Motivation_II.level * game.portal.Motivation_II.modifier);
currentCalc *= (motivationStrength + 1);
motivationStrength = prettify(motivationStrength * 100) + "%";
textString += "<tr><td class='bdTitle'>Motivation II</td><td class='bdPercent'>+ " + motivationStrength + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add Meditation
if (game.portal.Meditation.level > 0){
var meditation = game.portal.Meditation;
var medStrength = meditation.getBonusPercent();
if (medStrength > 0){
currentCalc *= (1 + (medStrength * .01));
textString += "<tr><td class='bdTitle'>Meditation</td><td class='bdPercent'>" + (meditation.getBonusPercent(true) * 10) + " minutes (+" + medStrength + "%)</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
}
//Add Magmamancer
if (game.jobs.Magmamancer.owned > 0 && what == "metal"){
var manceStrength = game.jobs.Magmamancer.getBonusPercent();
if (manceStrength > 1){
currentCalc *= manceStrength;
manceStrength = (manceStrength - 1) * 100;
textString += "<tr><td class='bdTitle'>Magmamancers</td><td class='bdPercent'>" + (game.jobs.Magmamancer.getBonusPercent(true) * 10) + " minutes (+" + prettify(manceStrength) + "%)</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
}
if (game.upgrades.Speedexplorer.done > 0 && what == "fragments"){
var bonus = Math.pow(4, game.upgrades.Speedexplorer.done);
currentCalc *= bonus;
textString += "<tr><td class='bdTitle'>Speedexplorer</td><td class='bdPercent'>+ " + prettify((bonus - 1) * 100) + "%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add Size (challenge)
if (game.global.challengeActive == "Size"){
currentCalc *= 1.5;
textString += "<tr><td class='bdTitle'>巨大 (尺寸)</td><td class='bdPercent'>+ 50%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
} //Add meditate (challenge)
if (game.global.challengeActive == "Meditate"){
currentCalc *= 1.25;
textString += "<tr><td class='bdTitle'>冥想</td><td class='bdPercent'>+ 25%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.challengeActive == "Toxicity"){
var toxMult = (game.challenges.Toxicity.lootMult * game.challenges.Toxicity.stacks) / 100;
currentCalc *= (1 + toxMult);
toxMult = (toxMult * 100).toFixed(1) + "%";
textString += "<tr><td class='bdTitle'>微调 (毒)</td><td class='bdPercent'>+ " + toxMult + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.challengeActive == "Balance"){
currentCalc *= game.challenges.Balance.getGatherMult();
textString += "<tr><td class='bdTitle'>Strength (Balance)</td><td class='bdPercent'>+ " + game.challenges.Balance.getGatherMult(true) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.challengeActive == "Decay"){
currentCalc *= 10;
textString += "<tr><td class='bdTitle'>明智 (衰变)</td><td class='bdPercent'>x 10</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
var stackStr = Math.pow(0.995, game.challenges.Decay.stacks);
currentCalc *= stackStr;
textString += "<tr style='color: red'><td class='bdTitle'>Decay</td><td class='bdPercent'>x " + stackStr.toFixed(3) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.challengeActive == "Watch"){
currentCalc /= 2;
textString += "<tr style='color: red'><td class='bdTitle'>Sleepy (Watch)</td><td class='bdPercent'>50%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.challengeActive == "Lead" && ((game.global.world % 2) == 1)){
currentCalc *= 2;
textString += "<tr><td class='bdTitle'>决心 (Lead)</td><td class='bdPercent'>+ 100%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.challengeActive == "Daily"){
var mult = 0;
if (typeof game.global.dailyChallenge.dedication !== 'undefined'){
mult = dailyModifiers.dedication.getMult(game.global.dailyChallenge.dedication.strength);
currentCalc *= mult;
textString += "<tr><td class='bdTitle'>专用 (日常)</td><td class='bdPercent'>+ " + prettify((mult * 100) - 100) + "%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (typeof game.global.dailyChallenge.famine !== 'undefined' && what != "fragments" && what != "science"){
mult = dailyModifiers.famine.getMult(game.global.dailyChallenge.famine.strength);
currentCalc *= mult;
textString += "<tr style='color: red'><td class='bdTitle'>饥荒 (日常)</td><td class='bdPercent'>" + prettify(mult * 100) + "%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
}
if (what != "fragments" && getEmpowerment() == "Wind"){
var windMod = game.empowerments.Wind.getCombatModifier() * 10;
currentCalc *= (1 + windMod);
textString += "<tr><td class='bdTitle'>迅捷 (风)</td><td class='bdPercent'>+ " + prettify(windMod * 100) +"%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
var heirloomBonus = calcHeirloomBonus("Staff", jobs[index] + "Speed", 0, true);
if (heirloomBonus > 0){
currentCalc *= ((heirloomBonus / 100) + 1);
heirloomBonus = prettify(heirloomBonus) + '%';
textString += "<tr><td class='bdTitle'>传家宝 (员工)</td><td class='bdPercent'>+ " + heirloomBonus + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add player
if (game.global.playerGathering == what){
if ((game.talents.turkimp4.purchased || game.global.turkimpTimer > 0) && (what == "food" || what == "wood" || what == "metal")){
var tBonus = 50;
if (game.talents.turkimp4.purchased) tBonus = 100;
else if (game.talents.turkimp3.purchased) tBonus = 75;
currentCalc *= (1 + (tBonus / 100));
textString += "<tr><td class='bdTitle'>分享食物</td><td class='bdPercent'>+ " + tBonus + "%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
var playerStrength = getPlayerModifier();
currentCalc += playerStrength;
textString += "<tr><td class='bdTitle'>你</td><td class='bdPercent'>+ " + prettify(playerStrength) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add Loot ALWAYS LAST
if (game.options.menu.useAverages.enabled){
var avg = getAvgLootSecond(what);
if (avg > 0) {
currentCalc += avg;
textString += "<tr><td class='bdTitle'>平均战利品</td><td class='bdPercent'>+ " + prettify(avg) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
}
if (rawNum) return currentCalc;
textString += "</tbody></table>";
game.global.lockTooltip = false;
tooltip('confirm', null, 'update', textString, "getPsString('" + what + "')", what.charAt(0).toUpperCase() + what.substr(1, what.length) + " Per Second", "Refresh", true);
}
function getZoneStats(event, update) {
if (!update && game.global.lockTooltip) return;
var textString = "<table class='bdTable table table-striped'><tbody>";
textString += "<tr><td class='bdTitle bdZoneTitle' colspan='3'>区域 " + game.global.world + ", 格子 " + (game.global.lastClearedCell + 2) + "</td></tr>";
textString += "<tr><td colspan='3'>你已经在这个区域 " + formatMinutesForDescriptions((new Date().getTime() - game.global.zoneStarted) / 1000 / 60) + "</td></tr>";
if ((game.global.mapsActive || game.global.preMapsActive) && game.global.currentMapId){
var map = game.global.mapsOwnedArray[getMapIndex(game.global.currentMapId)];
textString += "<tr><td class='bdTitle bdZoneTitle' colspan='3'>" + map.name + ", 等级 " + map.level;
if (map.bonus && typeof mapSpecialModifierConfig[map.bonus] !== 'undefined')
textString += " (" + mapSpecialModifierConfig[map.bonus].abv + ")";
textString += ", 格子 " + (game.global.lastClearedMapCell + 2) + "</td></tr>";
textString += '<tr><td><span class="' + getMapIcon(map) + '"></span> ' + ((map.location == "Void") ? voidBuffConfig[game.global.voidBuff].title : getMapIcon(map, true)) + '</td><td><span class="icomoon icon-gift2"></span>' + Math.floor(map.loot * 100) + '%</span> <span class="icomoon icon-cube2"></span>' + map.size + ' <span class="icon icon-warning"></span>' + Math.floor(map.difficulty * 100) + '%</td><td>' + ((map.location == "Void") ? '&nbsp' : ('物品: ' + addSpecials(true, true, map))) + '</td></tr>';
textString += "<tr><td colspan='3'>你已经在这个地图上停留了 " + formatMinutesForDescriptions((new Date().getTime() - game.global.mapStarted) / 1000 / 60) + "</td></tr>";
if (map.location == "Void") textString += "<tr><td colspan='3'>你拥有 " + game.global.totalVoidMaps + " 虚空地图" + ((game.global.totalVoidMaps == 1) ? "" : "") + ".</td></tr>";
}
textString += "</tbody></table>";
if (update) {
document.getElementById("tipText").innerHTML = textString;
return;
}
tooltip("世界信息", "customText", event, textString)
tooltipUpdateFunction = function() {
getZoneStats(null, true);
}
}
function getTrimpPs() {
if (game.global.challengeActive == "Trapper") return;
var trimps = game.resources.trimps;
var base = 0.0085;
var textString = "<table class='bdTable table table-striped'><tbody>";
//Add base
textString += "<tr><td class='bdTitle'>基础</td><td class='bdPercent'></td><td class='bdNumber'>" + base + "</td></tr>";
//Add job count
var breeding = trimps.owned - trimps.employed;
var currentCalc = breeding * base;
textString += "<tr><td class='bdTitle'>配种</td><td class='bdPercent'>" + prettify(breeding) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
//Add Potency
if (game.upgrades.Potency.done > 0){
var potencyStrength = Math.pow(1.1, game.upgrades.Potency.done);
currentCalc *= potencyStrength;
potencyStrength = prettify((potencyStrength - 1) * 100) + "%";
textString += "<tr><td class='bdTitle'>繁殖效率</td><td class='bdPercent'>+ " + potencyStrength + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add Nurseries
if (game.buildings.Nursery.owned > 0){
var nurseryStrength = Math.pow(1.01, game.buildings.Nursery.owned);
currentCalc *= nurseryStrength;
nurseryStrength = prettify((nurseryStrength - 1) * 100) + "%";
textString += "<tr><td class='bdTitle'>托儿所</td><td class='bdPercent'>+ " + nurseryStrength + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add Venimp
if (game.unlocks.impCount.Venimp > 0){
var venimpStrength = Math.pow(1.003, game.unlocks.impCount.Venimp);
currentCalc *= (venimpStrength);
venimpStrength = prettify((venimpStrength - 1) * 100) + "%";
textString += "<tr><td class='bdTitle'>Venimp</td><td class='bdPercent'>+ " + venimpStrength + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.brokenPlanet){
currentCalc /= 10;
textString += "<tr style='color: red'><td class='bdTitle'>Broken Planet</td><td class='bdPercent'>X 0.1</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add pheromones
if (game.portal.Pheromones.level > 0){
var PheromonesStrength = (game.portal.Pheromones.level * game.portal.Pheromones.modifier);
currentCalc *= (PheromonesStrength + 1);
PheromonesStrength = prettify(PheromonesStrength * 100) + "%";
textString += "<tr><td class='bdTitle'>信息素</td><td class='bdPercent'>+ " + PheromonesStrength + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add Geneticist
if (game.jobs.Geneticist.owned > 0) {
var mult = Math.pow(.98, game.jobs.Geneticist.owned);
currentCalc *= mult;
var display = (mult > 0.0001) ? mult.toFixed(4) : mult.toExponential(3);
textString += "<tr style='color: red'><td class='bdTitle'>Geneticist</td><td class='bdPercent'>X " + display + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add quick trimps
if (game.unlocks.quickTrimps){
currentCalc *= 2;
textString += "<tr><td class='bdTitle'>Quick Trimps</td><td class='bdPercent'>+ 100%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.challengeActive == "Daily"){
var mult = 0;
if (typeof game.global.dailyChallenge.dysfunctional !== 'undefined'){
mult = dailyModifiers.dysfunctional.getMult(game.global.dailyChallenge.dysfunctional.strength);
currentCalc *= mult;
textString += "<tr style='color: red'><td class='bdTitle'>功能失调 (日常)</td><td class='bdPercent'>X " + mult.toFixed(3) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>"
}
if (typeof game.global.dailyChallenge.toxic !== 'undefined'){
mult = dailyModifiers.toxic.getMult(game.global.dailyChallenge.toxic.strength, game.global.dailyChallenge.toxic.stacks);
currentCalc *= mult;
textString += "<tr style='color: red'><td class='bdTitle'>毒物 (日常)</td><td class='bdPercent'>X " + mult.toFixed(3) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>"
}
}
if (game.global.challengeActive == "Toxicity" && game.challenges.Toxicity.stacks > 0){
var potencyMod = Math.pow(game.challenges.Toxicity.stackMult, game.challenges.Toxicity.stacks);
currentCalc *= potencyMod;
textString += "<tr style='color: red'><td class='bdTitle'>有毒空气</td><td class='bdPercent'>X " + potencyMod.toFixed(3) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>"
}
if (game.global.voidBuff == "slowBreed"){
currentCalc *= 0.2;
textString += "<tr style='color: red'><td class='bdTitle'>虚空气体</td><td class='bdPercent'>X 0.2</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>"
}
var heirloomBonus = calcHeirloomBonus("Shield", "breedSpeed", 0, true);
if (heirloomBonus > 0){
currentCalc *= ((heirloomBonus / 100) + 1);
heirloomBonus = prettify(heirloomBonus) + '%';
textString += "<tr><td class='bdTitle'>传家宝 (护盾)</td><td class='bdPercent'>+ " + heirloomBonus + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>"
}
textString += "</tbody></table>";
game.global.lockTooltip = false;
tooltip('confirm', null, 'update', textString, "getTrimpPs()", "Trimps Per Second", "Refresh", true);
}
function getFluctuation(number, minFluct, maxFluct){
var min = Math.floor(number * (1 - minFluct));
var max = Math.ceil(number + (number * maxFluct));
return "<td>" + prettify(min) + "</td><td>" + prettify(max) + "</td>";
}
function getBattleStatBd(what) {
var equipment = {};
var name = what.charAt(0).toUpperCase() + what.substr(1, what.length);
var textString = "<table class='bdTableSm table table-striped'><tbody><tr><td></td><td>基础</td><td>等级</td><td>Item " + name + "</td><td>总计</td>" + ((what == "attack") ? "<td>最小</td><td>最大</td>" : "") + "</tr>";
var currentCalc = 0;
var maxFluct = 0.2;
var minFluct = 0.2;
var percent = 0;
if (what == "health" || what == "attack"){
currentCalc += (what == "health") ? 50 : 6;
textString += "<tr><td class='bdTitle'>基础</td><td class='bdPercentSm'>" + prettify(currentCalc) + "</td><td></td><td></td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + ((what == "attack") ? "<td>-20%</td><td>+20%</td>" : "") + "</tr>";
if (what == "attack"){
//Discipline
if (game.global.challengeActive == "Discipline"){
minFluct = 0.995;
maxFluct = 0.995;
textString += "<tr><td class='bdTitle'>缺乏纪律</td><td class='bdPercentSm'></td><td></td><td></td><td class='bdNumberSm'></td><td>-99.5%</td><td>+99.5%</td></tr>";
}
else {
//Range
if (game.portal.Range.level > 0){
minFluct -= (0.02 * game.portal.Range.level);
textString += "<tr><td class='bdTitle'>距离</td><td class='bdPercentSm'>+2% 最少</td><td>" + game.portal.Range.level + "</td><td>+" + prettify(2 * game.portal.Range.level) + "% 最少</td><td class='bdNumberSm'></td><td>-" + prettify(minFluct * 100) + "%</td><td>+" + prettify(maxFluct * 100) + "%</td></tr>";
}
//MinDamageDaily
if (typeof game.global.dailyChallenge.minDamage !== 'undefined'){
var addMin = dailyModifiers.minDamage.getMult(game.global.dailyChallenge.minDamage.strength);
minFluct += addMin;
if (minFluct > 1) minFluct = 1;
textString += "<tr style='color: red'><td class='bdTitle'>最低限度 (日常)</td><td class='bdPercentSm'>-" + prettify(addMin * 100) + "% 最少</td><td></td><td></td><td class='bdNumberSm'></td><td>-" + prettify(minFluct * 100) + "%</td><td>+" + prettify(maxFluct * 100) + "%</td></tr>";
}
//MaxDamageDaily
if (typeof game.global.dailyChallenge.maxDamage !== 'undefined'){
var addMax = dailyModifiers.maxDamage.getMult(game.global.dailyChallenge.maxDamage.strength);
maxFluct += addMax;
textString += "<tr><td class='bdTitle'>败家子 (日常)</td><td class='bdPercentSm'>+" + prettify(addMax * 100) + "% Max</td><td></td><td></td><td class='bdNumberSm'></td><td>-" + prettify(minFluct * 100) + "%</td><td>+" + prettify(maxFluct * 100) + "%</td></tr>";
}
}
}
for (var equip in game.equipment){
var temp = game.equipment[equip];
if (typeof temp[what] === 'undefined' || temp.level <= 0 || temp.blockNow) continue;
var equipStrength = temp[what + "Calculated"] * temp.level;
currentCalc += equipStrength;
percent = ((equipStrength / game.global[what]) * 100).toFixed(1) + "%";
textString += "<tr><td class='bdTitle'>" + cnequip(equip) + "</td><td>" + prettify(temp[what + "Calculated"]) + "</td><td>" + temp.level + "</td><td>" + prettify(equipStrength) + " (" + percent + ")</td><td>" + prettify(currentCalc) + "</td>" + ((what == "attack") ? getFluctuation(currentCalc, minFluct, maxFluct) : "") + "</tr>";
}
}
else if (what == "block"){
//Add Gym
var gym = game.buildings.Gym;
if (gym.owned > 0){
var gymStrength = gym.owned * gym.increase.by;
percent = ((gymStrength / game.global.block) * 100).toFixed(1) + "%";
currentCalc += gymStrength;
textString += "<tr><td class='bdTitle'>健身房</td><td>" + prettify(gym.increase.by) + "</td><td>" + prettify(gym.owned) + "</td><td>" + prettify(gymStrength) + " (" + percent + ")</td><td>" + prettify(currentCalc) + "</td></tr>";
}
var shield = game.equipment.Shield;
if (shield.blockNow && shield.level > 0){
var shieldStrength = shield.level * shield.blockCalculated;
percent = ((shieldStrength / game.global.block) * 100).toFixed(1) + "%";
currentCalc += shieldStrength;
textString += "<tr><td class='bdTitle'>盾</td><td>" + prettify(shield.blockCalculated) + "</td><td>" + prettify(shield.level) + "</td><td>" + prettify(shieldStrength) + " (" + percent + ")</td><td>" + prettify(currentCalc) + "</td></tr>";
}
var trainer = game.jobs.Trainer;
if (trainer.owned > 0){
var trainerStrength = trainer.owned * (trainer.modifier / 100);
trainerStrength = calcHeirloomBonus("Shield", "trainerEfficiency", trainerStrength);
currentCalc *= (trainerStrength + 1);
trainerStrength = prettify(trainerStrength * 100) + "%";
textString += "<tr><td class='bdTitle'>培训师</td><td>" + prettify(calcHeirloomBonus("Shield", "trainerEfficiency", trainer.modifier)) + "%</td><td>" + prettify(trainer.owned) + "</td><td>+ " + trainerStrength + "</td><td>" + prettify(currentCalc) + "</td></tr>";
}
}
//Add coordination
currentCalc *= game.resources.trimps.maxSoldiers;
textString += "<tr><td class='bdTitle'>士兵</td><td class='bdPercentSm'></td><td></td><td>x " + prettify(game.resources.trimps.maxSoldiers) + "</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + ((what == "attack") ? getFluctuation(currentCalc, minFluct, maxFluct) : "") + "</tr>";
//Add achievements
if (what == "attack" && game.global.achievementBonus > 0){
currentCalc *= 1 + (game.global.achievementBonus / 100);
textString += "<tr><td class='bdTitle'>成就</td><td class='bdPercentSm'></td><td></td><td>+ " + game.global.achievementBonus + "%</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>"
}
//Add perk
var perk = "";
if (what == "health") perk = "Toughness";
if (what == "attack") perk = "Power";
if (perk && game.portal[perk].level > 0){
var PerkStrength = (game.portal[perk].level * game.portal[perk].modifier);
currentCalc *= (PerkStrength + 1);
PerkStrength = prettify(PerkStrength * 100) + "%";
textString += "<tr><td class='bdTitle'>" + cnperk(perk) + "</td><td>" + (game.portal[perk].modifier * 100) + "%</td><td>" + game.portal[perk].level + "</td><td>+ " + PerkStrength + "</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + ((what == "attack") ? getFluctuation(currentCalc, minFluct, maxFluct) : "") + "</tr>";
}
perk = perk + "_II";
if (game.portal[perk] && game.portal[perk].level > 0){
var PerkStrength = (game.portal[perk].level * game.portal[perk].modifier);
currentCalc *= (PerkStrength + 1);
PerkStrength = prettify(PerkStrength * 100) + "%";
textString += "<tr><td class='bdTitle'>" + perk.replace('_', ' ') + "</td><td>" + (game.portal[perk].modifier * 100) + "%</td><td>" + game.portal[perk].level + "</td><td>+ " + PerkStrength + "</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + ((what == "attack") ? getFluctuation(currentCalc, minFluct, maxFluct) : "") + "</tr>";
}
//Add resilience
if (what == "health" && game.portal.Resilience.level > 0){
var resStrength = Math.pow(game.portal.Resilience.modifier + 1, game.portal.Resilience.level);
currentCalc *= resStrength;
resStrength = prettify((resStrength - 1) * 100) + "%";
textString += "<tr><td class='bdTitle'>Resilience</td><td>" + (game.portal.Resilience.modifier * 100) + "%</td><td>" + game.portal.Resilience.level + "</td><td>+ " + resStrength + "</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td></tr>";
}
//Add Geneticist
var geneticist = game.jobs.Geneticist;
if (game.global.lastLowGen > 0 && what == "health"){
var calcedGenes = game.global.lastLowGen;
var geneticistStrength = Math.pow(1.01, calcedGenes);
currentCalc *= geneticistStrength;
geneticistStrength = prettify((geneticistStrength * 100) - 100) + "%";
textString += "<tr><td class='bdTitle'>Geneticists</td><td>1%</td><td>" + prettify(calcedGenes) + "</td><td>+ " + geneticistStrength + "</td><td>" + prettify(currentCalc) + "</td></tr>";
}
//Add Anticipation
var anticipation = game.portal.Anticipation;
if (anticipation.level > 0 && what == "attack"){
var antiStrength = ((anticipation.level * anticipation.modifier * game.global.antiStacks) + 1);
currentCalc *= antiStrength;
antiStrength = prettify((antiStrength - 1) * 100) + "%";
textString += "<tr><td class='bdTitle'>Anticipation</td><td>2% (X" + game.global.antiStacks + ")</td><td>" + prettify(anticipation.level) + "</td><td>+ " + antiStrength + "</td><td>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
//Add formations
if (game.global.formation > 0){
var formStrength = 0.5;
if ((game.global.formation == 1 && what == "health") || (game.global.formation == 2 && what == "attack") || (game.global.formation == 3 && what == "block")) formStrength = 4;
currentCalc *= formStrength;
textString += "<tr><td class='bdTitle'>Formation</td><td></td><td></td><td>x " + formStrength + "</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + ((what == "attack") ? getFluctuation(currentCalc, minFluct, maxFluct) : "") + "</tr>";
}
//Add Titimp
if (game.global.titimpLeft > 1 && game.global.mapsActive && what == "attack"){
currentCalc *= 2;
textString += "<tr><td class='bdTitle'>Titimp</td><td></td><td></td><td>x 2</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
//Add map bonus
if (!game.global.mapsActive && game.global.mapBonus > 0 && what == "attack"){
var mapBonusMult = 0.2 * game.global.mapBonus;
currentCalc *= (1 + mapBonusMult);
mapBonusMult *= 100;
textString += "<tr><td class='bdTitle'>地图奖金</td><td>20%</td><td>" + game.global.mapBonus + "</td><td>+ " + prettify(mapBonusMult) + "%</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
//Add RoboTrimp
if (what == "attack" && game.global.roboTrimpLevel > 0){
var roboTrimpMod = 0.2 * game.global.roboTrimpLevel;
currentCalc *= (1 + roboTrimpMod);
roboTrimpMod *= 100;
textString += "<tr><td class='bdTitle'><span class='icomoon icon-chain'></span> RoboTrimp <span class='icomoon icon-chain'></span></td><td>20%</td><td>" + game.global.roboTrimpLevel + "</td><td>+ " + prettify(roboTrimpMod) + "%</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
//Add challenges
if (what == "health" && game.global.challengeActive == "Life"){
currentCalc *= game.challenges.Life.getHealthMult();
textString += "<tr><td class='bdTitle'>Unliving (Life)</td><td>10%</td><td>" + game.challenges.Life.stacks + "</td><td>+ " + game.challenges.Life.getHealthMult(true) + "</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td></tr>";
}
if (what == "attack" && game.global.challengeActive == "Life"){
currentCalc *= game.challenges.Life.getHealthMult();
textString += "<tr><td class='bdTitle'>Unliving (Life)</td><td></td><td></td><td>+ " + game.challenges.Life.getHealthMult(true) + "</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
if (what == "health" && game.global.challengeActive == "Balance"){
currentCalc *= game.challenges.Balance.getHealthMult();
textString += "<tr style='color: red'><td class='bdTitle'>Weakness (Balance)</td><td>1%</td><td>" + game.challenges.Balance.balanceStacks + "</td><td>- " + game.challenges.Balance.getHealthMult(true) + "</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td></tr>";
}
if (what == "attack" && game.global.challengeActive == "Lead" && ((game.global.world % 2) == 1)){
currentCalc *= 1.5;
textString += "<tr><td class='bdTitle'>Determined (Lead)</td><td></td><td></td><td>+ 50%</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
var heirloomBonus = calcHeirloomBonus("Shield", "trimp" + capitalizeFirstLetter(what), 0, true);
if (heirloomBonus > 0){
currentCalc *= ((heirloomBonus / 100) + 1);
heirloomBonus = prettify(heirloomBonus) + '%';
textString += "<tr><td class='bdTitle'>传家宝 (护盾)</td><td></td><td></td><td>+ " + heirloomBonus + "</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + ((what == "attack") ? getFluctuation(currentCalc, minFluct, maxFluct) : "") + "</tr>";
}
if (game.global.challengeActive == "Decay" && what == "attack"){
currentCalc *= 5;
textString += "<tr><td class='bdTitle'>明智 (衰变)</td><td></td><td></td><td class='bdPercent'>x 5</td><td class='bdNumber'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
var stackStr = Math.pow(0.995, game.challenges.Decay.stacks);
currentCalc *= stackStr;
textString += "<tr style='color: red'><td class='bdTitle'>Decay</td><td>x 0.995</td><td>" + game.challenges.Decay.stacks + "</td><td class='bdPercent'>x " + stackStr.toFixed(3) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
if ((game.global.challengeActive == "Electricity" || game.global.challengeActive == "Mapocalypse") && what == "attack") {
var mult = (1 - (game.challenges.Electricity.stacks * 0.1));
currentCalc *= mult;
textString += "<tr style='color: red'><td class='bdTitle'>" + game.global.challengeActive + "</td><td>-10%</td><td>" + game.challenges.Electricity.stacks.toString() + "</td><td class='bdPercent'>x " + mult.toFixed(1) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
if (game.global.challengeActive == "Daily"){
var mult = 0;
if (typeof game.global.dailyChallenge.weakness !== 'undefined' && what == "attack"){
mult = dailyModifiers.weakness.getMult(game.global.dailyChallenge.weakness.strength, game.global.dailyChallenge.weakness.stacks);
currentCalc *= mult;
textString += "<tr style='color: red'><td class='bdTitle'>虚弱 (日常)</td><td>x " + dailyModifiers.weakness.getMult(game.global.dailyChallenge.weakness.strength, 1).toFixed(2) + "</td><td>" + game.global.dailyChallenge.weakness.stacks + "</td><td class='bdPercent'>x " + mult.toFixed(2) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
if (typeof game.global.dailyChallenge.oddTrimpNerf !== 'undefined' && what == "attack" && (game.global.world % 2 == 1)){
mult = dailyModifiers.oddTrimpNerf.getMult(game.global.dailyChallenge.oddTrimpNerf.strength);
currentCalc *= mult;
textString += "<tr style='color: red'><td class='bdTitle'>非常弱 (日常)</td><td>x " + mult.toFixed(2) + "</td><td></td><td class='bdPercent'>x " + mult.toFixed(2) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
if (typeof game.global.dailyChallenge.evenTrimpBuff !== 'undefined' && what == "attack" && (game.global.world % 2 == 0)){
mult = dailyModifiers.evenTrimpBuff.getMult(game.global.dailyChallenge.evenTrimpBuff.strength);
currentCalc *= mult;
textString += "<tr><td class='bdTitle'>Even Stronger (日常)</td><td>x " + mult.toFixed(2) + "</td><td></td><td class='bdPercent'>+ " + prettify((mult * 100) - 100) + "%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
if (typeof game.global.dailyChallenge.rampage !== 'undefined' && what == "attack"){
mult = dailyModifiers.rampage.getMult(game.global.dailyChallenge.rampage.strength, game.global.dailyChallenge.rampage.stacks);
currentCalc *= mult;
textString += "<tr><td class='bdTitle'>Rampage (日常)</td><td>x " + dailyModifiers.rampage.getMult(game.global.dailyChallenge.rampage.strength, 1).toFixed(3) + "</td><td>" + game.global.dailyChallenge.rampage.stacks + "</td><td class='bdPercent'>x " + mult.toFixed(3) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
if (typeof game.global.dailyChallenge.pressure !== 'undefined' && what == "health"){
mult = dailyModifiers.pressure.getMult(game.global.dailyChallenge.pressure.strength, game.global.dailyChallenge.pressure.stacks);
currentCalc *= mult;
textString += "<tr style='color: red'><td class='bdTitle'>压力 (日常)</td><td>x " + mult.toFixed(2) + "</td><td></td><td class='bdPercent'>x " + mult.toFixed(2) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
}
//Add golden battle
if (what != "block" && game.goldenUpgrades.Battle.currentBonus > 0){
amt = game.goldenUpgrades.Battle.currentBonus;
currentCalc *= 1 + amt;
textString += "<tr><td class='bdTitle'>黄金之战</td><td></td><td></td><td>+ " + prettify(amt * 100) + "%</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + ((what == "attack") ? getFluctuation(currentCalc, minFluct, maxFluct) : "") + "</tr>";
}
if (what != "block" && game.talents.voidPower.purchased && game.global.voidBuff){
amt = (game.talents.voidPower2.purchased) ? ((game.talents.voidPower3.purchased) ? 65 : 35) : 15;
currentCalc *= (1 + (amt / 100));
textString += "<tr><td class='bdTitle'>虚空力量 (专精)</td><td></td><td>" + ((game.talents.voidPower2.purchased) ? ((game.talents.voidPower3.purchased) ? "III" : "II") : "I") + "</td><td>+ " + amt + "%</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + ((what == "attack") ? getFluctuation(currentCalc, minFluct, maxFluct) : "") + "</tr>";
}
if (game.talents.magmamancer.purchased && what == "attack" && game.jobs.Magmamancer.getBonusPercent() > 1){
amt = game.jobs.Magmamancer.getBonusPercent();
currentCalc *= amt;
textString += "<tr><td class='bdTitle'>岩浆活动</td><td></td><td></td><td>+ " + prettify((amt - 1) * 100) + "%</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
if (game.talents.stillRowing2.purchased && what == "attack" && game.global.spireRows >= 1){
amt = game.global.spireRows * 0.06;
currentCalc *= (amt + 1);
textString += "<tr><td class='bdTitle'>静止划桨 II</td><td>6%</td><td>" + game.global.spireRows + "</td><td>+ " + prettify(amt * 100) + "%</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
if (game.talents.healthStrength.purchased && what == "attack" && mutations.Healthy.active()){
var cellCount = mutations.Healthy.cellCount();
amt = (0.15 * cellCount);
currentCalc *= (amt + 1);
textString += "<tr><td class='bdTitle'>健康的力量</td><td>15%</td><td>" + cellCount + "</td><td>+ " + prettify(amt * 100) + "%</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
//Pumpkimp buff
if (game.global.sugarRush > 0 && what == "attack"){
currentCalc *= sugarRush.getAttackStrength();
textString += "<tr class='pumpkimpRow'><td class='bdTitle'>甜蜜冲击</td><td>&nbsp;</td><td>&nbsp;</td><td>x " + sugarRush.getAttackStrength() + "</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + ((what == "attack") ? getFluctuation(currentCalc, minFluct, maxFluct) : "") + "</tr>";
}
//Magma
if (mutations.Magma.active() && (what == "attack" || what == "health")){
mult = mutations.Magma.getTrimpDecay();
var lvls = game.global.world - mutations.Magma.start() + 1;
currentCalc *= mult;
var display = (mult > 0.0001) ? mult.toFixed(4) : mult.toExponential(3);
textString += "<tr style='color: red'><td class='bdTitle'>温度过高 (岩浆)</td><td>x 0.8</td><td>" + lvls + "</td><td class='bdPercent'>x " + display + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td>" + ((what == "attack") ? getFluctuation(currentCalc, minFluct, maxFluct) : "") + "</tr>";
}
if (game.global.totalSquaredReward > 0 && (what == "attack" || what == "health")){
amt = game.global.totalSquaredReward;
currentCalc *= (1 + (amt / 100));
textString += "<tr><td class='bdTitle'>挑战² 奖励</td><td></td><td></td><td>+ " + amt + "%</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + ((what == "attack") ? getFluctuation(currentCalc, minFluct, maxFluct) : "") + "</tr>"
}
//Ice
if (what == "attack" && getEmpowerment() == "Ice"){
amt = 1 - game.empowerments.Ice.getCombatModifier();
currentCalc *= (1 + amt);
textString += "<tr><td class='bdTitle'>冷冻敌人</td><td></td><td></td><td>+ " + prettify(amt * 100) + "%</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>"
}
//Fluffy
if (what == "attack" && Fluffy.isActive()){
amt = Fluffy.getDamageModifier();
currentCalc *= amt;
textString += "<tr><td class='bdTitle'>Fluffy</td><td></td><td></td><td>+ " + prettify((amt -1 ) * 100) + "%</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>"
}
var critChance = getPlayerCritChance();
if (what == "attack" && critChance){
var critMult = getPlayerCritDamageMult();
currentCalc *= critMult;
textString += "<tr class='critRow'><td class='bdTitle'>暴击几率</td><td>" + prettify(critChance * 100) + "%</td><td class='bdTitle'>暴击伤害</td><td>+ " + prettify((critMult - 1) * 100) + "%</td><td class='bdNumberSm'>" + prettify(currentCalc) + "</td>" + getFluctuation(currentCalc, minFluct, maxFluct) + "</tr>";
}
textString += "</tbody></table>";
game.global.lockTooltip = false;
tooltip('confirm', null, 'update', textString, "getBattleStatBd('" + what + "')", name, "Refresh", true);
if (what == "attack" || what == "health"){
verticalCenterTooltip(true);
}
}
function verticalCenterTooltip(makeLarge){
var tipElem = document.getElementById('tooltipDiv');
if (makeLarge){
swapClass('tooltipExtra', 'tooltipExtraLg', tipElem);
tipElem.style.left = "25%";
}
var height = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
var tipHeight = Math.max(tipElem.clientHeight, tipElem.innerHeight || 0);
if (makeLarge && tipHeight / height > 0.9){
document.getElementById('tipText').className = "tinyTextTip";
tipHeight = Math.max(tipElem.clientHeight, tipElem.innerHeight || 0);
}
var dif = (height - tipHeight);
tipElem.style.top = (dif > 0) ? (dif / 2) + "px" : "0";
}
function capitalizeFirstLetter(word){
return word.charAt(0).toUpperCase() + word.slice(1);
}
function getMaxTrimps() {
var trimps = game.resources.trimps;
var base = 10;
var textString = "<table class='bdTable table table-striped'><tbody>";
//Add base
textString += "<tr><td class='bdTitle'>基础</td><td class='bdPercent'></td><td class='bdNumber'>" + base + "</td></tr>";
//Add job count
var housing = trimps.max - game.global.totalGifts - game.unlocks.impCount.TauntimpAdded - base - game.global.trimpsGenerated;
var currentCalc = housing + base;
textString += "<tr><td class='bdTitle'>房屋</td><td class='bdPercent'>+ " + prettify(housing) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
//Add generatorUpgrades
if (game.global.trimpsGenerated > 0){
currentCalc += game.global.trimpsGenerated;
textString += "<tr><td class='bdTitle'>产生的房屋</td><td class='bdPercent'>+ " + prettify(game.global.trimpsGenerated) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add Territory Bonus
if (game.global.totalGifts > 0){
currentCalc += game.global.totalGifts;
textString += "<tr><td class='bdTitle'>领土奖金</td><td class='bdPercent'>+ " + prettify(game.global.totalGifts) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add Tauntimp
if (game.unlocks.impCount.TauntimpAdded > 0){
currentCalc += game.unlocks.impCount.TauntimpAdded;
textString += "<tr><td class='bdTitle'>陶工</td><td class='bdPercent'>+ " + prettify(game.unlocks.impCount.TauntimpAdded) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add Carpentry
if (game.portal.Carpentry.level > 0){
var carpentryStrength = Math.pow(1.1, game.portal.Carpentry.level);
currentCalc *= (carpentryStrength);
currentCalc = Math.floor(currentCalc);
carpentryStrength = prettify((carpentryStrength - 1) * 100) + "%";
textString += "<tr><td class='bdTitle'>木工</td><td class='bdPercent'>+ " + carpentryStrength + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (game.portal.Carpentry_II.level > 0){
var carpentryStrength = game.portal.Carpentry_II.modifier * game.portal.Carpentry_II.level;
currentCalc *= (1 + carpentryStrength);
currentCalc = Math.floor(currentCalc);
carpentryStrength = prettify(carpentryStrength * 100) + "%";
textString += "<tr><td class='bdTitle'>木工 II</td><td class='bdPercent'>+ " + carpentryStrength + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
//Add Size Challenge
if (game.global.challengeActive == "Size"){
currentCalc = Math.floor(currentCalc / 2);
textString += "<tr style='color: red'><td class='bdTitle'>巨大的</td><td class='bdPercent'>X 0.5</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.challengeActive == "Daily"){
if (typeof game.global.dailyChallenge.large !== 'undefined'){
var mult = dailyModifiers.large.getMult(game.global.dailyChallenge.large.strength);
currentCalc = Math.floor(currentCalc * mult);
textString += "<tr style='color: red'><td class='bdTitle'>强大 (日常)</td><td class='bdPercent'>X " + mult.toFixed(2) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
}
textString += "</tbody></table>";
game.global.lockTooltip = false;
tooltip('confirm', null, 'update', textString, "getMaxTrimps()", "Max Trimps", "Refresh", true);
}
function getMaxResources(what) {
var structure;
switch (what) {
case "Food":
structure = "Barn";
break;
case "Wood":
structure = "Shed";
break;
case "Metal":
structure = "Forge";
break;
}
if (!structure) return;
var structureObj = game.buildings[structure];
var base = 500;
var textString = "<table class='bdTable table table-striped'><tbody>";
//Add base
var currentCalc = base;
textString += "<tr><td class='bdTitle'>基础</td><td class='bdPercent'></td><td class='bdNumber'>" + base + "</td></tr>";
//Add structure
var structBonus = Math.pow(2, structureObj.owned);
currentCalc *= structBonus;
structBonus = prettify(structBonus * 100) + "%";
textString += "<tr><td class='bdTitle'>" + cnwhat(structure) + "</td><td class='bdPercent'>+ " + structBonus + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
//Add packrat
if (game.portal.Packrat.level){
var packAmt = (game.portal.Packrat.level * 0.2) + 1;
currentCalc *= packAmt;
packAmt = prettify((packAmt - 1) * 100) + '%';
textString += "<tr><td class='bdTitle'>包装</td><td class='bdPercent'>+ " + packAmt + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (game.heirlooms.Shield.storageSize.currentBonus > 0){
var hatAmt = calcHeirloomBonus("Shield", "storageSize", 0, true);
currentCalc *= ((hatAmt / 100) + 1);
hatAmt = prettify(hatAmt) + '%';
textString += "<tr><td class='bdTitle'>传家宝 (护盾)</td><td class='bdPercent'>+ " + hatAmt + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
textString += "</tbody></table>";
game.global.lockTooltip = false;
tooltip('confirm', null, 'update', textString, "getMaxResources('" + what + "')", "Max " + what, "Refresh", true);
}
function getLootBd(what) {
var map;
var world;
var level = "";
var cell;
if (game.global.mapsActive) {
map = getCurrentMapObject();
cell = game.global.lastClearedMapCell + 1;
level = scaleLootLevel(cell, map.level);
world = map.level;
} else {
cell = game.global.lastClearedCell + 1;
level = scaleLootLevel(cell);
world = game.global.world;
}
var textString = ' <div><ul id="lootBdTabs" class="nav nav-tabs nav-justified"><li role="presentation" onclick="getLootBd(\'Food/Wood/Metal\')"><a href="#">Food/Wood/Metal</a></li>';
if (game.global.mapsUnlocked) textString += '<li role="presentation" onclick="getLootBd(\'Fragments\')"><a href="#">Fragments</a></li><li role="presentation" onclick="getLootBd(\'Gems\')"><a href="#">Gems</a></li>';
if (game.global.world >= 20) textString += '<li role="presentation" onclick="getLootBd(\'Helium\')"><a href="#">Helium</a></li>';
textString += '</ul></div>';
textString += "<table class='bdTableSm table table-striped'><tbody><tr><td style='font-weight: bold; font-size: 1.1em'>" + what + "</td><td>基础</td><td>Amount</td><td>Line Total</td><td>总计</td></tr>";
var currentCalc = 0;
var percent = 0;
var amt = 0;
switch(what) {
case "Food/Wood/Metal":
var tempModifier = 0.5 * Math.pow(1.25, (game.global.world >= 59) ? 59 : game.global.world);
//Mega books
if (game.global.world >= 60) {
if (game.global.frugalDone) tempModifier *= Math.pow(1.6, game.global.world - 59);
else tempModifier *= Math.pow(1.5, game.global.world - 59);
}
//Bounty
if (game.global.world >= 15) tempModifier *= 2;
//Whipimp
if (game.unlocks.impCount.Whipimp) tempModifier *= Math.pow(1.003, game.unlocks.impCount.Whipimp);
var avgSec = tempModifier;
if (game.global.world < 100)
amt = avgSec * 3.5;
else
amt = avgSec * 5;
amt = (amt * .8) + ((amt * .002) * (cell + 1));
currentCalc = amt;
if ((game.talents.turkimp4.purchased || game.global.turkimpTimer > 0) && (game.global.playerGathering == "food" || game.global.playerGathering == "metal" || game.global.playerGathering == "wood")){
//Average the bonus out amongst all 3 resources. I can't remember why turkimp3 is 1.249 instead of 1.25 but at this point I'm too scared to change it
var tBonus = 1.166;
if (game.talents.turkimp4.purchased) tBonus = 1.333;
else if (game.talents.turkimp3.purchased) tBonus = 1.249;
amt *= tBonus;
}
textString += "<tr><td class='bdTitle'>基础</td><td></td><td></td><td>" + prettify(amt) + "</td><td>" + prettify(currentCalc) + "</td></tr>";
amt = game.resources.trimps.realMax() * 0.16;
currentCalc *= amt;
textString += "<tr><td class='bdTitle'>Trimps</td><td>0.16</td><td>x " + prettify(game.resources.trimps.realMax()) + "</td><td>x " + prettify(amt) + "</td><td>" + prettify(currentCalc) + "</td></tr>";
break;
case "Gems":
level = (level - 400) * 1.35;
if (level < 0) {
level = 0;
}
amt = Math.round(0.5 * Math.pow(1.23, Math.sqrt(level)));
amt += Math.round(0.5 * level);
amt = (amt * .8) + ((amt * .002) * (cell + 1));
currentCalc = amt;
textString += "<tr><td class='bdTitle'>基础</td><td></td><td></td><td>" + prettify(amt) + "</td><td>" + prettify(currentCalc) + "</td></tr>";
if (game.jobs.Dragimp.owned >= 1){
amt = 1.5 * game.jobs.Dragimp.modifier;
amt = (amt * .8) + ((amt * .002) * (cell + 1));
currentCalc += amt;
textString += "<tr><td class='bdTitle'>Dragimp Scouting</td><td></td><td></td><td>+ " + prettify(amt) + "</td><td>" + prettify(currentCalc) + "</td></tr>";
}
break;
case "Fragments":
amt = Math.floor(Math.pow(1.15, game.global.world) * game.global.world * game.global.world * 0.02);
currentCalc = amt;
textString += "<tr><td class='bdTitle'>基础</td><td></td><td></td><td>" + prettify(amt) + "</td><td>" + prettify(currentCalc) + "</td></tr>";
break;
case "Helium":
var level = scaleLootLevel(99);
level = Math.round((level - 1900) / 100);
level *= 1.35;
if (level < 0) level = 0;
var baseAmt = 0;
if (game.global.world < 59) baseAmt = 1;
else if (game.global.world < mutations.Corruption.start(true)) baseAmt = 5;
else baseAmt = 10;
var amt = Math.round(baseAmt * Math.pow(1.23, Math.sqrt(level)));
amt += Math.round(baseAmt * level);
amt /= baseAmt;
currentCalc = amt;
textString += "<tr><td class='bdTitle'>基础</td><td></td><td></td><td>" + prettify(amt) + "</td><td>" + prettify(currentCalc) + "</td></tr>";
if (baseAmt >= 5){
if (mutations.Magma.active()){
currentCalc *= 15;
textString += "<tr><td class='bdTitle'>综合奖金</td><td></td><td></td><td>X 15</td><td>" + prettify(currentCalc) + "</td></tr>";
}
else {
currentCalc *= 5;
textString += "<tr><td class='bdTitle'>非概率奖金</td><td></td><td></td><td>X 5</td><td>" + prettify(currentCalc) + "</td></tr>";
}
}
if (baseAmt >= 10){
currentCalc *= 2;
textString += "<tr><td class='bdTitle'>腐败奖金</td><td></td><td></td><td>X 2</td><td>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.sLevel >= 5){
amt = Math.pow(1.005, game.global.world);
currentCalc *= amt;
textString += "<tr><td class='bdTitle'>科学家 V</td><td></td><td></td><td>X " + prettify(amt) + "</td><td>" + prettify(currentCalc) + "</td></tr>";
}
if (game.goldenUpgrades.Helium.currentBonus > 0){
amt = game.goldenUpgrades.Helium.currentBonus;
currentCalc *= 1 + amt;
textString += "<tr><td class='bdTitle'>金色氦</td><td></td><td></td><td>+ " + prettify(amt * 100) + "%</td><td>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.voidBuff) {
currentCalc *= 2;
textString += "<tr><td class='bdTitle'>虚空地图</td><td></td><td></td><td>X 2</td><td>" + prettify(currentCalc) + "</td></tr>";
}
var fluffyBonus = Fluffy.isRewardActive("helium");
if (fluffyBonus > 0){
currentCalc += (currentCalc * (0.25 * fluffyBonus));
textString += "<tr><td class='bdTitle'>Fluffy Helium</td><td>25%</td><td>" + fluffyBonus + "</td><td>+ " + (25 * fluffyBonus) + "%</td><td>" + prettify(currentCalc) + "</td></tr>";
}
}
if (game.global.mapsActive && what != "Helium") {
var compareLv = game.global.world;
if (world > compareLv && map.location != "Bionic"){
amt = Math.pow(1.1, (world - compareLv));
currentCalc *= amt;
textString += "<tr><td class='bdTitle'>额外的地图区域</td><td>+10%</td><td>x " + (world - compareLv) + "</td><td>+ " + prettify((amt - 1) * 100) + "%</td><td>" + prettify(currentCalc) + "</td></tr>";
}
else {
if (game.talents.mapLoot.purchased)
compareLv--;
if (world < compareLv){
//-20% loot compounding for each level below world
amt = Math.pow(0.8, (compareLv - world));
currentCalc *= amt;
textString += "<tr style='color: red'><td class='bdTitle'>Low Map Level</td><td>-20%</td><td>x " + (compareLv - world) + "</td><td>" + prettify(amt * 100) + "%</td><td>" + prettify(currentCalc) + "</td></tr>";
}
}
//Add map loot bonus
currentCalc = Math.round(currentCalc * map.loot);
textString += "<tr><td class='bdTitle'>地图搜括</td><td></td><td></td><td>+ " + Math.round((map.loot - 1) * 100) + "%</td><td>" + prettify(currentCalc) + "</td></tr>";
}
if (game.portal.Looting.level){
amt = (1 + (game.portal.Looting.level * game.portal.Looting.modifier));
currentCalc *= amt;
textString += "<tr><td class='bdTitle'>搜括 (额外福利)</td><td>+ 5%</td><td>" + game.portal.Looting.level + "</td><td>+ " + prettify((amt - 1) * 100) + "%</td><td>" + prettify(currentCalc) + "</td></tr>";
}
if (game.portal.Looting_II.level){
amt = (1 + (game.portal.Looting_II.level * game.portal.Looting_II.modifier));
currentCalc *= amt;
textString += "<tr><td class='bdTitle'>抢劫 II (额外福利)</td><td>+ " + prettify(game.portal.Looting_II.modifier * 100) + "%</td><td>" + game.portal.Looting_II.level + "</td><td>+ " + prettify((amt - 1) * 100) + "%</td><td>" + prettify(currentCalc) + "</td></tr>";
}
if (game.unlocks.impCount.Magnimp && what != "Helium"){
amt = Math.pow(1.003, game.unlocks.impCount.Magnimp);
currentCalc = Math.floor(currentCalc * amt);
textString += "<tr><td class='bdTitle'>Magnimp</td><td>+ 0.3%</td><td>" + game.unlocks.impCount.Magnimp + "</td><td>+ " + prettify((amt - 1) * 100) + "%</td><td>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.challengeActive == "Toxicity"){
var toxMult = (game.challenges.Toxicity.lootMult * game.challenges.Toxicity.stacks) / 100;
currentCalc *= (1 + toxMult);
toxMult = (toxMult * 100).toFixed(1) + "%";
textString += "<tr><td class='bdTitle'>调整 (毒性)</td><td>+" + game.challenges.Toxicity.lootMult + "%</td><td>" + game.challenges.Toxicity.stacks + "</td><td>+ " + toxMult + "</td><td>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.challengeActive == "Decay" && what != "Helium"){
currentCalc *= 10;
textString += "<tr><td class='bdTitle'>明智 (衰变)</td><td></td><td></td><td class='bdPercent'>x 10</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
var stackStr = Math.pow(0.995, game.challenges.Decay.stacks);
currentCalc *= stackStr;
textString += "<tr style='color: red'><td class='bdTitle'>衰变</td><td>x 0.995</td><td>" + game.challenges.Decay.stacks + "</td><td class='bdPercent'>x " + stackStr.toFixed(3) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.challengeActive == "Watch" && what != "Helium"){
currentCalc /= 2;
textString += "<tr style='color: red'><td class='bdTitle'>昏昏欲睡 (注视)</td><td></td><td></td><td class='bdPercent'>50%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.challengeActive == "Lead" && ((game.global.world % 2) == 1)){
currentCalc *= 2;
textString += "<tr><td class='bdTitle'>决心 (领导)</td><td></td><td></td><td class='bdPercent'>+ 100%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.challengeActive == "Daily"){
if (typeof game.global.dailyChallenge.famine !== 'undefined' && what != "Fragments" && what != "Helium"){
mult = dailyModifiers.famine.getMult(game.global.dailyChallenge.famine.strength);
currentCalc *= mult;
textString += "<tr style='color: red'><td class='bdTitle'>饥荒 (日常)</td><td class='bdPercent'>" + prettify(mult * 100) + "%</td><td></td><td>" + prettify(mult * 100) + "%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (typeof game.global.dailyChallenge.karma !== 'undefined' && what != "Helium"){
mult = dailyModifiers.karma.getMult(game.global.dailyChallenge.karma.strength, game.global.dailyChallenge.karma.stacks);
currentCalc *= mult;
textString += "<tr><td class='bdTitle'>业力 (日常)</td><td class='bdPercent'>x " + mult.toFixed(3) + "</td><td></td><td>x " + mult.toFixed(3) + "</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>"
}
}
if (game.global.spireRows > 0){
var spireRowBonus = (game.talents.stillRowing.purchased) ? 0.03 : 0.02;
amt = game.global.spireRows * spireRowBonus;
currentCalc *= (1 + amt);
textString += "<tr><td class='bdTitle'>尖顶行</td><td>+ " + Math.round(spireRowBonus * 100) + "%</td><td>" + game.global.spireRows + "</td><td>+ " + prettify(amt * 100) + "%</td><td>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.voidBuff && what == "Helium" && game.talents.voidSpecial.purchased){
amt = (game.global.lastPortal * 0.0025);
currentCalc *= (1 + amt);
textString += "<tr><td class='bdTitle'>Void Special</td><td></td><td></td><td>+ " + prettify(amt * 100) + "%</td><td>" + prettify(currentCalc) + "</td></tr>";
}
if (what != "Fragments" && getEmpowerment() == "Wind" && (what != "Helium" || !game.global.mapsActive)){
var windMod;
var baseMod = game.empowerments.Wind.getModifier() * 100;
if (what == "Helium"){
windMod = game.empowerments.Wind.getCombatModifier();
}
else{
windMod = game.empowerments.Wind.getCombatModifier() * 10;
baseMod *= 10;
}
currentCalc *= (1 + windMod);
textString += "<tr><td class='bdTitle'>敏捷 (风)</td><td>" + prettify(baseMod) + "%</td><td>" + prettify(game.empowerments.Wind.currentDebuffPower) + "</td><td class='bdPercent'>+ " + prettify(windMod * 100) +"%</td><td class='bdNumber'>" + prettify(currentCalc) + "</td></tr>";
}
if (what != "Helium" && game.global.formation == 4 && !game.global.waitToScry){
currentCalc *= 2;
textString += "<tr><td class='bdTitle'>队形</td><td></td><td></td><td>X 2</td><td>" + prettify(currentCalc) + "</td></tr>";
}
var heirloomBonus = 0;
if (what == "Food/Wood/Metal"){
heirloomBonus = calcHeirloomBonus("Staff", "foodDrop", 0, true);
if (heirloomBonus > 0){
textString += "<tr><td class='bdTitle'>传家宝 - 食物 (员工)</td><td></td><td></td><td>+ " + prettify(heirloomBonus) + "%</td><td>" + prettify(currentCalc * ((heirloomBonus / 100) + 1)) + "</td></tr>";
heirloomBonus = 0;
}
heirloomBonus = calcHeirloomBonus("Staff", "woodDrop", 0, true);
if (heirloomBonus > 0){
textString += "<tr><td class='bdTitle'>传家宝 - 木头 (员工)</td><td></td><td></td><td>+ " + prettify(heirloomBonus) + "%</td><td>" + prettify(currentCalc * ((heirloomBonus / 100) + 1)) + "</td></tr>";
heirloomBonus = 0;
}
heirloomBonus = calcHeirloomBonus("Staff", "metalDrop", 0, true);
if (heirloomBonus > 0){
textString += "<tr><td class='bdTitle'>传家宝 - 金属 (员工)</td><td></td><td></td><td>+ " + prettify(heirloomBonus) + "%</td><td>" + prettify(currentCalc * ((heirloomBonus / 100) + 1)) + "</td></tr>";
heirloomBonus = 0;
}
}
else if (what == "Fragments"){
heirloomBonus = calcHeirloomBonus("Staff", "fragmentsDrop", 0, true);
if (heirloomBonus > 0){
textString += "<tr><td class='bdTitle'>传家宝 (员工)</td><td></td><td></td><td>+ " + prettify(heirloomBonus) + "%</td><td>" + prettify(currentCalc * ((heirloomBonus / 100) + 1)) + "</td></tr>";
heirloomBonus = 0;
}
}
else if (what == "Gems"){
heirloomBonus = calcHeirloomBonus("Staff", "gemsDrop", 0, true);
if (heirloomBonus > 0){
textString += "<tr><td class='bdTitle'>传家宝 (员工)</td><td></td><td></td><td>+ " + prettify(heirloomBonus) + "%</td><td>" + prettify(currentCalc * ((heirloomBonus / 100) + 1)) + "</td></tr>";
heirloomBonus = 0;
}
}
if (game.global.totalSquaredReward > 0 && what == "Helium"){
amt = game.global.totalSquaredReward / 1000;
currentCalc *= (amt + 1);
textString += "<tr><td class='bdTitle'>挑战² 奖励</td><td></td><td></td><td>+" + prettify(amt * 100) + "%</td><td>" + prettify(currentCalc) + "</td></tr>";
}
if (game.global.runningChallengeSquared && what == "Helium"){
currentCalc = 0;
textString += "<tr class='colorSquared'><td class='bdTitle'>挑战²</td><td></td><td></td><td>0%</td><td>" + prettify(currentCalc) + "</td></tr>";
}
//Corruption - World
var fullCorVal = currentCalc;
if (what == "Helium" && !game.global.voidBuff && (game.global.world >= mutations.Corruption.start())){
var corrVal = (game.global.challengeActive == "Corrupted") ? 7.5 : 15;
var corrCount = mutations.Corruption.cellCount();
if (mutations.Healthy.active()) corrCount -= mutations.Healthy.cellCount();
var corrCalc = (corrVal / 100) * currentCalc;
fullCorVal = currentCalc + (corrCalc * corrCount);
textString += "<tr class='corruptedCalcRow'><td class='bdTitle' style='vertical-align: middle'>Corruption Value</td><td>" + corrVal + "%<br/>" + corrCount + " Cells</td><td>Per Cell:<br/>" + prettify(corrCalc) + "</td><td>Per Zone:<br/>" + prettify(Math.round(corrCalc * corrCount)) + "</td><td style='vertical-align: middle'>" + prettify(fullCorVal) + "</td></tr>";
//<tr><td class='bdTitle'>Total Per Zone</td><td></td><td></td><td></td><td>" + prettify(currentCalc + (corrCalc * corrVal)) + "</td></tr>
}
//Healthy - World
if (what == "Helium" && mutations.Healthy.active() && !game.global.voidBuff){
var healthyCount = mutations.Healthy.cellCount();
var healthyVal = 45;
var healthyCalc = (healthyVal / 100) * currentCalc;
textString += "<tr class='healthyCalcRow'><td class='bdTitle' style='vertical-align: middle'>Healthy Value</td><td>" + healthyVal + "%<br/>" + healthyCount + " Cells</td><td>Per Cell:<br/>" + prettify(healthyCalc) + "</td><td>Per Zone:<br/>" + prettify(Math.round(healthyCalc * healthyCount)) + "</td><td style='vertical-align: middle'>" + prettify(fullCorVal + (healthyCalc * healthyCount)) + "</td></tr>";
}
//Healthy - Void Maps
if (what == "Helium" && game.global.voidBuff && mutations.Corruption.active()){
var corruptedCells = mutations.Corruption.cellCount();
if (mutations.Healthy.active()) corruptedCells -= mutations.Healthy.cellCount();
var corrVal = (game.global.challengeActive == "Corrupted") ? 7.5 : 15;
var percent = ((corrVal / 100) * (corruptedCells));
if (mutations.Healthy.active()){
textString += "<tr class='corruptedCalcRow mutationSumRow'><td class='bdTitle'>Corruption Value</td><td>" + corrVal + "%</td><td>" + corruptedCells + "</td><td>+ " + prettify(Math.round(percent * 100)) + "%</td><td></td></tr>";
var healthyCells = mutations.Healthy.cellCount();
var healthyVal = 45;
var healthyPercent = ((healthyVal / 100) * (healthyCells));
textString += "<tr class='healthyCalcRow mutationSumRow'><td class='bdTitle'>Healthy Value</td><td>" + healthyVal + "%</td><td>" + healthyCells + "</td><td>+ " + prettify(Math.round(healthyPercent * 100)) + "%</td><td></td></tr>";
var mutationPercent = (percent + healthyPercent);
currentCalc *= (mutationPercent + 1);
textString += "<tr class='mutationSumRow mutationTotalRow'><td class='bdTitle'>Mutation Total</td><td></td><td>" + (healthyCells + corruptedCells) + "</td><td>+ " + prettify(Math.round(mutationPercent * 100)) + "%</td><td>" + prettify(currentCalc) + "</td></tr>";
}
else {
percent++;
currentCalc *= percent;
textString += "<tr class='corruptedCalcRow'><td class='bdTitle'>Corruption Value</td><td>" + corrVal + "%</td><td>" + corruptedCells + "</td><td>X " + prettify(percent) + "</td><td>" + prettify(currentCalc) + "</td></tr>";
}
}
textString += "</tbody></table>";
game.global.lockTooltip = false;
tooltip('confirm', null, 'update', textString, "getLootBd('" + what + "')", what + " Loot Breakdown", "Refresh", true);
}
function swapNotation(updateOnly){
if (!updateOnly) game.options.menu.standardNotation.enabled = !game.options.menu.standardNotation.enabled;
document.getElementById("notationBtn").innerHTML = (game.options.menu.standardNotation.enabled) ? "Standard Notation" : "Scientific Notation";
if (game.global.fighting) updateAllBattleNumbers();
}
function prettify(number) {
var numberTmp = number;
if (!isFinite(number)) return "<span class='icomoon icon-infinity'></span>";
if (number >= 1000 && number < 10000) return Math.floor(number);
if (number === 0) return prettifySub(0);
if (number < 0) return "-" + prettify(-number);
var base = Math.floor(Math.log(number)/Math.log(1000));
if (base <= 0) return prettifySub(number);
number /= Math.pow(1000, base);
if (number >= 999.5) {
// 999.5 rounds to 1000 and we don’t want to show “1000K” or such
number /= 1000;
++base;
}
if (game.options.menu.standardNotation.enabled == 3){
var suffices = ["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"];
if (base <= suffices.length) suffix = suffices[base -1];
else {
var suf2 = (base % suffices.length) - 1;
if (suf2 < 0) suf2 = suffices.length - 1;
suffix = suffices[Math.ceil(base / suffices.length) - 2] + suffices[suf2];
}
}
else {
var suffices = [
'K', 'M', 'B', 'T', 'Qa', 'Qi', 'Sx', 'Sp', 'Oc', 'No', 'Dc', 'Ud',
'Dd', 'Td', 'Qad', 'Qid', 'Sxd', 'Spd', 'Od', 'Nd', 'V', 'Uv', 'Dv',
'Tv', 'Qav', 'Qiv', 'Sxv', 'Spv', 'Ov', 'Nv', 'Tg', 'Utg', 'Dtg', 'Ttg',
'Qatg', 'Qitg', 'Sxtg', 'Sptg', 'Otg', 'Ntg', 'Qaa', 'Uqa', 'Dqa', 'Tqa',
'Qaqa', 'Qiqa', 'Sxqa', 'Spqa', 'Oqa', 'Nqa', 'Qia', 'Uqi', 'Dqi',
'Tqi', 'Qaqi', 'Qiqi', 'Sxqi', 'Spqi', 'Oqi', 'Nqi', 'Sxa', 'Usx',
'Dsx', 'Tsx', 'Qasx', 'Qisx', 'Sxsx', 'Spsx', 'Osx', 'Nsx', 'Spa',
'Usp', 'Dsp', 'Tsp', 'Qasp', 'Qisp', 'Sxsp', 'Spsp', 'Osp', 'Nsp',
'Og', 'Uog', 'Dog', 'Tog', 'Qaog', 'Qiog', 'Sxog', 'Spog', 'Oog',
'Nog', 'Na', 'Un', 'Dn', 'Tn', 'Qan', 'Qin', 'Sxn', 'Spn', 'On',
'Nn', 'Ct', 'Uc'
];
var suffix;
if (game.options.menu.standardNotation.enabled == 2 || (game.options.menu.standardNotation.enabled == 1 && base > suffices.length) || (game.options.menu.standardNotation.enabled == 4 && base > 31))
suffix = "e" + ((base) * 3);
else if (game.options.menu.standardNotation.enabled && base <= suffices.length)
suffix = suffices[base-1];
else
{
var exponent = parseFloat(numberTmp).toExponential(2);
exponent = exponent.replace('+', '');
return exponent;
}
}
return prettifySub(number) + suffix;
}
function romanNumeral(number){
//This is only accurate up to 399, but that's more than plenty for this game. Probably not the cleanest converter ever, but I thought of it myself, it works, and I'm proud.
var numeral = "";
while (number >= 100){
number -= 100;
numeral += "C";
}
//77
if (number >= 90){
number -= 90;
numeral += "XC";
}
if (number >= 50){
number -= 50;
numeral += "L";
}
if (number >= 40){
number -= 40;
numeral += "XL";
}
while (number >= 10){
number -= 10;
numeral += "X";
}
if (number >= 9){
number -= 9;
numeral += "IX";
}
if (number >= 5){
number -= 5;
numeral += "V";
}
if (number >= 4){
number -= 4;
numeral += "IV";
}
while (number >= 1){
number -= 1;
numeral += "I";
}
return numeral;
}
function prettifySub(number){
number = parseFloat(number);
var floor = Math.floor(number);
if (number === floor) // number is an integer, just show it as-is
return number;
var precision = 3 - floor.toString().length; // use the right number of digits
return number.toFixed(3 - floor.toString().length);
}
function resetGame(keepPortal) {
if (game.options.menu.pauseGame.enabled){
game.options.menu.pauseGame.enabled = 0;
game.options.menu.pauseGame.onToggle();
}
game.resources.trimps.soldiers = 0;
game.global.autoBattle = false;
document.getElementById("wood").style.visibility = "hidden";
document.getElementById("metal").style.visibility = "hidden";
document.getElementById("trimps").style.visibility = "hidden";
document.getElementById("gems").style.visibility = "hidden";
document.getElementById("fragments").style.visibility = "hidden";
document.getElementById("buyCol").style.visibility = "hidden";
document.getElementById("unempHide").style.visibility = "hidden";
document.getElementById("empHide").style.visibility = "hidden";
document.getElementById("upgradesTitleSpan").innerHTML = "升级(先做研究)";
document.getElementById("science").style.visibility = "hidden";
document.getElementById("battleContainer").style.visibility = "hidden";
document.getElementById("pauseFight").style.display = "none";
document.getElementById("blockDiv").style.visibility = "hidden";
document.getElementById("badGuyCol").style.visibility = "hidden";
document.getElementById("jobsHere").innerHTML = "";
document.getElementById("jobsTab").style.visibility = "hidden";
document.getElementById("upgradesTab").style.visibility = "hidden";
document.getElementById("equipmentTab").style.visibility = "hidden";
document.getElementById("foremenCount").innerHTML = "";
document.getElementById("upgradesHere").innerHTML = "";
document.getElementById("mapsBtn").style.display = "none";
document.getElementById("grid").style.display = "block";
document.getElementById("preMaps").style.display = "none";
document.getElementById("mapGrid").style.display = "none";
document.getElementById("buildingsHere").innerHTML = "";
document.getElementById("grid").innerHTML = "";
document.getElementById("equipmentHere").innerHTML = "";
document.getElementById("queueItemsHere").innerHTML = "";
var log = document.getElementById("log");
log.innerHTML = "";
log.scrollTop = log.scrollHeight;
document.getElementById("worldNumber").innerHTML = "1";
document.getElementById("mapsHere").innerHTML = "";
document.getElementById("sciencePs").innerHTML = "+0/秒";
document.getElementById("repeatBtn").style.display = "none";
document.getElementById("helium").style.visibility = "hidden";
document.getElementById("jobsTitleDiv").style.display = "none";
document.getElementById("upgradesTitleDiv").style.display = "none";
document.getElementById("equipmentTitleDiv").style.display = "none";
document.getElementById("portalBtn").style.display = "none";
document.getElementById("respecPortalBtn").style.display = "none";
document.getElementById("battleHeadContainer").style.display = "block";
document.getElementById("mapsCreateRow").style.display = "none";
document.getElementById("worldName").innerHTML = "区域";
document.getElementById("wrapper").style.background = "url(css/bg2.png) center repeat-x";
document.getElementById("wrapper").className = "wrapperUnbroken"
document.getElementById("turkimpBuff").style.display = "none";
document.getElementById("statsBtnRow").style.display = "block";
document.getElementById("mapsBtnText").innerHTML = "地图";
document.getElementById("mapBonus").innerHTML = "";
document.getElementById("roboTrimpTurnsLeft").innerHTML = "";
swapClass("shriekState", "shriekStateCooldown", document.getElementById("chainHolder"));
document.getElementById("chainHolder").style.visibility = "hidden";
swapClass("dmgColor", "dmgColorWhite", document.getElementById("badGuyAttack"));
document.getElementById("badCrit").innerHTML = "";
document.getElementById("badCanCrit").style.display = "none";
document.getElementById("autoUpgradeBtn").style.display = "none";
document.getElementById("autoPrestigeBtn").style.display = "none";
document.getElementById("voidBuff").innerHTML = "";
document.getElementById("voidMapsHere").innerHTML = "";
document.getElementById("heirloomWrapper").style.display = "none";
document.getElementById("heirloomBtnContainer").style.display = "none";
document.getElementById("goodGuyName").innerHTML = '脆皮 (<span id="trimpsFighting">1</span>) <span id="anticipationSpan"></span> <span id="titimpBuff"></span> <span id="debuffSpan"></span>';
document.getElementById("autoStorageBtn").style.display = "none";
document.getElementById("repeatVoidsContainer").style.display = "none";
document.getElementById('corruptionBuff').innerHTML = "";
document.getElementById("portalTimer").className = "timerNotPaused";
document.getElementById("grid").className = "";
document.getElementById('exitSpireBtnContainer').style.display = "none";
document.getElementById('badDebuffSpan').innerHTML = "";
document.getElementById('heliumPh').innerHTML = "";
document.getElementById("mapCreditsLeft").innerHTML = "";
document.getElementById("swapToCurrentChallengeBtn").style.display = "none";
document.getElementById('autoGoldenBtn').style.display = "none";
document.getElementById('scienceCollectBtn').style.display = "block";
document.getElementById('trimpsBreedingTitle').innerHTML = "配种";
lookingAtCurrentChallenge = false;
swapClass("col-xs", "col-xs-10", document.getElementById("gridContainer"));
swapClass("col-xs", "col-xs-off", document.getElementById("extraMapBtns"));
mutations.Magma.multiplier = -1;
mutations.Magma.lastCalculatedMultiplier = -1;
game.achievements.humaneRun.earnable = true;
game.achievements.humaneRun.lastZone = 0;
heirloomsShown = false;
goldenUpgradesShown = false;
game.global.selectedHeirloom = [];
resetOnePortalRewards();
playFabLoginErrors = 0;
setFormation("0");
hideFormations();
hideBones();
cancelTooltip();
for (var item in game.resources){
var elem = document.getElementById(item + "Ps");
if (elem !== null) elem.innerHTML = "+0/秒";
}
filterTabs("all");
var gatherBtns = ["buildings", "food", "wood", "metal", "science", "trimps"];
for (var gatherBtn in gatherBtns){
setGather(gatherBtns[gatherBtn], true);
}
var messages = game.global.messages;
var portal;
var helium;
var b;
var imps;
var highestLevel;
var challenge = "";
var sLevel = 0;
var lastSkele;
var bestHelium;
var totalHeliumEarned;
var options = game.options;
var prison;
var frugal;
var slow;
var stats;
var repeat;
var achieves;
var pres;
var roboTrimp;
var autoStorage;
var heirloomStuff = {};
var lastPortal;
var autoStorageActive;
var autoPrestiges;
var autoUpgrades;
var heirloomBoneSeed;
var voidMaxLevel;
var autoUpgradesAvailable;
var rememberInfo;
var playFabLoginType;
var GeneticistassistSetting;
var Geneticistassist
var GeneticistassistSteps;
var essence;
var spentEssence;
var talents;
var decayDone;
var recentDailies;
var trapBuildToggled;
var magmite;
var genUpgrades;
var permanentGenUpgrades;
var genMode;
var advMaps;
var lastBonePresimpt;
var challengeSquared = false;
var c2s;
var perkPresets;
var improvedAutoStorage;
var firstCustomAmt;
var firstCustomExact;
var autoStructureSetting;
var pauseFightMember; //Member? I Member
var autoGolden;
var heirloomSeed;
var empowerments;
var spiresCompleted;
var hideMapRow;
var fluffyExp;
var fluffyPrestige;
var canMapAtZone;
if (keepPortal){
portal = game.portal;
helium = game.global.heliumLeftover;
totalPortals = game.global.totalPortals;
b = game.global.b;
imps = game.unlocks.imps;
highestLevel = game.global.highestLevelCleared;
sLevel = game.global.sLevel;
lastSkele = game.global.lastSkeletimp;
totalHeliumEarned = game.global.totalHeliumEarned;
prison = game.global.prisonClear;
frugal = game.global.frugalDone;
slow = game.global.slowDone;
autoStorage = game.global.autoStorageAvailable;
autoUpgradesAvailable = game.global.autoUpgradesAvailable;
decayDone = game.global.decayDone;
if (game.global.dailyHelium) game.global.tempHighHelium -= game.global.dailyHelium;
bestHelium = (game.global.tempHighHelium > game.global.bestHelium) ? game.global.tempHighHelium : game.global.bestHelium;
if (game.stats.bestHeliumHour.valueTotal < game.stats.heliumHour.value(true)){
game.stats.bestHeliumHour.valueTotal = game.stats.heliumHour.value(true);
}
stats = game.stats;
repeat = game.global.repeatMap;
if (game.global.selectedChallenge) challenge = game.global.selectedChallenge;
achieves = game.achievements;
pres = game.global.presimptStore;
roboTrimp = game.global.roboTrimpLevel;
lastPortal = game.global.world;
recentDailies = game.global.recentDailies;
trapBuildToggled = game.global.trapBuildToggled;
recycleAllExtraHeirlooms();
heirloomStuff = {
heirloomsCarried: game.global.heirloomsCarried,
StaffEquipped: game.global.StaffEquipped,
ShieldEquipped: game.global.ShieldEquipped,
nullifium: game.global.nullifium,
maxCarriedHeirlooms: game.global.maxCarriedHeirlooms,
};
perkPresets = {
perkPreset1: game.global.perkPreset1,
perkPreset2: game.global.perkPreset2,
perkPreset3: game.global.perkPreset3
};
autoStorageActive = game.global.autoStorage;
autoPrestiges = game.global.autoPrestiges;
autoUpgrades = game.global.autoUpgrades;
heirloomBoneSeed = game.global.heirloomBoneSeed;
heirloomSeed = game.global.heirloomSeed;
voidMaxLevel = game.global.voidMaxLevel;
playFabLoginType = game.global.playFabLoginType;
rememberInfo = game.global.rememberInfo;
GeneticistassistSetting = game.global.GeneticistassistSetting;
Geneticistassist = game.global.Geneticistassist;
GeneticistassistSteps = game.global.GeneticistassistSteps;
essence = game.global.essence;
talents = game.talents;
spentEssence = game.global.spentEssence;
magmite = (game.global.magmite > 0) ? Math.floor(game.global.magmite * ((100 - getMagmiteDecayAmt()) / 100)) : 0;
genUpgrades = game.generatorUpgrades;
permanentGenUpgrades = game.permanentGeneratorUpgrades;
genMode = game.global.generatorMode;
advMaps = game.global.mapPresets;
lastBonePresimpt = game.global.lastBonePresimpt;
challengeSquared = game.global.runningChallengeSquared;
improvedAutoStorage = game.global.improvedAutoStorage;
c2s = game.c2;
firstCustomAmt = (game.global.firstCustomAmt != -1) ? game.global.firstCustomAmt : game.global.lastCustomAmt;
firstCustomExact = (game.global.firstCustomExact != -1) ? game.global.firstCustomExact: game.global.lastCustomExact;
autoStructureSetting = game.global.autoStructureSetting;
pauseFightMember = game.global.pauseFight;
autoGolden = game.global.autoGolden;
empowerments = game.empowerments;
spiresCompleted = game.global.spiresCompleted;
hideMapRow = game.global.hideMapRow;
fluffyExp = game.global.fluffyExp;
fluffyPrestige = game.global.fluffyPrestige;
canMapAtZone = game.global.canMapAtZone;
if (!game.global.canMagma) {
if (highestLevel > 229) highestLevel = 229;
if (roboTrimp > 8) roboTrimp = 8;
}
}
game = null;
game = newGame();
game.global.autoSave = autoSave;
game.global.messages = messages;
game.options = options;
if (keepPortal){
game.achievements = achieves;
calculateAchievementBonus();
game.global.bestHelium = bestHelium;
game.portal = portal;
game.global.b = b;
game.global.heliumLeftover = helium;
game.global.totalPortals = totalPortals;
game.unlocks.imps = imps;
game.global.highestLevelCleared = highestLevel;
game.global.challengeActive = challenge;
game.global.recentDailies = recentDailies;
if (challenge == "Daily") game.global.dailyChallenge = getDailyChallenge(readingDaily, true, false);
game.global.sLevel = sLevel;
game.global.lastSkeletimp = lastSkele;
game.global.totalHeliumEarned = totalHeliumEarned;
game.global.prisonClear = prison;
game.global.frugalDone = frugal;
game.global.slowDone = slow;
game.global.autoStorageAvailable = autoStorage;
game.global.roboTrimpLevel = roboTrimp;
game.global.lastPortal = lastPortal;
game.global.autoStorage = autoStorageActive;
game.global.autoPrestiges = autoPrestiges;
game.global.autoUpgrades = autoUpgrades;
game.global.autoUpgradesAvailable = autoUpgradesAvailable;
game.global.playFabLoginType = playFabLoginType;
game.global.rememberInfo = rememberInfo;
game.global.heirloomBoneSeed = heirloomBoneSeed;
game.global.heirloomSeed = heirloomSeed;
game.global.trapBuildToggled = trapBuildToggled;
game.global.GeneticistassistSetting = (game.options.menu.GeneticistassistTarget.disableOnUnlock) ? -1 : GeneticistassistSetting;
game.global.Geneticistassist = Geneticistassist;
game.global.GeneticistassistSteps = GeneticistassistSteps;
game.global.essence = essence;
game.global.spentEssence = spentEssence;
game.talents = talents;
game.global.decayDone = decayDone;
game.global.magmite = magmite;
game.generatorUpgrades = genUpgrades;
game.permanentGeneratorUpgrades = permanentGenUpgrades;
game.global.generatorMode = genMode;
game.global.mapPresets = advMaps;
game.global.lastBonePresimpt = lastBonePresimpt;
game.global.runningChallengeSquared = challengeSquared;
game.global.perkPreset1 = perkPresets.perkPreset1;
game.global.perkPreset2 = perkPresets.perkPreset2;
game.global.perkPreset3 = perkPresets.perkPreset3;
game.global.autoGolden = autoGolden;
if (improvedAutoStorage)
enableImprovedAutoStorage();
game.global.lastCustomAmt = firstCustomAmt;
game.global.lastCustomExact = firstCustomExact;
game.global.autoStructureSetting = autoStructureSetting;
game.global.pauseFight = pauseFightMember;
game.empowerments = empowerments;
game.global.spiresCompleted = spiresCompleted;
game.global.hideMapRow = hideMapRow;
game.global.fluffyExp = fluffyExp;
game.global.fluffyPrestige = fluffyPrestige;
game.global.canMapAtZone = canMapAtZone;
for (var statItem in stats){
statItem = stats[statItem];
if (typeof statItem.value !== 'undefined' && typeof statItem.valueTotal !== 'undefined' && !statItem.noAdd) statItem.valueTotal += statItem.value;
if (statItem.keepHighest && statItem.value > statItem.valueTotal) statItem.valueTotal = statItem.value;
if (typeof statItem.value !== 'undefined' && typeof statItem.value !== 'function') statItem.value = 0;
if (typeof statItem.onPortal === 'function') statItem.onPortal();
}
game.stats = stats;
game.global.repeatMap = repeat;
if (sLevel >= 1) applyS1();
if (sLevel >= 2) applyS2();
if (sLevel >= 3) applyS3();
if (sLevel >= 4) game.buildings.Warpstation.craftTime = 0;
if (sLevel >= 5) applyS5();
if (game.global.autoUpgradesAvailable) document.getElementById("autoUpgradeBtn").style.display = "block";
if (game.global.autoStorageAvailable) {
document.getElementById("autoStorageBtn").style.display = "block";
toggleAutoStorage(true);
}
if (challenge !== "" && typeof game.challenges[challenge].start !== 'undefined') game.challenges[challenge].start();
game.portal.Coordinated.currentSend = 1;
if (pres == "gems" || pres == "fragments"){
pres = "food";
}
game.global.presimptStore = pres;
swapClass("psColor", "psColorWhite", document.getElementById("trimpsPs"));
for (var heirItem in heirloomStuff){
game.global[heirItem] = heirloomStuff[heirItem];
}
if (game.global.totalPortals == 5) message("Heavy use of the portal has created a chance for the Void to seep into your world. Be alert.", "Story", null, "voidMessage");
if (game.global.totalPortals >= 5) document.getElementById("heirloomBtnContainer").style.display = "block";
recalculateHeirloomBonuses();
if (lastPortal < voidMaxLevel) {
voidMaxLevel = Math.floor(voidMaxLevel * 0.95);
if (voidMaxLevel < lastPortal) voidMaxLevel = lastPortal;
}
game.global.voidMaxLevel = voidMaxLevel;
for (var cItem in c2s){
game.c2[cItem] = c2s[cItem];
}
}
else {
game.options.menu.darkTheme.enabled = 1;
game.options.menu.darkTheme.removeStyles();
game.options.menu.usePlayFab.enabled = 0;
toggleSetting("usePlayFab", null, false, true);
playFabId = -1;
}
missingTrimps = new DecimalBreed(0);
Fluffy.handleBox();
Fluffy.checkAndRunVoidance();
numTab(1);
document.getElementById("tab5Text").innerHTML = "+" + prettify(game.global.lastCustomAmt);
pauseFight(true);
repeatClicked(true);
toggleAutoTrap(true);
toggleAutoStructure(true);
toggleAutoGolden(true);
toggleAutoUpgrades(true);
toggleAutoPrestiges(true);
toggleVoidMaps(true);
fireMode(true);
setEmpowerTab();
resetAdvMaps();
cancelPortal();
updateElectricityStacks();
updateDecayStacks();
updateAntiStacks();
setNonMapBox();
checkChallengeSquaredAllowed();
initTalents();
countChallengeSquaredReward();
displayGoldenUpgrades();
updateSkeleBtn();
Fluffy.currentLevel = 0;
game.options.menu.tinyButtons.onToggle();
if (keepPortal) checkAchieve("portals");
document.getElementById("goodGuyAttack").innerHTML = "";
document.getElementById("goodGuyBlock").innerHTML = "";
document.getElementById("goodGuyBar").style.width = "0%";
document.getElementById("goodGuyHealth").innerHTML = "0";
document.getElementById("goodGuyHealthMax").innerHTML = "0";
document.getElementById("trimpsFighting").innerHTML = "1";
document.getElementById("critSpan").innerHTML = "";
document.getElementById('togglemapAtZone2').style.display = (game.global.canMapAtZone) ? "block" : "none";
if (game.global.autoGolden != -1)
lastAutoGoldenToggle = new Date().getTime() + 26000;
if (game.talents.voidSpecial.purchased){
var mapsToGive = Math.floor(lastPortal / 100);
for (var x = 0; x < mapsToGive; x++){
createVoidMap();
}
}
}
function enableImprovedAutoStorage(){
game.global.improvedAutoStorage = true;
game.buildings.Barn.craftTime = 0;
game.buildings.Shed.craftTime = 0;
game.buildings.Forge.craftTime = 0;
}
function applyS1(){
game.resources.science.owned += 5000;
fadeIn("science", 10);
document.getElementById("upgradesTitleSpan").innerHTML = "升级";
game.resources.wood.owned += 100;
game.resources.food.owned += 100;
game.buildings.Trap.owned += 10;
fadeIn("trimps", 10);
game.global.autoCraftModifier += 0.25;
document.getElementById("foremenCount").innerHTML = (game.global.autoCraftModifier * 4) + " 工头";
}
function applyS2(){
game.triggers.upgrades.fire();
if (game.global.challengeActive != "Frugal"){
var toUnlock = ["Supershield", "Dagadder", "Bootboost", "Megamace", "Hellishmet", "Polierarm", "Pantastic", "Axeidic", "Smoldershoulder", "Greatersword", "Bestplate"];
if (game.global.slowDone){
toUnlock.push("Harmbalest");
toUnlock.push("GambesOP");
}
for (var x = 0; x < toUnlock.length; x++){
var upgradeToUnlock = game.mapUnlocks[toUnlock[x]];
upgradeToUnlock.fire();
upgradeToUnlock.last += 5;
}
}
game.buildings.Barn.owned = 5;
game.buildings.Barn.purchased = 5;
game.resources.food.max = 16000;
game.buildings.Shed.owned = 5;
game.buildings.Shed.purchased = 5;
game.resources.wood.max = 16000;
game.buildings.Forge.owned = 5;
game.buildings.Forge.purchased = 5;
game.resources.metal.max = 16000;
}
function applyS3(){
game.global.playerModifier = 2;
game.resources.trimps.owned = game.resources.trimps.realMax();
if (document.getElementById("trimps").style.visibility == "hidden") fadeIn("trimps", 10);
}
//4.39Qi
function applyS5(){
game.global.playerModifier = 10;
game.buildings.Barn.owned = 50;
game.buildings.Barn.purchased = 50;
game.resources.food.max = 562949953421312000;
game.buildings.Shed.owned = 50;
game.buildings.Shed.purchased = 50;
game.resources.wood.max = 562949953421312000;
game.buildings.Forge.owned = 50;
game.buildings.Forge.purchased = 50;
game.resources.metal.max = 562949953421312000;
}
var pendingLogs = {
Loot: [],
Unlocks: [],
Combat: [],
Notices: [],
all: [],
RAF: null
};
var messageLock = false;
function message(messageString, type, lootIcon, extraClass, extraTag, htmlPrefix) {
if (messageLock && type !== "Notices"){
return;
}
if (extraTag && typeof game.global.messages[type][extraTag] !== 'undefined' && !game.global.messages[type][extraTag]) return;
var log = document.getElementById("log");
var displayType = (game.global.messages[type].enabled) ? "block" : "none";
var prefix = "";
var addId = "";
if (messageString == "Game Saved!" || extraClass == 'save') {
addId = " id='saveGame'";
if (document.getElementById('saveGame') !== null){
var needsScroll = ((log.scrollTop + 10) > (log.scrollHeight - log.clientHeight));
var oldElem = document.getElementById('saveGame');
log.removeChild(oldElem);
log.appendChild(oldElem);
if (messageString != "Game Saved!") messageString = "<span class='glyphicon glyphicon-off'></span>" + messageString;
oldElem.innerHTML = messageString;
if (needsScroll) log.scrollTop = log.scrollHeight;
return;
}
}
if (game.options.menu.timestamps.enabled){
messageString = ((game.options.menu.timestamps.enabled == 1) ? getCurrentTime() : updatePortalTimer(true)) + " " + messageString;
}
if (!htmlPrefix){
if (lootIcon && lootIcon.charAt(0) == "*") {
lootIcon = lootIcon.replace("*", "");
prefix = "icomoon icon-";
}
else prefix = "glyphicon glyphicon-";
if (type == "Story") messageString = "<span class='glyphicon glyphicon-star'></span> " + messageString;
if (type == "Combat") messageString = "<span class='glyphicon glyphicon-flag'></span> " + messageString;
if (type == "Loot" && lootIcon) messageString = "<span class='" + prefix + lootIcon + "'></span> " + messageString;
if (type == "Notices"){
if (lootIcon !== null) messageString = "<span class='" + prefix + lootIcon + "'></span> " + messageString;
else messageString = "<span class='glyphicon glyphicon-off'></span> " + messageString;
}
}
else messageString = htmlPrefix + " " + messageString;
var messageHTML = "<span" + addId + " class='" + type + "Message message" + " " + extraClass + "' style='display: " + displayType + "'>" + messageString + "</span>";
pendingLogs.all.push(messageHTML);
if (type != "Story"){
var pendingArray = pendingLogs[type];
pendingArray.push(pendingLogs.all.length - 1);
if (pendingArray.length > 10){
var index = pendingArray[0];
pendingLogs.all.splice(index, 1)
pendingArray.splice(0, 1);
adjustMessageIndexes(index);
}
}
}
function adjustMessageIndexes(index){
for (var item in pendingLogs){
if (item == "all" || item == "RAF") continue;
for (var x = 0; x < pendingLogs[item].length; x++){
if (pendingLogs[item][x] > index)
pendingLogs[item][x]--;
}
}
}
function postMessages(){
if (pendingLogs.RAF != null) cancelAnimationFrame(pendingLogs.RAF);
if(pendingLogs.all.length < 1) {
return;
}
pendingLogs.RAF = requestAnimationFrame(function() {
var log = document.getElementById("log");
var needsScroll = ((log.scrollTop + 10) > (log.scrollHeight - log.clientHeight));
var pendingMessages = pendingLogs.all.join('');
log.innerHTML += pendingMessages;
pendingLogs.all = [];
for (var item in pendingLogs){
if (item == "all" || item == "RAF") continue;
if (pendingLogs[item].length)
trimMessages(item);
pendingLogs[item] = [];
}
if (needsScroll) log.scrollTop = log.scrollHeight;
});
}
function getCurrentTime(){
var date = new Date();
var seconds = date.getSeconds();
var minutes = date.getMinutes();
var hours = date.getHours();
if (seconds <= 9) seconds = "0" + seconds;
if (minutes <= 9) minutes = "0" + minutes;
if (hours <= 9) hours = "0" + hours;
return hours + ":" + minutes + ":" + seconds;
}
function nodeToArray(nodeList){
for(var a=[], l=nodeList.length; l--; a[l]=nodeList[l]);
return a;
}
function trimMessages(what){
var log = document.getElementById("log");
var toChange = document.getElementsByClassName(what + "Message");
toChange = nodeToArray(toChange);
var messageCount = toChange.length;
if (messageCount > 20){
for (var count = 0; count < (messageCount - 20); count++){
log.removeChild(toChange[count]);
}
}
}
function filterMessage(what, updateOnly){ //send true for updateOnly
var log = document.getElementById("log");
var displayed = game.global.messages[what].enabled;
if (!updateOnly){
displayed = (displayed) ? false : true;
game.global.messages[what].enabled = displayed;
}
var toChange = document.getElementsByClassName(what + "Message");
var btnText = (displayed) ? cnwhat(what) : cnwhat(what) + "关闭";
var btnElem = document.getElementById(what + "Filter");
if (btnElem == null) return;
btnElem.innerHTML = btnText;
btnElem.className = "";
btnElem.className = getTabClass(displayed);
displayed = (displayed) ? "block" : "none";
for (var x = 0; x < toChange.length; x++){
toChange[x].style.display = displayed;
}
log.scrollTop = log.scrollHeight;
}
//
//Menu Stuff
function filterTabs (what) {
document.getElementById('talentsTab').style.display = (game.global.highestLevelCleared >= 180) ? "table-cell" : "none";
enableDisableTab(game.global.buyTab, false);
game.global.buyTab = what;
enableDisableTab(what, true);
var tabs = ["buildings", "jobs", "upgrades", "equipment", "talents", "nature"];
for (var tab in tabs){
tab = tabs[tab];
document.getElementById(tab + "Container").style.display = ((what == "all" && tab != "talents" && tab != "nature") || tab == what) ? "block" : "none";
}
if (what == "talents") displayTalents();
if (what == "nature") displayNature();
}
function enableDisableTab(what, enable){
var elem = document.getElementById(what + "Tab");
if(enable)
elem.className = elem.className.replace("tabNotSelected", "tabSelected");
else
elem.className = elem.className.replace("tabSelected", "tabNotSelected");
//document.getElementById(what + "A").style.borderBottom = (enable) ? "0" : "1px solid #ddd";
}
function getTabClass(displayed){
return (displayed) ? "btn btn-success logFlt" : "btn btn-danger logFlt";
}
function setMax(amount){
game.global.maxSplit = amount;
cancelTooltip();
document.getElementById("tab6Text").innerHTML = (amount != 1) ? game.global.maxSplit : "最大";
}
function numTab(what, p, fromRestore) {
var num = 0;
if (what == "6" && game.global.buyAmt == "Max") tooltip('Max', null, 'update');
if (what == 5){
unlockTooltip();
tooltip('hide');
var numBox = document.getElementById("customNumberBox");
if (numBox){
num = numBox.value.toLowerCase();
game.global.lastCustomExact = num;
if (game.global.firstCustomExact == -1) game.global.firstCustomExact = num;
if (num.split('%')[1] == ""){
num = num.split('%');
num[0] = parseFloat(num[0]);
if (num[0] <= 100 && num[0] >= 0){
var workspaces = game.workspaces;
num = Math.floor(workspaces * (num[0] / 100));
}
else num = 1;
}
else if (num.split('/')[1]){
num = num.split('/');
num[0] = parseFloat(num[0]);
num[1] = parseFloat(num[1]);
var workspaces = game.workspaces;
num = Math.floor(workspaces * (num[0] / num[1]));
if (num < 0 || num > workspaces) num = 1;
}
else if (num.split('e')[1]){
num = num.split('e');
num = Math.floor(parseFloat(num[0]) * (Math.pow(10, parseInt(num[1]))));
}
else {
var letters = num.replace(/[^a-z]/gi, "");
var base = 0;
if (letters.length){
if (game.options.menu.standardNotation.enabled == 3){
var suffices = ["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"];
base = (suffices.indexOf(letters[0]) + 1);
if (letters.length > 1) {
base *= suffices.length;
base += (suffices.indexOf(letters[1]) + 1);
}
}
else {
var suffices = [
'K', 'M', 'B', 'T', 'Qa', 'Qi', 'Sx', 'Sp', 'Oc', 'No', 'Dc', 'Ud',
'Dd', 'Td', 'Qad', 'Qid', 'Sxd', 'Spd', 'Od', 'Nd', 'V', 'Uv', 'Dv',
'Tv', 'Qav', 'Qiv', 'Sxv', 'Spv', 'Ov', 'Nv', 'Tg', 'Utg', 'Dtg', 'Ttg',
'Qatg', 'Qitg', 'Sxtg', 'Sptg', 'Otg', 'Ntg', 'Qaa', 'Uqa', 'Dqa', 'Tqa',
'Qaqa', 'Qiqa', 'Sxqa', 'Spqa', 'Oqa', 'Nqa', 'Qia', 'Uqi', 'Dqi',
'Tqi', 'Qaqi', 'Qiqi', 'Sxqi', 'Spqi', 'Oqi', 'Nqi', 'Sxa', 'Usx',
'Dsx', 'Tsx', 'Qasx', 'Qisx', 'Sxsx', 'Spsx', 'Osx', 'Nsx', 'Spa',
'Usp', 'Dsp', 'Tsp', 'Qasp', 'Qisp', 'Sxsp', 'Spsp', 'Osp', 'Nsp',
'Og', 'Uog', 'Dog', 'Tog', 'Qaog', 'Qiog', 'Sxog', 'Spog', 'Oog',
'Nog', 'Na', 'Un', 'Dn', 'Tn', 'Qan', 'Qin', 'Sxn', 'Spn', 'On',
'Nn', 'Ct', 'Uc'
];
for (var x = 0; x < suffices.length; x++){
if (suffices[x].toLowerCase() == letters){
base = x + 1;
break;
}
}
}
if (base) num = Math.round(parseFloat(num.split(letters)[0]) * Math.pow(1000, base));
}
if (!base) num = parseInt(num);
}
}
else num = game.global.lastCustomAmt;
if (num > 0 && isFinite(num)) {
var text = "+" + prettify(num);
document.getElementById("tab5Text").innerHTML = text;
document.getElementById("ptab5Text").innerHTML = text;
game.global.buyAmt = num;
game.global.lastCustomAmt = num;
if (game.global.firstCustomAmt == -1) game.global.firstCustomAmt = num;
}
else {
if (numBox.value == "pants" && game.global.sLevel >= 4) {
//Dedicated to Sleeves, who would be upset if I never added a pants easter egg.
pantsMode = true;
message("Get a leg up with PANTS! Until your next trou... browser refresh, you can enable the useless but stylish PANTS ONLY AutoPrestige setting! Denim-ite!", "Notices");
return;
}
message("Please use a number greater than 0!", "Notices");
return;
}
}
if (typeof what === 'undefined') what = game.global.numTab;
else
game.global.numTab = what;
var tabType = (p) ? "ptab" : "tab";
var count = (p) ? 5 : 6;
for (var x = 1; x <= count; x++){
var thisTab = document.getElementById(tabType + x);
if(what == x)
thisTab.className = thisTab.className.replace("tabNotSelected", "tabSelected");
else
thisTab.className = thisTab.className.replace("tabSelected", "tabNotSelected");
if (x == 5) continue;
switch (x){
case 1:
num = 1;
break;
case 2:
num = 10;
break;
case 3:
num = 25;
break;
case 4:
num = 100;
break;
case 6:
num = 'Max';
}
if (x == what) game.global.buyAmt = num;
}
document.getElementById("tab6Text").innerHTML = (what == 6 && game.global.maxSplit != 1) ? game.global.maxSplit : "最大";
if (p) {
displayPortalUpgrades(true);
updateAllPerkColors();
}
}
//Buildings Specific
function removeQueueItem(what, force, second) {
if (game.options.menu.pauseGame.enabled && !force) return;
var queue = document.getElementById("queueItemsHere");
var elem;
if (what == "first"){
elem = queue.firstChild;
var name = game.global.buildingsQueue[0].split('.');
if (name[1] > 1){
var item = name[0];
name[1] = (parseInt(name[1], 10) - 1);
var newQueue = name[0] + "." + name[1];
name = name[0] + " X" + name[1];
game.global.buildingsQueue[0] = newQueue;
elem.firstChild.innerHTML = name;
if (!second && game.talents.doubleBuild.purchased){
buildBuilding(item);
removeQueueItem('first', false, true);
}
}
else{
queue.removeChild(elem);
game.global.buildingsQueue.splice(0, 1);
}
checkEndOfQueue();
return;
}
var index = getQueueElemIndex(what, queue);
elem = document.getElementById(what);
if (!game.global.buildingsQueue[index]) index = 0;
queue.removeChild(elem);
refundQueueItem(game.global.buildingsQueue[index]);
game.global.buildingsQueue.splice(index, 1);
if (index === 0) {
game.global.crafting = "";
game.global.timeLeftOnCraft = 0;
}
checkEndOfQueue();
}
function getQueueElemIndex(id, queue){
var childs = queue.getElementsByTagName('*');
for (var i = 0, len = childs.length; i < len; i++){
if (childs[i].id == id) return ((i - 2)/ 3);
}
}
function checkEndOfQueue(){
if (game.global.buildingsQueue.length === 0){
document.getElementById("noQueue").style.display = "block";
game.global.nextQueueId = 0;
game.global.crafting = "";
}
}
function addQueueItem(what) {
var elem = document.getElementById("queueItemsHere");
document.getElementById("noQueue").style.display = "none";
var name = what.split('.');
if (name[1] > 1) name = name[0] + " X" + prettify(name[1]);
else name = name[0];
elem.innerHTML += '<div class="queueItem" id="queueItem' + game.global.nextQueueId + '" onmouseover="tooltip(\'Queue\',null,event)" onmouseout="tooltip(\'hide\')" onClick="removeQueueItem(\'queueItem' + game.global.nextQueueId + '\'); cancelTooltip();"><span class="queueItemName">' + cnwhat(name) + '</span><div id="animationDiv"></div></div>';
if (game.global.nextQueueId === 0) setNewCraftItem();
game.global.nextQueueId++;
}
function updateSkeleBtn(){
document.getElementById("boneBtnContainer").style.display = "block";
document.getElementById("boneBtnText").innerHTML = "交易 " + prettify(game.global.b) + " 骨头" + (game.global.b == 1 ? "" : "");
}
//
//Number updates
function updateLabels() { //Tried just updating as something changes, but seems to be better to do all at once all the time
var toUpdate;
//Resources (food, wood, metal, trimps, science). Per second will be handled in separate function, and called from job loop.
for (var item in game.resources){
toUpdate = game.resources[item];
if (!(toUpdate.owned > 0)){
toUpdate.owned = parseFloat(toUpdate.owned);
if (!(toUpdate.owned > 0)) toUpdate.owned = 0;
}
document.getElementById(item + "Owned").innerHTML = prettify(Math.floor(toUpdate.owned));
if (toUpdate.max == -1 || document.getElementById(item + "Max") === null) continue;
var newMax = toUpdate.max;
if (item != "trimps")
newMax = calcHeirloomBonus("Shield", "storageSize", (newMax * (game.portal.Packrat.modifier * game.portal.Packrat.level + 1)));
else if (item == "trimps") newMax = toUpdate.realMax();
document.getElementById(item + "Max").innerHTML = prettify(newMax);
var bar = document.getElementById(item + "Bar");
if (game.options.menu.progressBars.enabled){
var percentToMax = ((toUpdate.owned / newMax) * 100);
swapClass("percentColor", getBarColorClass(100 - percentToMax), bar);
bar.style.width = percentToMax + "%";
}
}
updateSideTrimps();
//Buildings, trap is the only unique building, needs to be displayed in trimp area as well
for (var itemA in game.buildings){
toUpdate = game.buildings[itemA];
if (toUpdate.locked == 1) continue;
var elem = document.getElementById(itemA + "Owned");
if (elem === null){
unlockBuilding(itemA);
elem = document.getElementById(itemA + "Owned");
}
elem.innerHTML = (game.options.menu.menuFormatting.enabled) ? prettify(toUpdate.owned) : toUpdate.owned;
if (itemA == "Trap") {
var trap1 = document.getElementById("trimpTrapText")
if (trap1) trap1.innerHTML = prettify(toUpdate.owned);
var trap2 = document.getElementById("trimpTrapText2")
if (trap2) trap2.innerHTML = prettify(toUpdate.owned);
}
}
//Jobs, check PS here and stuff. Trimps per second is handled by breed() function
for (var itemB in game.jobs){
toUpdate = game.jobs[itemB];
if (toUpdate.locked == 1 && toUpdate.increase == "custom") continue;
if (toUpdate.locked == 1) {
if (game.resources[toUpdate.increase].owned > 0)
updatePs(toUpdate, false, itemB);
continue;
}
if (document.getElementById(itemB) === null) unlockJob(itemB);
document.getElementById(itemB + "Owned").innerHTML = (game.options.menu.menuFormatting.enabled) ? prettify(toUpdate.owned) : toUpdate.owned;
var perSec = (toUpdate.owned * toUpdate.modifier);
updatePs(toUpdate, false, itemB);
}
//Upgrades, owned will only exist if 'allowed' exists on object
for (var itemC in game.upgrades){
toUpdate = game.upgrades[itemC];
if (toUpdate.allowed - toUpdate.done >= 1) toUpdate.locked = 0;
if (toUpdate.locked == 1) continue;
if (document.getElementById(itemC) === null) unlockUpgrade(itemC, true);
}
//Equipment
checkAndDisplayEquipment();
}
function checkAndDisplayEquipment() {
for (var itemD in game.equipment){
var toUpdate = game.equipment[itemD];
if (toUpdate.locked == 1) continue;
if (document.getElementById(itemD) === null) drawAllEquipment();
document.getElementById(itemD + "Owned").innerHTML = toUpdate.level;
}
}
function updatePs(jobObj, trimps, jobName){ //trimps is true/false, send PS as first if trimps is true, like (32.4, true)
if (jobObj.increase == "custom" || (typeof jobObj.increase === 'undefined' && !trimps)) return;
var psText;
var elem;
if (trimps) {
psText = jobObj.toFixed(3);
elem = document.getElementById("trimpsPs");
}
else{
var increase = jobObj.increase;
psText = (jobObj.owned * jobObj.modifier);
//portal Motivation
if (game.portal.Motivation.level) psText *= (1 + (game.portal.Motivation.level * game.portal.Motivation.modifier));
if (game.portal.Motivation_II.level) psText *= (1 + (game.portal.Motivation_II.level * game.portal.Motivation_II.modifier));
if (game.portal.Meditation.level > 0) psText *= (1 + (game.portal.Meditation.getBonusPercent() * 0.01));
if (game.jobs.Magmamancer.owned > 0 && increase == "metal") psText *= game.jobs.Magmamancer.getBonusPercent();
if (game.global.challengeActive == "Meditate") psText *= 1.25;
else if (game.global.challengeActive == "Size") psText *= 1.5;
if (game.global.challengeActive == "Toxicity"){
var toxMult = (game.challenges.Toxicity.lootMult * game.challenges.Toxicity.stacks) / 100;
psText *= (1 + toxMult);
}
if (game.global.challengeActive == "Balance"){
psText *= game.challenges.Balance.getGatherMult();
}
if (game.global.challengeActive == "Decay"){
psText *= 10 * (Math.pow(0.995, game.challenges.Decay.stacks));
}
if (game.global.challengeActive == "Daily" && typeof game.global.dailyChallenge.famine !== 'undefined' && increase != "fragments" && increase != "science"){
psText *= dailyModifiers.famine.getMult(game.global.dailyChallenge.famine.strength);
}
if (game.global.challengeActive == "Watch") psText /= 2;
if (game.global.challengeActive == "Lead" && ((game.global.world % 2) == 1)) psText *= 2;
if (jobName != "Explorer" && getEmpowerment() == "Wind"){
psText *= 1 + (game.empowerments.Wind.getCombatModifier() * 10);
}
psText = calcHeirloomBonus("Staff", jobName + "Speed", psText);
if (game.global.playerGathering == increase){
if ((game.talents.turkimp4.purchased || game.global.turkimpTimer > 0) && increase != "science"){
var tBonus = 1.5;
if (game.talents.turkimp4.purchased) tBonus = 2;
else if (game.talents.turkimp3.purchased) tBonus = 1.75;
psText *= tBonus;
}
psText += getPlayerModifier();
}
elem = document.getElementById(increase + "Ps");
//Portal Packrat
increase = game.resources[increase];
if (increase.max != -1){
var newMax = increase.max + (increase.max * game.portal.Packrat.modifier * game.portal.Packrat.level);
newMax = calcHeirloomBonus("Shield", "storageSize", newMax);
if (increase.owned >= newMax) psText = 0;
}
psText = psText.toFixed(1);
}
if (game.options.menu.useAverages.enabled) psText = parseFloat(psText) + getAvgLootSecond(jobObj.increase);
psText = prettify(psText);
/* var color = (psText < 0) ? "red" : "green";
if (psText == 0) color = "black"; */
psText = "+" + psText + "/秒";
if (trimps && game.unlocks.quickTrimps) {
psText += " (x2!)";
}
elem.textContent = psText;
swapClass('sizeSec', ((psText.replace('.','').length >= 11) ? 'sizeSecReduced' : 'sizeSecRegular'), elem);
}
function updateSideTrimps(){
var trimps = game.resources.trimps;
document.getElementById("trimpsEmployed").innerHTML = prettify(trimps.employed);
var breedCount = (trimps.owned - trimps.employed > 2) ? prettify(Math.floor(trimps.owned - trimps.employed)) : 0;
document.getElementById("trimpsUnemployed").innerHTML = breedCount;
document.getElementById("maxEmployed").innerHTML = prettify(Math.ceil(trimps.realMax() / 2));
var free = (Math.ceil(trimps.realMax() / 2) - trimps.employed);
if (free < 0) free = 0;
var s = (free > 1) ? "" : "";
document.getElementById("jobsTitleUnemployed").innerHTML = prettify(free) + " 工作空间";
}
function unlockBuilding(what) {
game.global.lastUnlock = new Date().getTime();
var building = game.buildings[what];
if (building.locked == 1) building.alert = true;
building.locked = 0;
drawAllBuildings();
}
function drawAllBuildings(){
var elem = document.getElementById("buildingsHere");
elem.innerHTML = "";
for (var item in game.buildings){
building = game.buildings[item];
if (building.locked == 1) continue;
//建筑名称
drawBuilding(item, elem);
if (building.alert && game.options.menu.showAlerts.enabled){
document.getElementById("buildingsAlert").innerHTML = "!";
if (document.getElementById(item + "Alert")) document.getElementById(item + "Alert").innerHTML = "!";
}
}
updateGeneratorInfo();
}
function drawBuilding(what, where){
where.innerHTML += '<div onmouseover="tooltip(\'' + what + '\',\'buildings\',event)" onmouseout="tooltip(\'hide\')" class="thingColorCanNotAfford thing noselect pointer buildingThing" id="' + what + '" onclick="buyBuilding(\'' + what + '\')"><span class="thingName"><span id="' + what + 'Alert" class="alert badge"></span>' + cnwhat(what) + '</span><br/><span class="thingOwned" id="' + what + 'Owned">0</span></div>';
}
function unlockJob(what) {
game.global.lastUnlock = new Date().getTime();
var job = game.jobs[what];
if (job.locked == 1) job.alert = true;
job.locked = 0;
drawAllJobs();
}
function drawAllJobs(){
var elem = document.getElementById("jobsHere");
elem.innerHTML = "";
for (var item in game.jobs){
if (game.jobs[item].locked == 1) continue;
if (item == "Geneticist" && game.global.Geneticistassist){
drawGeneticistassist(elem);
}
else
drawJob(item, elem);
if (game.jobs[item].alert && game.options.menu.showAlerts.enabled){
document.getElementById("jobsAlert").innerHTML = "!";
if (document.getElementById(item + "Alert")) document.getElementById(item + "Alert").innerHTML = "!";
}
}
}
function drawJob(what, where){
where.innerHTML += '<div onmouseover="tooltip(\'' + what + '\',\'jobs\',event)" onmouseout="tooltip(\'hide\')" class="thingColorCanNotAfford thing noselect pointer jobThing" id="' + what + '" onclick="buyJob(\'' + what + '\')"><span class="thingName"><span id="' + what + 'Alert" class="alert badge"></span>' + cnjob(what) + '</span><br/><span class="thingOwned" id="' + what + 'Owned">0</span></div>';
}
function drawGeneticistassist(where){
where.innerHTML += '<div id="GeneticistassistContainer" class="thing"><div onmouseover="tooltip(\'Geneticist\',\'jobs\',event)" onmouseout="tooltip(\'hide\')" class="thingColorCanNotAfford thing noselect pointer jobThing" id="Geneticist" onclick="buyJob(\'Geneticist\')"><span class="thingName"><span id="GeneticistAlert" class="alert badge"></span>遗传学家</span><br/><span class="thingOwned" id="GeneticistOwned">0</span></div><div onmouseover="tooltip(\'Geneticistassist\',null,event)" onmouseout="tooltip(\'hide\')" class="thing thingColorNone noselect stateHappy pointer jobThing" id="Geneticistassist" onclick="toggleGeneticistassist()">遗传学家助手<span id="GAIndicator"></span><br/><span id="GeneticistassistSetting">&nbsp;</span></div></div>';
toggleGeneticistassist(true);
}
function refreshMaps(){
document.getElementById("mapsHere").innerHTML = "";
document.getElementById("voidMapsHere").innerHTML = "";
for (var item in game.global.mapsOwnedArray) {
unlockMap(item);
}
}
function getUniqueColor(item){
if (item.location && game.mapConfig.locations[item.location].upgrade){
var upgrade = game.mapConfig.locations[item.location].upgrade;
upgrade = (typeof upgrade === 'object') ? upgrade[0] : upgrade;
upgrade = game.mapUnlocks[upgrade];
if (upgrade.specialFilter){
if (!upgrade.specialFilter(item.level)) return " noRecycleDone";
if (upgrade.specialFilter(item.level) && typeof upgrade.canRunOnce === 'undefined') return " noRecycle";
}
if (upgrade.canRunOnce) return " noRecycle";
}
return " noRecycleDone";
}
function getMapIcon(mapObject, nameOnly) {
var icon = mapObject.location;
icon = game.mapConfig.locations[icon].resourceType;
if (nameOnly) return icon;
if (mapObject.voidBuff)
return voidBuffConfig[mapObject.voidBuff].icon;
switch (icon){
case "Food":
return "glyphicon glyphicon-apple";
case "Metal":
return "icomoon icon-cubes";
case "Wood":
return "glyphicon glyphicon-tree-deciduous";
case "Gems":
return "icomoon icon-diamond";
case "Any":
return "icomoon icon-leaf2";
}
return "icomoon icon-cubes";
}
function unlockMap(what) { //what here is the array index
var item = game.global.mapsOwnedArray[what];
var btnClass = "mapElementNotSelected thing noselect pointer mapThing";
if (game.unlocks.goldMaps && !item.noRecycle) btnClass += " goldMap";
var level = item.level;
var tooltip = "";
var loc = "mapsHere";
if (item.location == "Void") {
btnClass += " voidMap";
level = '<span class="glyphicon glyphicon-globe"></span>';
tooltip = " onmouseover=\"tooltip('Void Map', 'customText', event, '这张地图将按你当前的区域等级进行变化,敌人有一个随机buff,最后一个单元格的boss会掉落氦。此地图在完成一次后将消失,离开地图将重置其进度。');\" onmouseout=\"tooltip('hide')\"";
loc = "voidMapsHere";
}
else if (item.noRecycle) btnClass += getUniqueColor(item);
var elem = document.getElementById(loc);
if (game.options.menu.extraStats.enabled) elem.innerHTML = '<div' + tooltip + ' class="' + btnClass + '" id="' + item.id + '" onclick="selectMap(\'' + item.id + '\')"><div class="onMapIcon"><span class="' + getMapIcon(item) + '"></span></div><div class="thingName onMapName">' + item.name + '</div><br/><span class="thingOwned mapLevel">等级 ' + level + ((item.bonus) ? getMapSpecTag(item.bonus) : '') + '</span><br/><span class="onMapStats"><span class="icomoon icon-gift2"></span>' + Math.floor(item.loot * 100) + '% </span><span class="icomoon icon-cube2"></span>' + item.size + ' <span class="icon icon-warning"></span>' + Math.floor(item.difficulty * 100) + '%</div>' + elem.innerHTML;
else elem.innerHTML = '<div' + tooltip + ' class="' + btnClass + '" id="' + item.id + '" onclick="selectMap(\'' + item.id + '\')"><span class="thingName">' + item.name + '</span><br/><span class="thingOwned mapLevel">Level ' + level + ((item.bonus) ? getMapSpecTag(item.bonus) : '') + '</span></div>' + elem.innerHTML;
if (item.id == game.global.currentMapId) swapClass("mapElement", "mapElementSelected", document.getElementById(item.id));
//onmouseover="tooltip(\'' + item.id + '\',\'maps\',event)" onmouseout="tooltip(\'hide\')"
}
function getMapSpecTag(modifier){
return '<span class="mapSpec"> (' + mapSpecialModifierConfig[modifier].abv + ')</span>'
}
function unlockUpgrade(what, displayOnly) {
if (!displayOnly) game.global.lastUnlock = new Date().getTime();
if (getAvailableGoldenUpgrades() >= 1) displayGoldenUpgrades(true);
var upgrade = game.upgrades[what];
upgrade.locked = 0;
if (upgrade.prestiges){
var resName = (what == "Supershield") ? "wood" : "metal";
upgrade.cost.resources[resName] = getNextPrestigeCost(what);
}
if (!displayOnly) {
upgrade.allowed++;
upgrade.alert = true;
}
drawAllUpgrades();
}
function drawAllUpgrades(){
var elem = document.getElementById("upgradesHere");
elem.innerHTML = "";
for (var item in game.upgrades){
if (game.upgrades[item].locked == 1) continue;
drawUpgrade(item, elem);
if (game.upgrades[item].alert && game.options.menu.showAlerts.enabled){
document.getElementById("upgradesAlert").innerHTML = "!";
if (document.getElementById(item + "Alert")) document.getElementById(item + "Alert").innerHTML = "!";
}
}
goldenUpgradesShown = false;
displayGoldenUpgrades();
}
function drawUpgrade(what, where){
var upgrade = game.upgrades[what];
if (upgrade.prestiges && (!upgrade.cost.resources[metal] || !upgrade.cost.resources[wood])){
var resName = (what == "Supershield") ? "wood" : "metal";
upgrade.cost.resources[resName] = getNextPrestigeCost(what);
}
var done = upgrade.done;
var dif = upgrade.allowed - done;
if (dif >= 1) dif -= 1;
where.innerHTML += '<div onmouseover="tooltip(\'' + what + '\',\'upgrades\',event)" onmouseout="tooltip(\'hide\')" class="thingColorCanNotAfford thing noselect pointer upgradeThing" id="' + what + '" onclick="buyUpgrade(\'' + what + '\')"><span id="' + what + 'Alert" class="alert badge"></span><span class="thingName">' + cntitle(what) + '</span><br/><span class="thingOwned" id="' + what + 'Owned">' + done + '</span></div>';
if (dif >= 1) document.getElementById(what + "Owned").innerHTML = upgrade.done + "(+" + dif + ")";
}
function checkButtons(what) {
var where = game[what];
if (what == "jobs") {
var workspaces = game.workspaces;
for (var item in game.jobs){
if (game.jobs[item].locked == 1) continue;
if (workspaces <= 0 && !(game.jobs[item].allowAutoFire && game.options.menu.fireForJobs.enabled)) updateButtonColor(item, false, true);
else updateButtonColor(item,canAffordJob(item, false, workspaces, true),true);
}
return;
}
if (what == "upgrades"){
for (var itemA in game.upgrades){
if (game.upgrades[itemA].locked == 1) continue;
if (itemA == "Coordination")
updateButtonColor(itemA, (canAffordTwoLevel(game.upgrades[itemA]) && canAffordCoordinationTrimps()));
else
updateButtonColor(itemA, canAffordTwoLevel(game.upgrades[itemA]));
}
return;
}
if (what == "buildings"){
for (var itemBuild in game.buildings){
var thisBuilding = game.buildings[itemBuild];
if (thisBuilding.locked == 1) continue;
var canAfford = canAffordBuilding(itemBuild, false, false, false, true);
/* if (itemBuild == "Nursery" && mutations.Magma.active())
canAfford = false;
*/ updateButtonColor(itemBuild, canAfford);
}
return;
}
if (what == "equipment"){
for (var itemEquip in game.equipment){
var thisEquipment = game.equipment[itemEquip];
if (thisEquipment.locked == 1) continue;
updateButtonColor(itemEquip, canAffordBuilding(itemEquip, null, null, true, true));
}
return;
}
for (var itemB in where) {
if (where[itemB].locked == 1) continue;
var canAfford = true;
for (var cost in where[itemB].cost) {
var costItem = where[itemB].cost[cost];
var numCost = (typeof costItem === 'function') ? costItem() : costItem;
if (typeof costItem[1] !== 'undefined') numCost = resolvePow(costItem, where[itemB]);
if (game.resources[cost].owned < numCost) {
canAfford = false;
break;
}
}
if (canAfford === false) {
updateButtonColor(itemB, false);
continue;
}
updateButtonColor(itemB, true);
}
}
function updateButtonColor(what, canAfford, isJob) {
var elem = document.getElementById(what);
if (elem === null){
return;
}
if (game.options.menu.lockOnUnlock.enabled == 1 && (new Date().getTime() - 1000 <= game.global.lastUnlock)) canAfford = false;
if (isJob && game.global.firing === true) {
if(game.jobs[what].owned >= 1) {
//note for future self:
//if you need to add more states here, change these to use the swapClass func -grabz
//with "thingColor" as first param
swapClass("thingColor", "thingColorFiringJob", elem);
}
else{
swapClass("thingColor", "thingColorCanNotAfford", elem);
}
return;
}
if (what == "Warpstation") {
if(canAfford)
elem.style.backgroundColor = getWarpstationColor();
else
elem.style.backgroundColor = "";
}
if(canAfford){
if
(what == "Gigastation" && (ctrlPressed || game.options.menu.ctrlGigas.enabled)) swapClass("thingColor", "thingColorCtrl", elem);
else
swapClass("thingColor", "thingColorCanAfford", elem);
}
else
swapClass("thingColor", "thingColorCanNotAfford", elem);
}
function getWarpstationColor() {
var amt = game.upgrades.Gigastation.done * 5;
if (amt > 255) amt = 255;
return "rgb(0, " + Math.floor(amt / 2) + ", " + amt + ")";
}
function unlockEquipment(what, fromCheck) {
game.global.lastUnlock = new Date().getTime();
var equipment = game.equipment[what];
equipment.locked = 0;
if (!fromCheck){
drawAllEquipment();
return;
}
}
function drawAllEquipment(){
var elem = document.getElementById("equipmentHere");
elem.innerHTML = "";
for (var item in game.equipment){
if (game.equipment[item].locked == 1) continue;
drawEquipment(item, elem);
}
}
function drawEquipment(what, elem){
var numeral = "";
var equipment = game.equipment[what];
if (equipment.prestige > 1){
numeral = romanNumeral(equipment.prestige);
}
elem.innerHTML += '<div onmouseover="tooltip(\'' + what + '\',\'equipment\',event)" onmouseout="tooltip(\'hide\')" class="noselect pointer thingColorCanNotAfford thing" id="' + what + '" onclick="buyEquipment(\'' + what + '\')"><span class="thingName">' + cnequip(what) + ' <span id="' + what + 'Numeral">' + numeral + '</span></span><br/><span class="thingOwned">等级: <span id="' + what + 'Owned">0</span></span></div>';
}
//isPrevious returns the previous color, used for swapping with str.replace to know which one was before
function getBarColorClass(percent) {
if (percent > 50) return "percentColorBlue";
else if (percent > 25) return "percentColorYellow";
else if (percent > 10) return "percentColorOrange";
else return "percentColorRed";
}
function displayPerksBtn(){
var btn = document.getElementById("pastUpgradesBtn");
if (game.global.totalPortals == 0){
btn.className = "btn";
btn.innerHTML = "???";
}
else {
btn.className = "btn btn-primary";
btn.innerHTML = "查看能力";
}
}
var hasNewSetting = false;
function toggleSettingsMenu(){
game.options.displayed = !game.options.displayed;
var menuElem = document.getElementById("settingsHere");
if (game.options.displayed) {
var searchElem = document.getElementById('searchSettings');
menuElem.style.display = "block";
toggleSettingSection(true);
settingTab(((hasNewSetting) ? "New" : "General"));
return;
}
menuElem.style.display = "none";
if (hasNewSetting) clearNewSettings();
}
function addNewSetting(name){
game.options.menu[name].isNew = true;
hasNewSetting = true;
toggleSettingAlert();
}
function clearNewSettings(){
for (var item in game.options.menu){
if (game.options.menu[item].isNew) game.options.menu[item].isNew = false;
}
hasNewSetting = false;
toggleSettingAlert();
document.getElementById('NewTab').style.display = 'none';
}
function toggleSettingAlert(){
var elem = document.getElementById('settingsAlert');
if (elem == null) {
if (hasNewSetting) document.getElementById('settingsText').innerHTML += ' <span class="alert" id="settingsAlert">!</span>';
return;
}
if (hasNewSetting) elem.style.display = 'inline-block';
else elem.style.display = 'none';
}
function displayAllSettings() {
var settingsHere = document.getElementById("allSettingsHere");
var html = "";
for (var item in game.options.menu){
var optionItem = game.options.menu[item];
if (optionItem.locked) continue;
if (typeof optionItem.lockUnless === 'function' && !optionItem.lockUnless()) continue;
html += getSettingHtml(optionItem, item);
}
settingsHere.innerHTML = html;
}
function toggleSettingSection(toSearch){
document.getElementById('searchSettingsWindow').style.display = (toSearch) ? "block" : "none";
document.getElementById('allSettings').style.display = (toSearch) ? "none" : "block";
document.getElementById(((toSearch) ? 'allSettingsHere' : 'settingSearchResults')).innerHTML = '';
if (!toSearch) displayAllSettings();
else searchSettings(document.getElementById('searchSettings'));
}
function settingTab(what){
var elem = document.getElementById('searchSettings');
elem.value = what;
searchSettings(elem);
clearSettingTabs();
var tabElem = document.getElementById(what + "Tab");
if (tabElem) swapClass('tab', 'tabSelected', tabElem);
if (what == "New") document.getElementById('NewTab').style.display = "table-cell";
}
function clearSettingTabs(){
var elems = document.getElementsByClassName('settingTab');
for (var x = 0; x < elems.length; x++){
swapClass('tab', 'tabNotSelected', elems[x])
}
}
function searchSettings(elem){
var search = elem.value.toLowerCase();
var resultsElem = document.getElementById('settingSearchResults');
if (search.length < 2) {
resultsElem.innerHTML = "";
return;
}
var results = [];
for (var optionName in game.options.menu){
var optionObject = game.options.menu[optionName];
if (optionObject.locked) continue;
if (typeof optionObject.lockUnless === 'function' && !optionObject.lockUnless()) continue;
if (search == "new"){
if (!optionObject.isNew) continue;
results.push(optionName);
continue;
}
if (optionObject.extraTags && optionObject.extraTags.search(search) != -1) results.push(optionName);
else if (optionObject.description.toLowerCase().search(search) != -1) results.push(optionName);
else {
for (var x = 0; x < optionObject.titles.length; x++){
if (optionObject.titles[x].toLowerCase().search(search) != -1){
results.push(optionName);
break;
}
}
}
}
var text = "";
var forceClass = "";
if (results.length > 10) {
if (results.length > 12) {
resultsElem.innerHTML = "";
return;
}
else forceClass = ' settingFit12';
}
clearSettingTabs();
for (var x = 0; x < results.length; x++){
text += getSettingHtml(game.options.menu[results[x]], results[x], forceClass);
}
resultsElem.innerHTML = text;
}
function getSettingHtml(optionItem, item, forceClass, appendId){
if (!appendId) appendId = "";
if (!forceClass) forceClass = "";
var text = optionItem.titles[optionItem.enabled];
return "<div class='optionContainer" + forceClass + "'><div id='toggle" + item + appendId + "' class='noselect settingsBtn settingBtn" + optionItem.enabled + "' onclick='toggleSetting(\"" + item + "\"" + ((appendId) ? "" : ", this") + ")' onmouseover='tooltip(\"" + text + "\", \"customText\", event, \"" + optionItem.description + "\")' onmouseout='tooltip(\"hide\")'>" + text + "</div></div>";
}
function saveMapAtZone(){
var elem = document.getElementById('mapAtZoneInput');
var errText = document.getElementById('mapAtZoneErrorText');
if (elem == null){
cancelTooltip(true);
return;
}
var value = parseInt(elem.value);
if (isNaN(value)) {
if (errText) errText.innerHTML = elem.value + " is not a number.";
return;
}
if (value < 10 || value > 1000) {
if (errText) errText.innerHTML = value + " is not between 10 and 1000.";
return;
}
game.options.menu.mapAtZone.setZone = value;
game.options.menu.mapAtZone.enabled = 1;
toggleSetting('mapAtZone', null, false, true);
cancelTooltip(true);
}
function toggleSetting(setting, elem, fromPortal, updateOnly, backwards){
if (setting == "GeneticistassistTarget") {
tooltip('Geneticistassist Settings', null, 'update');
return;
}
if (setting == "pauseGame" && game.options.menu.disablePause.enabled == 0) return;
var menuOption = game.options.menu[setting];
if (setting == "mapAtZone" && !updateOnly && menuOption.enabled == 0){
tooltip('Set Map At Zone', null, 'update');
return;
}
if (setting == "usePlayFab" && !updateOnly){
if (menuOption.enabled == 0){
authenticated = enablePlayFab();
if (!authenticated) return;
}
else {
game.global.playFabLoginType = -1;
playFabId = -1;
}
}
var toggles = menuOption.titles.length;
if (!updateOnly){
if (backwards && toggles > 2){
menuOption.enabled--;
if (menuOption.enabled < 0) menuOption.enabled = toggles - 1;
}
else {
if (toggles == 2) menuOption.enabled = (menuOption.enabled) ? 0 : 1;
else {
menuOption.enabled++;
if (menuOption.enabled >= toggles) menuOption.enabled = 0;
}
}
if (menuOption.onToggle) menuOption.onToggle();
}
else if (setting == "usePlayFab") menuOption.onToggle();
if (fromPortal){
document.getElementById('ptabInfoText').innerHTML = (menuOption.enabled) ? "Less Info" : "More Info";
displayPortalUpgrades(true);
return;
}
var menuElem = [];
menuElem[0] = (elem) ? elem : document.getElementById("toggle" + setting);
if (typeof menuOption.secondLocation !== 'undefined'){
for (var z = 0; z < menuOption.secondLocation.length; z++){
menuElem.push(document.getElementById(menuOption.secondLocation[z]));
}
}
for (var x = 0; x < menuElem.length; x++){
if (menuElem[x] === null) continue;
menuElem[x].innerHTML = menuOption.titles[menuOption.enabled];
swapClass("settingBtn", "settingBtn" + menuOption.enabled, menuElem[x]);
if (setting == "deleteSave") return;
if (!updateOnly && elem) cancelTooltip(true);
menuElem[x].onmouseover = function(event) {tooltip(menuOption.titles[menuOption.enabled], "customText", event, menuOption.description)};
}
if (!updateOnly && elem) tooltip(menuOption.titles[menuOption.enabled], "customText", 'update', menuOption.description)
}
function achievementCompatibilityUnlock() {
checkAchieve("zones", null, false, true);
checkAchieve("damage", calculateDamage(game.global.soldierCurrentAttack, true, true, true), false, true);
checkAchieve("trimps", game.resources.trimps.owned, false, true);
checkAchieve("portals", null, false, true);
checkAchieve("totalZones", null, false, true);
checkAchieve("totalMaps", null, false, true);
game.stats.gemsCollected.value += game.resources.gems.owned;
checkAchieve("totalGems", null, false, true);
for (var item in game.achievements.housing.breakpoints){
item = game.achievements.housing.breakpoints[item];
if (game.buildings[item] && game.buildings[item].owned > 0) checkAchieve("housing", item, false, true);
else break;
}
if (game.global.achievementBonus > 0){
cancelTooltip();
tooltip("New Achievements", null, 'update');
}
}
function displayAchievementPopup(id, forHover, displayNumber){
if (!forHover && game.options.menu.achievementPopups.enabled == 0) return;
var achievement = game.achievements[id];
var index = achievement.newStuff.indexOf(displayNumber);
if (index != -1) {
document.getElementById(id + displayNumber + "Alert").style.display = "none";
achievement.newStuff.splice(index, 1);
}
var location = (forHover) ? "Hover" : "Popup";
if (!forHover && typeof achievement.finished === 'number') displayNumber = achievement.finished;
var prog = document.getElementById("achievementHoverProgress");
var one = (typeof achievement.finished !== 'number');
var titleElem = document.getElementById('achievement' + location + 'Title');
if (forHover && ((!one && !achievement.showAll && displayNumber > achievement.finished) || (one && (game.global.highestLevelCleared < achievement.filters[displayNumber] && !achievement.finished[displayNumber])))) {
document.getElementById("achievement" + location).style.display = "block";
document.getElementById("achievement" + location + "IconContainer").innerHTML = '<span class="achieveTier' + achievement.tiers[displayNumber] + ' icomoon icon-locked achievementPopupIcon"></span>';
titleElem.innerHTML = "未解锁";
titleElem.className = 'achieveTier' + achievement.tiers[displayNumber];
document.getElementById("achievement" + location + "Description").innerHTML = "未解锁";
document.getElementById("achievement" + location + "Reward").innerHTML = '<b>奖励:</b> +' + game.tierValues[achievement.tiers[displayNumber]] + "% 伤害";
prog.innerHTML = "";
return;
}
document.getElementById("achievement" + location).style.display = "block";
document.getElementById("achievement" + location + "IconContainer").innerHTML = '<span class="achieveTier' + achievement.tiers[displayNumber] + ' ' + achievement.icon + ' achievementPopupIcon"></span>';
titleElem.innerHTML = achievement.names[displayNumber];
titleElem.className = 'achieveTier' + achievement.tiers[displayNumber];
document.getElementById("achievement" + location + "Description").innerHTML = achievement.description(displayNumber);
document.getElementById("achievement" + location + "Reward").innerHTML = '<b>奖励:</b> +' + game.tierValues[achievement.tiers[displayNumber]] + "% 伤害";
if (forHover && typeof achievement.progress !== 'undefined' && (typeof achievement.highest === 'undefined' || achievement.highest > 0)){
prog.innerHTML = "进度: " + achievement.progress();
}
else
prog.innerHTML = "";
}
function checkAchieve(id, evalProperty, doubleChecking, noDisplay) {
if (id == "housing" && checkHousing() >= 100) giveSingleAchieve("Realtor");
var achievement = game.achievements[id];
if (typeof achievement.evaluate !== 'undefined') evalProperty = achievement.evaluate();
if (typeof achievement.highest !== 'undefined') {
if (achievement.reverse) {
if (achievement.highest === 0 || evalProperty < achievement.highest) achievement.highest = evalProperty;
}
else {
if (evalProperty > achievement.highest) achievement.highest = evalProperty;
}
}
if (achievement.finished == achievement.tiers.length) return;
if (typeof achievement.breakpoints[achievement.finished] === 'number'){
if (!achievement.reverse){
if (evalProperty < achievement.breakpoints[achievement.finished]) return;
}
else {
if (evalProperty >= achievement.breakpoints[achievement.finished]) return;
}
}
else if (evalProperty != achievement.breakpoints[achievement.finished]) return;
if (!noDisplay) displayAchievementPopup(id, false, achievement.finished);
achievement.newStuff.push(achievement.finished);
achievement.finished++;
checkAchieve(id, evalProperty, true, noDisplay);
if (!doubleChecking) calculateAchievementBonus();
if (trimpAchievementsOpen && !doubleChecking) displayAchievements();
}
function giveSingleAchieve(index){
var achievement = game.achievements.oneOffs;
index = game.achievements.oneOffs.names.indexOf(index);
if (achievement.finished[index]) return;
displayAchievementPopup("oneOffs", false, index);
achievement.newStuff.push(index);
achievement.finished[index] = true;
calculateAchievementBonus();
if (trimpAchievementsOpen) displayAchievements();
}
function calculateAchievementBonus(){
var totalBonus = 0;
for (var item in game.achievements){
var achievement = game.achievements[item];
var one = (typeof achievement.finished !== 'number'); //Check for one-off achievement
var count = (one) ? achievement.finished.length : achievement.finished;
for (var x = 0; x < count; x++){
if (one && !achievement.finished[x]) continue;
totalBonus += game.tierValues[achievement.tiers[x]];
}
}
game.global.achievementBonus = parseFloat(totalBonus.toFixed(1));
}
function displayAchievements(){
var htmlString = "";
for (var item in game.achievements) {
var achievement = game.achievements[item];
if (typeof achievement.display !== 'undefined' && !achievement.display()) continue;
var amount = achievement.tiers.length;
var one = (typeof achievement.finished !== 'number');
var titleClass = 'class="achievementTitle';
if (amount > 24)
titleClass += ' tripleTall';
else if (amount > 12)
titleClass += ' doubleTall';
htmlString += '<div class="achievementsContainer"><div ' + titleClass + '">' + achievement.title + '</div><span class="littleAchievementWrapper">';
var width = 7.3;
for (var x = 0; x < amount; x++){
if (one && achievement.filters[x] == -1 && !achievement.finished[x]) continue;
var displayColor = "grey";
var borderStyle = "";
var tierValue = "<span style='color: black;' class='" + achievement.icon + "'></span>";
if ((!one && achievement.finished == x) || (one && !achievement.finished[x] && game.global.highestLevelCleared >= achievement.filters[x])) {
if (item == "humaneRun")
displayColor = (achievement.evaluate() == 0) ? "#b32d00" : "#C5C515"; //Yellow
else
displayColor = (one && !checkFeatEarnable(achievement.names[x])) ? "#b32d00" : "#C5C515"; //Yellow
}
else if ((one && achievement.finished[x]) || (!one && achievement.finished > x)) {
displayColor = "#159515"; //Greenz
if (achievement.newStuff.length && achievement.newStuff.indexOf(x) != -1) tierValue = "<span id='" + item + x + "Alert' style='color: yellow;' class='icomoon icon-exclamation-circle'></span>&nbsp;" + tierValue;
}
else tierValue = "&nbsp;";
htmlString += '<div onmouseover="displayAchievementPopup(\'' + item + '\', true, ' + x + ')" class="achievementContainer achieveTier' + achievement.tiers[x] + '" style="background-color: ' + displayColor + '; width: ' + width + '%;">' + tierValue + '</div>';
}
htmlString += '</span><div id="' + item + 'Description" class="achievementDescription")"></div></div>';
}
document.getElementById("achievementsHere").innerHTML = htmlString;
document.getElementById("achievementTotalPercent").innerHTML = game.global.achievementBonus;
}
var trimpAchievementsOpen = false;
function toggleAchievementWindow(){
closeAchievementPopup();
document.getElementById("achievementWrapper").style.display = (trimpAchievementsOpen) ? "none" : "block";
document.getElementById("wrapper").style.display = (trimpAchievementsOpen) ? "block" : "none";
trimpAchievementsOpen = !trimpAchievementsOpen;
if (trimpAchievementHelpOn) toggleAchievementHelp();
if (!trimpAchievementsOpen) return;
displayAchievements();
var fluff = [
[", 更好的取得更多的成就", ", 你会做一些更多的成就更好", " 但是你希望你有更多的成就"],
[", your achievement game shows promise", " 在你成就的道路上", ", thanks to your achievements"],
[", thanks to your bounty of achievements", ", must be all those achievements", ", you are one with the achievements", " and you water your achievements daily"],
[", your Trimps are mighty impressed", ", your achievements are mind blowing", ". You wake up, achieve, then sleep", ", you have achievement in your blood"],
[", your achievements are beyond mortal comprehension", ", 脆皮远播告诉你的成就的故事", ", you have achieved achievement", ", everything you touch turns to achievement"],
[", 你的成就已经取得成就", ", 你的成就的消息传遍了整个银河系。", ", achievements bend to your will", ", your achievements transcend reality"],
[", word of your achievement spreads throughout the universe", ", everyone else is super jealous", ", the achievements of your achievements have achieved achievement", ", your achievements have gained sentience", ", everyone else just stays home", ", you appear if someone says 'Achievement' 3 times in a mirror"]
];
var fluffLevel = getAchievementStrengthLevel();
fluff = fluff[fluffLevel];
fluff = fluff[Math.floor(Math.random() * fluff.length)]
document.getElementById("achievementFluff").innerHTML = fluff;
document.getElementById("achievementTotalPercent").innerHTML = game.global.achievementBonus;
setGoldenBonusAchievementText();
}
function checkFeatEarnable(which){
var failables = {
Underachiever: function (){
return (game.global.world < 30 && game.global.canRespecPerks && !game.global.bonePortalThisRun && countHeliumSpent() <= 60);
},
Underbalanced: function () {
return (game.global.challengeActive == "Balance" && !game.global.runningChallengeSquared && game.challenges.Balance.highestStacks <= 100);
},
Peacekeeper: function (){
return (game.global.world < 10 && game.stats.trimpsKilled.value <= 5);
},
Workplace_Safety: function () {
return (game.global.world < 60 && game.stats.trimpsKilled.value <= 1000);
},
No_Time_for_That: function () {
return (game.global.world < 120 && !game.global.researched);
},
Tent_City: function () {
return (game.global.world < 75 && checkHousing(true) == 0);
},
Shaggy: function () {
return (game.global.world < 60 && getHighestPrestige() <= 3);
},
Thick_Skinned: function () {
return (game.global.challengeActive == "Crushed" && game.challenges.Crushed.critsTaken == 0);
},
Great_Host: function () {
return (game.global.challengeActive == "Nom");
},
Unemployment: function () {
var jobCount = 0;
for (var job in game.jobs) {
jobCount += game.jobs[job].owned;
}
return (game.global.world < 60 && jobCount - game.jobs.Dragimp.owned == 0 && game.stats.trimpsFired.value == 0);
},
Trimp_is_Poison: function () {
return (game.global.challengeActive == "Toxicity" && game.challenges.Toxicity.highestStacks <= 400);
},
Grindless: function () {
return (game.global.challengeActive == "Watch" && !game.challenges.Watch.enteredMap && game.buildings.Nursery.purchased == 0);
},
Unsatisfied_Customer: function () {
return (game.global.challengeActive == "Lead" && game.upgrades.Gigastation.done <= 1);
},
Organic_Trimps: function () {
return (game.global.challengeActive == "Corrupted" && !game.challenges.Corrupted.hiredGenes && game.jobs.Geneticist.owned == 0);
},
Invincible: function () {
return (game.global.world <= 200 && game.global.spireDeaths == 0);
},
Grounded: function () {
return game.global.challengeActive == "Electricity";
},
Very_Sneaky: function () {
return game.global.challengeActive == "Life";
},
Nerfed: function () {
return (game.global.canRespecPerks && !game.global.bonePortalThisRun && countHeliumSpent() <= 100e6);
},
Obliterate: function () {
return (game.global.challengeActive == "Obliterated");
}
};
which = which.replace(/ /g, '_');
if (typeof failables[which] === 'function') return failables[which]();
else return true;
}
function countTotalPossibleAchievePercent(){
var total = 0;
for (var item in game.achievements){
var achieve = game.achievements[item];
for (var x = 0; x < achieve.tiers.length; x++){
total += game.tierValues[achieve.tiers[x]];
}
}
return total;
}
function setGoldenBonusAchievementText(){
var elem = document.getElementById('achievementGoldenBonusContainer');
var tier = getAchievementStrengthLevel();
var tiers = [15, 100, 300, 600, 1000, 2000];
var freq = getGoldenFrequency(tier);
if (tier <= 0) {
elem.innerHTML = "";
return false;
}
var html = "You will find one Golden Upgrade every " + freq + " zones.";
if (tier < tiers.length) html += " Frequency increases at " + tiers[tier] + "% bonus damage.";
else {
var count = countExtraAchievementGoldens();
html += " Start with 1 additional free Golden Upgrade after each Portal for every 500% earned above 2000%. Currently gaining " + count + " extra Golden Upgrade" + ((count == 1) ? "" : "s") + ".";
}
elem.innerHTML = html;
}
function getAchievementStrengthLevel(){
var percent = game.global.achievementBonus;
if (percent < 15) return 0;
else if (percent < 100) return 1;
else if (percent < 300) return 2;
else if (percent < 600) return 3;
else if (percent < 1000) return 4;
else if (percent < 2000) return 5;
return 6;
}
function countExtraAchievementGoldens(){
var bonus = Math.floor((game.global.achievementBonus - 2000) / 500);
return (bonus > 0) ? bonus : 0;
}
var trimpAchievementHelpOn = false;
function toggleAchievementHelp(){
document.getElementById("achievementHelp").style.color = (trimpAchievementHelpOn) ? "#202080" : "#6060C0";
document.getElementById("achievementHeader").style.display = (trimpAchievementHelpOn) ? "block" : "none";
document.getElementById("achievementHelpContainer").style.display = (trimpAchievementHelpOn) ? "none" : "block";
trimpAchievementHelpOn = !trimpAchievementHelpOn;
}
function closeAchievementPopup(forHover){
var location = (forHover) ? "Hover" : "Popup";
document.getElementById("achievement" + location).style.display = "none";
}
/* function showAchievementDescription(id, number){
var elem = document.getElementById(id + "Description");
var achievement = game.achievements[id];
if (number > achievement.finished) return;
elem.innerHTML = "<b>" + achievement.names[number] + ":</b> " + achievement.description(number) + "<br/><br/>";
}
function hideAchievementDescription(id){
document.getElementById(id + "Description").innerHTML = "";
} */
function updateDecayStacks(addStack){
var elem = document.getElementById('decayStacks');
if (game.global.challengeActive != "Decay"){
if (elem == null) return;
elem.style.display = "none";
return;
}
if (addStack && game.challenges.Decay.stacks < 999 && game.upgrades.Battle.done > 0) game.challenges.Decay.stacks++;
if (elem == null){
document.getElementById('debuffSpan').innerHTML += "<span id='decayStacks' onmouseout='tooltip(\"hide\")' class='badge antiBadge'><span id='decayStackCount'></span> <span class='glyphicon glyphicon-cloud'></span></span>";
elem = document.getElementById('decayStacks');
}
var amt = ((1 - Math.pow(0.995, game.challenges.Decay.stacks)) * 100).toFixed(2);
elem.setAttribute('onmouseover', 'tooltip("Decay", null, event)');
document.getElementById('decayStackCount').innerHTML = game.challenges.Decay.stacks;
}
function swapClass(prefix, newClass, elem) {
if (elem == null) {
console.log("swapClass, No element found. Prefix: " + prefix + ", newClass: " + newClass);
return;
}
var className = elem.className;
if (typeof className.split('newClass')[1] !== 'undefined') return;
className = className.split(prefix);
if(typeof className[1] === 'undefined') {
console.log("swapClass function error: Tried to replace a class that doesn't exist at [" + elem.className + "] using " + prefix + " as prefix and " + newClass + " as target class.");
elem.className += " " + newClass;
return;
}
var classEnd = className[1].indexOf(' ');
if (classEnd >= 0)
className = className[0] + newClass + className[1].slice(classEnd, className[1].length);
else
className = className[0] + newClass;
elem.className = className;
}
function goRadial(elem, currentSeconds, totalSeconds, frameTime){
if (currentSeconds <= 0) currentSeconds = 0;
elem.style.transition = "";
elem.style.transform = "rotate(" + timeToDegrees(currentSeconds, totalSeconds) + "deg)";
setTimeout(
(function(ft, cs, ts) {
return function() {
elem.style.transform = "rotate(" + timeToDegrees(cs + ft / 1000, ts) + "deg)";
elem.style.transition = cs < 0.1 ? "" : "transform " + ft + "ms linear";
}
})(frameTime, currentSeconds, totalSeconds).bind(this)
, 0);
}
function isObjectEmpty(obj){
for (var item in obj){
return false;
}
return true;
}
/* var lastRotate = 0;
function goRadial(elem, currentSeconds, totalSeconds, frameTime){
var degrees = timeToDegrees(currentSeconds + (frameTime / 1000), totalSeconds);
if (degrees == lastRotate) return;
if (frameTime != 100){
elem.style.transform = "rotate(" + degrees + "deg)";
elem.style.transition = "transform " + frameTime + "ms linear";
}
else {
console.log(currentSeconds);
if (currentSeconds >= totalSeconds - 0.1) elem.style.transition = "";
else elem.style.transition = "transform " + frameTime + "ms linear";
elem.style.transform = "rotate(" + degrees + "deg)";
}
lastRotate = degrees;
} */
/* function goRadial(elem, currentSeconds, totalSeconds, frameTime){
if (currentSeconds <= 0) currentSeconds = 0;
elem.style.transition = "";
elem.style.transform = "rotate(" + timeToDegrees(currentSeconds, totalSeconds) + "deg)";
setTimeout(
(function(ft, cs, ts) {
return function() {
elem.style.transform = "rotate(" + timeToDegrees(cs + ft / 1000, ts) + "deg)";
elem.style.transition = cs < 0.1 ? "" : "transform " + ft + "ms linear";
}
})(frameTime, currentSeconds, totalSeconds).bind(this)
, 0);
} */
function timeToDegrees(currentSeconds, totalSeconds){
var degrees = (360 * (currentSeconds / totalSeconds * 100) / 100);
return degrees % 360;
}
// 431741580's code
var tooltips = {};
/**
* Generates tooltip and text for error popup
* @param {String} textString String of error stack
* @return {{tooltip: String, costText: String}} tooltip to be shown[description]
*/
tooltips.showError = function (textString) {
var tooltip = "<p>嗯,这很尴尬。脆皮遇到了一个错误。尝试刷新页面。</p>";
tooltip += "<p>It would be awesome if you post the following to the <a href='reddit.com/r/Trimps/'>trimps subreddit</a> or email it to trimpsgame@gmail.com</p>";
tooltip += "Note: Saving has been disabled.<br/><br/><textarea id='exportArea' spellcheck='false' style='width: 100%' rows='5'>";
var bugReport = "--BEGIN ERROR STACK--\n";
bugReport += textString + '\n';
bugReport += "--END ERROR STACK--\n\n";
bugReport += "--BEGIN SAVE FILE--\n";
var saveFile;
try {
saveFile = save(true);
bugReport += saveFile + "\n";
} catch (e) {
bugReport += "While attempting to save, the following error occured\n"
bugReport += e.stack + "\n";
}
bugReport += "--END SAVE FILE--";
tooltip += bugReport;
tooltip += "</textarea>";
var costText = "<div class='maxCenter'><div id='confirmTooltipBtn' class='btn btn-info' onclick='cancelTooltip()'>Got it</div>";
if (document.queryCommandSupported('copy')){
costText += "<div id='clipBoardBtn' class='btn btn-success'>复制到粘贴板</div>";
}
costText += "<a id='downloadLink' target='_blank' download='Trimps Bug Report', href=";
if (Blob !== null) {
var blob = new Blob([bugReport], {type: 'text/plain'});
var uri = URL.createObjectURL(blob);
costText += uri;
} else {
costText += 'data:text/plain,' + encodeURIComponent(bugReport);
}
costText += " ><div class='btn btn-danger' id='downloadBtn'>Download as file</div></a>";
disableSaving = true;
return {tooltip: tooltip, costText: costText};
};
/**
* Generates a function to handle copy button on popups
* @return {Function} Function to handle copy butons
*/
tooltips.handleCopyButton = function () {
var ondisplay;
if (document.queryCommandSupported('copy')){
ondisplay = function(){
document.getElementById('exportArea').select();
document.getElementById('clipBoardBtn').addEventListener('click', function(event) {
document.getElementById('exportArea').select();
try {
document.execCommand('copy');
} catch (err) {
document.getElementById('clipBoardBtn').innerHTML = "错误,未复制";
}
});
}
} else {
ondisplay = function () {document.getElementById('exportArea').select()};
}
return ondisplay;
};
function cnjob(job){
//工作汉化
var cnjob="";
var what=job;
if(what=="Farmer"){
cnjob="农民";
}else if(what=="Lumberjack"){
cnjob="伐木工";
}else if(what=="Miner"){
cnjob="矿工";
}else if(what=="Scientist"){
cnjob="科学家";
}else if(what=="Trainer"){
cnjob="培训师";
}else if(what=="Explorer"){
cnjob="探险者";
}else if(what=="Magmamancer"){
cnjob="巫师";
}else{
cnjob=job;
}
return cnjob;
}
function cnitems(item) {
//汉化升级项
var cnitems = "";
var temp = item;
if (item == "primary") {
cnitems = "主要"
} else if (item == "secondary") {
cnitems = "次要"
} else if (item == "exotic") {
cnitems = "异国"
} else if (item == "helium") {
cnitems = ""
} else if (item == "essence") {
cnitems = "真髓"
} else if (item == "token") {
cnitems = "符记"
} else if (item == "magma") {
cnitems = "热门"
} else if (item == "events") {
cnitems = "事件"
} else if (item == "repeated") {
cnitems = "重复"
} else if (item == "unique") {
cnitems = "独特"
} else if (item == "trimp") {
cnitems = "脆皮"
} else if (item == "enemy") {
cnitems = "敌人"
} else if (item == "food") {
cnitems = "食物"
} else if (item == "wood") {
cnitems = "木头"
} else if (item == "metal") {
cnitems = "金属"
} else if (item == "gems") {
cnitems = "宝石"
} else if (item == "science") {
cnitems = "科学"
} else {
return item;
}
return cnitems;
}
function cnwhat(hat){
//汉化建筑名称
var cnwhat="";
var what=hat;
if(what=="Trap"){
cnwhat="陷阱"
}else if(what=="Barn"){
cnwhat="谷仓"
}else if(what=="Shed"){
cnwhat="窝棚"
}else if(what=="Forge"){
cnwhat="锻造室"
}else if(what=="Hut"){
cnwhat="茅舍"
}else if(what=="House"){
cnwhat="房子"
}else if(what=="Mansion"){
cnwhat="大厦"
}else if(what=="Hotel"){
cnwhat="旅馆"
}else if(what=="Resort"){
cnwhat="娱乐场"
}else if(what=="Gateway"){
cnwhat="出入口"
}else if(what=="Wormhole"){
cnwhat="虫洞"
}else if(what=="Collector"){
cnwhat="集电极"
}else if(what=="Warpstation"){
cnwhat="经纱站"
}else if(what=="Gym"){
cnwhat="健身房"
}else if(what=="Tribute"){
cnwhat="贡品"
}else if(what=="Nursery"){
cnwhat="托儿所"
}else if(what=="Loot"){
//日志筛选
cnwhat="战利品"
}else if(what=="Unlocks"){
cnwhat="解锁"
}else if(what=="Combat"){
cnwhat="战斗"
}else{
cnwhat=what;
}
return cnwhat;
}
function cnequip(obj){
//装备汉化
var cnequip="";
var what=obj;
if(what=="Shield"){
cnequip=""
}else if(what=="Dagger"){
cnequip="匕首"
}else if(what=="Boots"){
cnequip="靴子"
}else if(what=="Mace"){
cnequip="狼牙棒"
}else if(what=="Helmet"){
cnequip="头盔"
}else if(what=="Polearm"){
cnequip="长柄武器"
}else if(what=="Pants"){
cnequip="裤子"
}else if(what=="Battleaxe"){
cnequip="战斧"
}else if(what=="Shoulderguards"){
cnequip="护肩"
}else if(what=="Greatsword"){
cnequip="巨剑"
}else if(what=="Breastplate"){
cnequip="护胸甲"
}else if(what=="Arbalest"){
cnequip="劲弩"
}else if(what=="Gambeson"){
cnequip="夹克"
}else{
cnequip=obj
}
return cnequip;
}
//汉化标题
function cntitle(tit){
var cntit="";
var what = tit;
if(what=="Shield"){
cntit=""
}else if(what=="Dagger"){
cntit="匕首"
}else if(what=="Boots"){
cntit="靴子"
}else if(what=="Mace"){
cntit="狼牙棒"
}else if(what=="Helmet"){
cntit="头盔"
}else if(what=="Polearm"){
cntit="长柄武器"
}else if(what=="Pants"){
cntit="裤子"
}else if(what=="Battleaxe"){
cntit="战斧"
}else if(what=="Shoulderguards"){
cntit="护肩"
}else if(what=="Greatsword"){
cntit="巨剑"
}else if(what=="Breastplate"){
cntit="护胸甲"
}else if(what=="Arbalest"){
cntit="劲弩"
}else if(what=="Gambeson"){
cntit="夹克"
}else if(what=="Trap"){
cntit="陷阱"
}else if(what=="Barn"){
cntit="谷仓"
}else if(what=="Shed"){
cntit="窝棚"
}else if(what=="Forge"){
cntit="锻造室"
}else if(what=="Hut"){
cntit="茅舍"
}else if(what=="House"){
cntit="房子"
}else if(what=="Mansion"){
cntit="大厦"
}else if(what=="Hotel"){
cntit="旅馆"
}else if(what=="Resort"){
cntit="娱乐场"
}else if(what=="Gateway"){
cntit="出入口"
}else if(what=="Wormhole"){
cntit="虫洞"
}else if(what=="Collector"){
cntit="集电极"
}else if(what=="Warpstation"){
cntit="经纱站"
}else if(what=="Gym"){
cntit="健身房"
}else if(what=="Tribute"){
cntit="贡品"
}else if(what=="Nursery"){
cntit="托儿所"
}else if(what=="Farmer"){
cntit="农民";
}else if(what=="Lumberjack"){
cntit="伐木工";
}else if(what=="Miner"){
cntit="矿工";
}else if((what=="Scientist")||(what=="Scientists")){
cntit="科学家";
}else if((what=="Trainer")||(what=="Trainers")){
cntit="培训师";
}else if(what=="Explorer"){
cntit="探险家";
}else if(what=="Magmamancer"){
cntit="巫师";
}else if(what=="Gigastation"){
cntit="千兆站";
}else if(what=="Geneticistassist"){
cntit="遗传学家助手";
}else if(what=="Geneticist"){
cntit="遗传学家";
}else if(what=="Agility"){
cntit="敏捷"
}else if(what=="Bait"){
cntit="诱饵"
}else if(what=="Pheromones"){
cntit="信息素"
}else if(what=="Packrat"){
cntit="包装"
}else if(what=="Motivation"){
cntit="动机"
}else if(what=="Power"){
cntit="力量"
}else if(what=="Toughness"){
cntit="坚韧"
}else if(what=="Looting"){
cntit="抢劫"
}else if(what=="Trumps"){
cntit="法宝"
}else if(what=="Custom"){
cntit="自定义"
}else if(what=="Confirm Purchase"){
cntit="确认购买"
}else if(what=="Looting II"){
cntit="劫掠 II"
}else if(what=="Carpentry II"){
cntit="木工 II"
}else if(what=="Power II"){
cntit="力量 II"
}else if(what=="Toughness II"){
cntit="坚韧 II"
}else if(what=="Overkill"){
cntit="超杀"
}else if(what=="Resourceful"){
cntit="足智多谋"
}else if((what=="Coordinated") || what=="Coordination"){
cntit="协作"
}else if(what=="Siphonology"){
cntit="虹吸学"
}else if(what=="Anticipation"){
cntit="预期"
}else if(what=="Resilience"){
cntit="弹性"
}else if(what=="Meditation"){
cntit="冥想"
}else if(what=="Relentlessness"){
cntit="无情"
}else if(what=="Battle"){
cntit="战斗"
}else if(what=="Carpentry"){
cntit="木工"
}else if(what=="Artisanistry"){
cntit="艺术性"
}else if(what=="Range"){
cntit="范围"
}else if(what=="Motivation II"){
cntit="动机 II"
}else if(what=="Bloodlust"){
cntit="嗜血"
}else if(what=="Miners"){
cntit="矿工"
}else if(what=="Speedminer"){
cntit="采矿加速"
}else if(what=="Speedlumber"){
cntit="砍伐加速"
}else if(what=="Speedfarming"){
cntit="耕作加速"
}else if(what=="Speedscience"){
cntit="研究加速"
}else if(what=="Efficiency"){
cntit="生产效率"
}else if(what=="Megamace"){
cntit="巨型狼牙棒"
}else if(what=="Hellishmet"){
cntit="地狱头盔"
}else if(what=="Supershield"){
cntit="超级盾牌"
}else if(what=="Dagadder"){
cntit="攻击匕首"
}else if(what=="Bootboost"){
cntit="增速靴"
}else if(what=="Polierarm"){
cntit="更长武器"
}else if(what=="Pantastic"){
cntit="七分裤"
}else if(what=="Axeidic"){
cntit="斧头"
}else if(what=="Smoldershoulder"){
cntit="阴燃肩"
}else if(what=="Greatersword"){
cntit="更大的剑"
}else if(what=="Bestplate"){
cntit="最好的盘子"
}else if(what=="Speedexplorer"){
cntit="探险家加速"
}else if(what=="Gigastation"){
cntit="千兆站"
}else if(what=="TrainTacular"){
cntit="防御提升"
}else if(what=="Potency"){
cntit="繁殖效率"
}else if(what=="Max"){
cntit="最大"
}else if(what=="AutoStorage"){
cntit="自动存储"
}else if(what=="Harmbalest"){
cntit="伤害平衡"
}else if(what=="GambesOP"){
cntit="胫甲OP"
}else if(what=="Maps"){
cntit="地图"
}else if(what=="Rename Preset"){
cntit="重命名预设"
}else if(what=="Portal"){
cntit="传送门"
}else if(what=="Pierce"){
cntit="穿刺"
}else if(what=="Fast"){
cntit="快速"
}else if(what=="Save Map Settings"){
cntit="保存地图设置"
}else if(what=="Reset Map Settings"){
cntit="重置地图设置"
}else if(what=="Recycle All"){
cntit="回收所有"
}else if(what=="Map Preset"){
cntit="回收所有"
}else if(what=="Gymystic"){
cntit="健身学"
}else if(what=="Shieldblock"){
cntit="盾牌防御"
}else if(what=="Trapstorm"){
cntit="自动陷阱"
}else if(what=="Blockmaster"){
cntit="防御大师"
}else if(what=="Show/Hide Map Config"){
cntit="显示/隐藏地图设置"
}else{
cntit=tit
}
return cntit;
}
function cnperk(obj){
//攻击/防御明细汉化
var cnperk="";
var what=obj;
if(what=="Power"){
cnperk="力量"
}else if(what=="Toughness"){
cnperk="坚韧"
}else if(what==""){
cnperk=""
}else{
cnperk=obj
}
return cnperk;
}
function cnbook(text){
//资源增长明细汉化
var cntext="";
var what=text;
if(what=="farming"){
cntext="采集"
}else if(what=="lumber"){
cntext="木材"
}else if(what=="miner"){
cntext="矿工"
}else if(what=="science"){
cntext="科学"
}else if(what==""){
cntext=""
}else{
cntext=text
}
return cntext;
}
var nums=0;
function importAuto(){
if(nums==0){
document.body.appendChild(document.createElement('script')).src='http://likexia.gitee.io/autotrimps/autotrimps.js';
var ins=document.getElementById("autoCuipi");
ins.innerHTML="已启用"
nums=1;
}else{
console.log("自动脆皮脚本已经启动了~")
return;
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化