Module:Buildup/doc: Difference between revisions

From The Deadlock Wiki
Jump to navigation Jump to search
LVL (talk | contribs)
Documentation of buildup module.
 
LVL (talk | contribs)
Updated info for doorman and paige
 
Line 34: Line 34:
== Internal Logic ==
== Internal Logic ==
The module uses the following formula derived from the game's mechanics:
The module uses the following formula derived from the game's mechanics:
<math>BPS = \frac{100}{BaseBuildup \times (RPS + 1)}</math>
<math>BPS = \frac{100}{BaseBuildup \times (RPS_{effective} + 1)}</math>


* '''Spin-Up Heroes:''' For heroes like McGinnis, the calculation uses their ''Max Spin'' RPS to ensure accurate representation of their intended buildup rate.
The '''Effective RPS''' is determined by analyzing specific hero mechanics:
* '''Shots to Proc:''' When generating tables, the module uses a Ceiling function (rounding up) to determine shots required. This accounts for cases like Kelvin where the math results in 19.99%, requiring 6 shots rather than the mathematically rounded 5.
* '''Standard Heroes:''' Uses the standard <code>RoundsPerSecond</code> from the data files.
* '''Spin-Up Heroes:''' For heroes like [[McGinnis]], the calculation uses their ''Max Spin'' RPS.
* '''Burst/Hybrid Heroes:''' For heroes like [[Paige]] and [[The Doorman]], the game displays a Fire Rate that includes an "Intra-Burst" delay, but the Buildup mechanic ignores this delay. The module detects this configuration (Burst Count = 1, but Interval > 0) and mathematically removes the interval to determine the true Effective RPS.
* '''Shots to Proc:''' The table uses <code>math.ceil</code> to always round up, ensuring accuracy for cases like [[Kelvin]] where the math results in 19.99% (requiring 6 shots, not 5).

Latest revision as of 20:55, 20 January 2026

Overview

[edit source]

The Buildup module provides functions for calculating the Status Effect Buildup per shot for heroes.

This is used for items that apply a status effect based on filling a meter (e.g., Toxic Bullets, Silencer, Inhibitor). The calculation normalizes the buildup based on the hero's Fire Rate (RPS) to ensure the time-to-activate is roughly consistent across different weapon types.

It references Data:HeroData.json for weapon stats (RPS, Spin-up) and Data:ItemData.json for the item's base buildup value.

Functions

[edit source]

The primary entry point used by Template:Buildup. It automatically detects whether to generate a full table or a single value based on the number of parameters provided.

get_bps

[edit source]

Calculates the specific buildup percentage per shot for a single hero.

Parameters

[edit source]
  • hero_name - Name of the hero in English (e.g., "Abrams") or the hero key.
  • item_name - Name of the item (e.g., "Toxic Bullets").

Example

[edit source]
{{#invoke:Buildup|get_bps|Haze|Toxic Bullets}}

Returns: 7.4

write_buildup_table

[edit source]

Generates a sortable wikitable listing the buildup percentage and shots-to-proc for every valid hero.

Parameters

[edit source]
  • item_name - Name of the item (e.g., "Silencer").

Example

[edit source]
{{#invoke:Buildup|write_buildup_table|Silencer}}

Internal Logic

[edit source]

The module uses the following formula derived from the game's mechanics: BPS=100BaseBuildup×(RPSeffective+1)

The Effective RPS is determined by analyzing specific hero mechanics:

  • Standard Heroes: Uses the standard RoundsPerSecond from the data files.
  • Spin-Up Heroes: For heroes like McGinnis, the calculation uses their Max Spin RPS.
  • Burst/Hybrid Heroes: For heroes like Paige and The Doorman, the game displays a Fire Rate that includes an "Intra-Burst" delay, but the Buildup mechanic ignores this delay. The module detects this configuration (Burst Count = 1, but Interval > 0) and mathematically removes the interval to determine the true Effective RPS.
  • Shots to Proc: The table uses math.ceil to always round up, ensuring accuracy for cases like Kelvin where the math results in 19.99% (requiring 6 shots, not 5).