Template:WeaponCard: Difference between revisions

From The Deadlock Wiki
Jump to navigation Jump to search
QuinnBinn (talk | contribs)
m Fonts
removing inline css because we have templatestyles now!
 
(43 intermediate revisions by 9 users not shown)
Line 1: Line 1:
<onlyinclude>
<includeonly><!--
<div style="display:inline-block; margin: 15px 10px 15px 0px; max-width:650px;">
-->{{#if: {{{key|}}} |<!-- If key is provided
{|- style="text-align:center; background-image: linear-gradient(#180E02, #30220C); border-collapse:collapse; font-size: 16px; font-family: 'PT Serif','Palatino','Georgia',serif;"
-->{{#vardefine:hero_key_or_en|{{{key}}}}}<!-- key
| style="width:350px; color:#CDBFAB; font-family: 'Retail Demo';" | {{#invoke:Lang|get_string|CitadelHeroStats_Weapon}}
-->{{#vardefine:hero_en|{{#invoke:Lang|get_string|{{{key}}}|lang_code_override=en}}}}<!-- en
| rowspan="3" style="bottom:50px;" | <div style="display:inline-block; position:relative;">[[File:{{{1|Abrams}}} Weapon.png|320x200px|link=]] <div style="position:absolute; bottom:0px; right:0px;><div style="position:relative; color:#FFEFD7;">
-->|<!-- If key is not provided, use {{{1}}} and assume its in english where it will be re-localized to current language in called functions
{|- style="background-color:rgba(0, 0, 0, 0.4); width:120px"
-->{{#vardefine:hero_key_or_en|{{{1}}}}}<!-- en
|colspan="2" style="font-family:'Retail Demo'; |{{#invoke:Lang|get_string|CitadelHeroStats_Weapon_Falloff}}
-->{{#vardefine:hero_en|{{{1}}}}}<!-- en
|-
-->}}
|style="font-family:'Retail Demo'; font-weight:bold; font-size:14px;"|{{#invoke:HeroData|get_hero_var|{{{1|Abrams}}}|FalloffStartRange|2}}{{#invoke:Lang|get_string|StatDesc_WeaponRangeFalloffMin_postfix}} - {{#invoke:HeroData|get_hero_var|{{{1|Abrams}}}|FalloffEndRange|2}}{{#invoke:Lang|get_string|StatDesc_WeaponRangeFalloffMax_postfix}}
<div class="weaponcard-container">
|}
<div class="weapon-display">
<div class="name-stats-container">
<div class="weapon-name">'''{{{weapon_name|{{#invoke:HeroData|get_hero_var|{{#var:hero_key_or_en}}|NameKey|true}}}}}'''</div>
<div class="weapon-type-container">
{{#if:{{#invoke:HeroData|get_list_elem|{{#var:hero_key_or_en}}|WeaponTypes|1|true}}
|<div class="weapon-type">{{#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 class="weapon-type">{{#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 class="weapon-type">{{#invoke:HeroData|get_list_elem|{{#var:hero_key_or_en}}|WeaponTypes|3|true}}</div>
|}}
</div></div>
<div class="second-half-container">
<div class="dps-text">[[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 class="falloff-range-container">
<div class="falloff-range-text">{{#invoke:Lang|get_string|CitadelHeroStats_Weapon_Falloff}}</div><!--
--><div class="falloff-range-numbers">{{#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 class="weapon-image">{{#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>
<div style="position:absolute; top:0px; right:5px; ><div style="position:relative; color:#FFEFD7; font-family:'Retail Demo'; font-weight:bold; font-size:14px;">{{Icon/Brown|[[File:Damage.png|20px|link=Damage per second]]|{{#invoke:HeroData|get_hero_var|{{{1|Abrams}}}|DPS|2}} {{#invoke:Lang|get_string|DPS_label}}}}</div> </div>
</div>
</div>
|-
<div class="notes-box">{{#ifeq:{{{no_description|}}}|true||{{#invoke:HeroData|get_hero_var|{{#var:hero_key_or_en}}|DescKey|true}}}}</div>
| style="text-align:center; font-family: 'Retail Demo'; font-weight:bold; color:#FFEFD7; height:20px; font-size:25px; line-height:8px;" | {{#invoke:HeroData|get_hero_var|{{{1|Abrams}}}|WeaponName|true}}
</div></includeonly><templatestyles src="WeaponCard/styles.css"/><noinclude>{{Documentation}}</noinclude>
|-
|
{| style="text-align:center; color:#FFEFD7; font-family:'Retail Demo'; font-weight:bold; font-size:15px; background-color:#1B160C; border-radius:15px; margin:auto;"
| <span style="margin-left:5px">{{#invoke:HeroData|get_list_elem|{{{1|Abrams}}}|WeaponTypes|1|true}}</span>
| style="background-color:rgba(0, 0, 0, 0); width:20px;"|
| {{#invoke:HeroData|get_list_elem|{{{1|Abrams}}}|WeaponTypes|2|true}}
{{#if:{{#invoke:HeroData|get_list_elem|{{{1|Abrams}}}|WeaponTypes|3|true}}
|<td style="background-color:rgba(0, 0, 0, 0); width:20px;"></td>
<td> <span style="margin-right:5px">{{#invoke:HeroData|get_list_elem|{{{1|Abrams}}}|WeaponTypes|3|true}}</span></td>
|}}
|}
|-
| colspan="2" style="background-color:#4A3617; color:#FFEFD7; height:40px; font-family:'Retail Demo'; font-size:14px; text-align:left;"> |<span style="margin-left:10px;">{{#invoke:HeroData|get_hero_var|{{{1|Abrams}}}|WeaponDescription|true}}</span>
|}
</div></onlyinclude>
{{WeaponCard|Dynamo}}
{{WeaponCard|McGinnis}}

Latest revision as of 11:14, 11 April 2026

Template documentation [view] [edit] [history] [purge]
CSS3 logo.svg
This template uses CSS found at WeaponCard/styles.css.

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

[edit source]
{{WeaponCard|Dynamo}}
The Vonnegun
Medium Range
Heavy Hitter
Projectile
48 Damage Per Second
Falloff Range
20m ➞ 58m
{{WeaponCard|key=hero_forge}}
Services Rendered
Rapid Fire
Medium Range
72 Damage Per Second
Falloff Range
20m ➞ 58m
Increases fire rate as the guns spins up
{{WeaponCard|key=hero_forge|weapon_name=Test Weapon}}
Test Weapon
Rapid Fire
Medium Range
72 Damage Per Second
Falloff Range
20m ➞ 58m
Increases fire rate as the guns spins up
{{WeaponCard|key=hero_forge|weapon_name=Test Weapon|no_description=true}}
Test Weapon
Rapid Fire
Medium Range
72 Damage Per Second
Falloff Range
20m ➞ 58m

No description.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
11

no description

Unknownoptional
keykey

no description

Unknownoptional
phph

no description

Unknownoptional
weapon_nameweapon_name

In case the weapon name is different from the files

Unknownoptional
no_descriptionno_description

Remove description

Default
true
Booleanoptional
no_falloffno_falloff

Weapons with no damage falloff (Celeste)

Default
true
Booleanoptional