Can anyone tell me the part of the code where Protect's chance of being successful is reduced?
"protect": {
num: 182,
accuracy: true,
basePower: 0,
category: "Status",
desc: "The user is protected from most attacks made by other Pokemon during this turn. This move has a 1/X chance of being successful, where X starts at 1 and triples each time this move is successfully used. X resets to 1 if this move fails or if the user's last move used is not Detect, Endure, King's Shield, Protect, Quick Guard, Spiky Shield, or Wide Guard. Fails if the user moves last this turn.",
shortDesc: "Prevents moves from affecting the user this turn.",
id: "protect",
isViable: true,
name: "Protect",
pp: 10,
priority: 4,
flags: {},
stallingMove: true,
volatileStatus: 'protect',
onPrepareHit: function (pokemon) {
return !!this.willAct() && this.runEvent('StallMove', pokemon);
},
onHit: function (pokemon) {
pokemon.addVolatile('stall');
},
effect: {
duration: 1,
onStart: function (target) {
this.add('-singleturn', target, 'Protect');
},
onTryHitPriority: 3,
onTryHit: function (target, source, move) {
if (!move.flags['protect']) return;
this.add('-activate', target, 'move: Protect');
let lockedmove = source.getVolatile('lockedmove');
if (lockedmove) {
// Outrage counter is reset
if (source.volatiles['lockedmove'].duration === 2) {
delete source.volatiles['lockedmove'];
}
}
return null;
},
},
secondary: false,
target: "self",
type: "Normal",
contestType: "Cute"