User:FourGreenFields/Row: Difference between revisions
From Official Barotrauma Wiki
(added doc + examples of how to color table cells based on the values & how we can calculate dps.) |
(Calculating background rgb based on the dps value) |
||
Line 1: | Line 1: | ||
<noinclude>{{User:FourGreenFields/doc}}</noinclude><includeonly><onlyinclude> | <noinclude>{{User:FourGreenFields/doc}}</noinclude><includeonly><onlyinclude> | ||
|- | |- {{#vardefine:TotalDamage|{{AmmoBoxDamage|{{{name|}}}}}}} {{#vardefine:DPS|{{#expr:{{#var:TotalDamage}}*{{{attackspeed}}}}}}}<!-- Reusing a template that sums all combat damage of an item (like lacerations, gunshotwound, bleeding etc.) --> | ||
| style="text-align:center;" | [[File:{{#replace:{{{name}}}|&#39;|'}}.png|x50px]] <br> [[{{#replace:{{{name}}}|&#39;|'}}]] | | style="text-align:center;" | [[File:{{#replace:{{{name}}}|&#39;|'}}.png|x50px]] <br> [[{{#replace:{{{name}}}|&#39;|'}}]] | ||
| style="background-color:{{#ifexpr:{{{attackspeed|}}}>=1|{{#ifexpr:{{{attackspeed|}}}=1|blue|green}}|red}}" | {{{attackspeed}}} | | style="background-color:{{#ifexpr:{{{attackspeed|}}}>=1|{{#ifexpr:{{{attackspeed|}}}=1|blue|green}}|red}}" | {{{attackspeed}}} | ||
Line 48: | Line 48: | ||
-->|}} | -->|}} | ||
| {{#if:{{{penetration|}}}|{{{penetration}}}%}} | | {{#if:{{{penetration|}}}|{{{penetration}}}%}} | ||
| {{#if:{{{severlimbsprobability|}}}|{{{severlimbsprobability|}}}% | | {{#if:{{{severlimbsprobability|}}}|{{{severlimbsprobability|}}}%}}<!-- | ||
-->{{#expr:{{#var: | -->{{#vardefine:Red| {{#expr:200-({{#var:DPS}})*4}} }}<!-- Red = 200 - (DPS * 4) | ||
-->{{#vardefine:Green| {{#expr:{{#var:DPS}}*4}} }}<!-- Green = DPS * 4 | |||
125 green is the highest possible so that it doesn't blind you when it maxes out --> | |||
| style="background-color:rgb({{#var:Red}}, {{#ifexpr:{{#var:Green}}>125|125|{{#var:Green}}}}, 0)" | {{#var:DPS}}</onlyinclude></includeonly> |
Revision as of 10:44, 19 April 2023
Trying to figure out how to do conditional formatting with this
Sub Templates
Template in use
Melee
weapontype
defined asmelee
.
{{User:FourGreenFields|tabletype=melee}}
Weapon | Attack Speed | Afflictions | Penetration | Severance Chance |
DPS
Error: No field named "bluntforcetrauma" found for the database table "Items".
|
---|
The above documentation is transcluded from User:FourGreenFields/Row/doc. (edit | history)