Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add critical tv smacking feature back in #56

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 49 additions & 3 deletions autoplay.noUpdate.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// @name Ye Olde Megajump
// @namespace https://github.com/YeOldeWH/MonsterMinigameWormholeWarp
// @description A script that runs the Steam Monster Minigame for you. Now with megajump. Brought to you by the Ye Olde Wormhole Schemers and DannyDaemonic
// @version 7.0.2
// @version 7.1.2
// @match *://steamcommunity.com/minigame/towerattack*
// @match *://steamcommunity.com//minigame/towerattack*
// @grant none
Expand Down Expand Up @@ -291,6 +291,7 @@ function firstRun() {
// Always show ability count
".abilitytemplate > a > .abilityitemquantity {visibility: visible; pointer-events: none;}",
".tv_ui {background-image: url(http://i.imgur.com/vM1gTFY.gif);}",
"#Chen {position: absolute; bottom: 0px; left: 770px; width: 286px; height: 250px; background-image: url(//i.imgur.com/xMbQChA.png); }",
""
];
styleNode.textContent = styleText.join("");
Expand All @@ -316,6 +317,7 @@ function firstRun() {

// Set to match preferences
toggleTrackTroll();
toggleChen();

// Add cool background
$J('body.flat_page.game').css('background-image', 'url(http://i.imgur.com/P8TB236.jpg)');
Expand Down Expand Up @@ -369,6 +371,9 @@ function firstRun() {
var lock_elements_checkbox = makeCheckBox("enableElementLock", "Lock element upgrades for more team dps", enableElementLock, toggleElementLock, false);
lock_elements_box.appendChild(lock_elements_checkbox);
ab_box.appendChild(lock_elements_box);

//Smack the TV Easter Egg
$J('<div style="cursor: pointer; transition: linear 100ms; opacity: 0.1; height: 52px; position: absolute; bottom: 85px; left: 828px; z-index: 12;" onmouseenter="this.style.opacity = 1" onmouseleave="this.style.opacity = 0.1" onclick="SmackTV();"><br><br><span style="font-size:10px; padding: 12px; color: gold;">Smack TV</span></div>').insertBefore('#row_bottom');

enhanceTooltips();

Expand Down Expand Up @@ -551,8 +556,12 @@ function MainLoop() {
}

updateSkips = true;

// GoGo Chen
honkingIntenstifys(true);
} else {
goToLaneWithBestTarget(level);
honkingIntenstifys(false);
}

attemptRespawn();
Expand Down Expand Up @@ -1236,16 +1245,53 @@ function toggleRenderer(event) {

var oldTvBg = "";
function toggleChen(event) {
enableChen = !enableChen;
var value = enableChen;

if(event !== undefined) {
value = handleCheckBox(event);
}
enableChen = value;

if (enableChen) {
addChen();
honkingIntenstifys(isBossLevel(getGameLevel()));

oldTvBg = w.$J('.tv_ui').css('background-image');
w.$J('.tv_ui').css('background-image', 'url(//i.imgur.com/QNSzdlS.png)');
w.$J('.tv_ui').css('background-image', 'url(//i.imgur.com/9wmTsxr.png)');
} else {
w.$J('.tv_ui').css('background-image', oldTvBg);

honkingIntenstifys(false);
}

}

function addChen() {
var chenDiv = document.querySelector("#Chen");

if (!chenDiv) { // We can only handle one Chen D:
var chenHTML = document.createElement('div');
chenHTML.id = "Chen";
document.querySelector("#uicontainer > div.tv_ui").appendChild(chenHTML);
}
}

function honkingIntenstifys(isBoss, hide) {
var chenDiv = document.querySelector("#Chen");

if (chenDiv && enableChen && isBoss) {
chenDiv.style.backgroundImage = "url(//i.imgur.com/eGnE1cD.gif)";
} else if (chenDiv && enableChen) {
chenDiv.style.backgroundImage = "url(//i.imgur.com/xMbQChA.png)";
}

if (chenDiv && !enableChen) {
chenDiv.style.visibility = "hidden";
} else if (chenDiv) {
chenDiv.style.visibility = "visible";
}
}

function autoRefreshPage(autoRefreshMinutes){
var timerValue = (autoRefreshMinutes + autoRefreshMinutesRandomDelay * Math.random()) * 60 * 1000;
refreshTimer = setTimeout(function() {
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"_comment" : "This file is used for automatic updates. Please update with update_version.sh.",
"Version" : "7.0.2"
"Version" : "7.1.2"
}