Template:CorruptionsTable/doc: Difference between revisions

From Melvor Idle
No edit summary
m (Change style of output results; Use text-positive class instead of a color style)
Line 4: Line 4:


<syntaxhighlight lang="javascript" line>
<syntaxhighlight lang="javascript" line>
let results = [`<noinclude>{{/doc}}[[Category:Manual Tables]]</noinclude>\n{| class="wikitable sortable stickyHeader"\n|-class="headerRow-0"\n!|Min Monster Lvl!!Effect`];
let results = [`<noinclude>{{/doc}}[[Category:Manual Tables]]</noinclude>\n{| class="wikitable sortable stickyHeader"\n|-\n! Min Monster Lvl\n! Effect`];
game.corruption.corruptionEffects.allRows.sort((a,b) => a.minMonsterLevel - b.minMonsterLevel).forEach(row => {
game.corruption.corruptionEffects.allRows.sort((a,b) => a.minMonsterLevel - b.minMonsterLevel).forEach(row => {
results.push(`|${row.minMonsterLevel ? numberWithCommas(row.minMonsterLevel) : 'Starts Unlocked'} || <span style="color:green">${row.customDescription}</span>`);
results.push(`| ${row.minMonsterLevel ? numberWithCommas(row.minMonsterLevel) : 'Starts Unlocked'}\n| <span class="text-positive">${row.customDescription}</span>`);
});
});
let output = ``;results.forEach((alias, i) => output += alias + (i === results.length - 1 ? '\n|}' : '\n|-\n'));console.log(output);
let output = ``;results.forEach((alias, i) => output += alias + (i === results.length - 1 ? '\n|}' : '\n|-\n'));console.log(output);
self.nw?.Clipboard.get().set ? self.nw?.Clipboard?.get().set(output, 'text') : copy(output);
self.nw?.Clipboard.get().set ? self.nw?.Clipboard?.get().set(output, 'text') : copy(output);
</syntaxhighlight>
</syntaxhighlight>

Revision as of 16:16, 16 September 2024

A script is used to generate the following table. To use, open the game and paste the below into the console. The outputs will be copied to your clipboard automatically. After running the script, 'edit source' on Template:CorruptionsTable then Ctrl+A and Ctrl+V. Look over the contents to ensure everything looks fine.

A manual pass will need to be done to add links to different status effects, buffs, and enemy debuffs, such as Laceration, Slow, etc. Limit these links to once per effect.

let results = [`<noinclude>{{/doc}}[[Category:Manual Tables]]</noinclude>\n{| class="wikitable sortable stickyHeader"\n|-\n! Min Monster Lvl\n! Effect`];
game.corruption.corruptionEffects.allRows.sort((a,b) => a.minMonsterLevel - b.minMonsterLevel).forEach(row => {
	results.push(`| ${row.minMonsterLevel ? numberWithCommas(row.minMonsterLevel) : 'Starts Unlocked'}\n| <span class="text-positive">${row.customDescription}</span>`);
});
let output = ``;results.forEach((alias, i) => output += alias + (i === results.length - 1 ? '\n|}' : '\n|-\n'));console.log(output);
self.nw?.Clipboard.get().set ? self.nw?.Clipboard?.get().set(output, 'text') : copy(output);