{ "version": 3, "sources": ["../../../../../data/mods/gen5/conditions.ts"], "sourcesContent": ["export const Conditions: {[k: string]: ModdedConditionData} = {\r\n\tslp: {\r\n\t\tinherit: true,\r\n\t\tonSwitchIn(target) {\r\n\t\t\tthis.effectState.time = this.effectState.startTime;\r\n\t\t},\r\n\t},\r\n\tpartiallytrapped: {\r\n\t\tinherit: true,\r\n\t\tonStart(pokemon, source) {\r\n\t\t\tthis.add('-activate', pokemon, 'move: ' + this.effectState.sourceEffect, '[of] ' + source);\r\n\t\t\tthis.effectState.boundDivisor = source.hasItem('bindingband') ? 8 : 16;\r\n\t\t},\r\n\t\tonResidual(pokemon) {\r\n\t\t\tconst trapper = this.effectState.source;\r\n\t\t\tif (trapper && (!trapper.isActive || trapper.hp <= 0 || !trapper.activeTurns)) {\r\n\t\t\t\tdelete pokemon.volatiles['partiallytrapped'];\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tthis.damage(pokemon.baseMaxhp / this.effectState.boundDivisor);\r\n\t\t},\r\n\t},\r\n\tstall: {\r\n\t\t// Protect, Detect, Endure counter\r\n\t\tduration: 2,\r\n\t\tcounterMax: 256,\r\n\t\tonStart() {\r\n\t\t\tthis.effectState.counter = 2;\r\n\t\t},\r\n\t\tonStallMove() {\r\n\t\t\t// this.effectState.counter should never be undefined here.\r\n\t\t\t// However, just in case, use 1 if it is undefined.\r\n\t\t\tconst counter = this.effectState.counter || 1;\r\n\t\t\tif (counter >= 256) {\r\n\t\t\t\t// 2^32 - special-cased because Battle.random(n) can't handle n > 2^16 - 1\r\n\t\t\t\treturn (this.random() * 4294967296 < 1);\r\n\t\t\t}\r\n\t\t\tthis.debug(\"Success chance: \" + Math.round(100 / counter) + \"%\");\r\n\t\t\treturn this.randomChance(1, counter);\r\n\t\t},\r\n\t\tonRestart() {\r\n\t\t\tif (this.effectState.counter < (this.effect as Condition).counterMax!) {\r\n\t\t\t\tthis.effectState.counter *= 2;\r\n\t\t\t}\r\n\t\t\tthis.effectState.duration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