Template:ScientiaStances/doc

Documentation for Template:ScientiaStances, Module:ScientiaStances, and Module:ScientiaStances/data. Testing grounds for the eventual Template:Stances, Module:Stances, and Module:Stances/data.

Template:ScientiaStances
To use, call  on the desired page. Stance name is not case-sensitive.

Module:ScientiaStances
This module is a Lua port of Template:StanceCombosV2, Template:ComboIcon, and Template:ComboIcon2 for the ease of editbility and expandability of new and existing stance combos.

This module is meant to be used in conjunction with Template:Stances. For best experience, view pages at 100% zoom to ensure correct formatting of tables.

Fair warning: minimal input validation, especially for data in Module:Stances/data. Follow styling as shown in said page to avoid errors.

Note to future editors: minimize refactoring of HTML strings; it is better to have multiple strings with similar HTML than a bunch of broken up HTML that are built through if statements (harder to understand)

Functions
Hierarchy of function calls: p.buildTable validateStanceData p.buildTableHelper buildComboRow <- edit this if you want to add new combos findMaxNumberOfHits buildComboIcons p.addComboIcon buildComboCSSClasses <- edit this if you want to change CSS classes/styling buildTopProcIconHTML <- edit this if you want to change CSS classes/styling buildMeleeIcon buildHitInfoHTML <- edit this if you want to change CSS classes/styling buildAttackTypeLegendRow buildAttackLegendRow buildMultiplierHitLegendRow buildProcLegendRow

Generic helper functions used: SHARED.tableCount SHARED.hasKey SHARED.contains SHARED.titleCase

Module:ScientiaStances/data
Each stance comes with the following unique combos: These will be stored in   table.
 * Basic: basic/neutral combo (unlocked by default if exists)
 * Forward: forward combo (unlocked at Rank 1 if exists)
 * ForwardBlock: "forward tactical" combo (unlocked at Rank 2 if exists)
 * Block: block combo (unlocked at Rank 3 if exists)

Each weapon class shares the following combos regardless of stance used: These will be stored in   table.
 * Heavy: heavy/charged attack
 * Slide: slide/spin attack
 * Air: air attack
 * Wall: wall attack
 * Ground: ground finisher

Each combo a set number of attacks that share the same input (e.g for Block combo, holding the block/aim key while attacking). Each combo comes with a list of attacks that have their own proc info, number of hits, attack type ("Default", "360", or "Slam"), and damage multiplier. For hits with multiple procs, concatenate the first three letters of each proc together in the order that they appear in this list (left to right): "Impact", "Puncture", "Slash", "Blast", "Lifted", "Knockdown", "Ragdoll" (e.g. "Slash" and "Puncture"  will become "PunSla" ).

Note: avoid putting nil values in tables, otherwise functions that iterate over tables will break or won't work properly. To denote a hit that doesn't proc in the Proc table, input "None".

Possible Values
Default values for keys if keys are omitted: ConclaveOnly = false Type = "Default" Multiplier = 1 or { 1, 1, ... } if NumberOfHits is a table NumberOfHits = 1 or { 1, 1, ... } if Multiplier is a table Proc = nil

Value type restrictions for keys: WeaponType = string ConclaveOnly = boolean (true or false) Name = string Type = string ("Default", "360", or "Slam") or nil Multiplier = number, number table, or nil NumberOfHits = number, number table, or nil Proc = string, string table, or nil For no icons: nil or "None" For single icons: "Impact", "Puncture", "Slash", "Blast", "Lifted", "Knockdown", "Ragdoll", "Stagger", or "Finisher" For double icons: "ImpPun", "ImpSla", "PunSla", "ImpLif", "PunLif", "SlaLif", "ImpKno", "PunKno", "SlaKno", "ImpRag", "PunRag", "SlaRag", "KnoRag", "LifRag", or "KnoLif"

Formatting
Styling for  : ["Stance Name"] = { WeaponType = required, ConclaveOnly = optional, Basic = { Name = required, Attacks = { { Type = optional, Multiplier = optional, NumberOfHits = optional, Proc = optional }, { Type = optional, Multiplier = optional, NumberOfHits = optional, Proc = optional }, { Type = optional, Multiplier = optional, NumberOfHits = optional, Proc = optional }, },       },        Forward = { Name = "", Attacks = { { Type = "Default", Multiplier = 3, NumberOfHits = 1, Proc = nil }, { Type = "Default", Multiplier = 3, NumberOfHits = 1, Proc = nil }, { Type = "Default", Multiplier = 3, NumberOfHits = 1, Proc = nil }, },       },        ForwardBlock = { Name = "", Attacks = { { Type = "Default", Multiplier = 3, NumberOfHits = 1, Proc = nil }, { Type = "Default", Multiplier = 3, NumberOfHits = 1, Proc = nil }, { Type = "Default", Multiplier = 3, NumberOfHits = 1, Proc = nil }, },       },        Block = { Name = "", Attacks = { { Type = "Default", Multiplier = 3, NumberOfHits = 1, Proc = nil }, { Type = "Default", Multiplier = 3, NumberOfHits = 1, Proc = nil }, { Type = "Default", Multiplier = 3, NumberOfHits = 1, Proc = nil }, },       },    }, Styling for  : ["WeaponType"] = { Heavy = { Name = "", Attacks = { { Multiplier = 3, NumberOfHits = 1, Proc = nil }, { Multiplier = 3, NumberOfHits = 1, Proc = nil }, },       },        Slide = { Name = "", Attacks = { { Type = "360", Multiplier = 3, NumberOfHits = 1, Proc = nil }, },       },        Air = { Name = "", Attacks = { { Type = "Default", Multiplier = 3, NumberOfHits = 1, Proc = nil }, },       },        Wall = { Name = "", Attacks = { { Type = "Default", Multiplier = 3, NumberOfHits = 1, Proc = nil }, },       },        Ground = { Name = "", Attacks = { { Type = "Default", Multiplier = 3, NumberOfHits = 1, Proc = nil }, },       },    },

Example stance table (note that it is recommended to put shared combos (heavy, slide, air, wall, ground) into  ): ["Iron Phoenix"] = { WeaponType = "Sword", Basic = { Name = "Wings and Beak", Attacks = { { Multiplier = 3, Proc = "ImpSla" }, { Multiplier = 2 }, { Multiplier = 2, Proc = "Knockdown" }, },       },        Forward = { Name = "Double Slash", Attacks = { { nil }, { Multiplier = 2 }, },       },        ForwardBlock = { Name = "Taking Flight", Attacks = { {                   -- first element is multipler for first hit -- second element is multiplier for second hit Multiplier = { 1, 2 }, NumberOfHits = { 1, 1 }, -- first element is proc for first hit -- second element is multipler for second hit Proc = { "None", "Impact" } },               { Type = "Slam", Multiplier = 4, Proc = "Lifted" }, },       },        Heavy = { Name = "Perfect Cut", Attacks = { { Multiplier = 5, Proc = "Lifted" }, { Multiplier = 5, Proc = "Knockdown" }, },       },        Slide = { Name = "Spiral Cut", Attacks = { { Type = "360", Proc = "Impact" }, },       },        Air = { Name = "Weightless Steel", Attacks = { { Multiplier = 2 }, { Multiplier = 2 }, { Multiplier = 3, Proc = "Knockdown" }, },       },        Wall = { Name = "Weightless Steel", Attacks = { { Multiplier = 3, Proc = "Knockdown" }, },       },        Ground = { Name = "Death's Mark", Attacks = { { Multiplier = 2.5, Proc = "Slash" }, },       },    },