User:Crashaholic/ActionTemplate: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(WIP amounttext)
m (Changed redirect target from Template:Action Page to Template:Action page)
Tags: Redirect target changed Visual edit
 
(22 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__
<div class="bg3wiki-tooltip-box bg3wiki-tooltip-gradient-common">[[File:{{#if: {{{image|}}} | {{{image|}}} | NoImage Icon.webp}}|frameless|right]]
{{{summary}}}
== Description ==
{{{description}}}
{{#lvardef: hasprop | {{#if: {{{damage|}}} | 1}}{{#if: {{{cost|}}} | 1}}{{#if: {{{concentration|}}} | 1}}{{#if: {{{recharge|}}} | 1}}{{#if: {{{distance|}}} | 1}}{{#if: {{{aoe|}}} | 1}}0}}
{{#ifexpr: {{#lvar: hasprop}} > 0| == Properties ==
{{trim|
{{#if: {{{damage|}}} |
{{#lvardef: amt|}}{{#lvardef: typ|}}{{#lvardef: mod|}}{{#lvardef: per|}}{{#lvardef: sav|}}{{#lvardef: sfx|}}
{{#ifeq:{{#pos:{{lc:{{{damage|}}}}}|amounttext:}}||| {{#lvardef: amttxt|{{#rmatch: {{{damage|}}}|amounttext:\s?([^\s][^,]*)|$1|caseless=0}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage|}}}}}|amount:}}||| {{#lvardef: amt|{{#rmatch: {{{damage|}}}|amount:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage|}}}}}|type:}}|||{{#lvardef: typ|{{#rmatch: {{{damage|}}}|type:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage|}}}}}|mod:}}|||{{#lvardef: mod|{{#rmatch: {{{damage|}}}|mod:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage|}}}}}|per:}}|||{{#lvardef: dot|{{#rmatch: {{{damage|}}}|per:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage|}}}}}|save:}}|||{{#lvardef: sav|{{#rmatch: {{{damage|}}}|save:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage|}}}}}|save effect:}}|||{{#lvardef: sfx|{{#rmatch: {{{damage|}}}|save effect:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#lvardef: dmg1|{{#if: {{#lvar: amttxt}}|{{DamageText|{{#lvar: amttxt}} |{{#lvar: typ}}}}|{{DamageInfo|{{#lvar: amt}}|{{#lvar: typ}}}}|modifier = {{#lvar:mod}}|per = {{#lvar: dot}}|save = {{#lvar: sav}}|save effect = {{#lvar: sfx}}}}}}}}
{{#if: {{{damage2|}}} |
{{#lvardef: amttxt|}}{{#lvardef: amt|}}{{#lvardef: typ|}}{{#lvardef: mod|}}{{#lvardef: per|}}{{#lvardef: sav|}}{{#lvardef: sfx|}}
{{#ifeq:{{#pos:{{lc:{{{damage2|}}}}}|amounttext:}}||| {{#lvardef: amttxt|{{#rmatch: {{{damage2|}}}|amounttext:\s?([^\s][^,]*)|$1|caseless=0}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage2|}}}}}|amount:}}||| {{#lvardef: amt|{{#rmatch: {{{damage2|}}}|amount:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage2|}}}}}|type:}}|||{{#lvardef: typ|{{#rmatch: {{{damage2|}}}|type:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage2|}}}}}|mod:}}|||{{#lvardef: mod|{{#rmatch: {{{damage2|}}}|mod:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage2|}}}}}|per:}}|||{{#lvardef: dot|{{#rmatch: {{{damage2|}}}|per:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage2|}}}}}|save:}}|||{{#lvardef: sav|{{#rmatch: {{{damage2|}}}|save:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#ifeq:{{#pos:{{lc:{{{damage2|}}}}}|save effect:}}|||{{#lvardef: sfx|{{#rmatch: {{{damage2|}}}|save effect:\s?([^\s][^,]*)|$1|caseless=1}}}}}}
{{#lvardef: dmg2|{{#if: {{#lvar: amttxt}}|{{DamageText|{{#lvar: amttxt}} |{{#lvar: typ}}}}|{{DamageInfo|{{#lvar: amt}}|{{#lvar: typ}}}}|modifier = {{#lvar:mod}}|per = {{#lvar: dot}}|save = {{#lvar: sav}}|save effect = {{#lvar: sfx}}}}}}}}
{{#if: {{{damage|}}}| {{#if:{{{damage2|}}}| {{InfoBlob|{{#lvar: dmg1}} + {{#lvar: dmg2}}}} | {{#lvar: dmg1}}}}|{{blank}}}}
}}
{{trim|<!--DONT DO HACKS AT HOME KIDS-->
{{#lvardef:action|0}}
{{#lvardef:bonus|0}}
{{#lvardef:reaction|0}}
{{#lvardef:movement|0}}
{{#lvardef:ar|0}}
{{#lvardef:bi|0}}
{{#lvardef:cd|0}}
{{#lvardef:co|0}}
{{#lvardef:ki|0}}
{{#lvardef:lh|0}}
{{#lvardef:nr|0}}
{{#lvardef:rg|0}}
{{#lvardef:sd|0}}
{{#lvardef:wp|0}}
{{#lvardef:ws|0}}
{{#lvardef:hasaction|0}}
{{#lvardef:hasmovemt|0}}
{{#lvardef:hasothers|0}}
{{#rmatch: {{{cost|}}}|\Waction|{{#lvardef:action|1}} {{#lvardef:hasaction|1}}<!--add cargo in this place-->|caseless=1}} <!--Action-->
{{#rmatch: {{{cost|}}}|bonus|{{#lvardef:bonus|1}} {{#lvardef:hasaction|1}}<!--add cargo in this place-->|caseless=1}} <!--Bonus-->
{{#rmatch: {{{cost|}}}|reaction|{{#lvardef:reaction|1}} {{#lvardef:hasaction|1}}<!--add cargo in this place-->|caseless=1}} <!--Reaction-->
{{#rmatch: {{{cost|}}}|movement|{{#lvardef:movement|1}} {{#lvardef:hasmovemt|1}}<!--add cargo in this place-->|caseless=1}} <!--Movement-->
{{#rmatch: {{{cost|}}}|arcrec|{{#lvardef:ar|{{#rmatch:{{{cost|}}}|arcrec:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#lvardef:hasothers|1}}<!--add cargo in this place-->| <!--Arcane Recovery-->
{{#rmatch: {{{cost|}}}|barins|{{#lvardef:bi|{{#rmatch:{{{cost|}}}|barins:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#lvardef:hasothers|1}}<!--add cargo in this place-->| <!--Bardic Inspiration-->
{{#rmatch: {{{cost|}}}|chadiv|{{#lvardef:cd|{{#rmatch:{{{cost|}}}|chadiv:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#lvardef:hasothers|1}}<!--add cargo in this place-->| <!--Channel Divinity-->
{{#rmatch: {{{cost|}}}|chaoat|{{#lvardef:co|{{#rmatch:{{{cost|}}}|chaoat:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#lvardef:hasothers|1}}<!--add cargo in this place-->| <!--Channel Oath-->
{{#rmatch: {{{cost|}}}|ki|{{#lvardef:ki|{{#rmatch:{{{cost|}}}|ki:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#lvardef:hasothers|1}}<!--add cargo in this place-->| <!--Ki-->
{{#rmatch: {{{cost|}}}|layonh|{{#lvardef:lh|{{#rmatch:{{{cost|}}}|layonh:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#lvardef:hasothers|1}}<!--add cargo in this place-->| <!--Lay On Hands-->
{{#rmatch: {{{cost|}}}|natrec|{{#lvardef:nr|{{#rmatch:{{{cost|}}}|natrec:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#lvardef:hasothers|1}}<!--add cargo in this place-->| <!--Natural Recovery-->
{{#rmatch: {{{cost|}}}|rage|{{#lvardef:rg|{{#rmatch:{{{cost|}}}|rage:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#lvardef:hasothers|1}}<!--add cargo in this place-->| <!--Rage-->
{{#rmatch: {{{cost|}}}|supdie|{{#lvardef:sd|{{#rmatch:{{{cost|}}}|supdie:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#lvardef:hasothers|1}}<!--add cargo in this place-->| <!--Superiority Die-->
{{#rmatch: {{{cost|}}}|warpri|{{#lvardef:wp|{{#rmatch:{{{cost|}}}|warpri:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#lvardef:hasothers|1}}<!--add cargo in this place-->| <!--War Priest-->
{{#rmatch: {{{cost|}}}|wldshp|{{#lvardef:ws|{{#rmatch:{{{cost|}}}|wldshp:\s?([^\s][^,]*)|$1|caseless=1}}}} {{#lvardef: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: {{#lvar: reaction}} | 1 | {{action|reaction}} | {{#ifeq: {{#lvar: action}} | 1 | {{#ifeq: {{#lvar: bonus}}| 1 | {{action|both}}<!--1,1--> | {{action}}<!--1,0-->}} | {{#ifeq: {{#lvar: bonus}} | 1 | {{action|bonus}}<!--0,1--> | {{blank}}<!--0,0-->}}}}}} {{#ifeq: {{#lvar: hasaction}} | 1 | {{#ifeq: {{#lvar: hasothers}} | 1 | +}}}} {{#ifexpr: {{#lvar: ar}} > 0|{{R|name=ar|count={{#lvar: ar}}}}}}{{#ifexpr: {{#lvar: bi}} > 0|{{R|name=bi|count={{#lvar: bi}}}}}}{{#ifexpr: {{#lvar: cd}} > 0|{{R|name=cd|count={{#lvar: cd}}}}}}{{#ifexpr: {{#lvar: co}} > 0|{{R|name=co|count={{#lvar: co}}}}}}{{#ifexpr: {{#lvar: ki}} > 0|{{R|name=ki|count={{#lvar: ki}}}}}}{{#ifexpr: {{#lvar: lh}} > 0|{{R|name=lh|count={{#lvar: lh}}}}}}{{#ifexpr: {{#lvar: rg}} > 0|{{R|name=rg|count={{#lvar: rg}}}}}}{{#ifexpr: {{#lvar: sd}} > 0|{{R|name=sd|count={{#lvar: sd}}}}}}{{#ifexpr: {{#lvar: wp}} > 0|{{R|name=wp|count={{#lvar: wp}}}}}}{{#ifexpr: {{#lvar: ws}} > 0|{{R|name=ws|count={{#lvar: 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}}
}}
}}{{#if: {{{range|}}} |
<br> {{Range | {{{range}}} }}
}} {{#if: {{{range m|}}} {{{range ft|}}} |
<br> {{Range | m = {{{range m}}} | ft = {{{range ft}}} }}
}} {{#if: {{{aoe|}}} |
<br> {{AOE | {{{aoe}}} | m = {{{aoe m}}} | ft = {{{aoe ft}}} }}
}} {{#if: {{{area|}}} |
<br> {{SmallIcon|Aoe Icon.png}} Creates Area: {{{area}}}
}}
{{trim|
{{#if: {{{save|}}}
{{#lvardef: saveicon | }} {{#lvardef: savetext | }}
{{#lvardef: savetype | {{#if: {{#pos:{{{save|}}}|,}} | {{#explode:{{{save|}}}|,|0}} | {{{save|}}}}}}}
{{#lvardef: saverslt | {{#if: {{#pos:{{{save|}}}|,}} | {{#explode:{{{save|}}}|,|1}} | ""}}}}
| {{#switch: {{lc:{{#lvar: savetype}}}}
| strength | str =  {{#lvardef: saveicon | Strength}} {{#lvardef: savetext | STR}}
| dexterity | dex  = {{#lvardef: saveicon | Dexterity}} {{#lvardef: savetext | DEX}}
| constitution | con | = {{#lvardef: saveicon | Constitution}} {{#lvardef: savetext | CON}}
| intelligence | int | = {{#lvardef: saveicon | Intelligence}} {{#lvardef: savetext | INT}}
| wisdom | wis  = {{#lvardef: saveicon | Wisdom}} {{#lvardef: savetext | WIS}}
| charisma | cha  = {{#lvardef: saveicon | Charisma}} {{#lvardef: savetext | CHA}}
| #default = {{#lvardef: saveicon |Alert}} {{#lvardef: savetext | EDITOR SHOULD CHECK TEMPLATE}}
}}<br/>{{SmallIcon|Saving Throw Icons.png}} [[File:{{#lvar: saveicon}} icon.png|frameless|25px|{{#lvar: saveicon}}]][[{{#lvar: saveicon}}|{{#lvar: savetext}}]] [[Saving Throw|Save]] {{#if: {{#pos:{{{save|}}}|,}}
| (On Save: {{#explode:{{{save|}}}|,|1}})
}}| {{blank}}
}}
}}
{{trim|{{#if: {{{additional|}}} | <br>{{{additional}}}| {{blank}}}}}}
}}
{{#if: {{{higherlevels|}}} | == At Higher Levels ==}}
{{trim|{{#if: {{{higherlevels|}}} | {{{higherlevels}}}| {{blank}}}}}} <!-- TODO: make this a bit smarter -->
</div>
== How to Learn ==
{{#lvardef: how-to-learn-content |
  {{#lvardef: classes-learn-list |
    {{#loop: level | 1 | 20 |
      {{#if: {{{ class learns at level {{#var:level}} |}}} | {{blank}}
* Class Level {{#var:level}}: {{#invoke: ParseList | main | {{{ class learns at level {{#var:level}} }}} | useTemplate = Class }}
      }}
    }}
  }}{{#lvardef: races-learn-list |
    {{#loop: level | 1 | 20 |
      {{#if: {{{ race learns at level {{#var:level}} |}}} | {{blank}}
* Character Level {{#var:level}}: {{#invoke: ParseList | main | {{{ race learns at level {{#var:level}} }}} | useTemplate = Race }}
      }}
    }}
  }}{{#if: {{#lvar:classes-learn-list}} |
Classes:
{{#lvar:classes-learn-list}}
  }}{{#if: {{#lvar:races-learn-list}} | {{blank}}
 
Races:
{{#lvar:races-learn-list}}
 
(Character Level is the sum of all Class Levels for a multi-classed character.)
  }}{{#if: {{{granted by feats|}}} | {{blank}}
 
Feats:
{{#invoke: ParseList | main | {{{granted by feats}}} | makeLinks = yes }}
  }}
}}<div class="bg3wiki-tooltip-box">
{{#lvar: how-to-learn-content | ''(Information not yet added.)'' }}
</div>
{{clear}}
{{#if: {{{notes|}}} | == Notes == }}
{{trim|{{#if: {{{notes|}}} | <div class="bg3wiki-tooltip-box bg3wiki-tooltip">{{{notes}}}</div>| {{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 =
| damage2 =
| recharge =
| duration =
| range =
| aoe =
| save =
| additional =
| higherlevels =
| X learns at level X =
| 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|damage2}}
| The damage of the action. '''REWRITE PENDING'''
|-
| {{C|cost}}
| The resource cost of the action. Format is {Resource}:{Amount}, {"action" if action etc.}. Resource types:
* Arcane Recovery: barins
* Channel Divinity: chadiv
* Channel Oath: chaoat
* Ki: ki
* Lay On Hands: layonh
* Natural Recovery: natrec
* Rage: rage
* Superiority Die: supdie
* War Priest: warpri
* Wild Shape: wldshp
|-
| {{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>
|-
| {{C|X learns at level X}}
| Which class/race/feat learns this
| <code>class learns at level 3 = Monk</code>
<code>race learns at level 5 = Wood Elf</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
| damage2 = amount: 1d6, type: Fire
| recharge = Long Rest
| range = 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
| class learns at level 3 = Monk
| race learns at level 5 = Wood Elf
}}
</pre>
{{User:Crashaholic/ActionTemplate
| description = abc
| image = Fly Icon.png
| summary = fly you fools
| cost = ki:2, action
| damage = amounttext: 1d4+1, type:Bludgeoning
| damage2 = amount: 1d6, type: Fire
| recharge = Long Rest
| range = 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
| class learns at level 3 = Monk
| race learns at level 5 = Wood Elf
}}
</noinclude>

Latest revision as of 21:56, 21 January 2024