From 19d3e7aa2fe47e5d605bb3135e1d33cd89f7d7f8 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Sat, 2 Apr 2016 03:03:21 -0400 Subject: [PATCH] April Fool's 2016 --- js/battle.js | 25 ++++++++++++++----------- js/client-topbar.js | 6 ++++++ js/storage.js | 7 +++++++ 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/js/battle.js b/js/battle.js index c8e1e4f38..1a6358478 100644 --- a/js/battle.js +++ b/js/battle.js @@ -3178,17 +3178,20 @@ var Battle = (function () { } this.message(pokemon.getName() + ' used Fissure!'); this.message('Just kidding! It was Earthquake!'); - } else if (window.Config && Config.server && Config.server.afd && (move.id === 'metronome' || move.id === 'sleeptalk' || move.id === 'assist')) { - this.message(pokemon.getName() + ' used ' + move.name + '!'); - var buttons = ["A", "B", "START", "SELECT", "UP", "DOWN", "LEFT", "RIGHT", "DEMOCRACY", "ANARCHY"]; - var people = ["Zarel", "The Immortal", "Diatom", "Nani Man", "shaymin", "apt-get", "sirDonovan", "Arcticblast", "Trickster"]; - var button; - for (var i = 0; i < 10; i++) { - var name = people[Math.floor(Math.random() * people.length)]; - if (!button) button = buttons[Math.floor(Math.random() * buttons.length)]; - this.log('
' + Tools.escapeHTML(name) + ': ' + button + '
'); - button = (name === 'Diatom' ? "thanks diatom" : null); - } + } else if (window.Config && Config.server && Config.server.afd && move.id === 'stealthrock') { + var srNames = ['Sneaky Pebbles', 'Sly Rubble', 'Subtle Sediment', 'Buried Bedrock', 'Camouflaged Cinnabar', 'Clandestine Cobblestones', 'Cloaked Clay', 'Concealed Ore', 'Covert Crags', 'Crafty Coal', 'Discreet Bricks', 'Disguised Debris', 'Espionage Pebbles', 'Furtive Fortress', 'Hush-Hush Hardware', 'Incognito Boulders', 'Invisible Quartz', 'Masked Minerals', 'Mischievous Masonry', 'Obscure Ornaments', 'Private Paragon', 'Secret Solitaire', 'Sheltered Sand', 'Surreptitious Sapphire', 'Undercover Ultramarine']; + this.message(pokemon.getName() + ' used ' + srNames[Math.floor(Math.random() * srNames.length)] + '!'); + // } else if (window.Config && Config.server && Config.server.afd && (move.id === 'metronome' || move.id === 'sleeptalk' || move.id === 'assist')) { + // this.message(pokemon.getName() + ' used ' + move.name + '!'); + // var buttons = ["A", "B", "START", "SELECT", "UP", "DOWN", "LEFT", "RIGHT", "DEMOCRACY", "ANARCHY"]; + // var people = ["Zarel", "The Immortal", "Diatom", "Nani Man", "shaymin", "apt-get", "sirDonovan", "Arcticblast", "Trickster"]; + // var button; + // for (var i = 0; i < 10; i++) { + // var name = people[Math.floor(Math.random() * people.length)]; + // if (!button) button = buttons[Math.floor(Math.random() * buttons.length)]; + // this.log('
' + Tools.escapeHTML(name) + ': ' + button + '
'); + // button = (name === 'Diatom' ? "thanks diatom" : null); + // } } else { this.message(pokemon.getName() + ' used ' + move.name + '!'); } diff --git a/js/client-topbar.js b/js/client-topbar.js index 14743189f..246569da8 100644 --- a/js/client-topbar.js +++ b/js/client-topbar.js @@ -12,6 +12,8 @@ 'dragover .roomtab': 'dragEnterRoom' }, initialize: function () { + // April Fool's 2016 - Digimon Showdown + // this.$el.html('
'); this.$el.html('
'); this.$tabbar = this.$('.maintabbar .inner'); // this.$sidetabbar = this.$('.sidetabbar'); @@ -679,6 +681,10 @@ buf += '

'; buf += '

'; + + // April Fool's 2016 - background change disabling + // buf = '

Sorry, the background chooser is experiencing technical difficulties. Please try again tomorrow!

'; + this.$el.css('max-width', 448).html(buf); this.$el.html(buf); }, diff --git a/js/storage.js b/js/storage.js index 6cb5c6565..29e8bf6dc 100644 --- a/js/storage.js +++ b/js/storage.js @@ -68,6 +68,11 @@ Storage.bg = { } bgUrl = Tools.resourcePrefix + 'fx/client-bg-' + bgid + '.jpg'; } + + // April Fool's 2016 - Digimon theme + // bgid = 'digimon'; + // bgUrl = Tools.resourcePrefix + 'sprites/afd/digimonbg.jpg'; + var background; if (bgUrl.charAt(0) === '#') { background = bgUrl; @@ -98,6 +103,8 @@ Storage.bg = { case 'charizards': hues = ["37.159090909090914,74.57627118644066%", "10.874999999999998,70.79646017699115%", "179.51612903225808,52.10084033613446%", "20.833333333333336,36.73469387755102%", "192.3076923076923,80.41237113402063%", "210,29.629629629629633%"]; break; + case 'digimon': + hues = ["170.45454545454544,27.500000000000004%", "84.70588235294119,13.821138211382115%", "112.50000000000001,7.8431372549019605%", "217.82608695652175,54.761904761904766%", "0,1.6949152542372816%", ""]; } if (!hues && bgUrl.charAt(0) === '#') { var r = parseInt(bgUrl.slice(1, 3), 16) / 255;