<!DOCTYPE html><htmlclass="default"lang="en"><head><metacharset="utf-8"/><metahttp-equiv="x-ua-compatible"content="IE=edge"/><title>SwitchPhase | 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/phases.html">phases</a></li><li><ahref="phases.SwitchPhase.html">SwitchPhase</a></li></ul><h1>Class SwitchPhase</h1></div><sectionclass="tsd-panel tsd-comment"><divclass="tsd-comment tsd-typography"><p>Opens the party selector UI and transitions into a <ahref="phases.SwitchSummonPhase.html"class="tsd-kind-class"><code>SwitchSummonPhase</code></a>
for the player (if a switch would be valid for the current battle state).</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">scene</span>: <ahref="battle_scene.default.html"class="tsd-signature-type tsd-kind-class">default</a></span><divclass="tsd-comment tsd-typography"><p><ahref="battle_scene.default.html"class="tsd-kind-class"><code>BattleScene</code></a> Current battle scene</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">fieldIndex</span>: <spanclass="tsd-signature-type">number</span></span><divclass="tsd-comment tsd-typography"><p>Field index to switch out</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">isModal</span>: <spanclass="tsd-signature-type">boolean</span></span><divclass="tsd-comment tsd-typography"><p>Indicates if the switch should be forced (true) or is
optional (false).</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><spanclass="tsd-kind-parameter">doReturn</span>: <spanclass="tsd-signature-type">boolean</span></span><divclass="tsd-comment tsd-typography"><p>Indicates if the party member on the field should be
recalled to ball or has already left the field. Passed to <ahref="phases.SwitchSummonPhase.html"class="tsd-kind-class"><code>SwitchSummonPhase</code></a>.</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <ahref="phases.SwitchPhase.html"class="tsd-signature-type tsd-kind-class">SwitchPhase</a></h4><divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><p>Overrides <ahref="phases.BattlePhase.html">BattlePhase</a>.<ahref="phases.BattlePhase.html#constructor">constructor</a></p><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/451a1a2c50fe3fc65b7b459b3572454b0ec4706f/src/phases.ts#L4700">src/phases.ts:4700</a></li></ul></aside></li></ul></section></section></details><detailsclass="tsd-panel-group tsd-member-group tsd-accordion"open><summaryclass="tsd-accordion-summary"data-key="section-Properties"><h2><svgwidth="20"height="20"viewBox="0 0 24 24"fill="none"><usehref="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><sectionclass="tsd-panel tsd-member tsd-is-protected"><aid="fieldIndex"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag">Protected</code><span>field<wbr/>Index</span><ahref="#fieldIndex"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">field<wbr/>Index</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">number</span></div><asideclass="tsd-sources"><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/451a1a2c50fe3fc65b7b459b3572454b0ec4706f/src/phases.ts#L4687">src/phases.ts:4687</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><aid="scene"class="tsd-anchor"></a><h3class="tsd-anchor-link"><codeclass="tsd-tag">Protected</code><span>scene</span><ahref="#scene"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">scene</span><spanclass="tsd-signature-symbol">:</span><ahref="battle_scene.default.html"class="tsd-signature-type tsd-kind-class">default</a></div><asideclass="tsd-sources"><p>Inherited from <ahref="phases.BattlePhase.html">BattlePhase</a>.<ahref="phases.BattlePhase.html#scene">scene</a></p><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/451a1a2c50fe3fc65b7b459b3572454b0ec4706f/src/phase.ts#L4">src/phase.ts:4</a></li></ul></aside></section></section></details><detailsclass="tsd-panel-group tsd-member-group tsd-accordion"open><summaryclass="tsd-accordion-summary"data-key="section-Methods"><h2><svgwidth="20"height="20"viewBox="0 0 24 24"fill="none"><usehref="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><sectionclass="tsd-panel tsd-member tsd-is-inherited"><aid="end"class="tsd-anchor"></a><h3class="tsd-anchor-link"><span>end</span><ahref="#end"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures tsd-is-inherited"><liclass="tsd-signature tsd-anchor-link"><aid="end.end-1"class="tsd-anchor"></a><spanclass="tsd-kind-call-signature">end</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">: </span><spanclass="tsd-signature-type">void</span><ahref="#end.end-1"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"><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">void</span></h4><asideclass="tsd-sources"><p>Inherited from <ahref="phases.BattlePhase.html">BattlePhase</a>.<ahref="phases.BattlePhase.html#end">end</a></p><ul><li>Defined in <ahref="https://github.com/pagefaultgames/pokerogue/blob/451a1a2c50fe3fc65b7b459b3572454b0ec4706f/src/phase.ts#L17">src/phase.ts:17</a></li></ul></aside></li></