Difference between revisions of "Template:Recipe draw/sandbox"
From Captain of Industry Wiki
(14 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
** Clear variables in case of multiple uses on one page ** | ** Clear variables in case of multiple uses on one page ** | ||
Line 7: | Line 6: | ||
-->{{#vardefine: accepts | no}}<!-- | -->{{#vardefine: accepts | no}}<!-- | ||
-->{{#vardefine: provides | no}}<!-- | -->{{#vardefine: provides | no}}<!-- | ||
-->{{#vardefine: special_output | no}}<!-- | |||
** Set up variables to specify desired settings and reuse code ** | ** Set up variables to specify desired settings and reuse code ** | ||
Line 16: | Line 16: | ||
-->{{#vardefine: imgsz_reg | 48x48px }}<!-- | -->{{#vardefine: imgsz_reg | 48x48px }}<!-- | ||
** List of pollution: must input in small latter ** | |||
-->{{#vardefine: pollution_1 | air pollution }}<!-- | |||
-->{{#vardefine: pollution_2 | water pollution }}<!-- | |||
-->{{#vardefine: pollution_3 | }}<!-- | |||
-->{{#vardefine: pollution_4 | }}<!-- | |||
** Apply style ** | |||
--><templatestyles src="Template:Recipe draw/styles.css" /><!-- | |||
--><div class="recipe-wrapper {{#if: {{{Unreleased|}}} | unreleased_border}}"><!-- | --><div class="recipe-wrapper {{#if: {{{Unreleased|}}} | unreleased_border}}"><!-- | ||
** Special output for when `Mining = yes` ** | ** Special output for when `Mining = yes` ** | ||
-->{{# | -->{{#ifeq: {{lc:{{{Input1Name|}}}}} | mining |<!-- | ||
--><div class="block">[[File:Mining.png{{!}}{{#var: imgsz_large}}{{!}}link=Mining]]</div><!-- | --><div class="block">[[File:Mining.png{{!}}{{#var: imgsz_large}}{{!}}link=Designations#Mining]]</div><!-- | ||
--><div class="block">{{#var: img_arrow}}</div><!-- | --><div class="block">{{#var: img_arrow}}</div><!-- | ||
--><div class="block">[[File:{{{Output1Name}}}.png{{!}}{{#var: imgsz_large}}{{!}}link={{{Output1Name}}}]]</div><!-- | --><div class="block">[[File:{{{Output1Name}}}.png{{!}}{{#var: imgsz_large}}{{!}}link={{{Output1Name}}}]]</div><!-- | ||
-->{{#vardefine: special_output | yes}}<!-- | |||
-->}}<!-- | -->}}<!-- | ||
** Special output for when `Dumping = yes` ** | ** Special output for when `Dumping = yes` ** | ||
-->{{# | -->{{#ifeq: {{lc:{{{Output1Name|}}}}} | dumping |<!-- | ||
--><div class="block">[[File:{{{Input1Name}}}.png{{!}}{{#var: imgsz_large}}{{!}}link={{{Input1Name}}}]]</div><!-- | --><div class="block">[[File:{{{Input1Name}}}.png{{!}}{{#var: imgsz_large}}{{!}}link={{{Input1Name}}}]]</div><!-- | ||
--><div class="block">{{#var: img_arrow}}</div><!-- | --><div class="block">{{#var: img_arrow}}</div><!-- | ||
--><div class="block">[[File:Dumping.png{{!}}{{#var: imgsz_large}}{{!}}link=Dumping]]</div><!-- | --><div class="block">[[File:Dumping.png{{!}}{{#var: imgsz_large}}{{!}}link=Designations#Dumping]]</div><!-- | ||
-->{{#vardefine: special_output | yes}}<!-- | |||
-->}}<!-- | -->}}<!-- | ||
** Stop output if | ** Stop output if we drew Mining or Dumping ** | ||
-->{{# | -->{{#ifeq: {{#var: special_output}} | no |<!-- | ||
** Check if Template:Infobox_machine already knows the building. If not, try the `Building` param. ** | ** Check if Template:Infobox_machine already knows the building. If not, try the `Building` param. ** | ||
Line 48: | Line 60: | ||
-->}}<!-- | -->}}<!-- | ||
-->}}<!-- | -->}}<!-- | ||
** Determine if we should display the "PROVIDES" or "ACCEPTS" text in the output ** | |||
-->{{#if: {{{Input1Name|}}}{{{Input2Name|}}}{{{Input3Name|}}}{{{Input4Name|}}}{{{Input5Name|}}}{{{Input6Name|}}} || {{#vardefine: provides | yes}} }} <!-- | |||
-->{{#vardefine: combined_output | {{lc:{{{Output1Name|}}}{{{Output2Name|}}}{{{Output3Name|}}}{{{Output4Name|}}}{{{Output5Name|}}}{{{Output6Name|}}} }} }}<!-- | |||
-->{{#ifeq: <!-- | |||
-->{{#expr: <!-- | |||
--> {{#ifeq: {{#var: combined_output}} | {{#var: pollution_1}} | 1 | 0 }} <!-- | |||
--> or {{#ifeq: {{#var: combined_output}} | {{#var: pollution_2}} | 1 | 0 }} <!-- | |||
--> or {{#ifeq: {{#var: combined_output}} | {{#var: pollution_3}} | 1 | 0 }} <!-- | |||
--> or {{#ifeq: {{#var: combined_output}} | {{#var: pollution_4}} | 1 | 0 }} <!-- | |||
--> or {{#ifeq: {{#var: combined_output}} | | 1 | 0 }} <!-- | |||
-->}} | 1 | <!-- | |||
-->{{#vardefine: accepts| yes}} | <!-- | |||
-->}} <!-- | |||
** Main sequence starts here ** | ** Main sequence starts here ** | ||
-->{{#ifeq: {{#var: bldg}} | none ||<!-- | -->{{#ifeq: {{#var: bldg}} | none ||<!-- | ||
** Draw the building (and colon) unless the user or Template:Infobox_machine set it to hidden. ** | ** Draw the building (and colon) unless the user or Template:Infobox_machine set it to hidden. ** | ||
Line 81: | Line 93: | ||
-->{{#ifeq: {{#var: provides}} | yes | <div class="block accepts-provides">PROVIDES</div> }}<!-- | -->{{#ifeq: {{#var: provides}} | yes | <div class="block accepts-provides">PROVIDES</div> }}<!-- | ||
** Draw | ** Draw outputs except pollution if {{#var: provides}} is `yes`. ** | ||
** Draw input unless {{#var: provides}} is `yes`. ** | |||
** Draw | |||
-->{{#ifeq: {{#var: provides}} | yes |<!-- | -->{{#ifeq: {{#var: provides}} | yes |<!-- | ||
-->{{Recipe item | Name = {{{Output1Name|}}} | Quantity = {{{Output1Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output1Unit|}}} | Pollution = hide }}<!-- | |||
-->{{Recipe item | Name = {{{Output2Name|}}} | Quantity = {{{Output2Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output2Unit|}}} | Pollution = hide | Plus = yes }}<!-- | |||
-->{{Recipe item | Name = {{{Output3Name|}}} | Quantity = {{{Output3Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output3Unit|}}} | Pollution = hide | Plus = yes }}<!-- | |||
-->{{ | -->{{Recipe item | Name = {{{Output4Name|}}} | Quantity = {{{Output4Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output4Unit|}}} | Pollution = hide | Plus = yes }}<!-- | ||
-->{{Recipe item | Name = {{{Output5Name|}}} | Quantity = {{{Output5Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output5Unit|}}} | Pollution = hide | Plus = yes }}<!-- | |||
-->{{Recipe item | Name = {{{Output6Name|}}} | Quantity = {{{Output6Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output6Unit|}}} | Pollution = hide | Plus = yes }}<!-- | |||
-->|<!-- | |||
-->{{Recipe item | Name = {{{Input1Name|}}} | Quantity = {{{Input1Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input1Unit|}}} }} <!-- | |||
-->{{Recipe item | Name = {{{Input2Name|}}} | Quantity = {{{Input2Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input2Unit|}}} | Plus = yes }}<!-- | |||
-->{{Recipe item | Name = {{{Input3Name|}}} | Quantity = {{{Input3Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input3Unit|}}} | Plus = yes }}<!-- | |||
-->{{Recipe item | Name = {{{Input4Name|}}} | Quantity = {{{Input4Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input4Unit|}}} | Plus = yes }}<!-- | |||
-->{{Recipe item | Name = {{{Input5Name|}}} | Quantity = {{{Input5Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input5Unit|}}} | Plus = yes }}<!-- | |||
-->{{Recipe item | Name = {{{Input6Name|}}} | Quantity = {{{Input6Qty|}}} | Time = {{{Time|}}} | Unit = {{{Input6Unit|}}} | Plus = yes }}<!-- | |||
-->{{ | |||
-->{{ | |||
--> | |||
-->{{ | |||
-->{{ | |||
-->{{ | |||
-->}}<!-- | -->}}<!-- | ||
** Draw the recipe times unless it has a unit defined (KW, MW, etc). ** | ** Draw the recipe times unless it has a unit defined (KW, MW, etc). ** | ||
Line 268: | Line 124: | ||
-->{{#ifeq: {{lc:{{{Time}}}}} | <!-- instant --> 0 | <div>{{#var: img_arrow}}</div> |<!-- | -->{{#ifeq: {{lc:{{{Time}}}}} | <!-- instant --> 0 | <div>{{#var: img_arrow}}</div> |<!-- | ||
--><div class="upper"><!-- | --><div class="upper"><!-- | ||
-->{{#ifeq: {{#var: provides}} | yes | | -->{{#ifeq: {{#var: provides}} | yes | / }}<!-- | ||
-->{{#ifeq: {{#var: accepts}} | yes | / }}<!-- | |||
-->{{{Time}}} [[File:Clock.png|link=Time|16x16px]]<!-- | -->{{{Time}}} [[File:Clock.png|link=Time|16x16px]]<!-- | ||
--></div><!-- | --></div><!-- | ||
--><div><!-- | --><div><!-- | ||
-->{{#ifeq: {{#var: provides}} | yes | | -->{{#ifeq: {{#var: provides}} | yes | <br/> |<!-- | ||
-->{{#ifeq: {{#var: accepts}} | yes | <br/> |<!-- | |||
-->{{#ifeq: {{#var: accepts}} | yes | | |||
-->{{#var: img_arrow}}<!-- | -->{{#var: img_arrow}}<!-- | ||
-->}}<!-- | -->}}<!-- | ||
Line 286: | Line 136: | ||
--></div><!-- | --></div><!-- | ||
--><div class="lower blue"><!-- | --><div class="lower blue"><!-- | ||
-->{{#ifeq: {{#var: provides}} | yes | | -->{{#ifeq: {{#var: provides}} | yes | / }}<!-- | ||
-->{{#ifeq: {{#var: accepts}} | yes | / }}<!-- | |||
-->60 [[File:Clock 60s.png|link=Time|16x16px]]<!-- | -->60 [[File:Clock 60s.png|link=Time|16x16px]]<!-- | ||
--></div><!-- | --></div><!-- | ||
Line 300: | Line 144: | ||
-->}}<!-- | -->}}<!-- | ||
** Draw outputs unless {{#var: provides}} is `yes` ** | |||
** Draw outputs except pollution unless {{#var: provides}} is `yes` ** | |||
-->{{#ifeq: {{#var: provides}} | yes ||<!-- | -->{{#ifeq: {{#var: provides}} | yes ||<!-- | ||
-->{{Recipe item | Name = {{{Output1Name|}}} | Quantity = {{{Output1Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output1Unit|}}} | Pollution = hide }}<!-- | |||
-->{{Recipe item | Name = {{{Output2Name|}}} | Quantity = {{{Output2Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output2Unit|}}} | Pollution = hide | Plus = yes }}<!-- | |||
-->{{Recipe item | Name = {{{Output3Name|}}} | Quantity = {{{Output3Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output3Unit|}}} | Pollution = hide | Plus = yes }}<!-- | |||
-->{{Recipe item | Name = {{{Output4Name|}}} | Quantity = {{{Output4Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output4Unit|}}} | Pollution = hide | Plus = yes }}<!-- | |||
-->{{Recipe item | Name = {{{Output5Name|}}} | Quantity = {{{Output5Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output5Unit|}}} | Pollution = hide | Plus = yes }}<!-- | |||
-->{{Recipe item | Name = {{{Output6Name|}}} | Quantity = {{{Output6Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output6Unit|}}} | Pollution = hide | Plus = yes }}<!-- | |||
-->}}<!-- | |||
** Draw vertical line and pollution if pollution exists ** | |||
-->{{#vardefine: all_pollutions |<!-- | |||
-->{{Recipe item | Name = {{{Output1Name|}}} | Quantity = {{{Output1Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output1Unit|}}} | Pollution = only }}<!-- | |||
-->{{Recipe item | Name = {{{Output2Name|}}} | Quantity = {{{Output2Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output2Unit|}}} | Pollution = only }}<!-- | |||
-->{{Recipe item | Name = {{{Output3Name|}}} | Quantity = {{{Output3Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output3Unit|}}} | Pollution = only }}<!-- | |||
-->{{Recipe item | Name = {{{Output4Name|}}} | Quantity = {{{Output4Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output4Unit|}}} | Pollution = only }}<!-- | |||
-->{{Recipe item | Name = {{{Output5Name|}}} | Quantity = {{{Output5Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output5Unit|}}} | Pollution = only }}<!-- | |||
-->{{Recipe item | Name = {{{Output6Name|}}} | Quantity = {{{Output6Qty|}}} | Time = {{{Time|}}} | Unit = {{{Output6Unit|}}} | Pollution = only }}<!-- | |||
-->}}<!-- | |||
-->{{#if: {{#var: all_pollutions}} |<!-- | |||
--> <!-- | |||
--><div style="display: inline-block; | |||
vertical-align: middle; | |||
min-height: 90px; | |||
border-left: 2px solid #6d6d6d; | |||
margin-right: 11px" | |||
--></div><!-- | |||
-->{{#var: all_pollutions}}<!-- | |||
-->}}<!-- | |||
-->}}<!-- End of building check | |||
-->}}<!-- End of Mining/Dumping check | |||
-->{{#if: {{{Unreleased|}}} | <div class="unreleased_label">UNRELEASED</div> }}<!-- Big ol' label for unreleased content | |||
--></div></includeonly><noinclude> | |||
{{Recipe draw/sandbox | |||
| Input1Name = Mining | |||
| Output1Name = Copper Ore | |||
}} | |||
{{Recipe draw/sandbox | |||
| Output1Name = Dumping | |||
| Input1Name = Rock | |||
}} | |||
{{Recipe draw/sandbox | |||
| Building = Rotary Kiln | |||
| Input1Name = Limestone | |||
| Input1Qty = 12 | |||
| Input2Name = Coal | |||
| Input2Qty = 2 | |||
| Time = 10 | |||
| Output1Name = Cement | |||
| Output1Qty = 4 | |||
| Output2Name = Exhaust | |||
| Output2Qty = 8 | |||
}} | |||
{{Recipe draw/sandbox | |||
| Building = Air Separator | |||
| Time = 20 | |||
| Output1Name = Oxygen | |||
| Output1Qty = 12 | |||
| Output2Name = Nitrogen | |||
| Output2Qty = 12 | |||
}} | |||
{{Recipe draw/sandbox | |||
| Building = Smoke Stack | |||
| Input1Name = Oxygen | |||
| Input1Qty = 200 | |||
| Time = 20 | |||
}} | |||
{{Recipe draw/sandbox | |||
| Building = Liquid Dump | |||
| Input1Name = Waste Water | |||
| Input1Qty = 2 | |||
| Time = 2 | |||
| Output1Name = Water Pollution | |||
| Output1Qty = 2 | |||
}} | |||
{{Recipe draw/sandbox | |||
| Building = Low-pressure Turbine | |||
| Input1Name = Steam Lo | |||
| Input1Qty = 4 | |||
| Time = 5 | |||
| Output1Name = Mechanical Power | |||
| Output1Qty = 1 | |||
| Output1Unit = MW | |||
| Output2Name = Steam Depleted | |||
| Output2Qty = 4 | |||
}} | |||
{{Recipe draw/sandbox | |||
| Building = Power Generator | |||
| Input1Name = Mechanical Power | |||
| Input1Qty = 500 | |||
| Input1Unit = KW | |||
| Time = 0 | |||
| Output1Name = Electricity | |||
| Output1Qty = 250 | |||
| Output1Unit = KW | |||
}} | |||
{{Recipe draw/sandbox | |||
| Building = Waste Sorting Plant | |||
| Time = 20 | |||
| Input1Name = Recyclables | |||
| Input1Qty = 48 | |||
| Output1Name = Iron Scrap | |||
| Output1Unit = ? | |||
| Output2Name = Copper Scrap | |||
| Output2Unit = ? | |||
| Output3Name = Gold Scrap | |||
| Output3Unit = ? | |||
| Output4Name = Broken Glass | |||
| Output4Unit = ? | |||
}} | |||
{{Recipe draw/sandbox | |||
| Building = Exhaust Scrubber | |||
| Input1Name = Exhaust | |||
| Input1Qty = 30 | |||
| Input2Name = Water | |||
| Input2Qty = 4 | |||
| Time = 10 | |||
| Output1Name = Sulfur | |||
| Output1Qty = 1 | |||
| Output2Name = Carbon Dioxide | |||
| Output2Qty = 12 | |||
| Output3Name = Steam Lo | |||
| Output3Qty = 4 | |||
| Output4Name = Air Pollution | |||
| Output4Qty = 4 | |||
}} | |||
{{Recipe draw/sandbox | |||
| Building = Mixer | |||
| HideBldg = yes | |||
| Input1Name = Sand | |||
| Input1Qty = 18 | |||
| Input2Name = Limestone | |||
| Input2Qty = 4 | |||
| Input3Name = Salt | |||
| Input3Qty = 4 | |||
| Time = 20 | |||
| Output1Name = Glass Mix | |||
| Output1Qty = 14 | |||
}} | |||
{{Recipe draw/sandbox | |||
| Building = Air Separator | |||
| Time = 20 | |||
| Output1Name = Oxygen | |||
| Output1Qty = 12 | |||
| Output2Name = Nitrogen | |||
| Output2Qty = 12 | |||
| Output3Name = Water Pollution | |||
| Output3Qty = -1 | |||
| Unreleased = yes | |||
}} | |||
{{Recipe draw/sandbox | |||
| Building = | |||
| Time = 20 | |||
| Output1Name = Oxygen | |||
| Output1Qty = 12 | |||
| Output2Name = Nitrogen | |||
| Output2Qty = 12 | |||
}} | |||
</noinclude> |