Difference between revisions of "Template:Card probabilities"

From Yugipedia
Jump to: navigation, search
m (Deltaneos moved page Template:Deck probabilities to Template:Card probabilities: Genericise to also allow it to be used for cards dropped by a player.)
(I hope I'm doing this correctly; will revert if this breaks anything)
 
(48 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
<!--
 
<!--
-->[[Character::{{{character|}}}| ]]<!--
+
-->{{ #arraydefine: $cards | {{{cards|}}} | /\n/ }}<!--
-->[[Game::{{{game|}}}| ]]<!--
+
-->{{ #vardefine: $character        | {{ #if: {{{character|}}} | {{{character}}} | {{PAGENAME}} }} }}<!--
 +
-->{{ #vardefine: $is_victory_bonus | {{ #switch: {{ lc: {{{type}}} }} | victory bonus = 1 }} }}<!--
 +
-->{{ #vardefine: $property        | {{ #switch: {{ lc: {{{type}}} }}
 +
  | drops        = Drops
 +
  | victory bonus = Victory bonus
 +
  | fixed set    = Set contains
 +
  |#default      = Deck contains
 +
  }} }}<!--
 +
-->{{ #ifeq: {{ lc: {{{type}}} }} | fixed set | {{ #vardefine: $use_fixed_quantities | 1 }} }}<!--
 +
 
 +
-->{{ #vardefine: ${{ #var: $property }}-counter
 +
| {{ #expr: {{ #var: ${{ #var: $property }}-counter | 0 }} + 1 }}
 +
}}<!--
 +
 
 +
-->{{ #vardefine: $main_subobject
 +
| {{ #var: $property }}{{ #ifeq: {{ #var: ${{ #var: $property }}-counter }} | 0 || -{{ #var: ${{ #var: $property }}-counter }} }}
 +
}}<!--
 +
 
 +
-->{{ #vardefine: $cp-en_name | {{ #if: {{{character_name|}}} | {{{character_name|}}} | {{ #explode: {{ #var: $character }} | ( }} }} }}<!--
 +
 
 +
# Per-game properties
 +
-->{{ #switch: {{{game}}}
 +
| DM2 | Yu-Gi-Oh! Duel Monsters II: Dark Duel Stories = <!--
 +
  -->{{ #vardefine: $has_alignment_col | 1 }}
 +
 
 +
| DM3 | DDS | Yu-Gi-Oh! Dark Duel Stories
 +
| DM4      | Yu-Gi-Oh! Duel Monsters 4: Battle of Great Duelist
 +
| DM6      = <!--
 +
  -->{{ #vardefine: $has_alignment_col | 1 }}<!--
 +
  -->{{ #vardefine: $has_level_col    | 1 }}<!--
 +
  -->{{ #ifeq: {{ #var: $property }} | Deck contains
 +
    | {{ #vardefine: $use_fixed_quantities | 1 }}
 +
    }}
 +
 
 +
| SDD      = <!--
 +
  -->{{ #vardefine: $has_attribute_col | 1 }}<!--
 +
  -->{{ #vardefine: $has_level_col    | 1 }}<!--
 +
  -->{{ #ifeq: {{ #var: $property }} | Deck contains
 +
    | {{ #vardefine: $use_fixed_quantities | 1 }}
 +
    }}
 +
 
 +
| DM7 | TSC | Yu-Gi-Oh! The Sacred Cards
 +
| DM8 | ROD | Yu-Gi-Oh! Reshef of Destruction = <!--
 +
  -->{{ #vardefine: $has_summon_col    | 1 }}<!--
 +
  -->{{ #vardefine: $has_level_col    | 1 }}<!--
 +
  -->{{ #ifeq: {{ #var: $property }} | Deck contains
 +
    | {{ #vardefine: $use_fixed_quantities | 1 }}
 +
    }}
 +
 
 +
| FMR | Yu-Gi-Oh! Forbidden Memories
 +
| DOR | Yu-Gi-Oh! The Duelists of the Roses = <!--
 +
  -->{{ #vardefine: $has_dc_col        | 1 }}<!--
 +
  -->{{ #vardefine: $has_attribute_col | 1 }}<!--
 +
  -->{{ #vardefine: $has_level_col    | 1 }}
 +
}}<!--
  
-->{{ #arraydefine: $cards | {{{cards|}}} | /\n/ }}<!--
 
 
-->{{ #vardefine: $i | 0 }}<!--
 
-->{{ #vardefine: $i | 0 }}<!--
  
--><table class="wikitable sortable card-list">
+
-->[[Character::{{ #var: $character }}| ]]<!--
 +
-->[[Game::{{{game|}}}| ]]<!--
 +
 
 +
--><table class="wikitable sortable card-list" style="width: auto; clear: none;">
 
   <tr>
 
   <tr>
 
     <th scope="col"><abbr title="Number">#</abbr></th>
 
     <th scope="col"><abbr title="Number">#</abbr></th>
     <th scope="col">Card</th>
+
     <th scope="col">Card</th>{{ #if: {{ #var: $has_dc_col }} |
     <th scope="col">Type</th>
+
    <th scope="col">DC</th>
 +
}}
 +
    <th scope="col">Card type</th>{{ #if: {{ #var: $has_alignment_col }} |
 +
    <th scope="col">Alignment</th>
 +
}}{{ #if: {{ #var: $has_summon_col }} |
 +
    <th scope="col">Summon</th>
 +
}}{{ #if: {{ #var: $has_attribute_col }} |
 +
    <th scope="col">Attribute</th>
 +
}}
 +
     <th scope="col">Type</th>{{ #if: {{ #var: $has_level_col }} |
 +
    <th scope="col">Level</th>
 +
}}
 
     <th scope="col">ATK</th>
 
     <th scope="col">ATK</th>
 
     <th scope="col">DEF</th>
 
     <th scope="col">DEF</th>
     <th scope="col"><abbr title="Percentage chance of being included in the Deck">%</abbr></th>
+
{{ #if: {{ #var: $is_victory_bonus }}
     <th scope="col"><abbr title="Chance out of 2048 of being included in the Deck">2048th</abbr></th>
+
|
 +
    <th scope="col">Wins</th>
 +
| {{ #if: {{ #var: $use_fixed_quantities }}
 +
  |
 +
     <th scope="col"><abbr title="Quantity">Qty</abbr></th>
 +
  |
 +
    <th scope="col"><abbr title="Chance out of 100">%</abbr></th>
 +
     <th scope="col"><abbr title="Chance out of 2048">2048th</abbr></th>
 +
  }}
 +
}}
 
   </tr>
 
   </tr>
{{ #arrayprint: $cards
+
{{ #subobject: {{ #var: $main_subobject }}
 +
| English name          = {{ #var: $cp-en_name }}
 +
| English name (linked) = [[{{ #var: $character }}|{{ #var: $cp-en_name }}]]
 +
| Internal number      = {{{internal_number|}}}|+sep=,
 +
}}<!--
 +
 
 +
-->{{ #arrayprint: $cards
 
|&#32;
 
|&#32;
 
| $row
 
| $row
 
| <!--
 
| <!--
   -->{{ #vardefine: $i                | {{ #expr: {{ #var: $i }} + 1 }} }}<!--
+
   -->{{ #vardefine: $i                | {{ padleft: {{ #expr: {{ #var: $i }} + 1 }} | 4 | 0 }} }}<!--
 
   -->{{ #vardefine: $card            | {{ #explode: $row | ; }} }}<!--
 
   -->{{ #vardefine: $card            | {{ #explode: $row | ; }} }}<!--
   -->{{ #vardefine: $card_name        | {{ #show: {{ #var: $card }} |?English name }} }}<!--
+
  -->{{ #vardefine: $card-strip      | {{ #replace: {{ #var: $card }} | # }} }}<!--
   -->{{ #vardefine: $2048_probability | {{ #explode: $row | ; | 1 }} }}<!--
+
   -->{{ #vardefine: $card_name        | {{ #show: {{ #var: $card-strip }} |?English name }} }}<!--
  -->{{ #vardefine: $probability      | {{ #if: {{ #var: $2048_probability }} | {{ #expr: 0{{ #var: $2048_probability }} / 2048 * 100 round 2 }} }} }}<!--
+
   -->{{ #vardefine: $artwork          | {{ #explode: $row | artwork:: | 1 }} }}<!--
   -->{{ #subobject: Card-{{ #pad: {{ #var: $i }} | 4 | 0 | left }}
+
 
  | Deck contains      = {{ #var: $card }}
+
  -->{{ #if: {{ #var: $is_victory_bonus }}
   | Owner             = {{{character|}}}
+
  | {{ #vardefine: $wins_required| {{ #explode: $row | ; | 1 }} }}
   | Owner name         = {{ #if: {{{character_name|}}} | {{{character_name|}}} | {{ #explode: {{{character}}} | ( }} }}
+
  | {{ #if: {{ #var: $use_fixed_quantities }}
   | Probability        = {{ #var: $probability }}
+
    | {{ #vardefine: $quantity | {{ #explode: $row ; 1 | ; | 1 }} }}
   | 2048th probability = {{ #var: $2048_probability }}
+
    | <!--
 +
      -->{{ #vardefine: $2048_probability | {{ #explode: {{ #explode: $row | ; | 1 }} | // | 0 }} }}<!--
 +
      -->{{ #vardefine: $probability      | {{ #if: {{ #var: $2048_probability }} | {{ #expr: {{ #var: $2048_probability }} / 2048 * 100 round 2 }} }} }}
 +
    }}
 +
  }}<!--
 +
 
 +
   -->{{ #subobject: {{ #var: $main_subobject }}-{{ #var: $i }}
 +
  | {{ #var: $property }} = {{ #var: $card-strip }}
 +
   | Owner                 = {{ #var: $character }}
 +
   | Owner name           = {{ #var: $cp-en_name }}
 +
  | Probability          = {{ #var: $probability }}
 +
  | 2048th probability    = {{ #var: $2048_probability }}
 +
  | Wins required        = {{ #var: $wins_required }}
 +
   | Amount                = {{ #var: $quantity }}
 +
   | Subobject of          = {{PAGENAME}}#{{ #var: $main_subobject }}
 
   }}
 
   }}
 
   <tr>
 
   <tr>
     <td>{{ #show: {{ #var: $card }} |?Card number }}</td>
+
     <td>{{ #if: {{ #var: $artwork }}
     <td>[[{{ #var: $card }}|{{ #var: $card_name | {{ #explode: {{ #var: $card }} | ( }} }}]]</td>
+
      | {{ #show: {{ #var: $card-strip }}#artwork_{{ #var: $artwork }} |?Card number }}
     <td>{{ #show: {{ #var: $card }} |?Type }}</td>
+
      | {{ #show: {{ #var: $card-strip }} |?Card number }}
     <td>{{ #show: {{ #var: $card }} |?ATK string }}</td>
+
      }}</td>
     <td>{{ #show: {{ #var: $card }} |?DEF string }}</td>
+
     <td>"[[{{ #var: $card-strip }}|{{ #var: $card_name | {{ #explode: {{ #var: $card }} | ( }} }}]]"</td>{{ #if: {{ #var: $has_dc_col }} |
 +
    <td>{{ #show: {{ #var: $card-strip }} |?Deck Cost }}</td>
 +
}}
 +
    <td>{{ #show: {{ #var: $card-strip }} |?Card type (short) }}</td>{{ #if: {{ #var: $has_alignment_col }}{{ #var: $has_summon_col }} |
 +
    <td>{{ #show: {{ #var: $card-strip }} |?Alignment (local) }}</td>
 +
}}{{ #if: {{ #var: $has_attribute_col }} |
 +
    <td>{{ #show: {{ #var: $card-strip }} |?Attribute }}</td>
 +
}}
 +
     <td>{{ #show: {{ #var: $card-strip }} |?Type }}</td>{{ #if: {{ #var: $has_level_col }} |
 +
    <td>{{ #show: {{ #var: $card-strip }} |?Level# }}</td>
 +
}}
 +
     <td>{{ #show: {{ #var: $card-strip }} |?ATK string }}</td>
 +
     <td>{{ #show: {{ #var: $card-strip }} |?DEF string }}</td>
 +
  {{ #if: {{ #var: $is_victory_bonus }}
 +
  |
 +
    <td>{{ #var: $wins_required }}</td>
 +
  | {{ #if: {{ #var: $use_fixed_quantities }}
 +
    |
 +
    <td>{{ #var: $quantity }}</td>
 +
    |
 
     <td>{{ #var: $probability }}</td>
 
     <td>{{ #var: $probability }}</td>
 
     <td>{{ #var: $2048_probability }}</td>
 
     <td>{{ #var: $2048_probability }}</td>
 +
    }}
 +
  }}
 
   </tr>
 
   </tr>
 
}}
 
}}
</table>
+
</table><!--
 +
 
 +
# Reset variables before the next transclusion
 +
-->{{ #vardefine: $cp-en_name          }}<!--
 +
-->{{ #vardefine: $has_dc_col          }}<!--
 +
-->{{ #vardefine: $has_alignment_col    }}<!--
 +
-->{{ #vardefine: $has_summon_col      }}<!--
 +
-->{{ #vardefine: $has_attribute_col    }}<!--
 +
-->{{ #vardefine: $has_level_col        }}<!--
 +
-->{{ #vardefine: $use_fixed_quantities }}

Latest revision as of 13:46, 29 January 2024

# Card Card type Type ATK DEF % 2048th