Skip to content

Commit

Permalink
Merge pull request #33 from Rezzo64/main
Browse files Browse the repository at this point in the history
January 12 2024: Merge with PS
  • Loading branch information
Rezzo64 authored Jan 12, 2024
2 parents 28679c2 + 4e3031c commit 3832575
Show file tree
Hide file tree
Showing 13 changed files with 341 additions and 48 deletions.
13 changes: 11 additions & 2 deletions build-tools/build-indexes
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ function buildTeambuilderTables() {
const tierTable = {};
const overrideTier = {};
const ubersUUBans = {};
const ndDoublesBans = {};
const monotypeBans = {};
const nonstandardMoves = [];
for (const id of pokemon) {
Expand Down Expand Up @@ -548,8 +549,14 @@ function buildTeambuilderTables() {
if (ubersUU.exists && Dex.formats.getRuleTable(ubersUU).isBannedSpecies(species)) {
ubersUUBans[species.id] = 1;
}
const ndDoubles = Dex.formats.get(gen + 'nationaldexdoubles');
if (ndDoubles.exists && Dex.formats.getRuleTable(ndDoubles).isBannedSpecies(species)) {
ndDoublesBans[species.id] = 1;
}
}
if (genNum >= 5) {
const mono = Dex.formats.get(gen + (isNatDex ? 'nationaldex' : '') + 'monotype');
if (Dex.formats.getRuleTable(mono).isBannedSpecies(species)) {
if (mono.exists && Dex.formats.getRuleTable(mono).isBannedSpecies(species)) {
monotypeBans[species.id] = 1;
}
}
Expand All @@ -570,6 +577,7 @@ function buildTeambuilderTables() {
BattleTeambuilderTable['gen' + genNum + 'natdex'].tiers = tiers;
BattleTeambuilderTable['gen' + genNum + 'natdex'].overrideTier = overrideTier;
BattleTeambuilderTable['gen' + genNum + 'natdex'].items = items;
BattleTeambuilderTable['gen' + genNum + 'natdex'].ndDoublesBans = ndDoublesBans;
BattleTeambuilderTable['gen' + genNum + 'natdex'].monotypeBans = monotypeBans;
BattleTeambuilderTable['gen' + genNum + 'natdex'].formatSlices = formatSlices;
} else if (isMetBattle) {
Expand Down Expand Up @@ -1016,7 +1024,7 @@ function buildTeambuilderTables() {
// Client relevant data that should be overriden by past gens and mods
const overrideSpeciesKeys = ['abilities', 'baseStats', 'cosmeticFormes', 'isNonstandard', 'requiredItems', 'types', 'unreleasedHidden'];
const overrideMoveKeys = ['accuracy', 'basePower', 'category', 'desc', 'flags', 'isNonstandard', 'noSketch', 'pp', 'priority', 'shortDesc', 'target', 'type', 'viable'];
const overrideAbilityKeys = ['desc', 'isNonstandard', 'rating', 'shortDesc'];
const overrideAbilityKeys = ['desc', 'flags', 'isNonstandard', 'rating', 'shortDesc'];
const overrideItemKeys = ['desc', 'isNonstandard', 'rating', 'shortDesc'];

//
Expand Down Expand Up @@ -1652,6 +1660,7 @@ function buildMoves() {
const move = Dex.moves.get(Moves[id].name);
if (move.desc) Moves[id].desc = move.desc;
if (move.shortDesc) Moves[id].shortDesc = move.shortDesc;
if (move.basePowerCallback) Moves[id].basePowerCallback = true;
}
const buf = 'exports.BattleMovedex = ' + es3stringify(Moves) + ';';
fs.writeFileSync('play.pokemonshowdown.com/data/moves.js', buf);
Expand Down
2 changes: 1 addition & 1 deletion play.pokemonshowdown.com/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RewriteRule ^adminrequests?\/?$ https://www.smogon.com/forums/threads/names-pass
RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC]
RewriteRule ^forgotpassword\/?$ https://www.smogon.com/forums/threads/names-passwords-rooms-and-servers-contacting-upper-staff.3538721/post-6227626/ [R=302,L]
RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC]
RewriteRule ^bugs?(reports?)?\/?$ https://www.smogon.com/forums/threads/3663703/ [R=302,L]
RewriteRule ^bugs?(reports?)?\/?$ https://www.smogon.com/forums/ps-bug-report-form/ [R=302,L]
RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC]
RewriteRule ^rules?\/?$ https://pokemonshowdown.com/rules [R=302,L]
RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC]
Expand Down
10 changes: 8 additions & 2 deletions play.pokemonshowdown.com/js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ function toId() {
var replayLink = 'https://' + Config.routes.replays + '/' + replayid;
$.ajax(replayLink + '.json', {dataType: 'json'}).done(function (replay) {
if (replay) {
var title = replay.p1 + ' vs. ' + replay.p2;
var title = replay.players[0] + ' vs. ' + replay.players[1];
app.receive('>battle-' + replayid + '\n|init|battle\n|title|' + title + '\n' + replay.log);
app.receive('>battle-' + replayid + '\n|expire|<a href=' + replayLink + ' target="_blank" class="no-panel-intercept">Open replay in new tab</a>');
} else {
Expand Down Expand Up @@ -1500,7 +1500,9 @@ function toId() {
if (roomEl && roomEl.id) {
var roomid = roomEl.id.slice(5);
window.app.renameRoom(roomid, target);
window.app.rooms[target].join();
if (window.app.rooms[target]) {
window.app.rooms[target].join();
}
e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
Expand Down Expand Up @@ -2555,6 +2557,10 @@ function toId() {
this.$el.html('<form><p style="white-space:pre-wrap;word-wrap:break-word">' + (data.htmlMessage || BattleLog.parseMessage(data.message)) + '</p><p class="buttonbar">' + (data.buttons || '<button type="button" name="close" class="button autofocus"><strong>OK</strong></button>') + '</p></form>').css('max-width', data.maxWidth || 480);
},

copyText: function (value, target) {
app.curRoom.copyText(value, target);
},

dispatchClickButton: function (e) {
var target = e.currentTarget;
if (target.name) {
Expand Down
5 changes: 4 additions & 1 deletion play.pokemonshowdown.com/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,10 @@
}
buf += '<span class="col statcol"><em>Spe</em><br />' + stats.spe + '</span> ';
var bst = 0;
for (i in stats) bst += stats[i];
for (i in stats) {
if (i === 'spd' && gen === 1) continue;
bst += stats[i];
}
buf += '<span class="col bstcol"><em>BST<br />' + bst + '</em></span> ';

buf += '</a></li>';
Expand Down
224 changes: 219 additions & 5 deletions play.pokemonshowdown.com/src/battle-animations-moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2622,6 +2622,9 @@ export const BattleMoveAnims: AnimTable = {
spikyshield: {
anim: BattleOtherAnims.selfstatus.anim,
},
burningbulwark: {
anim: BattleOtherAnims.selfstatus.anim,
},
banefulbunker: {
anim(scene, [attacker]) {
scene.backgroundEffect('linear-gradient(#440044 30%, #000000', 600, 0.2);
Expand Down Expand Up @@ -6951,7 +6954,7 @@ export const BattleMoveAnims: AnimTable = {
lick: {
anim: BattleOtherAnims.contactattack.anim,
},
vicegrip: {
visegrip: {
anim: BattleOtherAnims.contactattack.anim,
},
headbutt: {
Expand Down Expand Up @@ -22864,6 +22867,221 @@ export const BattleMoveAnims: AnimTable = {
},
prepareAnim: BattleOtherAnims.chargestatus.anim,
},
electroshot: {
anim(scene, [attacker, defender]) {
let xstep = (defender.x - attacker.x) / 5;
let ystep = (defender.x - 200 - attacker.x) / 5;
let zstep = (defender.z - attacker.z) / 5;

scene.backgroundEffect('#000000', 900, 0.5);

for (let i = 0; i < 5; i++) {
scene.showEffect('electroball', {
x: attacker.x + xstep * (i + 1),
y: (attacker.y + 200) + ystep * (i + 1),
z: attacker.z + zstep * (i + 1),
scale: 0.7,
opacity: 0.6,
time: 40 * i + 300,
}, {
opacity: 0,
time: 100 * i + 500,
}, 'linear', '', {filter: 'hue-rotate(120deg)'});
}

scene.showEffect('electroball', {
x: attacker.x,
y: attacker.y,
z: attacker.z,
scale: 0.75,
opacity: 0.6,
}, {
x: attacker.x,
y: attacker.y + 200,
z: attacker.z,
scale: 1.25,
opacity: 0,
time: 200,
}, 'decel', '', {filter: 'hue-rotate(120deg)'});
scene.showEffect('wisp', {
x: attacker.x,
y: attacker.y,
z: attacker.z,
scale: 1,
opacity: 0.6,
}, {
x: attacker.x,
y: attacker.y + 200,
z: attacker.z,
scale: 1.5,
opacity: 0,
time: 200,
}, 'decel');

scene.showEffect('electroball', {
x: attacker.x,
y: attacker.y + 200,
z: attacker.z,
scale: 0.4,
opacity: 0.6,
time: 300,
}, {
x: defender.x + 30,
y: defender.y + 30,
z: defender.z,
scale: 0.6,
opacity: 0.3,
time: 500,
}, 'linear', 'explode', {filter: 'hue-rotate(120deg)'});
scene.showEffect('electroball', {
x: attacker.x,
y: attacker.y + 200,
z: attacker.z,
scale: 0.4,
opacity: 0.6,
time: 375,
}, {
x: defender.x + 20,
y: defender.y - 30,
z: defender.z,
scale: 0.6,
opacity: 0.3,
time: 575,
}, 'linear', 'explode');
scene.showEffect('electroball', {
x: attacker.x,
y: attacker.y + 200,
z: attacker.z,
scale: 0.4,
opacity: 0.6,
time: 425,
}, {
x: defender.x - 10,
y: defender.y + 10,
z: defender.z,
scale: 0.6,
opacity: 0.3,
time: 625,
}, 'linear', 'explode');
scene.showEffect('electroball', {
x: attacker.x,
y: attacker.y + 200,
z: attacker.z,
scale: 0.4,
opacity: 0.6,
time: 450,
}, {
x: defender.x - 30,
y: defender.y,
z: defender.z,
scale: 0.6,
opacity: 0.3,
time: 650,
}, 'linear', 'explode', {filter: 'hue-rotate(120deg)'});
scene.showEffect('electroball', {
x: attacker.x,
y: attacker.y + 200,
z: attacker.z,
scale: 0.4,
opacity: 0.6,
time: 500,
}, {
x: defender.x + 10,
y: defender.y - 10,
z: defender.z,
scale: 0.6,
opacity: 0.3,
time: 700,
}, 'linear', 'explode', {filter: 'hue-rotate(120deg)'});
scene.showEffect('electroball', {
x: attacker.x,
y: attacker.y + 200,
z: attacker.z,
scale: 0.4,
opacity: 0.6,
time: 575,
}, {
x: defender.x - 20,
y: defender.y,
z: defender.z,
scale: 0.6,
opacity: 0.3,
time: 775,
}, 'linear', 'explode');
},
prepareAnim(scene, [attacker]) {
scene.showEffect('electroball', {
x: attacker.x - 60,
y: attacker.y + 40,
z: attacker.z,
scale: 0.7,
opacity: 0.7,
time: 0,
}, {
x: attacker.x,
y: attacker.y,
scale: 0.2,
opacity: 0.2,
time: 300,
}, 'linear', 'fade', {filter: 'hue-rotate(120deg)'});
scene.showEffect('electroball', {
x: attacker.x + 60,
y: attacker.y - 5,
z: attacker.z,
scale: 0.7,
opacity: 0.7,
time: 100,
}, {
x: attacker.x,
y: attacker.y,
scale: 0.2,
opacity: 0.2,
time: 300,
}, 'linear', 'fade', {filter: 'hue-rotate(120deg)'});
scene.showEffect('electroball', {
x: attacker.x - 30,
y: attacker.y + 60,
z: attacker.z,
scale: 0.7,
opacity: 0.7,
time: 100,
}, {
x: attacker.x,
y: attacker.y,
scale: 0.2,
opacity: 0.2,
time: 400,
}, 'linear', 'fade', {filter: 'hue-rotate(120deg)'});
scene.showEffect('electroball', {
x: attacker.x + 20,
y: attacker.y - 50,
z: attacker.z,
scale: 0.7,
opacity: 0.7,
time: 100,
}, {
x: attacker.x,
y: attacker.y,
scale: 0.2,
opacity: 0.2,
time: 400,
}, 'linear', 'fade', {filter: 'hue-rotate(120deg)'});
scene.showEffect('electroball', {
x: attacker.x - 70,
y: attacker.y - 50,
z: attacker.z,
scale: 0.7,
opacity: 0.7,
time: 200,
}, {
x: attacker.x,
y: attacker.y,
scale: 0.2,
opacity: 0.2,
time: 500,
}, 'linear', 'fade', {filter: 'hue-rotate(120deg)'});
},
},
solarblade: {
anim(scene, [attacker, defender]) {
let xstep = 0;
Expand Down Expand Up @@ -35893,7 +36111,3 @@ BattleMoveAnims['trailblaze'] = {anim: BattleMoveAnims['powerwhip'].anim};
BattleMoveAnims['tripledive'] = {anim: BattleMoveAnims['dive'].anim};
BattleMoveAnims['hydrosteam'] = {anim: BattleMoveAnims['steameruption'].anim};
BattleMoveAnims['psyblade'] = {anim: BattleMoveAnims['psychocut'].anim};
BattleMoveAnims['electroshot'] = {
anim: BattleMoveAnims['zapcannon'].anim,
prepareAnim: BattleOtherAnims.lightstatus.anim,
};
Loading

0 comments on commit 3832575

Please sign in to comment.