User:Crashaholic/ActionTemplate: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Save improved, added bullet points)
m (Changed redirect target from Template:Action Page to Template:Action page)
Tags: Redirect target changed Visual edit
 
(46 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>{{PageSeo
#REDIRECT [[Template:Action page]]
| description = {{{summary}}}
| image = {{#if: {{{image|}}} | {{{image|}}} | Alert Icon.png}}
}}
__NOTOC__
[[File:{{#if: {{{image|}}} | {{{image|}}} | Alert Icon.png}}|frameless|right]]
{{{summary}}}
 
== Description ==
{{{description}}}
 
== Properties ==
{{trim|{{#if: {{{cost|}}}
    |{{#if: {{#pos: {{{cost|}}}|,}}
        |{{#if: {{trim|{{#explode: {{{cost|}}}|,|0}}}}
        | *{{InfoBlob|{{action|{{#explode: {{{cost|}}}|,|0}}}} + {{#explode: {{{cost|}}}|,|1}}}}
| *{{InfoBlob|{{#explode: {{{cost|}}}|,|1}}}}
}}
|*{{InfoBlob|{{action|{{#explode: {{{cost}}}|,|0}}}}}}
    }}| {{blank}}
}}}}
{{trim|{{#if: {{{concentration|}}} |*{{Concentration}} | {{blank}}}}}}
{{trim|{{#if: {{{damage|}}} |*{{{damage}}}| {{blank}}}}}} <!-- TODO: make this a bit smarter -->
{{trim|{{#if: {{{recharge|}}} |*{{{recharge}}}| {{blank}}}}}} <!-- TODO: make this a bit smarter -->
{{trim|
{{#if: {{{duration|}}}
|{{#ifeq:{{{duration|}}}| LR
|*{{Duration|Until Long Rest}}
|{{#ifeq: {{{duration|}}} |Perm
|*{{Duration|Permanent}}
|*{{Duration|{{{duration}}}}}
}}
}}
|{{blank}}
}}
}}
{{trim|{{#if: {{{range|}}} |*{{{range}}}| {{blank}}}}}} <!-- TODO: make this a bit smarter -->
{{trim|{{#if: {{{aoe|}}} |*{{{aoe}}}| {{blank}}}}}} <!-- TODO: make this a bit smarter -->
{{trim|
{{#if: {{{save|}}}
        {{#vardefine: saveicon | }} {{#vardefine: savetext | }}
{{#vardefine: savetype | {{#if: {{#pos:{{{save|}}}|,}} | {{#explode:{{{save|}}}|,|0}} | {{{save|}}}}}}}
{{#vardefine: saverslt | {{#if: {{#pos:{{{save|}}}|,}} | {{#explode:{{{save|}}}|,|1}} | ""}}}}
| {{#switch: {{lc:{{#var: savetype}}}}
| strength | str =  {{#vardefine: saveicon | Strength}} {{#vardefine: savetext | STR}}
| dexterity | dex  = {{#vardefine: saveicon | Dexterity}} {{#vardefine: savetext | DEX}}
| constitution | con | = {{#vardefine: saveicon | Constitution}} {{#vardefine: savetext | CON}}
| intelligence | int | = {{#vardefine: saveicon | Intelligence}} {{#vardefine: savetext | INT}}
| wisdom | wis  = {{#vardefine: saveicon | Wisdom}} {{#vardefine: savetext | WIS}}
| charisma | cha  = {{#vardefine: saveicon | Charisma}} {{#vardefine: savetext | CHA}}
| #default = {{#vardefine: saveicon |Alert}} {{#vardefine: savetext | EDITOR SHOULD CHECK TEMPLATE}}
}}*{{SmallIcon|Saving Throw Icons.png}} [[File:{{#var: saveicon}} icon.png|frameless|25px|{{#var: saveicon}}]][[{{#var: saveicon}}|{{#var: savetext}}]] [[Saving Throw|Save]] {{#if: {{#pos:{{{save|}}}|,}}
| (On Save: {{#explode:{{{save|}}}|,|1}})
}}| {{blank}}
}}
}}
{{trim|{{#if: {{{additional|}}} | {{{additional}}}| {{blank}}}}}}
 
{{#if: {{{higherlevels|}}} | == At Higher Levels ==}}
{{trim|{{#if: {{{higherlevels|}}} | {{{higherlevels}}}| {{blank}}}}}} <!-- TODO: make this a bit smarter -->
 
{{#if: {{{learns|}}} | == How to Learn ==}}
{{trim|{{#if: {{{learns|}}} | {{{learns|}}}}}}} <!-- TODO: make this a bit smarter -->
 
{{clear}}
{{#if: {{{notes|}}} | == Notes == }}
{{trim|{{#if: {{{notes|}}} | {{{notes}}}| {{blank}}}}}}</includeonly><noinclude>This is a page to transclude to generate action pages. It is generally for pages that do not fit the [[Template:SpellPage | <code><nowiki>{{SpellPage}} Template</nowiki></code>]]
 
If this is too egregious, do reach out to me on Discord and tell me if there are alternatives instead of using transclusion (which I'm trying to use for custom templates).
<!-- im just lazy and tired of copy pasting from other page sources, i just want to lazily type out something PLEASE-->
 
=Usage=
<pre>
{{User:Crashaholic/ActionTemplate
| description =
| image =
| summary =
| cost =
| concentration =
| damage =
| recharge =
| duration =
| range =
| aoe =
| save =
| additional =
| higherlevels =
| learns =
| notes =
}}
</pre>
 
The following is a table to further explain what each parameter takes, and how to use them.
 
{| class="wikitable" style="width: 100%;"
|-
! Parameter Name
! Description
! Usage
|-
| {{C|description}}
| The in-game description of the action. This description is NOT for SEO 'See: summary'.
| <code>description = Lorem ipsum</code>
|-
| {{C|image}}
| The image that will be used in the page's SEO and be the page's main image.<br/>IF THIS IS LEFT EMPTY, [[File:Alert Icon.png]] WILL BE USED INSTEAD!
| <code>image = Wiki_Link_To_Image_Here</code>
|-
| {{C|summary}}
| The summary of the action. This will be used as the wiki's description as well as the SEO text.
| <code>summary = Lorem Ipsum</code>
|-
| {{C|cost}}
| The resource cost of the action. You can use the same parameters as with <code><nowiki>{{action}}</nowiki></code>, but you can add an additional resource to it as well.
For example:
* If a skill takes a <code><nowiki>{{action|bonus}}</nowiki></code> and a [[Battle Master|Superiority Die]] (D8): <code><nowiki>| cost = bonus,[[File:Superiority_Die_d8_Icon.png|25px]]</nowiki></code>
** Result: <code>{{action|bonus}} + [[File:Superiority_Die_d8_Icon.png|25px]]</code>
* If a skill takes an <code><nowiki>{{action}}</nowiki></code>: <code><nowiki>| cost = action</nowiki></code>
** Result: <code>{{action}}</code>
* If a skill takes just a class resource like 2{{User:Tc/Ki}}s: <code><nowiki>| cost = ,2{{User:Tc/Ki}}s</nowiki></code>
** Result: <code>2{{User:Tc/Ki}}s</code>
| <code>cost = (<nowiki>{{action}}</nowiki> parameters), (text)</code><br/>
<code>cost = (<nowiki>{{action}}</nowiki> parameters)</code><br/>
<code>cost = , (text)</code>
|-
| {{C|concentration}}
| If this skill is a concentration, type something here. Can be any value you want. Otherwise, leave it blank or delete the field entirely.
| <code>concentration = This action is a concentration!</code>
<code>concentration=</code>
|}
 
=Example=
<pre>{{User:Crashaholic/ActionTemplate
| description = abc
| image = Fly Icon.png
| summary = fly you fools
| cost = action, 2{{User:Tc/Ki}}s
| damage = {{DamageInfo|1d4+1|Bludgeoning}}
| recharge = {{Recharge|Long Rest}}
| duration = LR
| save = DEX, abc
| additional = * abcd
{{User:Tc/FXBox
| name = Fly
| icon = Fly Icon.png
| effect = go on, fly
| duration = 1
}}
| higherlevels = go far
| notes = bar
| learns = {{class|Monk}} 3
}}
</pre>
{{User:Crashaholic/ActionTemplate
| description = abc
| image = Fly Icon.png
| summary = fly you fools
| cost = action, 2{{User:Tc/Ki}}s
| damage = {{DamageInfo|1d4+1|Bludgeoning}}
| recharge = {{Recharge|Long Rest}}
| duration = LR
| save = DEX, abc
| additional = * abcd
{{User:Tc/FXBox
| name = Fly
| icon = Fly Icon.png
| effect = go on, fly
| duration = 1
}}
| higherlevels = go far
| notes = bar
| learns = {{class|Monk}} 3
}}
</noinclude>

Latest revision as of 21:56, 21 January 2024