<!DOCTYPE html><htmlclass="default"lang="en"><head><metacharset="utf-8"/><metahttp-equiv="x-ua-compatible"content="IE=edge"/><title>getRandomPlayerPokemon | pokemon-rogue-battle</title><metaname="description"content="Documentation for pokemon-rogue-battle"/><metaname="viewport"content="width=device-width, initial-scale=1"/><linkrel="stylesheet"href="../assets/style.css"/><linkrel="stylesheet"href="../assets/highlight.css"/><scriptdefersrc="../assets/main.js"></script><scriptasyncsrc="../assets/icons.js"id="tsd-icons-script"></script><scriptasyncsrc="../assets/search.js"id="tsd-search-script"></script><scriptasyncsrc="../assets/navigation.js"id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme=localStorage.getItem("tsd-theme")||"os";document.body.style.display="none";setTimeout(()=>app?app.showPage():document.body.style.removeProperty("display"),500)</script><headerclass="tsd-page-toolbar"><divclass="tsd-toolbar-contents container"><divclass="table-cell"id="tsd-search"data-base=".."><divclass="field"><labelfor="tsd-search-field"class="tsd-widget tsd-toolbar-icon search no-caption"><svgwidth="16"height="16"viewBox="0 0 16 16"fill="none"><usehref="../assets/icons.svg#icon-search"></use></svg></label><inputtype="text"id="tsd-search-field"aria-label="Search"/></div><divclass="field"><divid="tsd-toolbar-links"></div></div><ulclass="results"><liclass="state loading">Preparing search index...</li><liclass="state failure">The search index is not available</li></ul><ahref="../index.html"class="title">pokemon-rogue-battle</a></div><divclass="table-cell"id="tsd-widgets"><ahref="#"class="tsd-widget tsd-toolbar-icon menu no-caption"data-toggle="menu"aria-label="Menu"><svgwidth="16"height="16"viewBox="0 0 16 16"fill="none"><usehref="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><divclass="container container-main"><divclass="col-content"><divclass="tsd-page-title"><ulclass="tsd-breadcrumb"><li><ahref="../index.html">pokemon-rogue-battle</a></li><li><ahref="../modules/data_mystery_encounters_utils_encounter_pokemon_utils.html">data/mystery-encounters/utils/encounter-pokemon-utils</a></li><li><ahref="data_mystery_encounters_utils_encounter_pokemon_utils.getRandomPlayerPokemon.html">getRandomPlayerPokemon</a></li></ul><h1>Function getRandomPlayerPokemon</h1></div><sectionclass="tsd-panel"><ulclass="tsd-signatures"><liclass="tsd-signature tsd-anchor-link"><aid="getRandomPlayerPokemon"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">get<wbr/>Random<wbr/>Player<wbr/>Pokemon</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">scene</span>, <spanclass="tsd-kind-parameter">isAllowed</span><spanclass="tsd-signature-symbol">?</span>, <spanclass="tsd-kind-parameter">isFainted</span><spanclass="tsd-signature-symbol">?</span>, <spanclass="tsd-kind-parameter">doNotReturnLastAllowedMon</span><spanclass="tsd-signature-symbol">?</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><ahref="../classes/field_pokemon.PlayerPokemon.html"class="tsd-signature-type tsd-kind-class">PlayerPokemon</a><ahref="#getRandomPlayerPokemon"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></li><liclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Will never remove the player's last non-fainted Pokemon (if they only have 1)
Otherwise, picks a Pokemon completely at random and removes from the party</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">scene</span>: <ahref="../classes/battle_scene.default.html"class="tsd-signature-type tsd-kind-class">default</a></span><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">isAllowed</span>: <spanclass="tsd-signature-type">boolean</span><spanclass="tsd-signature-symbol"> = false</span></span><divclass="tsd-comment tsd-typography"><p>Default false. If true, only picks from legal mons. If no legal mons are found (or there is 1, with `doNotReturnLastAllowedMon = true), will return a mon that is not allowed.</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">isFainted</span>: <spanclass="tsd-signature-type">boolean</span><spanclass="tsd-signature-symbol"> = false</span></span><divclass="tsd-comment tsd-typography"><p>Default false. If true, includes fainted mons.</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">doNotReturnLastAllowedMon</span>: <spanclass="tsd-signature-type">boolean</span><spanclass="tsd-signature-symbol"> = false</span></span><divclass="tsd-comment tsd-typography"><p>Default false. If true, will never return the last unfainted pokemon in the party. Useful when this function is being used to determine what Pokemon to remove from the party (Don't want to remove last unfainted)</p>