Template:DamageBlob: Difference between revisions
Jump to navigation
Jump to search
HiddenDragon (talk | contribs) (Created page with "<includeonly>{{trim| {{#lvardef: amt|}}{{#lvardef: typ|}}{{#lvardef: mod|}}{{#lvardef: per|}}{{#lvardef: sav|}}{{#lvardef: sfx|}} {{#ifeq:{{#pos:{{lc:{{{1}}}}}|amounttext:}}||| {{#lvardef: amttxt|{{#rmatch: {{{1}}}|amounttext:\s?([^\s][^,]*)|$1|caseless=0}}}}}} {{#ifeq:{{#pos:{{lc:{{{1}}}}}|amount:}}||| {{#lvardef: amt|{{#rmatch: {{{1}}}|amount:\s?([^\s][^,]*)|$1|caseless=1}}}}}} {{#ifeq:{{#pos:{{lc:{{{1}}}}}|type:}}|||{{#lvardef: typ|{{#rmatch: {{{1}}}|type:\s?([^...") |
HiddenDragon (talk | contribs) (Cleanup errant p tag) |
||
(One intermediate revision by the same user not shown) | |||
Line 8: | Line 8: | ||
{{#ifeq:{{#pos:{{lc:{{{1}}}}}|save:}}|||{{#lvardef: sav|{{#rmatch: {{{1}}}|save:\s?([^\s][^,]*)|$1|caseless=1}}}}}} | {{#ifeq:{{#pos:{{lc:{{{1}}}}}|save:}}|||{{#lvardef: sav|{{#rmatch: {{{1}}}|save:\s?([^\s][^,]*)|$1|caseless=1}}}}}} | ||
{{#ifeq:{{#pos:{{lc:{{{1}}}}}|save effect:}}|||{{#lvardef: sfx|{{#rmatch: {{{1}}}|save effect:\s?([^\s][^,]*)|$1|caseless=1}}}}}} | {{#ifeq:{{#pos:{{lc:{{{1}}}}}|save effect:}}|||{{#lvardef: sfx|{{#rmatch: {{{1}}}|save effect:\s?([^\s][^,]*)|$1|caseless=1}}}}}} | ||
{{#lvardef: dmg1|{{#if: {{#lvar: amttxt}}|{{InfoBlob|{{DamageText|{{#lvar: amttxt}} |{{#lvar: typ}}}}}}|{{DamageInfo|{{#lvar: amt}}|{{#lvar: typ}}|modifier = {{#lvar:mod}}|per = {{#lvar: dot}}|save = {{#lvar: sav}}|save effect = {{#lvar: sfx}}}}}}}} | {{#ifeq:{{#pos:{{lc:{{{1}}}}}|cond:}}|||{{#lvardef: cond|{{#rmatch: {{{1}}}|cond:\s?([^\s][^,]*)|$1|caseless=1}}}}}} | ||
{{#lvardef: dmg1|{{#if: {{#lvar: amttxt}}|{{InfoBlob|{{DamageText|{{#lvar: amttxt}} |{{#lvar: typ}}}}}}|{{DamageInfo|{{#lvar: amt}}|{{#lvar: typ}}|modifier = {{#lvar:mod}}|per = {{#lvar: dot}}|save = {{#lvar: sav}}|save effect = {{#lvar: sfx}}|con={{#lvar: cond}}}}}}}} | |||
{{#lvar: dmg1}} | {{#lvar: dmg1}} | ||
}} | }} | ||
</includeonly><noinclude> | </includeonly><noinclude> | ||
Line 19: | Line 19: | ||
<p>{{DamageBlob|amount: 1d6, type: Fire, mod: Strength}}</p> | <p>{{DamageBlob|amount: 1d6, type: Fire, mod: Strength}}</p> | ||
<code><nowiki>{{DamageBlob|amount: 1d6, type: Fire, mod: Strength, cond:yes}}</nowiki></code>: | |||
<p>{{DamageBlob|amount: 1d6, type: Fire, mod: Strength, cond:yes}}</p> | |||
<code><nowiki>{{DamageBlob|amounttext: 4d6+3, type: Cold}}</nowiki></code>: | <code><nowiki>{{DamageBlob|amounttext: 4d6+3, type: Cold}}</nowiki></code>: |
Latest revision as of 21:11, 12 December 2023
This template abstracts out the parsing of damage and damage2 fields from Template:ActionPage
{{DamageBlob|amount: 1d6, type: Fire, mod: Strength}}
:
1d6 (1~6) + Strength modifier Fire
{{DamageBlob|amount: 1d6, type: Fire, mod: Strength, cond:yes}}
:
1d6 (1~6) + Strength modifier Fire (conditional)
{{DamageBlob|amounttext: 4d6+3, type: Cold}}
: