Template:ShipInfobox: Difference between revisions

Added an insurance field that should automatically calculate based on cost input
Changed label displayed for data source "fighterhangar" from "Fighter Hangar" to "Fighter Bay" per request.
 
(62 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<onlyinclude>{| class="eInfobox" style="width: 300px;"
<infobox theme="portInfobox">
|-
<title><default>{{PAGENAME}}</default></title>
! colspan="2" style="font-size: 14px; text-align: center;" | {{PAGENAME}}
<image source="image"><default>Placeholder Ship.png</default></image>
|-
<group>
! colspan="2" style="padding: 1px; text-align: center;" | {{#if:{{{image|}}}|[[File:{{{image|Placeholder.png}}}|292px|link=]]|[[File:Placeholder.png|292px|link=]]}}
    <header>Overview</header>
|- {{#if:{{{factionreq|}}}||style="display: none;"}}
    <data source="manufacturer"><label>Manufacturer</label><format>[[{{{manufacturer}}}]]</format></data>
! colspan="2" style="text-align: center; color: #FFFF66;" | Requires {{{factionreq|}}} rank of {{{factionrank|}}} or higher
    <data source="yearsproduced"><label>Years Produced</label></data>
|-
    <data source="type"><label>Type</label></data>
! style="width: 45%;" | Manufacturer
    <data source="cost">
| style="width: 55%;" | {{#if:{{{manufacturer|}}}|[[{{{manufacturer|}}}]]|---}}
        <label>Cost</label>
|-
        <format>{{{cost}}} CR</format>
! Cost
    </data>
| {{#if:{{{cost|}}}|{{{cost|?}}} CR|---}}
    <data source="arx">
|- {{#if:{{{cost|x}}}||style="display: none;"}}
        <label>ARX</label>
! Insurance
        <format>{{{arx}}} ARX</format>
| {{formatnum:{{#expr:trunc({{formatnum:{{{cost|146,969,451}}}|R}}*0.05)}}}}
    </data> 
|-
    <data source="insurance">
! Top Speed
        <label>Insurance</label>
| {{#if:{{{topspeed|}}}|{{{topspeed|?}}} m/s|---}}
        <format>{{{insurance}}} CR</format>
|-
        </data>
! Boost Speed
    <data source="factionreq"><label>Faction</label><format>[[{{{factionreq}}}]]</format></data>
| {{#if:{{{boostspeed|}}}|{{{boostspeed|?}}} m/s|---}}
    <data source="factionrank">
|-
        <label>Faction Rank</label>
! Maneuverability
        <format>{{#if: {{{factionreq|}}} | {{{factionrank}}} }}</format>
| {{#if:{{{maneuverability|}}}|{{{maneuverability|}}}|---}}
    </data>
|-
    <data source="expansionreq"><label>Expansion</label></data>
! Shields
    </group>
| {{#if:{{{shields|}}}|{{{shields|?}}}|---}}
<group>
|-
    <header>Specifications</header>
! Armour
    <data source="landingpad"><label>Landing Pad Size</label></data>
| {{#if:{{{armour|}}}|{{{armour|?}}}|---}}
    <data source="dimensions"><label>Dimensions</label></data>
|-
    <data source="seats"><label>Pilot Seats</label></data>
! Hull Mass
    <data source="multicrew"><label>Multicrew</label></data>
| {{#if:{{{hullmass|}}}|{{{hullmass|?}}} T|---}}
    <data source="fighterhangar"><label>Fighter Bay</label></data>
|- {{#if:{{{cargocapacity|}}}||style="display: none;"}}
    <data source="hullmass"><label>Hull Mass</label><format>{{{hullmass}}} t</format></data>
! Cargo Capacity
    <data source="masslock"><label>Mass Lock Factor</label></data>
| {{#if:{{{cargocapacity|}}}|{{{cargocapacity|?}}} T|---}}
    <data source="armour"><label>Armour</label></data>
|- {{#if:{{{fuelcapacity|}}}||style="display: none;"}}
    <data source="armourhardness"><label>Armour Hardness</label></data>
! Fuel Capacity
    <data source="shields"><label>Shields</label><format>{{{shields}}} MJ</format></data>
| {{#if:{{{fuelcapacity|}}}|{{{fuelcapacity|?}}} T|---}}
    <data source="heatcapacity"><label>Heat Capacity</label></data>
|- {{#if:{{{jumprange|}}}||style="display: none;"}}
    <data source="fuelcapacity"><label>Fuel Capacity</label><format>{{{fuelcapacity}}} t</format></data>
! Jump Range (unladen)
    <data source="scooptimised"><label>SCO Optimised</label></data>
| {{{jumprange|}}} LY
    <data source="manoeuvrability"><label>Manoeuvr-<br/>ability</label></data>
|-
    <data>
! Landing Pad Size
        <label>Top Speed</label>
| {{#if:{{{landingpad|}}}|{{{landingpad|?}}}|---}}
        <default>{{#if: {{{topspeed|}}} | {{{topspeed}}} m/s <abbr title="Default value of an unmodified ship">(''default'')</abbr> <br/> }}{{#if: {{{maxtopspeed|}}} | {{{maxtopspeed}}} m/s <abbr title="Maximum possible value before Engineering">(''upgraded'')</abbr> <br/> }}</default>
|-
    </data>
! Hardpoints
    <data>
| {{#if:{{{utility|}}}|{{{utility}}}x Utility Mount{{#ifexpr:{{{utility|}}}>1|s}}}}{{#if:{{{small|}}}|{{#if:{{{utility|}}}|<br>}}{{{small|}}}x Small Hardpoint{{#ifexpr:{{{small|}}}>1|s}}}}{{#if:{{{medium|}}}|{{#if:{{{utility|}}}or{{{small|}}}|<br>}}{{{medium|}}}x Medium Hardpoint{{#ifexpr:{{{medium|}}}>1|s}}}}{{#if:{{{large|}}}|{{#if:{{{utility|}}}or{{{small|}}}or{{{medium|}}}|<br>}}{{{large|}}}x Large Hardpoint{{#ifexpr:{{{large|}}}>1|s}}}}{{#if:{{{huge|}}}|{{#if:{{{utility|}}}or{{{small|}}}or{{{medium|}}}or{{{large|}}}|<br>}}{{{huge|}}}x Huge Hardpoint{{#ifexpr:{{{huge|}}}>1|s}}}}
        <label>Boost Speed</label>
|-
        <default>{{#if: {{{boostspeed|}}} | {{{boostspeed}}} m/s <abbr title="Default value of an unmodified ship">(''default'')</abbr> <br/> }}{{#if: {{{maxboostspeed|}}} | {{{maxboostspeed}}} m/s <abbr title="Maximum possible value before Engineering">(''upgraded'')</abbr> <br/> }}</default>
! Internals
    </data>
| {{#if:{{{size1|}}}|{{{size1|}}}x Size 1 Compartment{{#ifexpr:{{{size1|}}}>1|s}}}}{{#if:{{{size2|}}}|{{#if:{{{size1|}}}|<br>}}{{{size2|}}}x Size 2 Compartment{{#ifexpr:{{{size2|}}}>1|s}}}}{{#if:{{{size3|}}}|{{#if:{{{size1|}}}or{{{size2|}}}|<br>}}{{{size3|}}}x Size 3 Compartment{{#ifexpr:{{{size3|}}}>1|s}}}}{{#if:{{{size4|}}}|{{#if:{{{size1|}}}or{{{size2|}}}or{{{size3|}}}|<br>}}{{{size4|}}}x Size 4 Compartment{{#ifexpr:{{{size4|}}}>1|s}}}}{{#if:{{{size5|}}}|{{#if:{{{size1|}}}or{{{size2|}}}or{{{size3|}}}or{{{size4|}}}|<br>}}{{{size5|}}}x Size 5 Compartment{{#ifexpr:{{{size5|}}}>1|s}}}}{{#if:{{{size6|}}}|{{#if:{{{size1|}}}or{{{size2|}}}or{{{size3|}}}or{{{size4|}}}or{{{size5|}}}|<br>}}{{{size6|}}}x Size 6 Compartment{{#ifexpr:{{{size6|}}}>1|s}}}}{{#if:{{{size7|}}}|{{#if:{{{size1|}}}or{{{size2|}}}or{{{size3|}}}or{{{size4|}}}or{{{size5|}}}or{{{size6|}}}|<br>}}{{{size7|}}}x Size 7 Compartment{{#ifexpr:{{{size7|}}}>1|s}}}}{{#if:{{{size8|}}}|{{#if:{{{size1|}}}or{{{size2|}}}or{{{size3|}}}or{{{size4|}}}or{{{size5|}}}or{{{size6|}}}or{{{size7|}}}|<br>}}{{{size8|}}}x Size 8 Compartment{{#ifexpr:{{{size8|}}}>1|s}}}}
    <data>
|- {{#if:{{{modules|}}}||style="display: none;"}}
        <label>Unladen Jump Range</label>
! Modules
        <default>{{#if: {{{jumprange|}}} | {{{jumprange}}} ly <abbr title="Default value of an unmodified ship">(''default'')</abbr> <br/> }}{{#if: {{{maxjumprange|}}} | {{{maxjumprange}}} ly <abbr title="Maximum possible value before Engineering and Guardian FSD Booster">(''upgraded'')</abbr> <br/> }}</default>
| {{{modules|}}}
    </data>
|-
    <data>
| colspan="2" style="font-size: 10px;" | *Information represents the default version of the ship.
        <label>Cargo Capacity</label>
|-
        <default>{{#if: {{{cargocapacity|}}} | {{{cargocapacity}}} t <abbr title="Default value of an unmodified ship">(''default'')</abbr> <br/> }}{{#if: {{{maxcargocapacity|}}} | {{{maxcargocapacity}}} t <abbr title="Maximum possible value">(''max'')</abbr> <br/> }}</default>
|}<includeonly>
    </data>
[[Category:Ships]]
    </group>
</includeonly></onlyinclude>
    <group>
<noinclude>
        <header>Outfitting</header>
<pre style="width: 300px">
    <data>
        <label>Hardpoints</label>
        <default>{{#if: {{{utility|}}} | {{{utility}}}× Utility {{plural: {{{utility}}} | Mount | Mounts}} <br/> }}{{#if: {{{small|}}} | {{{small}}}× Small {{plural: {{{small}}} | Hardpoint | Hardpoints}} <br/> }}{{#if: {{{medium|}}} | {{{medium}}}× Medium {{plural: {{{medium}}} | Hardpoint | Hardpoints}} <br/> }}{{#if: {{{large|}}} | {{{large}}}× Large {{plural: {{{large}}} | Hardpoint | Hardpoints}} <br/> }}{{#if: {{{huge|}}} | {{{huge}}}× Huge {{plural: {{{huge}}} | Hardpoint | Hardpoints}} <br/> }}</default>
        </data>
    <data source="reservedhp"><label>Reserved Hardpoints</label>
    </data>
    <data><label>Internal Compartments</label>
        <default>{{#if: {{{size1|}}} | {{{size1}}}× Class 1 {{plural: {{{size1}}} | Compartment | Compartments}} <br/> }}{{#if: {{{size2|}}} | {{{size2}}}× Class 2 {{plural: {{{size2}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size3|}}} | {{{size3}}}× Class 3 {{plural: {{{size3}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size4|}}} | {{{size4}}}× Class 4 {{plural: {{{size4}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size5|}}} | {{{size5}}}× Class 5 {{plural: {{{size5}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size6|}}} | {{{size6}}}× Class 6 {{plural: {{{size6}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size7|}}} | {{{size7}}}× Class 7 {{plural: {{{size7}}} | Compartment | Compartments }} <br/> }}{{#if: {{{size8|}}} | {{{size8}}}× Class 8 {{plural: {{{size8}}} | Compartment | Compartments }} <br/> }}</default>
    </data>
    <data source="reservedic"><label>Reserved Compartments</label>
    </data>
    </group>
</infobox><includeonly>{{#if: {{NAMESPACE}} || [[Category:Ships]]}}</includeonly><noinclude>
Example usage:<pre>
{{ShipInfobox
{{ShipInfobox
| image               =  
| image           =  
| manufacturer        =  
| manufacturer     =
| cost                =  
| yearsproduced    =
| topspeed           =  
| type            =
| boostspeed         =  
| cost            =
| maneuverability     =  
| arx              =
| shields            =  
| insurance       =  
| armour              =  
| factionreq      =
| hullmass            =  
| factionrank      =
| cargocapacity       =  
| expansionreq    =
| fuelcapacity       =  
| landingpad      =
| jumprange          =  
| dimensions      =  
| landingpad          =  
| seats           =  
| utility             =  
| multicrew        =
| small               =  
| fighterhangar    =
| medium             =  
| hullmass        =
| large               =  
| masslock        =
| huge               =  
| armour          =
| size1               =  
| armourhardness  =
| size2               =  
| shields         =  
| size3               =  
| heatcapacity     =  
| size4               =  
| fuelcapacity    =
| size5               =  
| scooptimised    =
| size6               =  
| manoeuvrability  =  
| size7               =  
| topspeed        =  
| size8               =  
| maxtopspeed      =  
| boostspeed       =  
| maxboostspeed    =
| jumprange       =  
| maxjumprange    =
| cargocapacity    =  
| maxcargocapacity =  
| utility         =  
| small           =  
| medium           =  
| large           =  
| huge             =
| reservedhp      =  
| size1           =  
| size2           =  
| size3           =  
| size4           =  
| size5           =  
| size6           =  
| size7           =  
| size8           =
| reservedic      =  
}}
}}
</pre>
</pre>[[Category:Infobox templates|{{PAGENAME}}]]
 
Add following text for faction requirements:
<pre style="width: 300px">
| factionreq          =
| factionrank        =
</pre>
</noinclude>
</noinclude>