Fix randbats allowing sets with no damaging moves

This commit is contained in:
TalkTakesTime 2014-01-31 22:36:36 +13:00
parent 5823ca0bd6
commit cc9d0b2711

View File

@ -1142,8 +1142,8 @@ exports.BattleScripts = {
if (j<moveKeys.length && moves.length === 4) {
// Move post-processing:
if (damagingMoves.length===0) {
// Have a 60% chance of rejecting one move at random:
if (Math.random()*1.66<1) moves.splice(Math.floor(Math.random()*moves.length),1);
// A set shouldn't have no attacking moves
moves.splice(Math.floor(Math.random()*moves.length),1);
} else if (damagingMoves.length===1) {
// Night Shade, Seismic Toss, etc. don't count:
if (!damagingMoves[0].damage) {