Difference between revisions of "Template:Cs"

From Tales of Maj'Eyal
Jump to: navigation, search
(Created template for combatScale (for real this time))
 
m
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><onlyinclude>{{{3}}}–{{{5}}}<sup>[[Scaling#cS|cS:{{{2}}}]]</sup> as {{{1}}} varies from {{{4}}}–{{{6}}}</onlyinclude></includeonly>
+
<includeonly><onlyinclude>{{{2}}}–{{{4}}}<sup>[[Scaling#cS|cS{{#if:{{{6|}}}|&#58;{{{6}}}P{{#if:{{{7|}}}|,{{{7}}}{{#if:{{{8|}}}|,{{{8}}}|}}|}}|{{#if:{{{7|}}}|&#58;{{{7}}}{{#if:{{{8|}}}|,{{{8}}}|}}|}}}}]]</sup> as {{{1}}} varies from {{{3}}}–{{{5}}}</onlyinclude></includeonly>
 
+
[[Category:Templates]]
+
 
+
 
===Introduction===
 
===Introduction===
  
 
This template is used to denote talent parameters that scale by the [[Scaling#cS|combatScale]] function.
 
This template is used to denote talent parameters that scale by the [[Scaling#cS|combatScale]] function.
  
The template accepts six parameters, corresponding to those in the LUA code: ''x, limit, y_low, x_low, y_high, x_high''. It is assumed that these parameters will be fed to the template in the order specified above.
+
The template accepts up to eight parameters, corresponding to those in the LUA code: ''x, y_low, x_low, y_high, x_high, power, add, shift''. It is assumed that the first 6 parameters will be fed to the template in the order specified above.
  
All six parameters are required.
+
The first 5 parameters are required, ''power'' must go into parameter 6 if it exists, while parameter 7 and 8 are open for ''add'' and ''shift'' to use.
  
 
===Basic Example===
 
===Basic Example===
Line 24: Line 21:
  
 
  {{CS|(0.07 * Str * Talent Level)|5|0|40|35}}
 
  {{CS|(0.07 * Str * Talent Level)|5|0|40|35}}
 +
 +
Note that any percentage signs must be inserted manually with the parameters.
  
 
Be aware that since this template produces a rather long string of text, you may have to rewrite other parts of a talent's description in order to make the whole thing legible.
 
Be aware that since this template produces a rather long string of text, you may have to rewrite other parts of a talent's description in order to make the whole thing legible.
 +
 +
[[Category:Templates]]

Latest revision as of 11:25, 13 October 2021

Introduction

This template is used to denote talent parameters that scale by the combatScale function.

The template accepts up to eight parameters, corresponding to those in the LUA code: x, y_low, x_low, y_high, x_high, power, add, shift. It is assumed that the first 6 parameters will be fed to the template in the order specified above.

The first 5 parameters are required, power must go into parameter 6 if it exists, while parameter 7 and 8 are open for add and shift to use.

Basic Example

The LUA code for the damage bonus of Berserker calls for

self:combatScale(self:getStr(7, true) * self:getTalentLevel(t), 5, 0, 40, 35)

which requires some interpretation of the first parameter to produce the following wiki markup

{{CS|(0.07 * Str * Talent Level)|5|0|40|35}}

and will in turn produce the following text

5–40cS as (0.07 * Str * Talent Level) varies from 0–35

Note that any percentage signs must be inserted manually with the parameters.

Be aware that since this template produces a rather long string of text, you may have to rewrite other parts of a talent's description in order to make the whole thing legible.