|
|
Line 1: |
Line 1: |
| <includeonly> | | <includeonly> |
| {{!
| | {{#if:{{{Theme|}}}|{{#vardefine:cell|#{{{{{Theme}}}_color_light}}}}{{#vardefine:background|#{{{{{Theme}}}_color}}}}{{#vardefine:border|#{{{{{Theme}}}_color_dark}}}}}} |
| Template parameters:
| |
| - Theme: (Optional) Base name for theme colors (e.g., "Grass"). Defines cell, background, border colors.
| |
| - Lineup: (Required) Comma-separated list of Pokémon names (e.g., "Pikachu,Charizard,Venusaur").
| |
| - Mega: (Optional) Comma-separated list of flags (1 or 0) indicating Mega status for each Pokémon in Lineup. Defaults to all 0s.
| |
| - Nature0, Nature1, ... NatureN: (Optional) Nature for the Pokémon at index 0, 1, ... N. Defaults to "Random".
| |
| - Ability0, Ability1, ... AbilityN: (Optional) Ability for the Pokémon at index 0, 1, ... N. Defaults to "Random".
| |
| - Item0, Item1, ... ItemN: (Optional) Held Item for the Pokémon at index 0, 1, ... N. Defaults to "None".
| |
| - Moves0, Moves1, ... MovesN: (Required) Comma-separated list of moves for the Pokémon at index 0, 1, ... N.
| |
| - Sprite0, Sprite1, ... SpriteN: (Optional) Override sprite filename (without extension) for the Pokémon at index 0, 1, ... N.
| |
| - Counterpart0, Counterpart1, ... CounterN: (Optional) Counterpart name prefix for sprite/display at index 0, 1, ... N.
| |
| - Notes: This template generates a series of <td> cells. It should be placed within a <table><tr> structure on the calling page.
| |
| The template itself manages adding closing </tr> and opening <tr class="keita-lineup-row"> every two Pokémon.
| |
| Ensure required extensions (ParserFunctions, Variables, Arrays, Loops, ExternalData) are installed.
| |
| Ensure color variables like Type_color, Type_color_light, Type_color_dark exist globally.
| |
| Ensure external data sources (PokemonRawList, RawMegaPokemonList, RawMovesList) are accessible and correct.
| |
| }}
| |
| {{! Theme Color Setup (optional) }}
| |
| {{#if:{{{Theme|}}} | |
| |{{#vardefine:cell_color|#{{{{{Theme}}}_color_light}}}}
| |
| {{#vardefine:background_color|#{{{{{Theme}}}_color}}}}
| |
| {{#vardefine:border_color|#{{{{{Theme}}}_color_dark}}}}
| |
| |{{! Default colors if no theme - consider setting defaults or relying purely on type colors }}
| |
| {{#vardefine:border_color|#000000}} {{! Example default border }}
| |
| }}
| |
| | |
| {{! Initialize Data Arrays }}
| |
| {{#arraydefine:lineup|{{{Lineup}}}}} | | {{#arraydefine:lineup|{{{Lineup}}}}} |
| {{#arraydefine:mega|{{{Mega|{{#padleft:|{{#arraysize:lineup}}|0,}}0}}}}} {{! Default mega flags based on lineup size }} | | {{#arraydefine:mega|{{{Mega|0,0,0,0,0,0}}}}} |
| | {{#if:{{{NPC|}}}|{{#vardefine:name|{{{NPC|}}}}}|{{#if:{{#var:leader}}|{{#vardefine:name|{{#var:leader}}}}}}}} |
|
| |
|
| {{! Initialize Row Counter - IMPORTANT: Must be done *outside* the template call if used multiple times on one page, or handled differently }} | | <templatestyles src="Template:TrainerTeam/styles.css" /> <div class="trainer-team-container" style="--trainer-background-color:{{#var:background|#eee}}; --trainer-border-color:{{#var:border|#ccc}}; --trainer-cell-color:{{#var:cell|#f8f8f8}};"> <div class="trainer-info"> |
| {{! For self-contained use generating multiple rows, initialize here. If called *multiple* times on a page *for the same lineup*, this needs rethinking. }} | | {{#ifexist:File:{{#var:name}}.png|[[File:{{#var:name}}.png|link=]]}} <div>{{#var:name}}</div> |
| {{! Assuming this template call generates the *entire* lineup display structure: }} | | </div> |
| {{#vardefine:rows|0}} | |
|
| |
|
| {{! Start the outer table structure (optional, but helps self-containment) }}
| | <div class="pokemon-lineup"> |
| <table class="keita-team-lineup" style="width: 100%; border-collapse: separate; border-spacing: 10px;"> | | {{#loop:pokelineup|0|{{#arraysize:lineup}}| |
| | {{#if:{{#arrayindex:lineup|{{#var:pokelineup}}}} | |
| | {{#arraydefine:moves|{{{Moves{{#var:pokelineup}}}}}}} |
| | {{#get_web_data:url=http://wiki.pokemonrevolution.net/index.php?title=Special:GetData/{{#ifexpr:{{#arrayindex:mega|{{#var:pokelineup}}}} > 0|RawMegaPokemonList|PokemonRawList}}|format=CSV with header|filters=Name={{#arrayindex:lineup|{{#var:pokelineup}}}}|data=name=Name,number=Pokedex Number,type1=Type1,type2=Type2}} |
|
| |
|
| {{! Loop through the Pokémon lineup }}
| | <div class="pokemon-card"> |
| {{#loop:pokelineup|0|{{#arraysize:lineup}}|
| | <div class="pokemon-details"> |
| {{#vardefine:current_pname|{{#arrayindex:lineup|{{#var:pokelineup}}}}}}
| |
| {{! Proceed only if a Pokémon name exists at this index }}
| |
| {{#if:{{#var:current_pname}}|
| |
| {{! Get Pokémon Data using ExternalData }}
| |
| {{#vardefine:is_mega|{{#arrayindex:mega|{{#var:pokelineup}}}}}}
| |
| {{#get_web_data:
| |
| url=http://wiki.pokemonrevolution.net/index.php?title=Special:GetData/{{#ifexpr:{{#var:is_mega}} > 0|RawMegaPokemonList|PokemonRawList}}
| |
| |format=CSV with header
| |
| |filters=Name={{#var:current_pname}}
| |
| |data=poke_name=Name,poke_number=Pokedex Number,poke_type1=Type1,poke_type2=Type2
| |
| }}
| |
|
| |
|
| {{! Check if data was fetched successfully (at least type1) }}
| | <div class="pokemon-sprite-container" style="background-color:#{{{{#external_value:type1}}_color_light}}; --pokemon-type1-dark-color:#{{{{#external_value:type1}}_color_dark}};"> {{#if:{{{Sprite{{#var:pokelineup}}|}}} |
| {{#if:{{#external_value:poke_type1}}|
| | |[[File:{{{Sprite{{#var:pokelineup}}}}}.png|link=]] |
| | | |[[File:{{#ifexpr:{{#arrayindex:mega|{{#var:pokelineup}}}} > 0|Mega_}}{{#external_value:name}}_Front_Sprite.png|link=]] |
| {{! --- Row Management (Start) --- }}
| | }} |
| {{#ifexpr: {{#var:rows}} == 0 }}<tr class="keita-lineup-row">{{/ifexpr}}
| | <div class="pokemon-name-plate" style="--pokemon-type1-dark-color:#{{{{#external_value:type1}}_color_dark}};"> |
| {{#vardefine:rows|{{#expr:{{#var:rows}}+1}}}}
| | {{#ifexpr:{{#arrayindex:mega|{{#var:pokelineup}}}} > 0|Mega}} [[{{#external_value:name}}]] |
| {{! --- Row Management (End) --- }}
| | </div> |
| | </div> |
|
| |
|
| {{! Define form/counterpart prefixes based on index }}
| | <table class="collapsible collapsed pokemon-moves-table" style="width: 100%; margin-top: 10px;"> <thead> <tr style="background-color: var(--trainer-cell-color); color: var(--trainer-border-color);"> <th>Move</th><th>Type</th><th>Category</th><th>Power</th><th>Accuracy</th> |
| {{#vardefine:form_prefix|{{#ifexpr:{{#var:is_mega}} > 0|Mega|}}}}
| |
| {{#vardefine:counterpart_prefix|{{{Counterpart{{#var:pokelineup}}|}}}}}
| |
| {{#vardefine:current_sprite_override|{{{Sprite{{#var:pokelineup}}|}}}}}
| |
| | |
| {{! --- Start Pokémon Cell (Structure from Template 1) --- }}
| |
| <td class="keita-pokemon-cell" style="background-color:#{{{{#external_value:poke_type1}}_color_light}}; border-radius: 25px; border: 3px solid {{#var:border_color|#{{{{#external_value:poke_type1}}_color_dark}} }}; padding: 10px; margin: 10px; width: 45%; max-width: 450px; min-width: 300px; vertical-align: top;">
| |
| <table width="100%" style="text-align: center;">
| |
| <tr>
| |
| <td colspan="5">
| |
| <div>
| |
| [[File:{{#if:{{#var:current_sprite_override}}|{{#var:current_sprite_override}}.png|{{#if:{{#var:counterpart_prefix}}|{{ucfirst:{{#var:counterpart_prefix}}}}}_{{#external_value:poke_name}}|{{#if:{{#var:form_prefix}}|{{#var:form_prefix}}_{{#external_value:poke_name}}|{{#external_value:poke_name}}_Front_Sprite}}}}.png|responsive|max-width=150px]]
| |
| <div style="background-color:#{{{{#external_value:poke_type1}}_color}}; border: 1px solid #{{{{#external_value:poke_type1}}_color_dark}}; border-radius: 25px; padding: 5px; margin: auto auto; margin-top: 5px; margin-bottom: 5px; width: 80%; max-width: 200px; color: #FFFFFF; font-weight: bold;">
| |
| {{#if:{{#var:counterpart_prefix}}|{{ucfirst:{{#var:counterpart_prefix}}}} }}{{#var:form_prefix}} [[{{#external_value:poke_name}}|<span style="color:#FFFFFF;">{{#external_value:poke_name}}</span>]]
| |
| </div>
| |
| </div>
| |
| </td>
| |
| </tr>
| |
| <tr>
| |
| <td colspan="5"> {{! Changed from just <td> in original to colspan=5 to match structure }}
| |
| <table width="100%" align="center" style="text-align: center; margin-bottom: 10px;">
| |
| <tr style="background-color: #{{{{#external_value:poke_type1}}_color}}; color: #FFFFFF;">
| |
| <th style="border: 1px solid #{{{{#external_value:poke_type1}}_color_dark}}; width: 33%; padding: 5px;">[[Natures|<span style="color: #FFFFFF">Nature</span>]]</th>
| |
| <th style="border: 1px solid #{{{{#external_value:poke_type1}}_color_dark}}; width: 33%; padding: 5px;">[[Abilities|<span style="color: #FFFFFF">Ability</span>]]</th>
| |
| <th style="border: 1px solid #{{{{#external_value:poke_type1}}_color_dark}}; width: 33%; padding: 5px;">Item</th>
| |
| </tr> | | </tr> |
| <tr style="background-color: #FFFFFF;">
| | </thead> |
| <td style="padding: 5px;">{{{Nature{{#var:pokelineup}}|Random}}}</td>
| | <tbody> |
| <td style="padding: 5px;">{{#if:{{{Ability{{#var:pokelineup}}|}}}|[[{{{Ability{{#var:pokelineup}}}}}_(ability)|{{{Ability{{#var:pokelineup}}}}}]]|Random}}</td>
| | {{#loop:vector|0|{{#arraysize:moves}}| |
| <td style="padding: 5px;">{{#if:{{{Item{{#var:pokelineup}}|}}}|[[{{{Item{{#var:pokelineup}}}}}]]|None}}</td> | | <tr style="background-color:#FFFFFF; color:#000000;"> {{#get_web_data:url=http://wiki.pokemonrevolution.net/index.php?title=Special:GetData/RawMovesList|format=CSV with header|filters=Name={{#arrayindex:moves|{{#var:vector}}}}|data=technique=Name,movetype=Type,category=Category,power=Power,accuracy=Accuracy,pp=PP,broken=Broken,typeless=Typeless}} |
| </tr>
| | <td class="move-name"> |
| </table>
| | <span style="{{#ifeq: {{#external_value:category}} | Status | | {{#ifeq:{{#external_value:typeless}} | N | {{#ifeq:{{#external_value:type1}} | {{#external_value:movetype}} | font-weight: bold; | {{#ifeq: {{#external_value:type2}} | {{#external_value:movetype}} | font-weight: bold;}} }} }} }} {{#ifeq:{{#external_value:broken}} | Y | font-style: italic;}}"> [[{{#external_value:technique}}]] |
| </td> {{! End colspan=5 td }}
| | </span> |
| </tr>
| | </td> |
| <tr>
| | <td class="move-type" style="background-color: #{{{{#external_value:movetype}}_color}};"><span style="color:#FFFFFF;">[[{{#external_value:movetype}}_(type)|{{#external_value:movetype}}]]</span></td> |
| <td colspan="5"> {{! Changed from just <td> in original to colspan=5 to match structure }}
| | <td class="move-category" style="background-color:#{{{{#external_value:category}}_color}};"><span style="color:#FFFFFF;">[[{{#external_value:category}} Moves|{{#external_value:category}}]]</span></td> |
| <div class="keita-moves-container">
| | <td>{{#if:{{#external_value:power}} | {{#external_value:power}} | — }}</td> |
| <div class="mw-collapsible mw-collapsed" style="width: 100%">
| | <td>{{#external_value:accuracy}}</td> |
| <div class="mw-collapsible-toggle" style="background-color: #{{{{#external_value:poke_type1}}_color}}; color: #FFFFFF; padding: 5px; border-radius: 5px; text-align: center; cursor: pointer; margin-bottom: 5px; display: block; width: 100%;">
| | </tr> |
| Show Moves
| | }} |
| </div>
| | </tbody> |
| <div class="mw-collapsible-content" style="overflow-x: auto; display: block; clear: both">
| | </table> |
| {{! --- Moveset Generation (Logic from Template 2) --- }}
| | </div> |
| {{#arraydefine:moves|{{{Moves{{#var:pokelineup}}|}}}}}
| | </div> |
| <table width="100%" class="keita-moves-table" style="text-align: center;">
| | }} |
| <tr style="background-color: #{{{{#external_value:poke_type1}}_color}}; color: #FFFFFF;">
| | }} |
| <th style="border: 1px solid #{{{{#external_value:poke_type1}}_color_dark}}; padding: 5px;">Move</th>
| | </div> |
| <th style="border: 1px solid #{{{{#external_value:poke_type1}}_color_dark}}; padding: 5px;">Type</th>
| | <div class="team-legend"> |
| <th style="border: 1px solid #{{{{#external_value:poke_type1}}_color_dark}}; padding: 5px;">Category</th>
| |
| <th style="border: 1px solid #{{{{#external_value:poke_type1}}_color_dark}}; padding: 5px;">Base Power</th>
| |
| <th style="border: 1px solid #{{{{#external_value:poke_type1}}_color_dark}}; padding: 5px;">Accuracy</th>
| |
| </tr>
| |
| {{#loop:vector|0|{{#arraysize:moves}}|
| |
| {{#vardefine:current_move|{{#arrayindex:moves|{{#var:vector}}}}}}
| |
| {{#if:{{#var:current_move}}|
| |
| {{! Get Move Data }}
| |
| {{#get_web_data:
| |
| url=http://wiki.pokemonrevolution.net/index.php?title=Special:GetData/RawMovesList
| |
| |format=CSV with header
| |
| |filters=Name={{#var:current_move}}
| |
| |data=technique=Name,movetype=Type,category=Category,power=Power,accuracy=Accuracy,pp=PP,broken=Broken,typeless=Typeless
| |
| }}
| |
| {{! Display Move Row }}
| |
| <tr style="background-color:#FFFFFF; color:#000000;">
| |
| <td><span style="{{#ifeq: {{#external_value:category}} | Status | | {{#ifeq:{{#external_value:typeless}} | N | {{#ifeq:{{#external_value:poke_type1}} | {{#external_value:movetype}} | font-weight: bold; | {{#ifeq: {{#external_value:poke_type2}} | {{#external_value:movetype}} | font-weight: bold;}} }} }} }}{{#ifeq:{{#external_value:broken}} | Y | font-style: italic;}}">[[{{#external_value:technique}}|{{#external_value:technique}}]]</span></td>
| |
| <td style="background-color: #{{{{#external_value:movetype}}_color}};"><span style="display:block; padding: 3px;">[[File:{{#external_value:movetype}}IC.png|link={{#external_value:movetype}} (type)|{{#external_value:movetype}} type]]</span></td>
| |
| <td style="background-color:#{{{{#external_value:category}}_color}};"> <span style="display:block; padding: 3px;">[[File:{{#external_value:category}}IC.png|link={{#external_value:category}} Moves|{{#external_value:category}} category]]</span> </td>
| |
| <td>{{#if:{{#external_value:power}} | {{#external_value:power}} | — }}</td>
| |
| <td>{{#if:{{#external_value:accuracy}}|{{#external_value:accuracy}}%|—}}</td>
| |
| </tr>
| |
| }} {{! end if current_move exists }}
| |
| }} {{! end loop vector }}
| |
| </table>
| |
| {{! --- End Moveset Generation --- }}
| |
| </div>
| |
| </div>
| |
| </div>
| |
| </td> {{! End colspan=5 td }}
| |
| </tr>
| |
| </table> | |
| </td>
| |
| {{! --- End Pokémon Cell --- }}
| |
| | |
| {{! --- Row Management (Closing) --- }}
| |
| {{#ifexpr: {{#var:rows}} == 2 }}
| |
| </tr>
| |
| {{#vardefine:rows|0}}
| |
| {{/ifexpr}}
| |
| {{! --- Row Management (Closing End) --- }}
| |
| | |
| }} {{! end if external data fetched }} | |
| }} {{! end if current_pname exists }} | |
| }} {{! end loop pokelineup }}
| |
| | |
| {{! --- Final Row Cleanup --- }}
| |
| {{#ifexpr: {{#var:rows}} != 0 }}</tr>{{/ifexpr}} {{! Close the last row if it wasn't completed }}
| |
| | |
| {{! --- Add Legend Row (optional) --- }}
| |
| <tr class="keita-lineup-legend"> | |
| <td colspan="2" style="background-color: {{#var:cell_color|#EEEEEE}}; border: 1px solid {{#var:border_color|#AAAAAA}}; border-radius: 10px; padding: 10px;">
| |
| <ul> | | <ul> |
| <li>'''Emboldened''' moves gain STAB (Same-Type Attack Bonus).</li> | | <li>'''Emboldened''' moves gain a STAB bonus.</li> |
| <li>''Italicized'' moves may be functionally broken or have altered mechanics; check the move's page.</li> | | <li>''Italicized'' moves are functionally broken (see move page).</li> |
| </ul> | | </ul> |
| </td> | | </div> |
| </tr>
| |
| {{! --- End Legend Row --- }}
| |
|
| |
|
| </table> {{! End the outer table structure }} | | </div> |
| </includeonly> | | </includeonly> |