User:Crashaholic/ActionTemplate: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
m (maybe this will fix pages without any properties?)
m (Changed redirect target from Template:Action Page to Template:Action page)
Tags: Redirect target changed Visual edit
 
(35 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}}}
{{#vardefine: hasprop | {{#if: {{{damage|}}} | 1}}{{#if: {{{cost|}}} | 1}}{{#if: {{{concentration|}}} | 1}}{{#if: {{{recharge|}}} | 1}}{{#if: {{{distance|}}} | 1}}{{#if: {{{aoe|}}} | 1}}0}}
{{#ifexpr: {{#var: hasprop}} > 0| == Properties ==
{{trim|
{{#if: {{{damage|}}} |
{{#vardefine: amt|}}
{{#vardefine: typ|}}
{{#vardefine: mod|}}
{{#vardefine: per|}}
{{#vardefine: sav|}}
{{#vardefine: sfx|}}
{{#ifeq:{{#pos:{{lc:{{{damage|}}}}}|amount:}}|| <!--doesnt exist--> | {{#vardefine: amt|{{#rmatch: {{{damage|}}}|amount:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage|}}}}}|type:}}|| <!--doesnt exist--> |{{#vardefine: typ|{{#rmatch: {{{damage|}}}|type:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage|}}}}}|mod:}}|| <!--doesnt exist--> |{{#vardefine: mod|{{#rmatch: {{{damage|}}}|mod:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage|}}}}}|per:}}|| <!--doesnt exist--> |{{#vardefine: dot|{{#rmatch: {{{damage|}}}|per:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage|}}}}}|save:}}|| <!--doesnt exist--> |{{#vardefine: sav|{{#rmatch: {{{damage|}}}|save:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage|}}}}}|save effect:}}|| <!--doesnt exist--> |{{#vardefine: sfx|{{#rmatch: {{{damage|}}}|save effect:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#vardefine:d1|{{trim|{{DamageInfo|{{#var: amt}}|{{#var: typ}}|modifier = {{#var:mod}}|per = {{#var: dot}}|save = {{#var: sav}}|save effect = {{#var: sfx}}}}}}}}
}}|{{blank}}}}
{{trim|
{{#if: {{{damage2|}}} |
{{#vardefine: amt|}}
{{#vardefine: typ|}}
{{#vardefine: mod|}}
{{#vardefine: per|}}
{{#vardefine: sav|}}
{{#vardefine: sfx|}}
{{#ifeq:{{#pos:{{lc:{{{damage2|}}}}}|amount:}}|| <!--doesnt exist--> | {{#vardefine: amt|{{#rmatch: {{{damage2|}}}|amount:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage2|}}}}}|type:}}|| <!--doesnt exist--> |{{#vardefine: typ|{{#rmatch: {{{damage2|}}}|type:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage2|}}}}}|mod:}}|| <!--doesnt exist--> |{{#vardefine: mod|{{#rmatch: {{{damage2|}}}|mod:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage2|}}}}}|per:}}|| <!--doesnt exist--> |{{#vardefine: dot|{{#rmatch: {{{damage2|}}}|per:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage2|}}}}}|save:}}|| <!--doesnt exist--> |{{#vardefine: sav|{{#rmatch: {{{damage2|}}}|save:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage2|}}}}}|save effect:}}|| <!--doesnt exist--> |{{#vardefine: sfx|{{#rmatch: {{{damage2|}}}|save effect:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#vardefine:d2|{{trim|{{DamageInfo|{{#var: amt}}|{{#var: typ}}|modifier = {{#var:mod}}|per = {{#var: dot}}|save = {{#var: sav}}|save effect = {{#var: sfx}}}}}}}}
}}|{{blank}}}}
{{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:cd|0}}
{{#vardefine:co|0}}
{{#vardefine:ki|0}}
{{#vardefine:lh|0}}
{{#vardefine:nr|0}}
{{#vardefine:rg|0}}
{{#vardefine:sd|0}}
{{#vardefine:wp|0}}
{{#vardefine:ws|0}}
{{#vardefine:hasaction|0}}
{{#vardefine:hasmovemt|0}}
{{#vardefine:hasothers|0}}
{{#rmatch: {{{cost|}}}|\Waction|{{#vardefine:action|1}} {{#vardefine:hasaction|1}}<!--add cargo in this place-->|caseless=1}} <!--Action-->
{{#rmatch: {{{cost|}}}|bonus|{{#vardefine:bonus|1}} {{#vardefine:hasaction|1}}<!--add cargo in this place-->|caseless=1}} <!--Bonus-->
{{#rmatch: {{{cost|}}}|reaction|{{#vardefine:reaction|1}} {{#vardefine:hasaction|1}}<!--add cargo in this place-->|caseless=1}} <!--Reaction-->
{{#rmatch: {{{cost|}}}|movement|{{#vardefine:movement|1}} {{#vardefine:hasmovemt|1}}<!--add cargo in this place-->|caseless=1}} <!--Movement-->
{{#rmatch: {{{cost|}}}|arcrec|{{#vardefine:ar|{{#rmatch:{{{cost|}}}|arcrec:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->| <!--Arcane Recovery-->
{{#rmatch: {{{cost|}}}|barins|{{#vardefine:bi|{{#rmatch:{{{cost|}}}|barins:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->| <!--Bardic Inspiration-->
{{#rmatch: {{{cost|}}}|chadiv|{{#vardefine:cd|{{#rmatch:{{{cost|}}}|chadiv:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->| <!--Channel Divinity-->
{{#rmatch: {{{cost|}}}|chaoat|{{#vardefine:co|{{#rmatch:{{{cost|}}}|chaoat:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->| <!--Channel Oath-->
{{#rmatch: {{{cost|}}}|ki|{{#vardefine:ki|{{#rmatch:{{{cost|}}}|ki:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->| <!--Ki-->
{{#rmatch: {{{cost|}}}|layonh|{{#vardefine:lh|{{#rmatch:{{{cost|}}}|layonh:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->| <!--Lay On Hands-->
{{#rmatch: {{{cost|}}}|natrec|{{#vardefine:nr|{{#rmatch:{{{cost|}}}|natrec:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->| <!--Natural Recovery-->
{{#rmatch: {{{cost|}}}|rage|{{#vardefine:rg|{{#rmatch:{{{cost|}}}|rage:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->| <!--Rage-->
{{#rmatch: {{{cost|}}}|supdie|{{#vardefine:sd|{{#rmatch:{{{cost|}}}|supdie:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->| <!--Superiority Die-->
{{#rmatch: {{{cost|}}}|warpri|{{#vardefine:wp|{{#rmatch:{{{cost|}}}|warpri:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->| <!--War Priest-->
{{#rmatch: {{{cost|}}}|wldshp|{{#vardefine:ws|{{#rmatch:{{{cost|}}}|wldshp:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#vardefine:hasothers|1}}<!--add cargo in this place-->|caseless=1}}|caseless=1}}|caseless=1}}|caseless=1}}|caseless=1}}|caseless=1}}|caseless=1}}|caseless=1}}|caseless=1}}|caseless=1}}|caseless=1}} <!--Wild Shape-->
<!--if you think i know what im doing, ymmv-->
{{#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|}}} |<br/>{{Concentration}} | {{blank}}}}}}
{{trim|{{#if: {{{recharge|}}} |<br/>{{Recharge|{{{recharge}}}}}| {{blank}}}}}}
{{trim|
{{#if: {{{duration|}}}
|<br/>{{#ifeq:{{lc:{{{duration|}}}}}| LR
|{{Duration|Until Long Rest}}
|{{#ifeq: {{{duration|}}} |Perm
|{{Duration|Permanent}}
|{{Duration|{{{duration}}}}}
}}
}}
|{{blank}}
}}
}}
{{trim|{{#if: {{{distance|}}} |<br/>{{Distance|{{{distance}}}}}| {{blank}}}}}} <!-- TODO: make this a bit smarter -->
{{trim|{{#if: {{{aoe|}}} |<br/>{{{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}}
}}<br/>{{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|damage}}
| The damage of the action. '''REWRITE PENDING'''
|-
| {{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>
|-
| {{C|additional}}
| Any additional information that does not fit the template goes here!
| <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, action
| damage = amount: 1d4+1, type: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 = amount: 1d4+1, type:Bludgeoning
| damage2 = amount: 1d6, type: Fire
| 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