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.2 KB
/
autoPlay.user.min.js
1
!function(e){"use strict";function t(){return e.g_Minigame.m_CurrentScene}function n(){se("Starting /u/wchill's script (version "+Le+")",1),Ve=t().DoCritEffect,je=t().m_rgClickNumbers.push,Ze=e.g_Minigame.Render,A(),Ae&&r(),Pe&&e.CEnemy&&(e.CEnemy.prototype.TakeDamage=function(){},e.CEnemySpawner.prototype.TakeDamage=function(){},e.CEnemyBoss.prototype.TakeDamage=function(){}),xe&&b(),Ie&&T();var n=document.getElementById("abilities");n&&(n.style.textAlign="left"),Me&&(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"),Oe&&p(Ue),Ge&&ve(),ke&&C(),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 c=document.createElement("div");document.getElementsByClassName("pagecontent")[0].insertBefore(c,document.getElementsByClassName("footer_spacer")[0]),c.className="options_box";var _=document.querySelector(".options_box");_||(_=document.querySelector(".options_box")),_.innerHTML="<b>OPTIONS</b> (v"+Le+')<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),y=document.createElement("div");y.style["-moz-column-count"]=3,y.style["-webkit-column-count"]=3,y.style["column-count"]=3,y.style.width="100%",y.appendChild(g("removeInterface","Remove interface",Me,u,!0)),y.appendChild(g("removeParticles","Remove particle effects",Ae,u,!0)),y.appendChild(g("removeFlinching","Remove flinching effects",Pe,u,!0)),y.appendChild(g("removeCritText","Remove crit text",xe,b,!1)),y.appendChild(g("removeGoldText","Remove gold text",Ne,u,!1)),y.appendChild(g("removeAllText","Remove all text",Ie,T,!1)),y.appendChild(g("disableRenderer","Throttle game renderer",ke,C,!0)),("undefined"!=typeof GM_info||e.usingMsgScript)&&y.appendChild(g("enableAutoRefresh","Enable auto-refresh",Oe,v,!1)),y.appendChild(g("enableFingering","Enable targeting pointer",Ge,u,!0)),y.appendChild(g("useTrollTracker","Track improper ability use",we,u,!0)),y.appendChild(g("praiseGoldHelm","Praise Gold Helm!",Be,f,!1)),y.appendChild(d("praiseGoldHelmImage","",ze,Ye,E)),y.appendChild(s("setLogLevel","Change the log level","25px",Re,0,5,L)),_.appendChild(y),h.innerHTML="<b>GAME INFO</b><br/>",h.className="info_box",h.style.right="0px",lt=document.createElement("div"),lt.style["-moz-column-count"]=3,lt.style["-webkit-column-count"]=3,lt.style["column-count"]=3,lt.appendChild(document.createElement("div")),lt.appendChild(document.createElement("div")),lt.appendChild(document.createElement("div")),h.appendChild(lt),_.parentElement.appendChild(h);var S=document.querySelector(".leave_game_helper");S.parentElement.removeChild(S),Ce(),Se();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 M=Math.floor(D/200);e.g_Minigame.CurrentScene().TrySpendBadgePoints(e.$J("<a data-type='26' data-cost='100'></a>"),M),e.g_Minigame.CurrentScene().TrySpendBadgePoints(e.$J("<a data-type='27' data-cost='100'></a>"),M),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";lt.children[n].innerHTML=c}}function i(){Be?(e.$J(".tv_ui").css("background-image","url("+ze+")"),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("+Qe+")"),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(){},Ae&&(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<=et.minsLeft?!0:!1}function l(){var e=Math.floor(t().m_nTime)%86400;return e-=57600,0>e&&(e+=86400),86400-e}function m(){if(!We){We=!0;var n=be();if(10>n&&et.useSlowMode)return;ct.forEach(K),$e=3*l()<ie(mt.WORMHOLE)||3*l()<ie(mt.LIKE_NEW),He=n%et.rainingRounds>0&&n%et.rainingRounds<100-et.rainingSafeRounds||$e,a(),q(),rt&&(e.clearInterval(rt),rt=!1),ot&&(e.clearInterval(ot),ot=!1),n%et.rainingRounds>0&&n%et.rainingRounds<100-et.rainingSafeRounds&&!$e?(n%et.rainingRounds===0?N():I(),O(),k(),G(),w(),F(),B(),(n<et.speedThreshold||n%et.rainingRounds===0)&&n>et.useGoldThreshold&&U(),J()):(n%et.rainingRounds===0||$e?N():I(),O(),G(),w(),F(),J(),$(),H(),W(n)),x(),n!==Xe&&(Xe=n,c()),ue(n),Ke=S(),t().m_nClicks=Ke,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);se("Ticked. Current clicks per second: "+Ke+". Current damage per second: "+i*Ke,4),ke&&(t().Tick(),requestAnimationFrame(function(){e.g_Minigame.Renderer.render(t().m_Container)})),We=!1;var r=t().GetEnemy(t().m_rgPlayerData.current_lane,t().m_rgPlayerData.target);if(Ke>0&&r){if(P(r.m_Sprite.position.x-440*r.m_nLane,r.m_Sprite.position.y-52,"-"+e.FormatNumberForDisplay(i*Ke,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 m=t().m_rgGameData.lanes[t().m_rgPlayerData.current_lane].active_player_ability_gold_per_click;if(m>0&&r.m_data.hp>0){var d=r.m_data.gold*m*Ke;t().ClientOverride("player_data","gold",t().m_rgPlayerData.gold+d),t().ApplyClientOverrides("player_data",!0),se("Raining gold ability is active in current lane. Percentage per click: "+m+"%. Approximately gold per second: "+d,4),Ne||P(r.m_Sprite.position.x-440*r.m_nLane,r.m_Sprite.position.y-17,"+"+e.FormatNumberForDisplay(d,5),"#e1b21e")}}ct.forEach(K)}e.CUI&&!tt&&(tt=!0,se("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();we?be()%100===0&&[10,11,12,15,20].indexOf(i.ability)>-1?(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 "+be()),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),se(i.actor_name+" used "+this.m_Game.m_rgTuningData.abilities[i.ability].name+" on level "+be(),1),e.$J(".name",r).attr("style","color: red; font-weight: bold;")):be()%100!==0&&be()%10>3&&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 "+be()),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)):(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 "+be()),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 o=this.m_eleUpdateLogContainer[0];o.children.length>20;)o.children[o.children.length-1].remove()}},this.m_eleUpdateLogContainer&&(this.m_eleUpdateLogContainer[0].innerHTML=""))}function c(){se("Refreshing player data",2),K("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 d(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 s(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 g(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 u(e){h(e)}function p(e){var t=60*(e+Fe*Math.random())*1e3;qe=setTimeout(function(){_()},t)}function _(){var n=t().GetEnemy(t().m_rgPlayerData.current_lane,t().m_rgPlayerData.target).m_data;if("undefined"!=typeof n){var a=n.type;a!=st.BOSS?(se("Refreshing, not boss",5),e.location.reload(!0)):(se("Not refreshing, A boss!",5),setTimeout(_,3e3))}else setTimeout(_,1e3)}function h(t){var n=t.target;return D(n.name,n.checked),e[n.name]=n.checked,n.checked}function y(t){var n=t.target;return D(n.name,n.value),e[n.name]=n.value,n.value}function f(e){void 0!==e&&(Be=h(e)),i()}function E(e){void 0!==e&&(ze=y(e)),i()}function v(e){var t=Oe;void 0!==e&&(t=h(e)),t?p(Ue):clearTimeout(qe)}function C(t){var n=ke;void 0!==t&&(n=ke=h(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=Ze,e.g_Minigame.Render())}function b(e){var n=xe;void 0!==e&&(n=h(e)),n?t().DoCritEffect=function(e,t,n,a){}:t().DoCritEffect=Ve}function T(e){var n=Ie;void 0!==e&&(n=h(e)),n?t().m_rgClickNumbers.push=function(e){e.container.removeChild(e)}:t().m_rgClickNumbers.push=je}function S(){var e=be();return e%et.rainingRounds===0?0:De}function L(e){void 0!==e&&(Re=e.target.value)}function D(e,t){try{"undefined"!==localStorage&&localStorage.setItem("steamdb-minigame/"+e,t)}catch(n){console.log(n)}}function R(e,t){try{if("undefined"!==localStorage){var n=localStorage.getItem("steamdb-minigame/"+e);return null!==n?n:t}}catch(a){return console.log(a),t}}function M(e,t){return"true"==R(e,t.toString())}function A(){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 P(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 N(){var e=0,n=t().GetEnemy(0,0).m_data;if("undefined"!=typeof n){var a=n.type;a==st.BOSS&&(se("In lane 0, there is a boss, avoiding",4),e=1)}t().m_nExpectedLane!=e&&(se("Switching to raining lane"+e,3),t().TryChangeLane(e))}function I(){for(var e,n=.4,a=.1,i=!1,r=0,l=0,m=0,c=0,d=-1,s=-1,g=[st.TREASURE,st.BOSS,st.MINIBOSS,st.SPAWNER,st.CREEP],u=!1,p=0,_=0,h=!1,y=!1,f=0;!i&&f<g.length;f++){h=g[f]==st.TREASURE,y=g[f]==st.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=le(),S=0;S<T.length;S++)if(e=T[S],0!==t().m_rgGameData.lanes[e].dps){var L=0;"undefined"!=typeof t().m_rgLaneData[e].abilities[17]&&(L=t().m_rgLaneData[e].abilities[17],se("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,P=t().CalculateDamage(t().m_rgPlayerTechTree.dps,A);if(!(P>=M))continue;M=P,i=!0,r=E[e].m_flDisplayedHP,l=E[e].m_nLane,m=E[e].m_nID}var x=E[e].m_flDisplayedHP/E[e].m_data.max_hp;(0===c||c>x)&&(c=x)}-1!=d&&-1!=s&&(l=d,m=s,se("Switching to a lane with best raining gold benefit",2)),g[f]==st.SPAWNER&&c>n&&-1==d&&(p=l,_=m,u=!0,i=!1),u&&g[f]==st.CREEP&&c>a&&(l=p,m=_)}if(i){t().m_nExpectedLane!=l&&(se("Switching to lane"+l,3),t().TryChangeLane(l)),t().m_nTarget!=m&&(se("Switching targets",3),t().TryChangeTarget(m));var N=be();h||y&&(N<et.speedThreshold||N%et.rainingRounds===0)?dt.forEach(K):dt.forEach(X),N<et.allowWormholeLevel&&!o()||X(mt.WORMHOLE)}}function O(){return ce(mt.DECREASE_COOLDOWNS)>0?void K(mt.DECREASE_COOLDOWNS):(z(mt.DECREASE_COOLDOWNS)||X(mt.DECREASE_COOLDOWNS),void j(mt.DECREASE_COOLDOWNS))}function G(e){return re(mt.PUMPED_UP)?void se("Pumped up is always good.",2):(j(mt.MEDICS)&&se("Medics is purchased, cooled down. Trigger it.",2),void(e>et.reflectDamageThreshold&&re(mt.REFLECT_DAMAGE)?se("We have reflect damage, cooled down. Trigger it.",2):e>et.stealHealthThreshold&&re(mt.STEAL_HEALTH)?se("We have steal health, cooled down. Trigger it.",2):re(mt.GOD_MODE)&&se("We have god mode, cooled down. Trigger it.",2)))}function k(){re(mt.CRIT)&&se("Crit chance is always good.",3),j(mt.GOOD_LUCK_CHARMS)&&se("Good Luck Charms is purchased, cooled down, and needed. Trigger it.",2)}function w(){se("Moral Booster is purchased, cooled down, and needed. Trigger it.",2),Z(mt.MORALE_BOOSTER)}function B(){if(ne(mt.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&&(se("Cripple Spawner available, and needed. Cripple 'em.",2),oe(mt.CRIPPLE_SPAWNER))}}function U(){oe(mt.RAINING_GOLD)&&se("Gold Rain is purchased and cooled down, triggering it.",2)}function F(){Z(mt.METAL_DETECTOR)&&se("Max Elemental Damage is purchased and cooled down, triggering it.",2)}function J(){re(mt.MAX_ELEMENTAL_DAMAGE,!0)&&se("Max Elemental Damage is purchased and cooled down, triggering it.",2)}function H(){var t=be();(t%et.rainingRounds===0||He||$e)&&(rt||(rt=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=be();(t%et.rainingRounds===0||He||$e)&&(ot||(ot=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 W(e){e%10===9&&re(mt.RESURRECTION)&&se("Triggered Resurrect.")}function q(){t().m_bIsDead&&t().m_rgPlayerData.time_died+5<t().m_nTime&&e.RespawnPlayer()}function K(e){Y(e,!1)}function X(e){Y(e,!0)}function Y(t,n){n?(e.$J("#ability_"+t).show(),e.$J("#abilityitem_"+t).show()):(e.$J("#ability_"+t).hide(),e.$J("#abilityitem_"+t).hide())}function z(e){return t().bIsAbilityActive(e)}function Q(e){var t=document.getElementById("ability_"+e);return t&&t.childElements()&&t.childElements().length>=1?"hidden"!==t.childElements()[0].style.visibility:!1}function V(e){return te(e)&&!ee(e)&&Q(e)}function j(e){return V(e)?(Z(e),!0):!1}function Z(e){t().m_rgAbilityQueue.push({ability:e})}function ee(e){return t().GetCooldownForAbility(e)>0}function te(e){return 1<<e&t().m_rgPlayerTechTree.unlocked_abilities_bitfield}function ne(e){return ae(e)&&!ee(e)&&de(e)}function ae(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 ie(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 a.quantity}return 0}function re(e,t){return ne(e)?t&&ce(e)>0?!1:(oe(e),!0):!1}function oe(e){var n=document.getElementById("abilityitem_"+e);n&&n.childElements()&&n.childElements().length>=1&&t().TryAbility(document.getElementById("abilityitem_"+e).childElements()[0])}function le(){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]}),se("Lane IDs : "+a[0]+" "+a[1]+" "+a[2],4),se("Elements : "+n[a[0]].element+" "+n[a[1]].element+" "+n[a[2]].element,4),a}function me(){return t().m_rgGameData.timestamp}function ce(e){for(var n=me(),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 de(e){var t=document.getElementById("abilityitem_"+e);return t&&t.childElements()&&t.childElements().length>=1?"hidden"!==t.childElements()[0].style.visibility:!1}function se(e,t){Re>=t&&console.log(e)}function ge(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 ue(n){var a=Math.floor(t().m_nTime)%86400;a-=57600,0>a&&(a+=86400);var i=86400-a,r=ge(i);document.ExpectedLevel.textContent="Level: "+e.FormatNumberForDisplay(n,5)+", Expected Jump: "+e.FormatNumberForDisplay(Te(),5),document.RemainingTime.textContent="Remaining Time: "+r.hours+" hours, "+r.minutes+" minutes."}function pe(){return 100*t().m_rgPlayerTechTree.crit_percentage}function _e(){return t().m_rgPlayerTechTree.damage_multiplier_crit}function he(){return t().m_rgPlayerTechTree.dps}function ye(){return t().m_rgPlayerTechTree.damage_per_click}function fe(){return t().m_rgPlayerTechTree.damage_per_click_multiplier}function Ee(){return 100*t().m_rgPlayerTechTree.boss_loot_drop_percentage}function ve(){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 Ce(){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=ye()*_e(),m=e.g_Minigame.CurrentScene().m_rgTuningData.player.damage_per_click*(fe()+o)*_e();r+="<br><br>Crit Click: "+e.FormatNumberForDisplay(l)+" => "+e.FormatNumberForDisplay(m);break;case 7:var c=_e(),d=c+o,s=he(),g=ye();r+="<br><br>You can have multiple crits in a second. The server combines them into one.",r+="<br><br>Crit Percentage: "+pe().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: "+Ee().toFixed(0)+"%",r+="<br>Next Level: "+(Ee()+100*o).toFixed(0)+"%",r+="<br><br>Base Increased By: "+e.FormatNumberForDisplay(100*o)+"%";break;default:return t(n)}return r}}function be(){return t().m_rgGameData.level+1}function Te(){for(var n=be(),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%et.rainingRounds!=0?(nt=0,at=0,it=0,0):(it!==a&&(nt++,at+=a,it=a),at/nt*(t().m_rgGameData.timestamp-t().m_rgGameData.timestamp_level_start))}function Se(){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 Le="7.0.0",De=20,Re=1,Me=M("removeInterface",!0),Ae=M("removeParticles",!0),Pe=M("removeFlinching",!0),xe=M("removeCritText",!1),Ne=M("removeGoldText",!1),Ie=M("removeAllText",!1),Oe=M("enableAutoRefresh","undefined"!=typeof GM_info||e.usingMsgScript),Ge=M("enableFingering",!0),ke=M("disableRenderer",!1),we=M("useTrollTracker",!1),Be=M("praiseGoldHelm",!0),Ue=30,Fe=10,Je=30,He=!1,$e=!1,We=!1,qe=null,Ke=De,Xe=0,Ye={"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"},ze=R("praiseGoldHelmImage",Ye["Golden Gaben"]),Qe="http://i.imgur.com/ieDoLnx.png",Ve=function(){},je=function(){},Ze=function(){},et={speedThreshold:2e3,rainingSafeRounds:25,rainingRounds:100,timePerUpdate:6e4,useSlowMode:!1,minsLeft:60,allowWormholeLevel:18e4,githubVersion:Le,useLikeNewMinChance:.02,useLikeNewMaxChance:1,useGoldThreshold:200},tt=!1,nt=0,at=0,it=0,rt=!1,ot=!1,lt=(M("showedUpdateInfo",!1),{}),mt={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},ct=[mt.TACTICAL_NUKE,mt.CLUSTER_BOMB,mt.NAPALM,mt.CRIPPLE_MONSTER,mt.MAX_ELEMENTAL_DAMAGE,mt.THROW_MONEY_AT_SCREEN,mt.TREASURE,mt.STEAL_HEALTH,mt.REFLECT_DAMAGE,mt.FEELING_LUCKY],dt=[mt.MORALE_BOOSTER,mt.GOOD_LUCK_CHARMS,mt.TACTICAL_NUKE,mt.CLUSTER_BOMB,mt.NAPALM,mt.CRIT,mt.CRIPPLE_SPAWNER,mt.CRIPPLE_MONSTER,mt.MAX_ELEMENTAL_DAMAGE,mt.REFLECT_DAMAGE,mt.THROW_MONEY_AT_SCREEN],st={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(m,1e3))},1e3),e.setTimeout(function(){e.g_Minigame&&e.g_Minigame.m_CurrentScene&&e.g_Minigame.m_CurrentScene.m_rgGameData||e.location.reload(!0)},1e3*Je);var gt=document.querySelector(".breadcrumbs");if(gt){var ut=document.createElement("span");ut.textContent=" > ",gt.appendChild(ut),ut=document.createElement("span"),ut.style.color="#D4E157",ut.style.textShadow="1px 1px 0px rgba( 0, 0, 0, 0.3 )",ut.textContent="Room "+e.g_GameID,gt.appendChild(ut),ut=document.createElement("span"),ut.textContent=" > ",gt.appendChild(ut),ut=document.createElement("span"),ut.style.color="#FFA07A",ut.style.textShadow="1px 1px 0px rgba( 0, 0, 0, 0.3 )",ut.textContent="Level: 0, Expected Level: 0, Likely Level: 0",gt.appendChild(ut),document.ExpectedLevel=ut,ut=document.createElement("span"),ut.textContent=" > ",gt.appendChild(ut),ut=document.createElement("span"),ut.style.color="#9AC0FF",ut.style.textShadow="1px 1px 0px rgba( 0, 0, 0, 0.3 )",ut.textContent="Remaining Time: 0 hours, 0 minutes.",gt.appendChild(ut),document.RemainingTime=ut}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)}(window);