diff --git a/js/battle.js b/js/battle.js index 8ecd5f56f..710c010ea 100644 --- a/js/battle.js +++ b/js/battle.js @@ -5674,7 +5674,9 @@ var Battle = (function () { } if (teamText) teamText += ' / '; teamText += pokemon.species; - text += ''; + var url = spriteData.url; + // if (this.paused) url.replace('/xyani', '/xy').replace('.gif', '.png'); + text += ''; } this.sides[k].totalPokemon = i; this.sides[k].updateSidebar(); @@ -6018,6 +6020,13 @@ var Battle = (function () { } if (this.errorCallback) this.errorCallback(this); } + + if (this.fastForward > 0 && this.fastForward < 1) { + if (nextLine.substr(0, 6) === '|start') { + this.fastForwardOff(); + if (this.endCallback) this.endCallback(this); + } + } } }; Battle.prototype.endPrevAction = function () { @@ -6102,7 +6111,11 @@ var Battle = (function () { Battle.prototype.fastForwardTo = function (time) { this.playbackState = 5; if (this.fastForward) return; - time = parseInt(time, 10); + if (time === 0 || time === '0') { + time = 0.5; + } else { + time = Math.floor(Number(time)); + } if (isNaN(time)) return; if (this.activityStep >= this.activityQueue.length - 1 && time >= this.turn + 1 && !this.activityQueueActive) return; if (this.ended && time >= this.turn + 1) return; diff --git a/js/replay-embed.js b/js/replay-embed.js index bca5b001b..2ceca2085 100644 --- a/js/replay-embed.js +++ b/js/replay-embed.js @@ -1,16 +1,16 @@ document.write(''); -document.write(''); -document.write(''); +document.write(''); +document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); -document.write(''); -document.write(''); -document.write(''); -document.write(''); -document.write(''); -document.write(''); +document.write(''); +document.write(''); +document.write(''); +document.write(''); +document.write(''); +document.write(''); var Replays = { init: function (log) { @@ -31,7 +31,9 @@ var Replays = { this.battle.resumeButton = this.resume.bind(this); this.battle.setQueue(log.split('\n')); - this.$('.battle').html('


'); + this.battle.reset(); + this.battle.fastForwardTo(0); + this.$('.battle').append('


'); this.$('.replay-controls-2').html('
Speed:
Color scheme:
'); @@ -128,7 +130,8 @@ var Replays = { }, reset: function () { this.battle.reset(); - this.$('.battle').html('


'); + this.battle.fastForwardTo(0); + this.$('.battle').append('


'); // this.$('.battle-log').html(''); this.$('.replay-controls').html(''); },