Snowball Showdown
Act II
The Front Yard (Alabaster's Side)
Difficulty:
The Snowball Showdown game is located on the Alabster (West) side of The Front Yard. Dusty Giftwrap is all about the snowball fights.
In the game we must launch snowballs over any obstacles and hit Wombley to score points. The Wombley side does the same against Alabaster. If we have more points than the Wombley side at the end of the game, we win. Very simple.
When a player or npc gets hit with a snowball, they get frozen for a few seconds. Most of the terrain is destructible as well. To complete the silver trophy you can complete the game legit with a friend, or you can hack the game in your favor. The latter is the more fun approach to me.
If you are like me and prefer to play by yourself, you can enable single player mode by modifying the URL parameter of game.html from "singlePlayer=false" to "singlePlayer=true", then reloading the page. Now you can hack and test things without impacting another player. Other Holiday Hack games from previous years use a similar approach to multiplayer including 2023's Snowball Hero, and 2021's Holiday Hero.
For games that rely on client-side Javascript, a great way to manipulate the game values is "Local Overrides". This is where the browser is configured to use a local copy of a file instead of the server's. You can checkout how to set it up here. I am using Chrome to solve this challenge. Once its setup, in the network tab in your dev tools just right-click the file you want to override and click "Override Content". The file will open in the Sources panel and you can begin editing it.
The file I edited for the majority of this challenge is "phaser-snowball-game.js". This is the Javascript file that controls the logic of the game. From here the sky is pretty much the limit. Last year I gave myself a machine gun.
Some ideas to tip the scales in my favor:
- Increase the fire rate
- Continuous fire using mouse-down
- Increase the snowball/impact radius
- Enable "noclip" e.g. flying
I think increasing the fire-rate and making the mouse-down event continually fire is a good place to start. I found the function "setupPlayerBindings()"in the phaser-snowball-game.js file. This function sets up all the keybinds for the game including mouse events. In the Phaser.js framework these events are named "pointerup" and "pointerdown". I commented out the old pointerdown code and created my own.
/* original fire on mouse up
this.input.on('pointerup', (pointer) => {
if (pointer.button === 0 && !this.player1.isKo) {
this.calcSnowballTrajectory(pointer, this.player1);
}
}); */
var fireInterval;
this.input.on('pointerdown', (pointer) => {
console.log("Fire");
let self = this;
this.calcSnowballTrajectory(pointer, this.player1);
fireInterval = setInterval(function(){
// Reset Throw Time
self.lastThrowTime = 0;
self.calcSnowballTrajectory(pointer, self.player1);
}, 10);
}, this);
this.input.on('pointerup', (pointer) => {
if(fireInterval !== undefined){
console.log("Cease Fire");
clearInterval(fireInterval);
}
}, this);
This code creates an interval on mouse-down that calls the snowball throw function "calcSnowballTrajectory" every 10ms. This is pretty much as fast as you can throw. On mouse-up it clears the interval so the player stops throwing.
This takes care of "Increase the fire rate", and "Continuous fire using mouse-down". The only ones that are left are "Increase the impact radius" and "flying". Fortunately these are as simple as changing the value of a variable. Take a look at the lines of code at line 679.
// Original blast radius and movement values
//this.snowBallBlastRadius = 24;
//this.onlyMoveHorizontally = true;
//New Values - Huge blast radius and flying!
this.snowBallBlastRadius = 1024;
this.onlyMoveHorizontally = false;
With these values set, I played a game and was able to blast straight through the obstacles and hammer Wombley and his team with a relentless barrage of snow!
With these hacks, its only a matter of time before Wombley throws in the towel!
With this win, I was awarded the silver trophy for this challenge.
Dusty Giftwrap mentioned that there is a secret weapon that he misplaced. We can get the gold trophy if we can find and use this secret weapon. It's actually pretty easy to find. I was inspecting the source of all the files returned by the server when the game loads and there is a file "reconnecting-websocket-min.js" that contains some interesting code.
There is a function "window.bgDebug" that appears to summon a bomber! Before it can be called, notice that there is a parameter object "e" that needs to have a "type" value of "moasb_start". To call it, enter the below command into the Javascript console while your game is underway.
window.bgDebug({'type':'moasb_start'});
After the smoke cleared I had the gold trophy for this challenge!
|  Powershell | Where to next? | Microsoft KC7 |
Holiday Hack Challenge 2024 Report - Cody Travis <cody@chillaspect.com>