Module:WeaponData/doc

From HoloCure Wiki
Jump to navigation Jump to search

This is the documentation page for Module:WeaponData

Deadbeat.gif
This template is deprecated and should not be used. It has not been maintained or it is superseded by another template.
Details: This module is no longer in use. Stats are now stored using the {{WeaponBoxC}} template in the weapon's page.

This is a data module for storing the weapon stats in the form of a Lua table. The values can be accessed using the {{GetDataValue}} template.

How to edit descriptions

Aside from descriptions, majority of these values can only be accessed through datamining, which requires some degree of programming knowledge, so this documentation will not go into further detail on how to edit these properties. See following sections for an attempt to explain the arrangement in detail.

Steps

1. Find the weapon in the module (Ctrl+F). For example, in the case of "Fox Tail" the entry will look like this:

	["Fox Tail"] = {
		{
			-- LVL 1
			desc = "Swipes Tail in front at close range.",
			weaponType = "Melee",
			attackTime1 = 70,
			attackCount1 = 1,
			damage1 = 1.5,
			hitLimit1 = -1,
			hitCD1 = 10,
			area1 = 1
		}, 
		{
			-- LVL 2
			desc = "Increase damage by 20%.",
			damage1 = 1.8
		}, 
		{
			-- LVL 3
			desc = "Increase attack area by 20%.",
			area1 = 1.2
		}, 
		{
			-- LVL 4
			desc = "Swing tail in front and back.",
			attackCount1 = 2,
			attackDelay1 = 10
		}, 
		{
			-- LVL 5
			desc = "Reduce time between attacks by 15%.",
			attackTime1 = 59
		}, 
		{
			-- LVL 6
			desc = "Increase attack area by 20%.",
			area1 = 1.44
		}, 
		{
			-- LVL 7/Awakened
			desc = "If Fox tail hits a target, there is a 20% chance to summon a Fubuki Sword that deals 100% damage.",
			label1 = "Tail",
			label2 = "Sword",
			damage2 = 1,
			area2 = 1,
			duration2 = 45,
			speed2 = 35,
			chance1 = 20
		}
	}, 

2. Scroll down until you find the level, which description you want to edit, indicated by "-- LVL " comment.

3. Usually on the very next line you will find " desc = ". The text within the quotation marks after this contains the description for the current level, you may freely edit this part.

4. Save your edit. If you did something wrong, the compiler will throw you an error and prevent you from proceeding, so it is unlikely that you will be able to cause any damage with your edit.

New entry

The block below can be copied to create a new entry with descriptions only.

	
    ["WEAPON_NAME"] = {
		{
			-- LVL 1
			desc = "DESCRIPTION"
		}, 
		{
			-- LVL 2
			desc = "DESCRIPTION"
		}, 
		{
			-- LVL 3
			desc = "DESCRIPTION"
		}, 
		{
			-- LVL 4
			desc = "DESCRIPTION"
		}, 
		{
			-- LVL 5
			desc = "DESCRIPTION"
		}, 
		{
			-- LVL 6
			desc = "DESCRIPTION"
		}, 
		{
			-- LVL 7/Awakened
			desc = "DESCRIPTION"
		}
	}, 
    

Colored text

Color coded in-game values can be added using the <span> tag as follows:

<span class=colorcode>Text to color</span>

For example,

Increase damage by <span class=gtgreen>20%</span>.

will output:

Increase damage by 20%.

Below is a list of the color classes available in the wiki's CSS. If more colors are needed, contact an admin.

  • gtgreen
  • gtred
  • gtyellow
  • gtblue
  • gtpink
  • gtorange
  • gtgray
  • gtpurple

General structure

The table contains weapon entries associated with a key value that is the weapon's name. Each weapon entry is a table of the weapon's levels, and each level is a table of the stat values at that level. In short:

  • Weapon
    • Level
      • Stat

Stats

Stat values are to be omitted if they do not exist, unknown, or if the current level does not change the value.

Following is a list of the currently used stats.

Key Value Description
desc string In-game description.
weight float Weapon's weight parameter. Describes how often the option appears in level ups and boxes compared to other weapons.
weaponType string Weapon's type: melee, ranged or multishot.
label string Effect header.
cooldown float Special Attack cooldown in seconds.
attackTime float Time between attack sequences in frames.
minDelay float Attack time minimum in frames.
duration float Duration of the effect in frames.
damage float Damage of the attack in decimal.
heal string Healing amount of the attack.
area float Area scale in decimal.
hitLimit float Amount of enemies the projectile can hit before expiring, use -1 for unlimited hits.
hitCD float Time before the projectile can hit the same enemy again in frames.
speed float Speed of the projectile or unit in pixels per frame.
attackCount float The amount of attacks in an attack sequence.
attackDelay float The time between attacks in an attack sequence in frames.
range float Effect range in pixels.
radius float Radius of an orbiting effect in pixels.
chance float Effect chance percentage (without the % sign).
kbDuration float Duration of knockback effect in frames.
kbSpeed float Speed of knockback effect in pixels per frame.

Handling multiple values of the same property

Weapons can cause multiple effects with different values in the same property. These values are differentiated by appending number to the base key (starting from 1) and using the label parameter to denote the effect. For example, a projectile has a bounce effect with different stats from the main projectile:

{
    -- LVL X
    label1 = "main", -- main projectile's stats
    damage1 = 1.2,
    area1 = 1.3,

    label2 = "bounce", -- bounced projectile's stats
    damage2 = 0.6,
    area2 = 0.8
}

In case of there being only one effect, the label parameter can be omitted, but '1' must be appended to the base key, except for desc and weight, which generally cannot have multiple values per level.

There is no limit to how many effects can be stored this way, but currently the templates using the data can handle up to 5, and may not display values beyond that.

Code

This is the documentation page, it should be transcluded into the main template page. See Template:Doc for more information.