User:Tiddlywinks/TE/Steel

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search

1

This template defines the defensive strengths/weakenesses of the  Steel  type. I.e., Steel is weak to Fire (2) and resists Normal (0.5). It is designed to be substituted, such that {{subst:User:Tiddlywinks/TE/Steel|Fire}} becomes "2" directly (instead of giving the switch statement).

Parameters
  • Unnamed
    • 1: A type (Normal, Fire, Bug, Water, etc). Capitalization is ignored, so "Bug", "bug", and "BUG" will return the same value
      • Super effective types return 2, not very effective types return 0.5, no effect types return 0 (immunity), and all other values return 1.
  • Named
    • gen (optional): the generation to get effectiveness for, since Steel's defensive properties have changed
      • This is a number like 1 or 6. (If not used, the latest effectiveness will be returned.) For simplicity, new types like Steel, Dark, or Fairy will return values even for a generation before they existed; it's left to the caller to handle such invalid cases.