SharkGame.Stats={tabId:"stats",tabDiscovered:!1,tabName:"Grotto",tabBg:"img/bg/bg-grotto.png",sceneImage:"img/events/misc/scene-grotto.png",recreateIncomeTable:null,discoverReq:{upgrade:["statsDiscovery"]},bannedDisposeCategories:["special","harmful"],message:"The grotto is a place to keep a better track of resources.You can also dispose of those you don't need anymore.Disposing specialists returns them to their normal, previous lives.",init:function(){var e=SharkGame.Stats;SharkGame.Tabs[e.tabId]={id:e.tabId,name:e.tabName,discovered:e.tabDiscovered,discoverReq:e.discoverReq,code:e},e.recreateIncomeTable=!0},switchTo:function(){var e=SharkGame.Stats,a=$("#content");a.append($("
").html("(Listed below are resources, the income each resource gives you, and the total income you're getting from each thing.)").addClass("medDesc")),n.append(o);var i=$("#generalStats");i.append($("
").html("Climate Level
"+SharkGame.Main.beautify(SharkGame.World.planetLevel))),i.append($("
").html("Time since you began:
").addClass("medDesc")),c||i.append($("
").html("Time since you came through the gate:
").addClass("medDesc")),i.append($("
").html("Essence given is the total acquired for the entire game and not just for this world.").addClass("medDesc")),i.append(e.createTotalAmountTable()),SharkGame.Main.createBuyButtons("rid")},update:function(){var e=SharkGame.Main,a=SharkGame.Stats;a.updateDisposeButtons(),a.updateIncomeTable(),a.updateTotalAmountTable(),a.recreateIncomeTable&&(a.createIncomeTable(),a.createTotalAmountTable(),a.recreateIncomeTable=!1);var t=(new Date).getTime();$("#gameTime").html(e.formatTime(t-SharkGame.timestampGameStart)),$("#runTime").html(e.formatTime(t-SharkGame.timestampRunStart))},createDisposeButtons:function(){var e=SharkGame.Resources,a=SharkGame.Stats,t=(SharkGame.Main,$("#disposeResource"));$.each(SharkGame.ResourceTable,(function(s,r){e.getTotalResource(s)>0&&-1===a.bannedDisposeCategories.indexOf(e.getCategoryOfResource(s))&&SharkGame.Button.makeButton("dispose-"+s,"Dispose of "+e.getResourceName(s),t,SharkGame.Stats.onDispose)}))},updateDisposeButtons:function(){var e=SharkGame.Resources,a=SharkGame.Main;$.each(SharkGame.ResourceTable,(function(t,s){if(e.getTotalResource(t)>0){var r=$("#dispose-"+t),o=e.getResource(t),n=SharkGame.Settings.current.buyAmount;if(n<0){var i=o,c=-1*Math.floor(n);n=Math.floor(i/c)}var d=1===n,m=o").attr("id","incomeTable"):s.empty();var r=null,o=!1;e.getSpecialMultiplier()>1&&(o=!0);var n=0;if($.each(SharkGame.ResourceTable,(function(i,c){if(e.getTotalResource(i)>0&&c.income){var d=!0,m=c.income,l=$("
"),p=0;if($.each(m,(function(a,s){t.doesResourceExist(a)&&e.getTotalResource(a)>0?p++:s<0&&!c.forceIncome&&(d=!1)})),d){var u=0,h=n%2==0?"evenRow":"oddRow";l.append($(" ").html(e.getResourceName(i)).attr("rowspan",p).addClass(h)),$.each(m,(function(n,c){if(t.doesResourceExist(n)&&e.getTotalResource(n)>0){var d=c>0?"+":"";l.append($(" ").html(e.getResourceName(n)).addClass(h)),l.append($(" ").html(""+d+a.beautify(c)+"/s").addClass(h));var m=t.worldResources[n].boostMultiplier;if(1!==m?l.append($(" ").html("x"+a.beautify(m)+"").addClass(h)):l.append($(" ").addClass(h)),0===u){l.append($(" ").attr("rowspan",p).html("x"+e.getMultiplier(i)+"").addClass(h));var g=t.getWorldIncomeMultiplier(i);1!==g?l.append($(" ").attr("rowspan",p).html("x"+a.beautify(g)+"").addClass(h)):l.append($(" ").attr("rowspan",p).addClass(h));var b=t.getArtifactMultiplier(i);1!==b?l.append($(" ").attr("rowspan",p).html("x"+a.beautify(b)+"").addClass(h)):l.append($(" ").attr("rowspan",p).addClass(h))}o&&(r=$(" ").html("x"+a.beautify(e.getSpecialMultiplier())+"").addClass("essenceGlow"),l.append(r),o=!1),l.append($(" ").attr("id","income-"+i+"-"+n).html(""+d+a.beautify(e.getProductAmountFromGeneratorResource(i,n))+"/s").addClass(h)),u++,s.append(l),l=$(" ")}})),l=null,n++}}})),r){var i=s.find("tr").length;r.attr("rowspan",i)}return s},createTotalAmountTable:function(){var e=SharkGame.Resources,a=SharkGame.Main,t=$("#totalAmountTable");return 0===t.length?t=$(" ").attr("id","totalAmountTable"):t.empty(),$.each(SharkGame.ResourceTable,(function(s,r){if(e.getTotalResource(s)>0){var o=$("
");o.append($(" ").html(e.getResourceName(s))),o.append($(" ").html(a.beautify(e.getTotalResource(s))).attr("id","totalAmount-"+s)),t.append(o)}})),t}};