forked from wchill/steamSummerMinigame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autoPlay.user.min.js
1 lines (1 loc) · 26.4 KB
/
autoPlay.user.min.js
1
!function(e){"use strict";function t(){return e.g_Minigame.m_CurrentScene}function n(){ce("Starting /u/wchill's script (version "+Te+")",1),e.document.addEventListener("event:welcomePanelVisible",function(){e.$J("#badge_items > .purchase_ability_item > .sub_item").each(function(){var t=e.$J(this),n=e.$J('<div class="sub_item x100">x100</div>');n.click(function(t){e.g_Minigame.CurrentScene().TrySpendBadgePoints(this,100),t.stopPropagation()}),n.data(t.data()),t.css("margin-right","50px"),t.after(n)});var t=e.g_Minigame.CurrentScene().m_UI.UpdateSpendBadgePointsDialog;e.g_Minigame.CurrentScene().m_UI.UpdateSpendBadgePointsDialog=function(){t.apply(e.g_Minigame.CurrentScene().m_UI,arguments);var n=e.g_Minigame.CurrentScene().m_rgPlayerTechTree.badge_points;e.$J("#badge_items > .purchase_ability_item > .sub_item.x100").each(function(){var t=e.$J(this);n<100*t.data().cost?t.addClass("disabled"):t.removeClass("disabled")})}},!1),Ye=t().DoCritEffect,ze=t().m_rgClickNumbers.push,Qe=e.g_Minigame.Render,M(),Re&&r(),Me&&e.CEnemy&&(e.CEnemy.prototype.TakeDamage=function(){},e.CEnemySpawner.prototype.TakeDamage=function(){},e.CEnemyBoss.prototype.TakeDamage=function(){}),Ae&&C(),Pe&&b();var n=document.getElementById("abilities");n&&(n.style.textAlign="left"),De&&(n=document.getElementById("global_header"),n&&n.parentNode&&n.parentNode.removeChild(n),n=document.getElementById("footer"),n&&n.parentNode&&n.parentNode.removeChild(n),n=document.getElementById("footer_spacer"),n&&n.parentNode&&n.parentNode.removeChild(n),n=document.querySelector(".pagecontent"),n&&(n.style["padding-bottom"]=0),document.body.style.backgroundPosition="0 0"),Ne&&u(we),Ie&&fe(),Oe&&v(),void 0!==e.CSceneGame&&(e.CSceneGame.prototype.DoScreenShake=function(){}),i();var a=document.createElement("span");a.className="toggle_music_btn",a.textContent="Easter Egg",a.onclick=function(){e.SmackTV()},document.querySelector(".game_options").insertBefore(a,document.querySelector(".leave_game_btn"));var o=document.querySelector(".title_activity"),l=document.createElement("span");l.innerHTML='<span id="players_in_game">0/1500</span> Players in room<br>',o.insertBefore(l,o.firstChild);var m=document.getElementById("activitylog");m.style.marginTop="33px";var p=document.createElement("div");document.getElementsByClassName("pagecontent")[0].insertBefore(p,document.getElementsByClassName("footer_spacer")[0]),p.className="options_box";var _=document.querySelector(".options_box");_||(_=document.querySelector(".options_box")),_.innerHTML="<b>OPTIONS</b> (v"+Te+')<br>Settings marked with a <span style="color:#FF5252;font-size:22px;line-height:4px;vertical-align:bottom;">*</span> requires a refresh to take effect.<hr>',_.className="options_box",_.style.backgroundColor="#000000",_.style.width="600px",_.style.marginTop="12px",_.style.padding="12px",_.style.boxShadow="2px 2px 0 rgba( 0, 0, 0, 0.6 )",_.style.color="#ededed",_.style.marginLeft="auto",_.style.marginRight="auto";var h=_.cloneNode(!0),T=document.createElement("div");T.style["-moz-column-count"]=3,T.style["-webkit-column-count"]=3,T.style["column-count"]=3,T.style.width="100%",T.appendChild(s("removeInterface","Remove interface",De,g,!0)),T.appendChild(s("removeParticles","Remove particle effects",Re,g,!0)),T.appendChild(s("removeFlinching","Remove flinching effects",Me,g,!0)),T.appendChild(s("removeCritText","Remove crit text",Ae,C,!1)),T.appendChild(s("removeGoldText","Remove gold text",xe,g,!1)),T.appendChild(s("removeAllText","Remove all text",Pe,b,!1)),T.appendChild(s("disableRenderer","Throttle game renderer",Oe,v,!0)),("undefined"!=typeof GM_info||"undefined"!==e.usingMsgScript)&&T.appendChild(s("enableAutoRefresh","Enable auto-refresh",Ne,E,!1)),T.appendChild(s("enableFingering","Enable targeting pointer",Ie,g,!0)),T.appendChild(s("useTrollTracker","Track improper ability use",Ge,g,!0)),T.appendChild(s("praiseGoldHelm","Praise Gold Helm!",ke,y,!1)),T.appendChild(c("praiseGoldHelmImage","",Xe,qe,f)),T.appendChild(d("setLogLevel","Change the log level","25px",Le,0,5,S)),_.appendChild(T),h.innerHTML="<b>GAME INFO</b><br/>",h.className="info_box",h.style.right="0px",it=document.createElement("div"),it.style["-moz-column-count"]=3,it.style["-webkit-column-count"]=3,it.style["column-count"]=3,it.appendChild(document.createElement("div")),it.appendChild(document.createElement("div")),it.appendChild(document.createElement("div")),h.appendChild(it),_.parentElement.appendChild(h);var L=document.querySelector(".leave_game_helper");L.parentElement.removeChild(L),Ee(),be();var D=e.g_Minigame.CurrentScene().m_rgPlayerTechTree.badge_points,R=e.g_steamID%10+1;e.g_Minigame.CurrentScene().TrySpendBadgePoints(e.$J("<a data-type='25' data-cost='200'></a>"),R),D-=200*R;var A=Math.floor(D/200);e.g_Minigame.CurrentScene().TrySpendBadgePoints(e.$J("<a data-type='26' data-cost='100'></a>"),A),e.g_Minigame.CurrentScene().TrySpendBadgePoints(e.$J("<a data-type='27' data-cost='100'></a>"),A),e.g_Minigame.CurrentScene().TrySpendBadgePoints(e.$J("<a data-type='19' data-cost='1'></a>"),D%100)}function a(){for(var e={1:":shelterwildfire:",2:":waterrune:",3:":Wisp:",4:":FateTree:"},n=0;3>n;n++){var a=t().m_rgGameData.lanes[n].element,i=t().m_rgLaneData[n].abilities;i||(i={});for(var r=[],o=0;4>o;o++){var l=t().GetEnemy(n,o);l&&r.push(l)}var m=t().m_rgLaneData[n].players,c="Lane "+(n+1)+' - <img src="http://cdn.steamcommunity.com/economy/emoticon/'+e[a]+'"><br>'+m+" players";it.children[n].innerHTML=c}}function i(){ke?(e.$J(".tv_ui").css("background-image","url("+Xe+")"),e.$J(".pagecontent").attr("style","padding-bottom: 0px; background-image: url('http://cdn.akamai.steamstatic.com/steamcommunity/public/images/items/368020/7b933b3766d64ec0525c86891dedb4b699a25fb9.jpg')")):e.$J(".tv_ui").css("background-image","url("+Ke+")"),e.$J("#activeinlanecontainer").css("height","154px"),e.$J("#activitycontainer").css("height","270px"),e.$J("#activityscroll").css("height","270px")}function r(){e.CSceneGame&&(e.CSceneGame.prototype.DoScreenShake=function(){},Re&&(e.CSceneGame.prototype.SpawnEmitter=function(e){return e.emit=!1,e}))}function o(){var e=new Date,t=e.getUTCHours(),n=e.getUTCMinutes(),a=60-n;return 15==t&&a<=Ve.minsLeft?!0:!1}function l(){if(!Je){Je=!0;var n=ve();if(10>n&&Ve.useSlowMode)return;ot.forEach(q),Ue=n%Ve.rainingRounds===0||Fe,a(),W(),nt&&(e.clearInterval(nt),nt=!1),at&&(e.clearInterval(at),at=!1),n%Ve.rainingRounds>0&&n%Ve.rainingRounds<100-Ve.rainingSafeRounds&&!Fe?(n%Ve.rainingRounds===0?P():N(),I(),G(),O(),w(),(n<Ve.speedThreshold||n%Ve.rainingRounds===0)&&n>Ve.useGoldThreshold&&B(),F()):(n%Ve.rainingRounds===0||Fe?P():N(),I(),O(),k(),U(),F(),$(),J(),H(n)),x(),n!==We&&(We=n,m()),se(n),He=T(),t().m_nClicks=He,t().m_nLastTick=!1,e.g_msTickRate=1e3;var i=t().CalculateDamage(t().m_rgPlayerTechTree.damage_per_click,t().m_rgGameData.lanes[t().m_rgPlayerData.current_lane].element);ce("Ticked. Current clicks per second: "+He+". Current damage per second: "+i*He,4),Oe&&(t().Tick(),requestAnimationFrame(function(){e.g_Minigame.Renderer.render(t().m_Container)})),Je=!1;var r=t().GetEnemy(t().m_rgPlayerData.current_lane,t().m_rgPlayerData.target);if(He>0&&r){if(A(r.m_Sprite.position.x-440*r.m_nLane,r.m_Sprite.position.y-52,"-"+e.FormatNumberForDisplay(i*He,5),"#aaf"),t().m_rgStoredCrits.length>0){var o=t().m_rgStoredCrits.reduce(function(e,t){return e+t});t().m_rgStoredCrits.length=0,t().DoCritEffect(o,r.m_Sprite.position.x-440*r.m_nLane,r.m_Sprite.position.y+17,"Crit!")}var l=t().m_rgGameData.lanes[t().m_rgPlayerData.current_lane].active_player_ability_gold_per_click;if(l>0&&r.m_data.hp>0){var c=r.m_data.gold*l*He;t().ClientOverride("player_data","gold",t().m_rgPlayerData.gold+c),t().ApplyClientOverrides("player_data",!0),ce("Raining gold ability is active in current lane. Percentage per click: "+l+"%. Approximately gold per second: "+c,4),xe||A(r.m_Sprite.position.x-440*r.m_nLane,r.m_Sprite.position.y-17,"+"+e.FormatNumberForDisplay(c,5),"#e1b21e")}}ot.forEach(q)}e.CUI&&!je&&(je=!0,ce("Anti nuke in effect",1),e.CUI.prototype.UpdateLog=function(t){this.m_Game.m_rgTuningData.abilities;if(this.m_Game.m_rgPlayerTechTree){for(var n=0,a=t.length-1;a>=0;a--){var i=t[a];if(isNaN(i.time)&&(i.time=this.m_nActionLogTime+1),!(i.time<=this.m_nActionLogTime)){switch(i.type){case"ability":var r=this.m_eleUpdateLogTemplate.clone();if(Ge)if(ve()%100===0&&[10,11,12,15,20].indexOf(i.ability)>-1){if(e.$J(r).data("abilityid",i.ability),e.BigNumber){var o=new e.BigNumber(i.actor);e.$J(".name",r).append('<a href="http://steamcommunity.com/profiles/'+o.plus(new e.BigNumber("76561197960265728"))+'" target="_blank" style="color: red; font-weight: bold;">'+i.actor_name+"</a>")}else e.$J(".name",r).text(i.actor_name);e.$J(".ability",r).text(this.m_Game.m_rgTuningData.abilities[i.ability].name+" on level "+ve()),e.$J("img",r).attr("src",e.g_rgIconMap["ability_"+i.ability].icon),e.$J(r).v_tooltip({tooltipClass:"ta_tooltip",location:"top"}),this.m_eleUpdateLogContainer[0].insertBefore(r[0],this.m_eleUpdateLogContainer[0].firstChild),ce(i.actor_name+" used "+this.m_Game.m_rgTuningData.abilities[i.ability].name+" on level "+ve(),1),e.$J(".name",r).attr("style","color: red; font-weight: bold;"),e.$J.ajax({type:"POST",url:"http://steam.intense.io:8080/report",crossDomain:!0,data:JSON.stringify({name:i.actor_name,steamid:i.actor,round:ve(),ability:i.ability,time:i.time}),dataType:"json",success:function(e,t,n){console.log("Reported "+i.actor_name+" at time "+i.time)},error:function(e,t,n){console.log("POST failed.")}})}else ve()%100!==0&&ve()%100>90&&26===i.ability&&(e.$J(r).data("abilityid",i.ability),e.$J(".name",r).text(i.actor_name),e.$J(".ability",r).text(this.m_Game.m_rgTuningData.abilities[i.ability].name+" on level "+ve()),e.$J("img",r).attr("src",e.g_rgIconMap["ability_"+i.ability].icon),e.$J(".name",r).attr("style","color: yellow"),e.$J(r).v_tooltip({tooltipClass:"ta_tooltip",location:"top"}),this.m_eleUpdateLogContainer[0].insertBefore(r[0],this.m_eleUpdateLogContainer[0].firstChild));else e.$J(r).data("abilityid",i.ability),e.$J(".name",r).text(i.actor_name),e.$J(".ability",r).text(this.m_Game.m_rgTuningData.abilities[i.ability].name+" on level "+ve()),e.$J("img",r).attr("src",e.g_rgIconMap["ability_"+i.ability].icon),e.$J(r).v_tooltip({tooltipClass:"ta_tooltip",location:"top"}),this.m_eleUpdateLogContainer[0].insertBefore(r[0],this.m_eleUpdateLogContainer[0].firstChild);break;default:console.log("Unknown action log type: %s",i.type),console.log(i)}i.time>n&&(n=i.time)}}n>this.m_nActionLogTime&&(this.m_nActionLogTime=n);for(var l=this.m_eleUpdateLogContainer[0];l.children.length>20;)l.children[l.children.length-1].remove()}},this.m_eleUpdateLogContainer&&(this.m_eleUpdateLogContainer[0].innerHTML=""))}function m(){ce("Refreshing player data",2),q("25"),e.g_Server.GetPlayerData(function(n){var a=t();n.response.player_data&&(a.m_rgPlayerData=n.response.player_data,a.ApplyClientOverrides("player_data"),a.ApplyClientOverrides("ability")),n.response.tech_tree&&(a.m_rgPlayerTechTree=n.response.tech_tree,n.response.tech_tree.upgrades?a.m_rgPlayerUpgrades=e.V_ToArray(n.response.tech_tree.upgrades):a.m_rgPlayerUpgrades=[]),a.OnReceiveUpdate()},function(){},!0)}function c(e,t,n,a,i){var r=document.createElement("label"),o=document.createTextNode(t),l=document.createElement("select");for(var m in a){var c=document.createElement("option");c.value=a[m],c.textContent=m,a[m]==n&&(c.selected=!0),l.appendChild(c)}return l.name=e,l.style.marginRight="5px",l.onchange=i,r.appendChild(l),r.appendChild(o),r.appendChild(document.createElement("br")),r}function d(t,n,a,i,r,o,l){var m=document.createElement("label"),c=document.createTextNode(n),d=document.createElement("input");return d.type="number",d.name=t,d.style.width=a,d.style.marginRight="5px",d.value=i,d.min=r,d.max=o,d.onchange=l,e[d.name]=d,m.appendChild(d),m.appendChild(c),m.appendChild(document.createElement("br")),m}function s(t,n,a,i,r){var o=document.createElement("span");o.appendChild(document.createTextNode("*")),o.style.color="#FF5252",o.style.fontSize="22px",o.style.lineHeight="14px",o.style.verticalAlign="bottom";var l=document.createElement("label"),m=document.createTextNode(n),c=document.createElement("input");return c.type="checkbox",c.name=t,c.checked=a,c.onclick=i,e[c.name]=c.checked,l.appendChild(c),l.appendChild(m),r&&l.appendChild(o),l.appendChild(document.createElement("br")),l}function g(e){_(e)}function u(e){var t=60*(e+Be*Math.random())*1e3;$e=setTimeout(function(){p()},t)}function p(){var n=t().GetEnemy(t().m_rgPlayerData.current_lane,t().m_rgPlayerData.target).m_data;if("undefined"!=typeof n){var a=n.type;a!=mt.BOSS?(ce("Refreshing, not boss",5),e.location.reload(!0)):(ce("Not refreshing, A boss!",5),setTimeout(p,3e3))}else setTimeout(p,1e3)}function _(t){var n=t.target;return L(n.name,n.checked),e[n.name]=n.checked,n.checked}function h(t){var n=t.target;return L(n.name,n.value),e[n.name]=n.value,n.value}function y(e){void 0!==e&&(ke=_(e)),i()}function f(e){void 0!==e&&(Xe=h(e)),i()}function E(e){var t=Ne;void 0!==e&&(t=_(e)),t?u(we):clearTimeout($e)}function v(t){var n=Oe;void 0!==t&&(n=Oe=_(t));var a=e.PIXI.ticker.shared;n?(a.autoStart=!1,a.stop(),e.g_Minigame.Render=function(){}):(a.autoStart=!0,a.start(),e.g_Minigame.Render=Qe,e.g_Minigame.Render())}function C(e){var n=Ae;void 0!==e&&(n=_(e)),n?t().DoCritEffect=function(e,t,n,a){}:t().DoCritEffect=Ye}function b(e){var n=Pe;void 0!==e&&(n=_(e)),n?t().m_rgClickNumbers.push=function(e){e.container.removeChild(e)}:t().m_rgClickNumbers.push=ze}function T(){var e=ve();return e%Ve.rainingRounds===0?0:Se}function S(e){void 0!==e&&(Le=e.target.value)}function L(e,t){try{void 0!==localStorage&&localStorage.setItem("steamdb-minigame/"+e,t)}catch(n){console.log(n)}}function D(e,t){try{if(void 0!==localStorage){var n=localStorage.getItem("steamdb-minigame/"+e);return null!==n?n:t}}catch(a){return console.log(a),t}}function R(e,t){return"true"==D(e,t.toString())}function M(){for(var e=document.querySelector('a.link.element_upgrade_btn[data-type="3"]'),t=document.querySelector('a.link.element_upgrade_btn[data-type="4"]'),n=document.querySelector('a.link.element_upgrade_btn[data-type="5"]'),a=document.querySelector('a.link.element_upgrade_btn[data-type="6"]'),i=[e,t,n,a],r=0;r<i.length;r++)i[r].style.visibility="hidden"}function A(n,a,i,r){var o=new e.PIXI.Text(i,{font:"35px 'Press Start 2P'",fill:r,stroke:"#000",strokeThickness:2});o.x=n,o.y=a,t().m_containerUI.addChild(o),o.container=t().m_containerUI;var l=new e.CEasingSinOut(o.y,-200,1e3);l.parent=o,o.m_easeY=l,l=new e.CEasingSinOut(2,-2,1e3),l.parent=o,o.m_easeAlpha=l,t().m_rgClickNumbers.push(o)}function x(){var e=t().m_rgLaneData[0].players+t().m_rgLaneData[1].players+t().m_rgLaneData[2].players;document.getElementById("players_in_game").innerHTML=e+"/1500"}function P(){var e=0,n=t().GetEnemy(0,0).m_data;if("undefined"!=typeof n){var a=n.type;a==mt.BOSS&&(ce("In lane 0, there is a boss, avoiding",4),e=1)}t().m_nExpectedLane!=e&&(ce("Switching to raining lane"+e,3),t().TryChangeLane(e))}function N(){for(var e,n=.4,a=.1,i=!1,r=0,l=0,m=0,c=0,d=-1,s=-1,g=[mt.TREASURE,mt.BOSS,mt.MINIBOSS,mt.SPAWNER,mt.CREEP],u=!1,p=0,_=0,h=!1,y=!1,f=0;!i&&f<g.length;f++){h=g[f]==mt.TREASURE,y=g[f]==mt.BOSS;var E=[];for(e=0;3>e;e++)for(var v=0;4>v;v++){var C=t().GetEnemy(e,v);C&&C.m_data.type==g[f]&&(E[E.length]=C)}if(!h&&!y)for(var b=0,T=re(),S=0;S<T.length;S++)if(e=T[S],0!==t().m_rgGameData.lanes[e].dps){var L=0;void 0!=typeof t().m_rgLaneData[e].abilities[17]&&(L=t().m_rgLaneData[e].abilities[17],ce("stacks: "+L,3));for(var D=0;D<t().m_rgEnemies.length;D++){var R=t().m_rgEnemies[D].m_data.gold;L*R>b&&(b=L*R,s=t().m_rgEnemies[D].m_nID,d=e)}}var M=0;for(e=0;e<E.length;e++)if(E[e]&&!E[e].m_bIsDestroyed){if(1>r||E[e].m_flDisplayedHP<r){var A=t().m_rgGameData.lanes[E[e].m_nLane].element,x=t().CalculateDamage(t().m_rgPlayerTechTree.dps,A);if(!(x>=M))continue;M=x,i=!0,r=E[e].m_flDisplayedHP,l=E[e].m_nLane,m=E[e].m_nID}var P=E[e].m_flDisplayedHP/E[e].m_data.max_hp;(0===c||c>P)&&(c=P)}-1!=d&&-1!=s&&(l=d,m=s,ce("Switching to a lane with best raining gold benefit",2)),g[f]==mt.SPAWNER&&c>n&&-1==d&&(p=l,_=m,u=!0,i=!1),u&&g[f]==mt.CREEP&&c>a&&(l=p,m=_)}if(i){t().m_nExpectedLane!=l&&(ce("Switching to lane"+l,3),t().TryChangeLane(l)),t().m_nTarget!=m&&(ce("Switching targets",3),t().TryChangeTarget(m));var N=ve();h||y&&(N<Ve.speedThreshold||N%Ve.rainingRounds===0)?lt.forEach(q):lt.forEach(X),N<Ve.allowWormholeLevel&&!o()||X(rt.WORMHOLE)}}function I(){return le(rt.DECREASE_COOLDOWNS)>0?void q(rt.DECREASE_COOLDOWNS):(Y(rt.DECREASE_COOLDOWNS)||X(rt.DECREASE_COOLDOWNS),void V(rt.DECREASE_COOLDOWNS))}function O(e){return ae(rt.PUMPED_UP)?void ce("Pumped up is always good.",2):void(Ve.medicChance<Math.random()||(V(rt.MEDICS,!1,!0)&&ce("Medics is purchased, cooled down. Trigger it.",2),e>Ve.reflectDamageThreshold&&ae(rt.REFLECT_DAMAGE)?ce("We have reflect damage, cooled down. Trigger it.",2):e>Ve.stealHealthThreshold&&ae(rt.STEAL_HEALTH)?ce("We have steal health, cooled down. Trigger it.",2):ae(rt.GOD_MODE)&&ce("We have god mode, cooled down. Trigger it.",2)))}function G(){ae(rt.CRIT)&&ce("Crit chance is always good.",3),Ve.goodLuckChance<Math.random()||V(rt.GOOD_LUCK_CHARMS)&&ce("Good Luck Charms is purchased, cooled down, and needed. Trigger it.",2)}function k(){ce("Moral Booster is purchased, cooled down, and needed. Trigger it.",2),j(rt.MORALE_BOOSTER)}function w(){if(te(rt.CRIPPLE_SPAWNER)){for(var e=t().m_nExpectedLane,n=!1,a=0,i=0;4>i;i++){var r=t().GetEnemy(e,i);r&&0===r.m_data.type&&(n=!0,a=r.m_flDisplayedHP/r.m_data.max_hp)}n&&a>.95&&(ce("Cripple Spawner available, and needed. Cripple 'em.",2),ie(rt.CRIPPLE_SPAWNER))}}function B(){ie(rt.RAINING_GOLD)&&ce("Gold Rain is purchased and cooled down, triggering it.",2)}function U(){j(rt.METAL_DETECTOR)&&ce("Max Elemental Damage is purchased and cooled down, triggering it.",2)}function F(){ae(rt.MAX_ELEMENTAL_DAMAGE,!0)&&ce("Max Elemental Damage is purchased and cooled down, triggering it.",2)}function J(){var t=ve();(t%Ve.rainingRounds===0||Ue||Fe)&&(nt||(nt=e.setInterval(function(){e.g_Minigame.m_CurrentScene.m_rgAbilityQueue.push({ability:26}),e.g_Minigame.m_CurrentScene.m_nLastTick=0,e.g_Minigame.m_CurrentScene.Tick()},100)))}function $(){var t=ve();(t%Ve.rainingRounds===0||Ue||Fe)&&(at||(at=e.setInterval(function(){e.g_Minigame.m_CurrentScene.m_rgAbilityQueue.push({ability:27}),e.g_Minigame.m_CurrentScene.m_nLastTick=0,e.g_Minigame.m_CurrentScene.Tick()},500)))}function H(e){e%10===9&&ae(rt.RESURRECTION)&&ce("Triggered Resurrect.")}function W(){t().m_bIsDead&&t().m_rgPlayerData.time_died+5<t().m_nTime&&e.RespawnPlayer()}function q(e){K(e,!1)}function X(e){K(e,!0)}function K(t,n){n?(e.$J("#ability_"+t).show(),e.$J("#abilityitem_"+t).show()):(e.$J("#ability_"+t).hide(),e.$J("#abilityitem_"+t).hide())}function Y(e){return t().bIsAbilityActive(e)}function z(e){var t=document.getElementById("ability_"+e);return t&&t.childElements()&&t.childElements().length>=1?"hidden"!==t.childElements()[0].style.visibility:!1}function Q(e){return ee(e)&&!Z(e)&&z(e)}function V(e){return Q(e)?(j(e),!0):!1}function j(e){t().m_rgAbilityQueue.push({ability:e})}function Z(e){return t().GetCooldownForAbility(e)>0}function ee(e){return 1<<e&t().m_rgPlayerTechTree.unlocked_abilities_bitfield}function te(e){return ne(e)&&!Z(e)&&me(e)}function ne(e){for(var n=0;n<t().m_rgPlayerTechTree.ability_items.length;++n){var a=t().m_rgPlayerTechTree.ability_items[n];if(a.ability==e)return!0}return!1}function ae(e,t){return te(e)?t&&le(e)>0?!1:(ie(e),!0):!1}function ie(e){var n=document.getElementById("abilityitem_"+e);n&&n.childElements()&&n.childElements().length>=1&&t().TryAbility(document.getElementById("abilityitem_"+e).childElements()[0])}function re(){for(var e=[t().m_rgPlayerTechTree.damage_multiplier_fire,t().m_rgPlayerTechTree.damage_multiplier_water,t().m_rgPlayerTechTree.damage_multiplier_air,t().m_rgPlayerTechTree.damage_multiplier_earth],n=t().m_rgGameData.lanes,a=[],i=0;i<n.length;i++)a[i]=i;return a.sort(function(t,a){return e[n[a].element-1]-e[n[t].element-1]}),ce("Lane IDs : "+a[0]+" "+a[1]+" "+a[2],4),ce("Elements : "+n[a[0]].element+" "+n[a[1]].element+" "+n[a[2]].element,4),a}function oe(){return t().m_rgGameData.timestamp}function le(e){for(var n=oe(),a=t().m_rgGameData.lanes[t().m_rgPlayerData.current_lane].active_player_abilities,i=0,r=0;r<a.length;r++)a[r].ability!=e||a[r].timestamp_done<n||i++;return i}function me(e){var t=document.getElementById("abilityitem_"+e);return t&&t.childElements()&&t.childElements().length>=1?"hidden"!==t.childElements()[0].style.visibility:!1}function ce(e,t){Le>=t&&console.log(e)}function de(e){for(var t=0,n=0,a=0;24>a;a++)e>=3600&&(e-=3600,t+=1);for(var i=0;60>i;i++)e>=60&&(e-=60,n+=1);return{hours:t,minutes:n}}function se(n){var a=Math.floor(t().m_nTime)%86400;a-=57600,0>a&&(a+=86400);var i=86400-a,r=de(i);document.ExpectedLevel.textContent="Level: "+e.FormatNumberForDisplay(n,5)+", Expected Jump: "+e.FormatNumberForDisplay(Ce(),5),document.RemainingTime.textContent="Remaining Time: "+r.hours+" hours, "+r.minutes+" minutes."}function ge(){return 100*t().m_rgPlayerTechTree.crit_percentage}function ue(){return t().m_rgPlayerTechTree.damage_multiplier_crit}function pe(){return t().m_rgPlayerTechTree.dps}function _e(){return t().m_rgPlayerTechTree.damage_per_click}function he(){return t().m_rgPlayerTechTree.damage_per_click_multiplier}function ye(){return 100*t().m_rgPlayerTechTree.boss_loot_drop_percentage}function fe(){e.CSceneGame.prototype.ClearNewPlayer=function(){},t().m_spriteFinger||(e.WebStorage.SetLocal("mg_how2click",0),t().CheckNewPlayer(),e.WebStorage.SetLocal("mg_how2click",1)),document.getElementById("newplayer").style.display="none"}function Ee(){var t=e.fnTooltipUpgradeDesc;e.fnTooltipUpgradeDesc=function(n){var a=e.$J(n),i=a.data("desc"),r=i,o=parseFloat(a.data("multiplier"));switch(a.data("upgrade_type")){case 2:r=t(n);var l=_e()*ue(),m=e.g_Minigame.CurrentScene().m_rgTuningData.player.damage_per_click*(he()+o)*ue();r+="<br><br>Crit Click: "+e.FormatNumberForDisplay(l)+" => "+e.FormatNumberForDisplay(m);break;case 7:var c=ue(),d=c+o,s=pe(),g=_e();r+="<br><br>You can have multiple crits in a second. The server combines them into one.",r+="<br><br>Crit Percentage: "+ge().toFixed(1)+"%",r+="<br><br>Critical Damage Multiplier:",r+="<br>Current: "+c+"x",r+="<br>Next Level: "+d+"x",r+="<br><br>Damage with one crit:",r+="<br>DPS: "+e.FormatNumberForDisplay(c*s)+" => "+e.FormatNumberForDisplay(d*s),r+="<br>Click: "+e.FormatNumberForDisplay(c*g)+" => "+e.FormatNumberForDisplay(d*g),r+="<br><br>Base Increased By: "+o.toFixed(1)+"x";break;case 9:r+="<br><br>Boss Loot Drop Rate:",r+="<br>Current: "+ye().toFixed(0)+"%",r+="<br>Next Level: "+(ye()+100*o).toFixed(0)+"%",r+="<br><br>Base Increased By: "+e.FormatNumberForDisplay(100*o)+"%";break;default:return t(n)}return r}}function ve(){return t().m_rgGameData.level+1}function Ce(){for(var n=ve(),a=0,i=0;2>=i;i++)"undefined"!=typeof e.g_Minigame.m_CurrentScene.m_rgLaneData[i].abilities[26]&&(a+=e.g_Minigame.m_CurrentScene.m_rgLaneData[i].abilities[26]);return n%Ve.rainingRounds!=0?(Ze=0,et=0,tt=0,0):(tt!==a&&(Ze++,et+=a,tt=a),et/Ze*(t().m_rgGameData.timestamp-t().m_rgGameData.timestamp_level_start))}function be(){var t=20,n=setInterval(function(){var a=e.$J(".spend_badge_ponts_ctn"),i=!!(a&&a.length&&a.is(":visible"));i?(window.document.dispatchEvent(new Event("event:welcomePanelVisible")),clearInterval(n)):e.g_Minigame&&e.g_Minigame.CurrentScene()&&e.g_Minigame.CurrentScene().m_rgPlayerTechTree&&!e.g_Minigame.CurrentScene().m_rgPlayerTechTree.badge_points?clearInterval(n):--t<=0&&clearInterval(n)},500)}var Te="7.4.9",Se=20,Le=1,De=R("removeInterface",!0),Re=R("removeParticles",!0),Me=R("removeFlinching",!0),Ae=R("removeCritText",!1),xe=R("removeGoldText",!1),Pe=R("removeAllText",!1),Ne=R("enableAutoRefresh","undefined"!=typeof GM_info||!!e.usingMsgScript),Ie=R("enableFingering",!0),Oe=R("disableRenderer",!1),Ge=R("useTrollTracker",!1),ke=R("praiseGoldHelm",!0),we=15,Be=5,Ue=!1,Fe=!1,Je=!1,$e=null,He=Se,We=0,qe={"Original Gold Helm":"https://i.imgur.com/1zRXQgm.png","Moving Gold Helm":"http://i.imgur.com/XgT8Us8.gif","Golden Gaben":"http://i.imgur.com/ueDBBrA.png","Gaben + Snoop Dogg":"http://i.imgur.com/9R0436k.gif","Wormhole Gaben":"http://i.imgur.com/6BuBgxY.png",MSG2015:"http://i.imgur.com/zHI6C6X.png","Matrix Gaben":"http://i.imgur.com/titbsfQ.png","Praising Intensifies":"http://i.imgur.com/1ynXett.gif"},Xe=D("praiseGoldHelmImage",qe["Golden Gaben"]),Ke="http://i.imgur.com/ieDoLnx.png",Ye=function(){},ze=function(){},Qe=function(){},Ve={speedThreshold:2e3,rainingSafeRounds:25,rainingRounds:100,timePerUpdate:6e4,useSlowMode:!1,minsLeft:60,allowWormholeLevel:18e4,githubVersion:Te,useLikeNewMinChance:.02,useLikeNewMaxChance:1,useGoldThreshold:200,goodLuckChance:.02,medicChance:.02},je=!1,Ze=0,et=0,tt=0,nt=!1,at=!1,it=(R("showedUpdateInfo",!1),{}),rt={FIRE_WEAPON:1,CHANGE_LANE:2,RESPAWN:3,CHANGE_TARGET:4,MORALE_BOOSTER:5,GOOD_LUCK_CHARMS:6,MEDICS:7,METAL_DETECTOR:8,DECREASE_COOLDOWNS:9,TACTICAL_NUKE:10,CLUSTER_BOMB:11,NAPALM:12,RESURRECTION:13,CRIPPLE_SPAWNER:14,CRIPPLE_MONSTER:15,MAX_ELEMENTAL_DAMAGE:16,RAINING_GOLD:17,CRIT:18,PUMPED_UP:19,THROW_MONEY_AT_SCREEN:20,GOD_MODE:21,TREASURE:22,STEAL_HEALTH:23,REFLECT_DAMAGE:24,FEELING_LUCKY:25,WORMHOLE:26,LIKE_NEW:27},ot=[rt.TACTICAL_NUKE,rt.CLUSTER_BOMB,rt.NAPALM,rt.CRIPPLE_MONSTER,rt.MAX_ELEMENTAL_DAMAGE,rt.THROW_MONEY_AT_SCREEN,rt.TREASURE,rt.STEAL_HEALTH,rt.REFLECT_DAMAGE,rt.FEELING_LUCKY],lt=[rt.MORALE_BOOSTER,rt.GOOD_LUCK_CHARMS,rt.TACTICAL_NUKE,rt.CLUSTER_BOMB,rt.NAPALM,rt.CRIT,rt.CRIPPLE_SPAWNER,rt.CRIPPLE_MONSTER,rt.MAX_ELEMENTAL_DAMAGE,rt.REFLECT_DAMAGE,rt.THROW_MONEY_AT_SCREEN],mt={SPAWNER:0,CREEP:1,BOSS:2,MINIBOSS:3,TREASURE:4};r(),e.SteamDB_Minigame_Timer&&e.clearInterval(e.SteamDB_Minigame_Timer),e.SteamDB_Minigame_Timer=e.setInterval(function(){e.g_Minigame&&t().m_bRunning&&t().m_rgPlayerTechTree&&t().m_rgGameData&&(e.clearInterval(e.SteamDB_Minigame_Timer),n(),e.SteamDB_Minigame_Timer=e.setInterval(l,1e3))},1e3);var ct=document.querySelector(".breadcrumbs");if(ct){var dt=document.createElement("span");dt.textContent=" > ",ct.appendChild(dt),dt=document.createElement("span"),dt.style.color="#D4E157",dt.style.textShadow="1px 1px 0px rgba( 0, 0, 0, 0.3 )",dt.textContent="Room "+e.g_GameID,ct.appendChild(dt),dt=document.createElement("span"),dt.textContent=" > ",ct.appendChild(dt),dt=document.createElement("span"),dt.style.color="#FFA07A",dt.style.textShadow="1px 1px 0px rgba( 0, 0, 0, 0.3 )",dt.textContent="Level: 0, Expected Level: 0, Likely Level: 0",ct.appendChild(dt),document.ExpectedLevel=dt,dt=document.createElement("span"),dt.textContent=" > ",ct.appendChild(dt),dt=document.createElement("span"),dt.style.color="#9AC0FF",dt.style.textShadow="1px 1px 0px rgba( 0, 0, 0, 0.3 )",dt.textContent="Remaining Time: 0 hours, 0 minutes.",ct.appendChild(dt),document.RemainingTime=dt}}(window);