User:Crashaholic/ActionTemplate: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
m (added more towards costs)
m (Changed redirect target from Template:Action Page to Template:Action page)
Tags: Redirect target changed Visual edit
 
(44 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>{{PageSeo
#REDIRECT [[Template:Action page]]
| description = {{{summary}}}
| image = {{#if: {{{image|}}} | {{{image|}}} | NoImage Icon.webp}}
}}
__NOTOC__
[[File:{{#if: {{{image|}}} | {{{image|}}} | NoImage Icon.webp}}|frameless|right]]
{{{summary}}}
 
== Description ==
{{{description}}}
 
== Properties ==
{{trim|{{#if: {{{damage|}}} |{{{damage}}}| {{blank}}}}}} <!-- TODO: make this a bit smarter -->
{{trim|<!--DONT DO HACKS AT HOME KIDS-->
{{#vardefine:action|0}}
{{#vardefine:bonus|0}}
{{#vardefine:reaction|0}}
{{#vardefine:movement|0}}
{{#vardefine:ar|0}}
{{#vardefine:bi|0}}
{{#vardefine:ki|0}}
{{#vardefine:sd|0}}
{{#vardefine:rg|0}}
{{#vardefine:hasaction|0}}
{{#vardefine:hasothers|0}}
{{#rmatch: string={{{cost|}}}|pattern=\W([Aa]ction)|then = {{#vardefine:action|1}} {{#vardefine:hasaction|1}}<!--add cargo in this place-->|caseless=1}} <!--Action-->
{{#rmatch: string={{{cost|}}}|pattern=([Bb]onus)|then = {{#vardefine:bonus|1}} {{#vardefine:hasaction|1}}<!--add cargo in this place-->|caseless=1}} <!--Bonus-->
{{#rmatch: string={{{cost|}}}|pattern=([Rr]eaction)|then = {{#vardefine:reaction|1}} {{#vardefine:hasaction|1}}<!--add cargo in this place-->|caseless=1}} <!--Reaction-->
{{#rmatch: string={{{cost|}}}|pattern=([Mm]ovement)| then = {{#vardefine:movement|1}} {{#vardefine:hasaction|1}}<!--add cargo in this place-->|caseless=1}} <!--Movement-->
{{#rmatch: string={{{cost|}}}|pattern=([Aa]rc[Rr]ec)|then={{#vardefine:ar|{{#rmatch:{{{cost|}}}|[Aa]rc[Rr]ec:\s?([^\s]*)|$1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->|caseless=1}} <!--Arcane Recovery-->
{{#rmatch: string={{{cost|}}}|pattern=([Bb]ar[Ii]ns)|then={{#vardefine:bi|{{#rmatch:{{{cost|}}}|[Bb]ar[Ii]ns:\s?([^\s]*)|$1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->|caseless=1}} <!--Bardic Inspiration-->
{{#rmatch: string={{{cost|}}}|pattern=([Cc]ha[Dd]iv)|then={{#vardefine:cd|{{#rmatch:{{{cost|}}}|[Cc]ha[Dd]iv:\s?([^\s]*)|$1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->|caseless=1}} <!--Channel Divinity-->
{{#rmatch: string={{{cost|}}}|pattern=([Cc]ha[Oo]at)|then={{#vardefine:co|{{#rmatch:{{{cost|}}}|[Cc]ha[Oo]at:\s?([^\s]*)|$1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->|caseless=1}} <!--Channel Oath-->
{{#rmatch: string={{{cost|}}}|pattern=([Kk]i)|then={{#vardefine:ki|{{#rmatch:{{{cost|}}}|[Kk]i:\s?([^\s]*)|$1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->|caseless=1}} <!--Ki-->
{{#rmatch: string={{{cost|}}}|pattern=([Ll]ay[Oo]n[Hh])|then={{#vardefine:lh|{{#rmatch:{{{cost|}}}|[Ll]ay[Oo]n[Hh]:\s?([^\s]*)|$1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->|caseless=1}} <!--Lay On Hands-->
{{#rmatch: string={{{cost|}}}|pattern=([Nn]at[Rr]ec)|then={{#vardefine:nr|{{#rmatch:{{{cost|}}}|[Nn]at[Rr]ec:\s?([^\s]*)|$1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->|caseless=1}} <!--Natural Recovery-->
{{#rmatch: string={{{cost|}}}|pattern=([Rr]age)|then={{#vardefine:rg|{{#rmatch:{{{cost|}}}|[Rr]age:\s?([^\s]*)|$1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->|caseless=1}} <!--Rage-->
{{#rmatch: string={{{cost|}}}|pattern=([Ss]up[Dd]ie)|then={{#vardefine:sd|{{#rmatch:{{{cost|}}}|[Ss]up[Dd]ie:\s?([^\s]*)|$1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->|caseless=1}} <!--Superiority Die-->
{{#rmatch: string={{{cost|}}}|pattern=([Ww]ar[Pp]ri)|then={{#vardefine:wp|{{#rmatch:{{{cost|}}}|[Ww]ar[Pp]ri:\s?([^\s]*)|$1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->|caseless=1}} <!--War Priest-->
{{#rmatch: string={{{cost|}}}|pattern=([Ww]il[Ss]hp)|then={{#vardefine:ws|{{#rmatch:{{{cost|}}}|[Ww]il[Ss]hp:\s?([^\s]*)|$1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->|caseless=1}} <!--Wild Shape-->
 
{{#ifexpr: {{#ifeq: {{#var:hasaction}} | 1 | 1 | 0}} or {{#ifeq: {{#var:hasothers}} | 1 | 1 | 0}} | *}}{{#ifeq: {{#var: reaction}} | 1 | {{action|reaction}} | {{#ifeq: {{#var: action}} | 1 | {{#ifeq: {{#var: bonus}}| 1 | {{action|both}}<!--1,1--> | {{action}}<!--1,0-->}} | {{#ifeq: {{#var: bonus}} | 1 | {{action|bonus}}<!--0,1--> | {{blank}}<!--0,0-->}}}}}} {{#ifeq: {{#var: hasaction}} | 1 | {{#ifeq: {{#var: hasothers}} | 1 | +}}}} {{#ifexpr: {{#var: ar}} > 0|{{R|name=ar|count={{#var: ar}}}}}}{{#ifexpr: {{#var: bi}} > 0|{{R|name=bi|count={{#var: bi}}}}}}{{#ifexpr: {{#var: cd}} > 0|{{R|name=cd|count={{#var: cd}}}}}}{{#ifexpr: {{#var: co}} > 0|{{R|name=co|count={{#var: co}}}}}}{{#ifexpr: {{#var: ki}} > 0|{{R|name=ki|count={{#var: ki}}}}}}{{#ifexpr: {{#var: lh}} > 0|{{R|name=lh|count={{#var: lh}}}}}}{{#ifexpr: {{#var: rg}} > 0|{{R|name=rg|count={{#var: rg}}}}}}{{#ifexpr: {{#var: sd}} > 0|{{R|name=sd|count={{#var: sd}}}}}}{{#ifexpr: {{#var: wp}} > 0|{{R|name=wp|count={{#var: wp}}}}}}{{#ifexpr: {{#var: ws}} > 0|{{R|name=ws|count={{#var: ws}}}}}}
}}
{{trim|{{#if: {{{concentration|}}} |*{{Concentration}} | {{blank}}}}}}
{{trim|{{#if: {{{recharge|}}} |*{{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: {{{distance|}}} |* {{Distance|{{{distance}}}}}| {{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>]]
 
=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:NoImage Icon.webp|x40px]] 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. '''REWRITE PENDING'''
|-
| {{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 = ki:2
| damage = {{DamageInfo|1d4+1|Bludgeoning}}
| recharge = Long Rest
| distance = melee
| 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 = ki:2 action
| damage = {{DamageInfo|1d4+1|Bludgeoning}}
| recharge = Long Rest
| distance = melee
| 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