mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-06-02 22:09:20 -05:00
Make item boost calculation check for item too, simplifies callers
This commit is contained in:
parent
0b22081e7b
commit
99d20f70ed
|
|
@ -2,7 +2,7 @@ var BattleTooltips = (function () {
|
|||
function BattleTooltips() {}
|
||||
BattleTooltips.prototype.boostBasePower = function (BattleRoom, move, pokemon, basePower, basePowerComment) {
|
||||
var myPokemon = BattleRoom.myPokemon[pokemon.slot];
|
||||
if (!BattleRoom.battle.hasPseudoWeather('Magic Room') && (!pokemon.volatiles || !pokemon.volatiles['embargo'])) {
|
||||
if (myPokemon.item && !BattleRoom.battle.hasPseudoWeather('Magic Room') && (!pokemon.volatiles || !pokemon.volatiles['embargo'])) {
|
||||
var item = Tools.getItem(myPokemon.item);
|
||||
var moveType = BattleRoom.getMoveType(move, pokemon);
|
||||
var splitItemName = item.name.split(' ');
|
||||
|
|
@ -41,7 +41,7 @@ var BattleTooltips = (function () {
|
|||
if (max <= 60) max *= 1.5;
|
||||
}
|
||||
var itemCheck = false;
|
||||
if (!BattleRoom.battle.hasPseudoWeather('Magic Room') && (!pokemon.volatiles || !pokemon.volatiles['embargo'])) {
|
||||
if (myPokemon.item && !BattleRoom.battle.hasPseudoWeather('Magic Room') && (!pokemon.volatiles || !pokemon.volatiles['embargo'])) {
|
||||
var item = Tools.getItem(myPokemon.item);
|
||||
var moveType = BattleRoom.getMoveType(move, pokemon);
|
||||
var splitItemName = item.name.split(' ');
|
||||
|
|
|
|||
|
|
@ -1429,19 +1429,8 @@
|
|||
else if (maxRatio >= 2) max = 80;
|
||||
else if (maxRatio >= 1) max = 60;
|
||||
else max = 40;
|
||||
// Special case due to being a range. Other moves are checked by technician below.
|
||||
basePower = 0;
|
||||
if (!myPokemon.item) {
|
||||
if (ability === 'Technician') {
|
||||
if (min <= 60) min *= 1.5;
|
||||
if (max <= 60) max *= 1.5;
|
||||
basePowerComment = '' + ((min === max) ? max : min + ' to ' + max) + ' (Technician boosted)';
|
||||
} else {
|
||||
basePowerComment = (min === max) ? max : min + ' to ' + max;
|
||||
}
|
||||
} else {
|
||||
return Tooltips.boostBasePower_Ball(this, move, pokemon, min, max);
|
||||
}
|
||||
// Special case due to being a range.
|
||||
return Tooltips.boostBasePower_Ball(this, move, pokemon, min, max);
|
||||
}
|
||||
if (move.id === 'gyroball') {
|
||||
var template = target;
|
||||
|
|
@ -1451,18 +1440,7 @@
|
|||
if (min > 150) min = 150;
|
||||
if (max > 150) max = 150;
|
||||
// Special case due to range as well.
|
||||
basePower = 0;
|
||||
if (!myPokemon.item) {
|
||||
if (ability === 'Technician') {
|
||||
if (min <= 60) min *= 1.5;
|
||||
if (max <= 60) max *= 1.5;
|
||||
basePowerComment = '' + ((min === max) ? max : min + ' to ' + max) + ' (Technician boosted)';
|
||||
} else {
|
||||
basePowerComment = (min === max) ? max : min + ' to ' + max;
|
||||
}
|
||||
} else {
|
||||
return Tooltips.boostBasePower_Ball(this, move, pokemon, min, max);
|
||||
}
|
||||
return Tooltips.boostBasePower_Ball(this, move, pokemon, min, max);
|
||||
}
|
||||
// Movements which have base power changed due to items.
|
||||
if (myPokemon.item && !this.battle.hasPseudoWeather('Magic Room') && (!pokemon.volatiles || !pokemon.volatiles['embargo'])) {
|
||||
|
|
@ -1513,11 +1491,7 @@
|
|||
basePowerComment = ' (' + ability + ' boosted)';
|
||||
}
|
||||
}
|
||||
if (myPokemon.item) {
|
||||
return Tooltips.boostBasePower(this, move, pokemon, basePower, basePowerComment);
|
||||
} else {
|
||||
return basePower == 0 ? basePowerComment : basePower + basePowerComment;
|
||||
}
|
||||
return Tooltips.boostBasePower(this, move, pokemon, basePower, basePowerComment);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user