Jofthomas's picture
Jofthomas HF staff
Upload 4781 files
5c2ed06 verified
{
"version": 3,
"sources": ["../../../../data/mods/passiveaggressive/conditions.ts"],
"sourcesContent": ["export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDataTable = {\n\ttox: {\n\t\tinherit: true,\n\t\tonResidual(pokemon) {\n\t\t\tif (this.effectState.stage < 15) {\n\t\t\t\tthis.effectState.stage++;\n\t\t\t}\n\t\t\tconst calc = calculate(this, this.effectState.source, pokemon);\n\t\t\tthis.damage(calc * this.clampIntRange(pokemon.baseMaxhp / 16, 1) * this.effectState.stage);\n\t\t},\n\t},\n\tbrn: {\n\t\tinherit: true,\n\t\tonResidual(pokemon) {\n\t\t\tconst calc = calculate(this, this.effectState.source, pokemon);\n\t\t\tthis.damage(calc * pokemon.baseMaxhp / 16);\n\t\t},\n\t},\n\tpsn: {\n\t\tinherit: true,\n\t\tonResidual(pokemon) {\n\t\t\tconst calc = calculate(this, this.effectState.source, pokemon);\n\t\t\tthis.damage(calc * pokemon.baseMaxhp / 8);\n\t\t},\n\t},\n\tpartiallytrapped: {\n\t\tinherit: true,\n\t\tonResidual(pokemon) {\n\t\t\tconst source = this.effectState.source;\n\t\t\t// G-Max Centiferno and G-Max Sandblast continue even after the user leaves the field\n\t\t\tconst gmaxEffect = ['gmaxcentiferno', 'gmaxsandblast'].includes(this.effectState.sourceEffect.id);\n\t\t\tif (source && (!source.isActive || source.hp <= 0 || !source.activeTurns) && !gmaxEffect) {\n\t\t\t\tdelete pokemon.volatiles['partiallytrapped'];\n\t\t\t\tthis.add('-end', pokemon, this.effectState.sourceEffect, '[partiallytrapped]', '[silent]');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst calc = calculate(this, source, pokemon);\n\t\t\tthis.damage(calc * pokemon.baseMaxhp / this.effectState.boundDivisor);\n\t\t},\n\t},\n\tsandstorm: {\n\t\tinherit: true,\n\t\tonWeather(target) {\n\t\t\tconst calc = calculate(this, this.effectState.source, target);\n\t\t\tthis.damage(calc * target.baseMaxhp / 16);\n\t\t},\n\t},\n};\n\nfunction calculate(battle: Battle, source: Pokemon, pokemon: Pokemon) {\n\tconst move = battle.dex.getActiveMove('tackle');\n\tmove.type = source.getTypes()[0];\n\tconst typeMod = 2 ** battle.clampIntRange(pokemon.runEffectiveness(move), -6, 6);\n\tif (!pokemon.runImmunity(move.type)) return 0;\n\treturn typeMod;\n}\n"],
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,aAA6E;AAAA,EACzF,KAAK;AAAA,IACJ,SAAS;AAAA,IACT,WAAW,SAAS;AACnB,UAAI,KAAK,YAAY,QAAQ,IAAI;AAChC,aAAK,YAAY;AAAA,MAClB;AACA,YAAM,OAAO,UAAU,MAAM,KAAK,YAAY,QAAQ,OAAO;AAC7D,WAAK,OAAO,OAAO,KAAK,cAAc,QAAQ,YAAY,IAAI,CAAC,IAAI,KAAK,YAAY,KAAK;AAAA,IAC1F;AAAA,EACD;AAAA,EACA,KAAK;AAAA,IACJ,SAAS;AAAA,IACT,WAAW,SAAS;AACnB,YAAM,OAAO,UAAU,MAAM,KAAK,YAAY,QAAQ,OAAO;AAC7D,WAAK,OAAO,OAAO,QAAQ,YAAY,EAAE;AAAA,IAC1C;AAAA,EACD;AAAA,EACA,KAAK;AAAA,IACJ,SAAS;AAAA,IACT,WAAW,SAAS;AACnB,YAAM,OAAO,UAAU,MAAM,KAAK,YAAY,QAAQ,OAAO;AAC7D,WAAK,OAAO,OAAO,QAAQ,YAAY,CAAC;AAAA,IACzC;AAAA,EACD;AAAA,EACA,kBAAkB;AAAA,IACjB,SAAS;AAAA,IACT,WAAW,SAAS;AACnB,YAAM,SAAS,KAAK,YAAY;AAEhC,YAAM,aAAa,CAAC,kBAAkB,eAAe,EAAE,SAAS,KAAK,YAAY,aAAa,EAAE;AAChG,UAAI,WAAW,CAAC,OAAO,YAAY,OAAO,MAAM,KAAK,CAAC,OAAO,gBAAgB,CAAC,YAAY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