Toggle search
Search
Toggle menu
110
215
16
2K
SpiritVale Wiki
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Upload file
Toggle preferences menu
Notifications
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
user-interface-preferences
Personal tools
Talk
Contributions
Create account
Log in
Join the Playtest on Steam Now:
SpiritVale
Editing
Module:GameEffects/doc
From SpiritVale Wiki
Views
Read
Edit
View history
associated-pages
Module
Discussion
More actions
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Module:GameEffects == '''Module:GameEffects''' renders effect / status data from [[Data:effects.json]] into a reusable infobox-style table. It is intended to be used via a template (for example [[Template:Effect]]) so that status effects can be embedded on any page without creating individual pages for each effect. This module: * Loads data via [[Module:GameData]] β <code>GameData.loadEffects()</code>. * Looks up effects primarily by display <code>"Name"</code> (what editors use), with <code>"Internal Name"</code> as an optional fallback. * Builds a table with only the fields that actually exist for that effect. ---- == Data source == Effect data comes from [[Data:effects.json]], which is a JSON page with this top-level structure (see [[Module:GameData/doc]] for full details): { "version": "SpiritVale-0.9.3", "schema_version": 1, "generated_at": "2025-12-12T17:24:05.762333+00:00", "records": [ { "Name": "Aegis", "Internal Name": "Aegis", "Icon": "status-aegis.webp", "Description": "...", "Users": { ... }, "Mechanics": { ... }, "Status Effects": [ ... ], "Status Applications": [ ... ], "Effect Removal": [ ... ], "Events": [ ... ] } ] } Key fields for each effect: * <code>"Name"</code> β display name used on the wiki. * <code>"Internal Name"</code> β stable ID used as the main lookup key. * <code>"Icon"</code> β image file name for the status icon. * <code>"Description"</code> β human-readable description of the effect. * <code>"Users"</code> β who can use / apply this effect (classes, monsters, summons, skills, events, etc.). * <code>"Mechanics"</code> β core numeric behavior, such as percent damage, percent healing, flat damage, and element information. * <code>"Status Effects"</code> β the underlying stat modifiers (e.g. Attack Speed, Elemental Damage, Damage Taken from Magic) with Base / Per Level / Expression values. * <code>"Status Applications"</code> β which statuses this effect applies to other entities (scope, status name, duration, chance, etc.). * <code>"Effect Removal"</code> β how or when the effect ends (e.g. removed by hit, removed by attack, stacks with itself). * <code>"Events"</code> β event hooks that trigger skills while the effect is active (e.g. On Take Hit Reflect β Counter Slash). ---- == Output == For a given effect, the module renders a table with the CSS class <code>spiritvale-effect-infobox</code>. Depending on what exists in the JSON record, the table may include: * Header row with icon and effect name. * Description text. * Internal name (for debugging / internal reference). * Users: ** Classes, Monsters, Summons, Events, Skills, and any linked Status Effects. * Mechanics: ** Percent damage / healing. ** Flat damage. ** Element and element ID (if present). * Status Effects: ** Each entry from <code>"Status Effects"</code>, showing type name and Base / Per Level / Expression values. * Status Applications: ** Each entry from <code>"Status Applications"</code>, showing scope (Self / Target), status name, duration, chance, and whether the duration is fixed. * Removal: ** Any entries from <code>"Effect Removal"</code>, such as "Removed by hit", "Stacks with itself", etc. * Events: ** Any entries from <code>"Events"</code>, such as <code>On Take Hit Reflect β Counter Slash</code>. Rows are only shown if the underlying field exists in the JSON for that effect. ---- == Public interface == The module exposes a single entry point for templates: === <code>GameEffects.infobox(frame)</code> === This is usually called via <code>#invoke</code> from a template, not directly from pages. It accepts the following parameters (either passed directly or via a wrapper template): * <code>1</code> β unnamed parameter; treated as the effect <code>"Name"</code>. * <code>name</code> β explicit display <code>"Name"</code> of the effect (equivalent to <code>1</code>). * <code>id</code> β <code>"Internal Name"</code> of the effect (optional fallback / power use). Lookup order: # If <code>name</code> or the first unnamed parameter is provided and matches a recordβs <code>"Name"</code>, that record is used. # Otherwise, if <code>id</code> is provided and matches an <code>"Internal Name"</code>, that record is used. # If nothing is found, a small error message is returned and the page is categorized for tracking. Example direct usage (not recommended; normally use a template): {{#invoke:GameEffects|infobox|name=Poison}} or: {{#invoke:GameEffects|infobox|id=Poison}} ---- == Template:Effect == The recommended way to use this module is via a small wrapper template: Template:Effect {{#invoke:GameEffects|infobox | 1={{{1|}}} | name={{{name|}}} | id={{{id|}}} }} Typical usage on any page: {{Effect|Poison}} or, explicitly: {{Effect|name=Poison}} Internal IDs can still be used when needed: {{Effect|id=Poison}} This keeps page wikitext simple while centralizing all JSON loading and formatting logic inside Lua.
Summary:
Please note that all contributions to SpiritVale Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
SpiritVale Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Data:effects.json
(
view source
) (protected)
Template:Effect
(
edit
)
Module:GameData
(
view source
) (protected)
Module:GameEffects
(
view source
) (protected)
Editing
Module:GameEffects/doc
From SpiritVale Wiki