Template:WeaponCard: Difference between revisionsGive feedback
Jump to navigation
Jump to search
added div class |
No edit summary |
||
| Line 6: | Line 6: | ||
-->{{#vardefine:hero_key_or_en|{{{1}}}}}<!-- en | -->{{#vardefine:hero_key_or_en|{{{1}}}}}<!-- en | ||
-->{{#vardefine:hero_en|{{{1}}}}}<!-- en | -->{{#vardefine:hero_en|{{{1}}}}}<!-- en | ||
-->}}< | -->}} | ||
<div class="weaponcard-container" style="width:570px; font-family: 'Retail Demo','Open Sans',serif; color:#ffefd7"> | |||
< | <div class="weapon-display" style="width:100%;display:inline-flex; height:150px; overflow:hidden; border-radius:5px 5px 0 0"> | ||
< | <div class="name-stats-container" style="width:auto; display:flex; flex-direction:column; padding:20px 15px; flex-start; gap:5px"> | ||
<div style="font-size:24px">'''{{{weapon_name|{{#invoke:HeroData|get_hero_var|{{#var:hero_key_or_en}}|NameKey|true}}}}}'''</div> | |||
< | <div style="display:flex; gap:10px; min-width: fit-content; flex-wrap: wrap; justify-content: center;"> | ||
< | <div style="padding:3px 5px; border-radius:5px; background:#0000005c; font-weight:600">{{#invoke:HeroData|get_list_elem|{{#var:hero_key_or_en}}|WeaponTypes|1|true}}</div> | ||
{{#if:{{#invoke:HeroData|get_list_elem|{{#var:hero_key_or_en}}|WeaponTypes|2|true}} | |||
|<div style="padding:3px 5px; border-radius:5px; background:#0000005c; font-weight:600"">{{#invoke:HeroData|get_list_elem|{{#var:hero_key_or_en}}|WeaponTypes|2|true}}</div> | |||
</ | |}}<!-- | ||
< | -->{{#if:{{#invoke:HeroData|get_list_elem|{{#var:hero_key_or_en}}|WeaponTypes|3|true}} | ||
< | |<div style="padding:3px 5px; border-radius:5px; background:#0000005c; font-weight:600"">{{#invoke:HeroData|get_list_elem|{{#var:hero_key_or_en}}|WeaponTypes|3|true}}</div> | ||
|}} | |||
</div></div> | |||
<div class="second-half-container" style="flex-grow:1; display:flex; justify-content:flex-end; position:relative"> | |||
<div class="dps-text" style="position:absolute; z-index:2; padding:10px 15px; font-size:15px; font-weight:600">[[File:Bullet_damage.png|20px|link=Damage per second]] <span style="color:#ffefd7;>{{#invoke:HeroData|get_hero_var|{{#var:hero_key_or_en}}|DPS|2}}</span> <span style="color:#ccbca8;">{{#invoke:Lang|get_string|DPS_label}}</span> | |||
</div> | </div> | ||
<div class="falloff-range-container" style="position:absolute; bottom:0; z-index:2; display:flex; flex-direction:column; | |||
background:#0000005c; padding: 0px 10px 5px 10px"> | |||
<div class="falloff-range-text" style="text-transform:uppercase; font-size:12px; font-weight:600; color:#968d7f; font-family: 'Retail Demo','Open Sans',serif;">{{#invoke:Lang|get_string|CitadelHeroStats_Weapon_Falloff}}</div><!-- | |||
--><div class="falloff-range-numbers" style="text-align:center; color:#ffefd7; font-weight:600">{{#ifeq:{{{no_falloff|}}}|true|N/A|{{#invoke:HeroData|get_hero_var|{{#var:hero_key_or_en}}|FalloffStartRange|2}}{{#invoke:Lang|get_string|StatDesc_WeaponRangeFalloffMin_postfix}} ➞ {{#invoke:HeroData|get_hero_var|{{#var:hero_key_or_en}}|FalloffEndRange|2}}{{#invoke:Lang|get_string|StatDesc_WeaponRangeFalloffMax_postfix}}}}</div> | |||
</div> | </div> | ||
<div | <div class="weapon-image" style="width: 100%; position: absolute; height: 100%; box-sizing: border-box; padding: 15px 0 0 15px; display: flex; justify-content: flex-end;">{{#ifexist:File:{{#var:hero_en}} Weapon.png|[[File:{{#var:hero_en}} Weapon.png|320x200px|link=]]|[[File:Placeholder Weapon.png|320x200px|link=]]}} | ||
</div> | |||
</div> | |||
</div> | |||
<div class="notes-box" style="padding:5px 5px 5px 10px; border-radius: 0 0 5px 5px; display:flex; align-items:center;">{{#ifeq:{{{no_description|}}}|true||{{#invoke:HeroData|get_hero_var|{{#var:hero_key_or_en}}|DescKey|true}}}}</div> | |||
|}} | |||
</ | |||
</ | |||
</ | |||
< | |||
</div></includeonly><noinclude>{{Documentation}}</noinclude> | </div></includeonly><noinclude>{{Documentation}}</noinclude> | ||
Revision as of 20:29, 2 April 2026
This template uses CSS found at WeaponCard/styles.css.
Usage
This template displays weapon stats.
Recommended to use key parameter for hero key instead of an unnamed 1st parameter of the english hero name. This allows localizing it to the current language in O(1) time complexity, as opposed to O(N).
Examples
{{WeaponCard|Dynamo}}
{{WeaponCard|key=hero_forge}}
Increases fire rate as the guns spins up
{{WeaponCard|key=hero_forge|weapon_name=Test Weapon}}
Increases fire rate as the guns spins up
{{WeaponCard|key=hero_forge|weapon_name=Test Weapon|no_description=true}}
No description.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| 1 | 1 | no description | Unknown | optional |
| key | key | no description | Unknown | optional |
| ph | ph | no description | Unknown | optional |
| weapon_name | weapon_name | In case the weapon name is different from the files | Unknown | optional |
| no_description | no_description | Remove description
| Boolean | optional |
| no_falloff | no_falloff | Weapons with no damage falloff (Celeste)
| Boolean | optional |