User:Sylphoid: Difference between revisions

From Deadlock Wiki
Jump to navigation Jump to search
Sylphoid (talk | contribs)
add contribution tables
Sylphoid (talk | contribs)
→‎TODO: update contributions
 
(25 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[User:Sylphoid/Sandbox]]
[[User:Sylphoid/Sandbox]]
[[Module:Sandbox/Sylphoid]]
https://github.com/deadlock-wiki/deadbot
== TODO ==
# stat review: rapid rounds, add Fire Rate formula, truncating weird, skip
## Soul Shredder Bullets, spirit amp, where to add this? skip
## Sharshooter weapon fall-off range, and weapon zoom, hmmm skip
## Current: Crippling Headshot
# revert [[Updates]]
# [[Module:ItemTables]] need all stats entered, bulleted list below
# replace [[:File:Map_of_Box_and_Golden_Statue_Spawns.webp]] with proper map
* include searches for all increases, percent and linear (IN PROGRESS)
<s>*Fire Rate%, Ammo%, Ammo, </s>
*Bullet Velocity%,
*Bullet Resist%,
*Weapon Damage%,
*Reload Time%,
*Bullet Shield Health,
*Spirit Shield Health,
*Spirit Power,
*Weapon Damage vs. NPCs%,
*Bullet Resist vs. NPCs%,
*Bonus Health, 
*Slide Distance%,
*Health Regen,
*Sprint Speed (m/s),
*Heavy Melee Distance%,Stamina, Spirit Resist%, Weapon Fall-off Range%, Weapon Zoom%, Bullet Lifesteal%, Spirit Lifesteal%, Move Speed (m/s), Max Health%, Cooldown Reduction%, Bullet Slow Proc%,
* split up p.main into functions for readability
* <s>setup default sort, where it sorts by category, then by price</s> DONE 10/8/2024
* <s>filter out disabled items (low prio, waiting for Sur or Saag to implement fix through github)</s> DONE 10/2/2024
* <s>append unit suffix to end</s> DONE 10/3/2024


{| class="wikitable sortable sticky-header" style="width:calc(100% - 313px); max-width:1350px; text-align:center;"
{| class="wikitable sortable sticky-header" style="width:calc(100% - 313px); max-width:1350px; text-align:center;"
Line 7: Line 40:
| data-sort-value="%s" | 09/12/2024
| data-sort-value="%s" | 09/12/2024
| [[Special:Diff/4676|First Contribution]]
| [[Special:Diff/4676|First Contribution]]
|-
| data-sort-value="%s" | 09/20/2024 - 11/3/2024
| [[Special:Diff/6254|Creating item stat tables.]] Created {{t|Item stat table}} and [[Module:ItemTables]].
|-
| data-sort-value="%s" | 11/1/2024
| Revamp and finally fix horrible {{t|Infobox item}}.
|}
|}


Line 15: Line 54:
| data-sort-value="%s" | 09/12/2024 - 09/19/2024
| data-sort-value="%s" | 09/12/2024 - 09/19/2024
| Categorizing, cleanup, and standardization on template naming, {{t|documentation}}, and [[:Category:Templates|categories]].  
| Categorizing, cleanup, and standardization on template naming, {{t|documentation}}, and [[:Category:Templates|categories]].  
|-
| data-sort-value="%s" | 09/20/2024
| [[Special:Diff/6419|100th edit.]] (Undoing my own edit)
|}
|}
== Number formatting for thousands separator ==
In general Lua, text formatting can be done with:
<syntaxhighlight lang="lua" line>
function Format(amount)
    local formatted = amount
    while true do
        formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
        if (k == 0) then
            break
        end
    end
    return formatted
end
</syntaxhighlight>
On Mediawiki installations, formatting should instead be done by:
<syntaxhighlight lang="lua" line>
local lang = mw.language.getContentLanguage()
local function Format(amount)
    local formatted = amount
    if(type(formatted) ~= "number") then return "<span style=\"color:red;\">Cannot format non-number value.</span>" end
    return lang:formatNum(tonumber(formatted))
end
</syntaxhighlight>

Latest revision as of 17:16, 8 November 2024

User:Sylphoid/Sandbox

Module:Sandbox/Sylphoid

https://github.com/deadlock-wiki/deadbot

TODO[edit | edit source]

  1. stat review: rapid rounds, add Fire Rate formula, truncating weird, skip
    1. Soul Shredder Bullets, spirit amp, where to add this? skip
    2. Sharshooter weapon fall-off range, and weapon zoom, hmmm skip
    3. Current: Crippling Headshot
  2. revert Updates
  3. Module:ItemTables need all stats entered, bulleted list below
  4. replace File:Map_of_Box_and_Golden_Statue_Spawns.webp with proper map
  • include searches for all increases, percent and linear (IN PROGRESS)

*Fire Rate%, Ammo%, Ammo,

  • Bullet Velocity%,
  • Bullet Resist%,
  • Weapon Damage%,
  • Reload Time%,
  • Bullet Shield Health,
  • Spirit Shield Health,
  • Spirit Power,
  • Weapon Damage vs. NPCs%,
  • Bullet Resist vs. NPCs%,
  • Bonus Health,
  • Slide Distance%,
  • Health Regen,
  • Sprint Speed (m/s),
  • Heavy Melee Distance%,Stamina, Spirit Resist%, Weapon Fall-off Range%, Weapon Zoom%, Bullet Lifesteal%, Spirit Lifesteal%, Move Speed (m/s), Max Health%, Cooldown Reduction%, Bullet Slow Proc%,
  • split up p.main into functions for readability
  • setup default sort, where it sorts by category, then by price DONE 10/8/2024
  • filter out disabled items (low prio, waiting for Sur or Saag to implement fix through github) DONE 10/2/2024
  • append unit suffix to end DONE 10/3/2024

Number formatting for thousands separator[edit | edit source]

In general Lua, text formatting can be done with:

function Format(amount)
    local formatted = amount
    while true do
        formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
        if (k == 0) then
            break
        end
    end
    return formatted
end

On Mediawiki installations, formatting should instead be done by:

local lang = mw.language.getContentLanguage()
local function Format(amount)
    local formatted = amount
    if(type(formatted) ~= "number") then return "<span style=\"color:red;\">Cannot format non-number value.</span>" end
    return lang:formatNum(tonumber(formatted))
end