#230
Black Sludge (06xxozfi)
0 ratingsAn item to be held by a Pokémon. It gradually restores HP to Poison-type Pokémon. It damages any other type.
Needs reworking, old code caused desync and activated weirdly
old code:
onTurnEnd: (game, mon) => {
if (mon.hp > 0) {
if (mon.battle.types[0] === "4" || mon.battle.types[1] === "4") {
game.updateHP(mon, Math.min(mon.hpTotal(), mon.hp + mon.hpTotal() / 16 | 0));
game.monEffect(mon, { absorb: true });
} else {
game.updateHP(mon, Math.max(0, mon.hp - (mon.hpTotal() / 8) | 0));
game.monEffect(mon, {flash: [160, 60, 180]});
}
}
}