public int use(BattleMechanics mech, Pokemon user, Pokemon target) {
if (target.hasSubstitute()) {
user.getField().showMessage("But it failed!");
return 0;
}
target.addStatus(user, new StatusEffect() {
public boolean apply(Pokemon p) {
HoldItem item = p.getItem();
if ((item != null) && item.isActive()) {
item.unapply(p);
item.deactivate();