WARFRAME Wiki

Read about the future of the Fandom platform and the WARFRAME wiki! Any feedback would be appreciated! User blog:Cephalon Scientia/2022 Fandom Community Connect. - 06:11, 6 June 2022 (UTC)

READ MORE

WARFRAME Wiki
Advertisement
WARFRAME Wiki

Hey! You! Here to update something that's out of date? Follow these easy steps:

  1. Open the relevant Horizontal Partition.
  2. Use Ctrl +F  to find the data for the weapon.
  3. Find the number that's wrong.
  4. Change the number and save the page.

That's it! After you've done that, the data will proliferate out to all the relevant pages.

If you're adding new data instead of just changing existing data, try to use an example of how things are entered if you're not quite sure what to do.

(Oh, order doesn't matter, but spelling and capitalization do. For example, it doesn't matter if Disposition is first or last)

Thanks, you're awesome!

User:Falterfire

Last updated: Fri, 01 Apr 2022 22:07:29 +0000 (UTC) by User:Cephalon Scientia

Attack Data Schema

	{
		AttackName = "Normal Attack",
		AmmoCost = 0.5,
		BurstCount = 1,
		Damage = { Impact = 1, Puncture = 1, Slash = 1 },
		CritChance = 0.1,
		CritMultiplier = 1,
		StatusChance = 0.1,
		FireRate = 1.0,
		Falloff = { StartRange = 400, EndRange = 600, Reduction = 0.2 },
		ShotType = "Hit-Scan",
		ShotSpeed = 1,
		Trigger = "Semi-Auto"
	},
Key/Column Name Arsenal EN L10n Mobile Export Equivalent Internal Equivalent Data Type Required? Explanation/Description Example(s)
AttackName Varies N/A N/A String Name of attack; defaults to "Normal Attack" "Normal Attack" or "AoE Explosion"
AmmoCost N/A N/A ammoRequirement Number (float) Ammo consumed on a single attack input; defaults to 1 0.5 or 10
AmmoType N/A N/A ammoType String Type of ammo pickups that replenishes ammo reserves; "None" for battery weapons and "Energy" for those that use Warframe energy "Sniper"
BurstCount N/A N/A NumShots Number (integer) For burst-fire weapons, the number of shots per burst; for attacks that shoot bursts that scale off magazine size (e.g Pandero.png Pandero), use the base magazine amount as the burst count 4
BurstDelay N/A N/A BurstDelay Number (float) For burst-fire weapons, the time in seconds between each burst; omit this for attacks that shoot bursts that scale off magazine size as reload time is the delay effectively 0.04
BurstFireRate N/A N/A fireRate Number (float) For burst-fire weapons, the fire rate of weapon during burst 9.09
Damage Damage damagePerShot and totalDamage AttackData Table (map of floats) ✔️ Table of damage types that the weapon deals and their individual damage values. Possible keys: Impact, Puncture, Slash, Cold, Electricity, Heat, Toxin, Blast, Corrosive, Gas, Magnetic, Radiation, Viral, Void, and MinProgenitorBonus (random element for Kuva/Tenet weapons) { Impact = 100, Puncture = 25, Slash = 30 }
ChargeTime Charge Rate N/A ChargeTime Number (float) For charged attacks, the base charge time for a fully charged attack 0.5
CritChance Critical Chance criticalChance CriticalChance or criticalHitChance Number (float) ✔️ Attack's base critical chance as a decimal 0.25
CritMultiplier Critical Multiplier criticalMultiplier CriticalMultiplier or criticalHitDamageMultiplier Number (float) ✔️ Attack's base critical hit multiplier as a scalar 2.2
EffectDuration N/A N/A N/A Number (float) For special attacks, the time in seconds that a special effect lasts for (e.g. Pox.png Pox's toxin clouds or Zenistar.png Zenistar's disc) 5
ExplosionDelay Embedded Delay N/A EmbedTime Number (float) For AoE attacks, the time in seconds between initial shot and explosion; the same as "Embedded Delay" stat in-game 0.5
ExtraHeadshotDmg N/A N/A N/A Number (float) Additional bonus damage on headshots for weapons such as CernosPrime.png Cernos Prime 0.5
Falloff Falloff N/A damageFallOff and damageFallOffMinDamage or ExplosionFallOff and DamageRadius Table (map of floats) Attack's base Damage Falloff stats; includes starting distance in meters when falloff multiplier comes into play, ending distance in meters when falloff multipler is at max reduction, and the maximum damage reduction as a decimal { StartRange = 0, EndRange = 5, Reduction = 0.5 }
FireRate Fire Rate fireRate fireRate Number (float) ✔️ Attack's base Fire Rate or Attack Speed 6.5
ForcedProcs N/A N/A ForcedProcs Table (array of strings) Attack's forced procs, if any { "Impact", "Slash" }
IsSilent Noise noise IsSilenced Boolean Whether or not an attack has a silent Noise Level; defaults to false true
Multishot Multishot multishot fireIterations Number (integer) Attack's base Multishot value; defaults to 1 10
PunchThrough Punch Through N/A PunctureDepth or tracePunctureDepth Number (float) Attack's base Punch Through value in meters; defaults to 0 1.5
Range Range N/A traceDistance or DamageRadius Number (float) For maximum range of a particular attack in meters. For AoE attacks, the base radius of area of effect in meters. 40
ShotType N/A N/A HitType String ✔️ Attack's shot type (e.g. "Hit-Scan", "Projectile", "Discharge" for beam/continuous weapons, and "AoE" for area of effects) Projectile
ShotSpeed N/A N/A KinematicMaxSpeed or ForwardVel Number (integer) For projectile attacks, the attack's maximum projectile speed in meters per second (not initial or minimum speed) 50
StatusChance Status procChance ProcChance Number (float) ✔️ Attack's base status chance as a decimal 0.2
SyndicateEffect N/A N/A N/A String For Syndicate weapons, the Syndicate Radial Effect that it has "Entropy"
Trigger Trigger trigger FireModes String For weapons with multiple Trigger Types, attack's trigger type "Semi-Auto"

Gun Entry Schema

["Long Gun Weapon Name"] = {
	_IgnoreEntry = true,
	_TooltipAttackDisplay = 1,
	Accuracy = 100,
    Attacks = {
		{
			AttackName = "Normal Attack",
			AmmoCost = 0.5,
			BurstCount = 1,
			Damage = { Impact = 1, Puncture = 1, Slash = 1 },
			CritChance = 0.1,
			CritMultiplier = 1,
			StatusChance = 0.1,
			FireRate = 1.0,
			Falloff = { StartRange = 400, EndRange = 600, Reduction = 0.2 },
			ShotType = "Hit-Scan",
			ShotSpeed = 100,
			Trigger = "Semi-Auto"
		}
	},
	Class = "Sniper Rifle",
	Conclave = false,
	Disposition = 0.5,
	ExilusPolarity = "V",
	Family = "",
	Image = "Weapon.png",
	Introduced = "",
    Link = "Page Name",
	Magazine = 1,
	Mastery = 1,
	MaxAmmo = 540,
	Name = "Weapon Name",
	Polarities = {},
	Reload = 1,
	ReloadStyle = "Regenerate",
    Slot = "Primary",
	SniperComboMin = 1,
	SniperComboReset = 1,
	Spool = 5,
	Trigger = "Semi-Auto",
	Traits = { "Grineer" },
	Users = { },
	Zoom = { "2.0x", "4.0x" }
},
Key/Column Name Arsenal EN L10n Mobile Export Equivalent Internal Equivalent Data Type Required? Explanation/Description Example(s)
Accuracy Accuracy accuracy N/A Number (float) ✔️ Gun's base Accuracy value 100
Attacks N/A N/A AttackData, ExplosiveAttack, RadialDamage, EmbedAttack Table ✔️ Contains attack data for the weapon See #Attack Data Schema
Class N/A productCategory parent or parents String ✔️ Weapon class for modding or a subclass of the weapon in its equip slot; in the case of Exalted Weapons, it is just "Exalted Weapon" "Sniper Rifle"
CodexSecret N/A codexSecret CodexSecret Boolean Whether or not the weapon has an entry in the Codex before the player acquires it; defaults to false false
Conclave N/A N/A AvailableOnPvp Boolean Whether or not the weapon can be used in Conclave false
DefaultUpgrades N/A N/A DefaultUpgrades Table (array of strings) Additional upgrades that are innate to the weapon { "/Lotus/Weapons/Grineer/KuvaLich/Upgrades/InnateDamageRandomMod" }
Disposition Riven Disposition omegaAttenuation OmegaAttenuation Number (float) ✔️ Riven Mod Disposition value 0.5
ExilusPolarity N/A N/A ArtifactSlots String Polarity on Exilus slot "Madurai"
Family N/A N/A N/A String Weapon family that it belongs to, corresponding to the Riven Mod compatibility "Latron"
Image N/A textureLocation N/A String ✔️ Image file name of the weapon as uploaded to the wiki "CrpBFG.png"
InternalName N/A uniqueName path or TypeName String ✔️ The full unique name of a weapon formatted as a file path "/Lotus/Weapons/MK1Series/MK1Paris"
Introduced N/A N/A N/A String ✔️ The game version in which the weapon was first introduced in the global build of WARFRAME "30.5" or "Specters of the Rail"
IsLichWeapon N/A N/A IsKuva Boolean Denotes whether or not a weapon is a Kuva or Tenet weapon true
Link N/A N/A N/A String ✔️ Page/article link to the weapon on the wiki "Artemis Bow (Weapon)"
Magazine Magazine magazineSize AmmoClipSize Number (integer) ✔️ Gun's base magazine size 45
Mastery N/A masteryReq RequiredLevel Number (integer) ✔️ Mastery Rank requirement 5
MaxAmmo Maximum Ammo (PvP arsenal only) N/A AmmoCapacity Number (integer) ✔️ Gun's base maximum reserve ammo (this excludes magazine size) 210
Name N/A name LocalizeTag String ✔️ Weapon's name "Primary Vermisplicer Chamber"
Polarities N/A N/A ArtifactSlots Table (array of strings) ✔️ Full names of the weapon's non-Universal polarities { "Naramon", "Madurai" }
Reload Reload reloadTime reloadTime or reloadEndTime, reloadLoopTime, reloadStartTime for by shell reloads Number (float) ✔️ Gun's base reload time in seconds 3.5
ReloadDelay N/A N/A HeavyBatteryRegenDelay Number (float) For rechargeable/battery weapons, the time in seconds after firing before magazine 'recharges' or is replenished. For Vectis.png Vectis and Exergis.png Exergis, the time in seconds after firing before reload animation starts. 0.5
ReloadDelayEmpty N/A N/A HeavyBatteryRegenDelayFromEmpty Number (float) For rechargeable/battery weapons, the time in seconds after fully depleting magazine before magazine 'recharges' or is replenished 1
ReloadRate N/A N/A HeavyBatteryRegenRate Number (float) For rechargeable/battery weapons, the rate at which magazine 'recharges' or is replenished per second 40
ReloadStyle N/A N/A N/A String Gun's unique reload type for weapons like Cycron.png Cycron or Corinth.png Corinth "Regenerate" or "ByRound"
Slot N/A slot InventorySlot String ✔️ The weapon slot that the weapon can be equipped on; in the case of Exalted Weapons, it is just their modding class "Primary"
SniperComboMin N/A N/A HitReqNextTierOperator Number (integer) For sniper rifles, the minimum number of hits to gain combo bonus 1
SniperComboReset N/A N/A TimeBetweenHits Number (integer) For sniper rifles, the number of seconds after last hit before combo number goes down 3
Spool N/A N/A ContinuousMaxShots Number (integer) For auto-spool weapons, number of shots until weapon reaches max fire rate 5
Tradable N/A N/A TradeCapability Number (integer, enum) Whether or not a weapon is tradable to other players.
  • 0 or nil = not tradable
  • 1 = weapon itself is tradable only if it is unranked with no Forma and Orokin Catalyst installed
  • 2 = tradable parts and/or blueprint(s) but weapon itself is not tradable
  • 3 = indirectly tradable through trading Kuva Liches/Sisters of Parvos (Lich System in general)
  • 4 = only fully built components are tradable, not blueprints
  • 5 = for Robotic weapons that are indirectly tradable if parent companion is tradable
2
Trigger Trigger trigger FireModes String ✔️ Gun's Trigger Type "Auto" or "Auto / Burst"
Traits N/A N/A N/A Table (array of strings) Gun's categorical traits { "Grineer", "Wraith" }
Users N/A N/A N/A Table (array of strings) Name of NPCs that use this weapon { "Stalker", "Shadow Stalker" }
Zoom N/A N/A ZoomLevels Table (array of strings) The levels of zoom that the gun offers { "2.0x", "4.5x" }

Melee Entry Schema

["Melee Weapon Name"] = {
	_IgnoreEntry = true,
	_TooltipAttackDisplay = 1,
	Attacks = {
		{
            AttackName = "Normal Attack"
			Damage = { Impact = 1, Puncture = 1, Slash = 1 },
			CritChance = 0.1,
			CritMultiplier = 2,
			StatusChance = 0.1,
			FireRate = 1
 		}
	},
	BlockAngle = 55,
	Class = "Two-Handed Nikana",
	ComboDur = 5,
	Conclave = false,
	Disposition = 0.5,
	Family = "Tatsu",
	FollowThrough = 0.7,
	HeavyAttack = 1284,
	HeavySlamAttack = 1070,
	HeavyRadialDmg = 1070,
	HeavySlamRadius = 8,
	Image = "Tatsu.png",
	Introduced = "",
    Link = "Page Name"
	Mastery = 1,
	MeleeRange = 3,
	Name = "MeleeName",
	Polarities = {},
	SlamAttack = 642,
	SlamElement = "Heat",
	SlamRadialDmg = 214,
	SlamRadialElement = "Heat",
	SlamRadialProcs = { "Heat" },
	SlamRadius = 7,
	SlideAttack = 1,
 	Slot = "Melee",
	StancePolarity = "V",
	Traits = { "Tenno" },
	WindUp = 0.7
},
Key/Column Name Arsenal EN L10n Mobile Export Equivalent Internal Equivalent Data Type Required? Explanation/Description Example(s)
Attacks N/A N/A AttackData, ExplosiveAttack, RadialDamage, EmbedAttack Table ✔️ Contains attack data for the weapon See #Attack Data Schema
BlockAngle Blocking Angle blockingAngle ParryAngle Number (integer) ✔️ Melee's base blocking angle in degrees 90
Class N/A productCategory parent, parents, or MeleeStyle String ✔️ Weapon class for modding or a subclass of the weapon in its equip slot; in the case of Exalted Weapons, it is just "Exalted Weapon" "Nikana"
CodexSecret N/A codexSecret CodexSecret Boolean Whether or not the weapon has an entry in the Codex before the player acquires it; defaults to false false
ComboDur Combo Duration comboDuration TimeBetweenHits Number (integer) Melee's base combo duration in seconds 5
Conclave N/A N/A AvailableOnPvp Boolean Whether or not the weapon can be used in Conclave false
DefaultUpgrades N/A N/A DefaultUpgrades Table (array of strings) Additional upgrades that are innate to the weapon { "/Lotus/Weapons/Grineer/KuvaLich/Upgrades/InnateDamageRandomMod" }
Disposition Riven Disposition omegaAttenuation OmegaAttenuation Number (float) ✔️ Riven Mod Disposition value 0.5
Family N/A N/A N/A String Weapon family that it belongs to, corresponding to the Riven Mod compatibility "Machete"
FollowThrough Follow Through followThrough N/A Number (float) ✔️ Melee's base follow through multiplier as a decimal 0.6
HeavyAttack Heavy Attack heavyAttackDamage N/A Number (float) ✔️ Melee's base heavy attack damage. For Kuva/Tenet weapons include minimum +25% Progenitor bonus in damage value. 1284
HeavySlamAttack Slam Attack heavySlamAttack N/A Number (float) ✔️ Melee's base heavy slam direct hit damage. For Kuva/Tenet weapons include minimum +25% Progenitor bonus in damage value. 1070
HeavyRadialDmg Slam Radial Damage heavySlamRadialDamage N/A Number (float) ✔️ Melee's base heavy slam radial attack damage. For Kuva/Tenet weapons include minimum +25% Progenitor bonus in damage value. 1070
HeavySlamRadius Slam Radius heavySlamRadius N/A Number (integer) ✔️ Melee's base heavy slam radius in meters 8
Image N/A textureLocation N/A String ✔️ Image file name of the weapon as uploaded to the wiki "Ankyros.png"
InternalName N/A uniqueName path or TypeName String ✔️ The full unique name of a weapon formatted as a file path "/Lotus/Weapons/MK1Series/MK1Furis"
Introduced N/A N/A N/A String ✔️ The game version in which the weapon was first introduced in the global build of WARFRAME "30.5" or "Specters of the Rail"
IsLichWeapon N/A N/A IsKuva Boolean Denotes whether or not a weapon is a Kuva or Tenet weapon true
Link N/A N/A N/A String ✔️ Page/article link to the weapon on the wiki "Exalted Blade (Weapon)"
Mastery N/A masteryReq RequiredLevel Number (integer) ✔️ Mastery Rank requirement 5
MeleeRange Range range N/A Number (float) ✔️ Melee's base attack range in meters 2
Name N/A name LocalizeTag String ✔️ Weapon's name "Galatine Prime"
Polarities N/A N/A ArtifactSlots Table (array of strings) ✔️ Full names of the weapon's non-Universal polarities { "Naramon", "Madurai" }
SlamAttack Slam Attack slamAttack N/A Number (float) ✔️ Melee's base normal slam direct hit damage. For Kuva/Tenet weapons include minimum +25% Progenitor bonus in damage value. 642
SlamElement N/A N/A N/A String Melee's base normal slam direct hit damage type "Heat"
SlamRadialDmg Slam Radial Damage slamRadialDamage N/A Number (float) ✔️ Melee's base normal slam radial damage. For Kuva/Tenet weapons include minimum +25% Progenitor bonus in damage value. 214
SlamRadialElement N/A N/A N/A String Melee's base normal slam radial attack damage type "Heat"
SlamRadialProcs N/A N/A N/A Table (array of strings) Melee's base normal slam radial attack forced proc(s) { "Heat" }
SlamRadius Slam Radius slamRadius N/A Number (integer) ✔️ Melee's base normal slam radius in meters 7
SlideAttack Slide Attack slideAttack N/A Number (float) ✔️ Melee's base slide attack damage. For Kuva/Tenet weapons include minimum +25% Progenitor bonus in damage value. 100
SlideElement N/A N/A N/A String Melee's base slide attack damage type "Toxin"
Slot N/A slot InventorySlot String ✔️ The weapon slot that the weapon can be equipped on; in the case of Exalted Weapons, it is just their modding class "Melee"
StancePolarity N/A N/A ArtifactSlots String ✔️ Polarity on Stance slot "Madurai"
Tradable N/A N/A TradeCapability Number (integer, enum) Whether or not a weapon is tradable to other players.
  • 0 or nil = not tradable
  • 1 = weapon itself is tradable only if it is unranked with no Forma and Orokin Catalyst installed
  • 2 = tradable parts and blueprint(s) but weapon itself is not tradable
  • 3 = indirectly tradable through trading Kuva Liches/Sisters of Parvos (Lich System in general)
  • 4 = only fully built components are tradable, not blueprints
2
Traits N/A N/A N/A Table (array of strings) Gun's categorical traits { "Grineer", "Wraith" }
Users N/A N/A N/A Table (array of strings) Name of NPCs that use this weapon { "Stalker", "Shadow Stalker" }
WindUp Wind Up windUp N/A Number (float) ✔️ Heavy attack wind-up time in seconds 0.5

For Module Use

Key/Column Name Data Type Required? Explanation/Description Example(s)
_IgnoreEntry Boolean For module use, indicates that this weapon table entry is special and should ignored when parsing table entries true
_TooltipAttackDisplay Number For module use, tells what table entry in Attack table to use when processing weapon tooltips and comparing weapon variants in Comparison sections; 1 will be used if no value is assigned 4

Horizontal Partitions (and where to update data)

Preprocessed Data

If you want data on the relative stat rankings (percentile-based) of each weapon for each weapon stat, see Module:Weapons/ppdata.

Export Data

CephalonSimaris.jpg
“Hunter, I have temporarily disabled that ability.”
This article contains JavaScript scripts that users can run locally in their browser's console or machine. As a warning, which goes for any scripts you copy/run from the Internet, MAKE SURE YOU UNDERSTAND THE CODE BEFORE RUNNING IT LOCALLY FOR YOUR OWN SECURITY! Contact an admin if you have any concerns or questions about a script.

Since this database is horizontally partitioned, if you want all the weapon table entries at once, go to Special:ExpandTemplates and run {{#invoke:LuaSerializer|serialize|Weapons/data}}. This will run the script on this page and return plaintext that contains a executable prettified Lua table with all the weapon table entries.

Alternatively, you can use MediaWiki's Action API to get the executed contents of this module:

Weapon Data

Validate data types of key-value pairs

p.validateDataTypes(frame): There are a total of 2 key-value errors

  1. "Cedo" contains an unsupported key AdditionalNotes
  2. "Tenet Spirex" contains an unsupported key AdditionalNotes

Checking missing keys

p.checkForMissingData(frame): There are a total of 28 key-value errors

  1. "Alternox" Attacks[4].FireRate is nil
  2. "Catchmoon" does not have Mastery key
  3. "Catchmoon (Primary)" does not have Mastery key
  4. "Dargyn" Attacks[1].CritChance is nil
  5. "Dargyn" Attacks[1].StatusChance is nil
  6. "Dargyn" Attacks[1].CritMultiplier is nil
  7. "Ebisu Spear" Attacks[1].CritChance is nil
  8. "Gaze" does not have Mastery key
  9. "Gaze (Primary)" does not have Mastery key
  10. "Lanzo Fishing Spear" Attacks[1].CritChance is nil
  11. "Peram Fishing Spear" Attacks[1].CritChance is nil
  12. "Rampart" Attacks[1].CritChance is nil
  13. "Rampart" Attacks[1].StatusChance is nil
  14. "Rampart" Attacks[1].CritMultiplier is nil
  15. "Rattleguts" does not have Mastery key
  16. "Rattleguts (Primary)" does not have Mastery key
  17. "Shockprod Fishing Spear" Attacks[1].CritChance is nil
  18. "Spari Spear" Attacks[1].CritChance is nil
  19. "Sporelacer" does not have Mastery key
  20. "Sporelacer (Primary)" does not have Mastery key
  21. "Stunna Fishing Spear" Attacks[1].CritChance is nil
  22. "Tombfinger" does not have Mastery key
  23. "Tombfinger (Primary)" does not have Mastery key
  24. "Tulok Fishing Spear" Attacks[1].CritChance is nil
  25. "Vermisplicer" does not have Mastery key
  26. "Vermisplicer (Primary)" does not have Mastery key
  27. "Wolf Sledge" Attacks[2].FireRate is nil
  28. "Wolf Sledge" Attacks[3].FireRate is nil

Validate Attack tables

p.validateAttacks(frame): There are a total of 0 key-value errors

Validate required weapon table keys

p.validateRequiredKeys(frame): There are a total of 257 key-value errors

  1. "Apoc" Image should be in the form of "WeaponName.png"; current value: TurretApoc.png
  2. "Apoc MK I" Image should be in the form of "WeaponName.png"; current value: TurretApoc.png
  3. "Apoc MK II" Image should be in the form of "WeaponName.png"; current value: TurretApoc.png
  4. "Apoc MK III" Image should be in the form of "WeaponName.png"; current value: TurretApoc.png
  5. "Cantic Prism (Gilded)" Image should be in the form of "WeaponName.png"; current value: CanticPrism.png
  6. "Carcinnox" Image should be in the form of "WeaponName.png"; current value: TurretCarcinnox.png
  7. "Carcinnox MK I" Image should be in the form of "WeaponName.png"; current value: TurretCarcinnox.png
  8. "Carcinnox MK II" Image should be in the form of "WeaponName.png"; current value: TurretCarcinnox.png
  9. "Carcinnox MK III" Image should be in the form of "WeaponName.png"; current value: TurretCarcinnox.png
  10. "Catchmoon" Image should be in the form of "WeaponName.png"; current value: KitgunChamberCatchmoon.png
  11. "Catchmoon" Magazine must be a value above 0
  12. "Catchmoon" Missing mastery rank unlock and mastery has to between 0 and 16 inclusive
  13. "Catchmoon" Missing reload time or reload time has to be above 0
  14. "Catchmoon (Primary)" Image should be in the form of "WeaponName.png"; current value: KitgunChamberCatchmoon.png
  15. "Catchmoon (Primary)" Missing InternalName
  16. "Catchmoon (Primary)" Magazine must be a value above 0
  17. "Catchmoon (Primary)" Missing mastery rank unlock and mastery has to between 0 and 16 inclusive
  18. "Catchmoon (Primary)" Missing reload time or reload time has to be above 0
  19. "Cerata" Heavy attack must be greater than 0
  20. "Cortege (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: Cortege.png
  21. "Corvas (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: Corvas.png
  22. "Corvas Prime (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: CorvasPrime.png
  23. "Cryophon" Image should be in the form of "WeaponName.png"; current value: TurretCryophon.png
  24. "Cryophon MK I" Image should be in the form of "WeaponName.png"; current value: TurretCryophon.png
  25. "Cryophon MK II" Image should be in the form of "WeaponName.png"; current value: TurretCryophon.png
  26. "Cryophon MK III" Image should be in the form of "WeaponName.png"; current value: TurretCryophon.png
  27. "Cyngas (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: Cyngas.png
  28. "Dargyn" Disposition must be between 0.5-1.55; default should be 0.5
  29. "Dargyn" Image should be in the form of "WeaponName.png"; current value: GrnSkiffMissile.png
  30. "Dargyn" Missing InternalName
  31. "Dargyn" Missing mastery rank unlock and mastery has to between 0 and 16 inclusive
  32. "Dissic Scaffold (Gilded)" Image should be in the form of "WeaponName.png"; current value: DissicScaffold.png
  33. "Dual Decurion (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: DualDecurion.png
  34. "Exard Scaffold (Gilded)" Image should be in the form of "WeaponName.png"; current value: ExardScaffold.png
  35. "Falcor" Heavy attack must be greater than 0
  36. "Fluctus (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: Fluctus.png
  37. "Galvarc" Image should be in the form of "WeaponName.png"; current value: OrdnanceGalvarc.png
  38. "Galvarc MK I" Image should be in the form of "WeaponName.png"; current value: OrdnanceGalvarc.png
  39. "Galvarc MK II" Image should be in the form of "WeaponName.png"; current value: OrdnanceGalvarc.png
  40. "Galvarc MK III" Image should be in the form of "WeaponName.png"; current value: OrdnanceGalvarc.png
  41. "Gaze" Image should be in the form of "WeaponName.png"; current value: KitgunChamberGaze.png
  42. "Gaze" Magazine must be a value above 0
  43. "Gaze" Missing mastery rank unlock and mastery has to between 0 and 16 inclusive
  44. "Gaze" Missing reload time or reload time has to be above 0
  45. "Gaze (Primary)" Image should be in the form of "WeaponName.png"; current value: KitgunChamberGaze.png
  46. "Gaze (Primary)" Missing InternalName
  47. "Gaze (Primary)" Magazine must be a value above 0
  48. "Gaze (Primary)" Missing mastery rank unlock and mastery has to between 0 and 16 inclusive
  49. "Gaze (Primary)" Missing reload time or reload time has to be above 0
  50. "Glaive" Heavy attack must be greater than 0
  51. "Glaive Prime" Heavy attack must be greater than 0
  52. "Glazio MK I" Image should be in the form of "WeaponName.png"; current value: TurretGlazio.png
  53. "Glazio MK II" Image should be in the form of "WeaponName.png"; current value: TurretGlazio.png
  54. "Glazio MK III" Image should be in the form of "WeaponName.png"; current value: TurretGlazio.png
  55. "Granmu Prism (Gilded)" Image should be in the form of "WeaponName.png"; current value: GranmuPrism.png
  56. "Grattler (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: Grattler.png
  57. "Halikar" Heavy attack must be greater than 0
  58. "Halikar Wraith" Heavy attack must be greater than 0
  59. "Imperator (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: Imperator.png
  60. "Imperator Vandal (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: ImperatorVandal.png
  61. "Kestrel" Heavy attack must be greater than 0
  62. "Klamora Prism (Gilded)" Image should be in the form of "WeaponName.png"; current value: KlamoraPrism.png
  63. "Klebrik Scaffold (Gilded)" Image should be in the form of "WeaponName.png"; current value: KlebrikScaffold.png
  64. "Kuva Ayanga (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: KuvaAyanga.png
  65. "Kuva Grattler (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: KuvaGrattler.png
  66. "Laith MK I" Image should be in the form of "WeaponName.png"; current value: TurretLaith.png
  67. "Laith MK II" Image should be in the form of "WeaponName.png"; current value: TurretLaith.png
  68. "Laith MK III" Image should be in the form of "WeaponName.png"; current value: TurretLaith.png
  69. "Larkspur (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: Larkspur.png
  70. "Lavan Apoc MK I" Image should be in the form of "WeaponName.png"; current value: TurretApoc.png
  71. "Lavan Apoc MK II" Image should be in the form of "WeaponName.png"; current value: TurretApoc.png
  72. "Lavan Apoc MK III" Image should be in the form of "WeaponName.png"; current value: TurretApoc.png
  73. "Lavan Carcinnox MK I" Image should be in the form of "WeaponName.png"; current value: TurretCarcinnox.png
  74. "Lavan Carcinnox MK II" Image should be in the form of "WeaponName.png"; current value: TurretCarcinnox.png
  75. "Lavan Carcinnox MK III" Image should be in the form of "WeaponName.png"; current value: TurretCarcinnox.png
  76. "Lavan Cryophon MK I" Image should be in the form of "WeaponName.png"; current value: TurretCryophon.png
  77. "Lavan Cryophon MK II" Image should be in the form of "WeaponName.png"; current value: TurretCryophon.png
  78. "Lavan Cryophon MK III" Image should be in the form of "WeaponName.png"; current value: TurretCryophon.png
  79. "Lavan Glazio MK I" Image should be in the form of "WeaponName.png"; current value: TurretGlazio.png
  80. "Lavan Glazio MK II" Image should be in the form of "WeaponName.png"; current value: TurretGlazio.png
  81. "Lavan Glazio MK III" Image should be in the form of "WeaponName.png"; current value: TurretGlazio.png
  82. "Lavan Laith MK I" Image should be in the form of "WeaponName.png"; current value: TurretLaith.png
  83. "Lavan Laith MK II" Image should be in the form of "WeaponName.png"; current value: TurretLaith.png
  84. "Lavan Laith MK III" Image should be in the form of "WeaponName.png"; current value: TurretLaith.png
  85. "Lavan Photor MK I" Image should be in the form of "WeaponName.png"; current value: TurretPhotor.png
  86. "Lavan Photor MK II" Image should be in the form of "WeaponName.png"; current value: TurretPhotor.png
  87. "Lavan Photor MK III" Image should be in the form of "WeaponName.png"; current value: TurretPhotor.png
  88. "Lavan Pulsar MK I" Image should be in the form of "WeaponName.png"; current value: TurretPulsar.png
  89. "Lavan Pulsar MK II" Image should be in the form of "WeaponName.png"; current value: TurretPulsar.png
  90. "Lavan Pulsar MK III" Image should be in the form of "WeaponName.png"; current value: TurretPulsar.png
  91. "Lavan Talyn MK I" Image should be in the form of "WeaponName.png"; current value: TurretTalyn.png
  92. "Lavan Talyn MK II" Image should be in the form of "WeaponName.png"; current value: TurretTalyn.png
  93. "Lavan Talyn MK III" Image should be in the form of "WeaponName.png"; current value: TurretTalyn.png
  94. "Lavan Vort MK I" Image should be in the form of "WeaponName.png"; current value: TurretVort.png
  95. "Lavan Vort MK II" Image should be in the form of "WeaponName.png"; current value: TurretVort.png
  96. "Lavan Vort MK III" Image should be in the form of "WeaponName.png"; current value: TurretVort.png
  97. "Lega Prism (Gilded)" Image should be in the form of "WeaponName.png"; current value: LegaPrism.png
  98. "MK1-Braton" Image should be in the form of "WeaponName.png"; current value: Braton.png
  99. "MK1-Furis" Image should be in the form of "WeaponName.png"; current value: Furis.png
  100. "MK1-Kunai" Image should be in the form of "WeaponName.png"; current value: Kunai.png
  101. "MK1-Paris" Image should be in the form of "WeaponName.png"; current value: Paris.png
  102. "MK1-Strun" Image should be in the form of "WeaponName.png"; current value: Strun.png
  103. "Mausolon (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: Mausolon.png
  104. "Milati" Image should be in the form of "WeaponName.png"; current value: OrdnanceMilati.png
  105. "Milati MK I" Image should be in the form of "WeaponName.png"; current value: OrdnanceMilati.png
  106. "Milati MK II" Image should be in the form of "WeaponName.png"; current value: OrdnanceMilati.png
  107. "Milati MK III" Image should be in the form of "WeaponName.png"; current value: OrdnanceMilati.png
  108. "Morgha (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: Morgha.png
  109. "Mote Amp (Gilded)" Image should be in the form of "WeaponName.png"; current value: MoteAmp.png
  110. "Orvius" Heavy attack must be greater than 0
  111. "Parazon" Magazine must be a value above 0
  112. "Parazon" MaxAmmo must be a value above 0 or math.huge (positive infinity)
  113. "Parazon" Missing reload time or reload time has to be above 0
  114. "Parazon" Missing trigger type of weapon
  115. "Pathocyst" Heavy attack must be greater than 0
  116. "Pencha Scaffold (Gilded)" Image should be in the form of "WeaponName.png"; current value: PenchaScaffold.png
  117. "Phaedra (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: Phaedra.png
  118. "Phahd Scaffold (Gilded)" Image should be in the form of "WeaponName.png"; current value: PhahdScaffold.png
  119. "Photor" Image should be in the form of "WeaponName.png"; current value: TurretPhotor.png
  120. "Photor MK I" Image should be in the form of "WeaponName.png"; current value: TurretPhotor.png
  121. "Photor MK II" Image should be in the form of "WeaponName.png"; current value: TurretPhotor.png
  122. "Photor MK III" Image should be in the form of "WeaponName.png"; current value: TurretPhotor.png
  123. "Prisma Dual Decurions (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: PrismaDualDecurions.png
  124. "Propa Scaffold (Gilded)" Image should be in the form of "WeaponName.png"; current value: PropaScaffold.png
  125. "Pugil" Missing InternalName
  126. "Pugil" Magazine must be a value above 0
  127. "Pugil" MaxAmmo must be a value above 0 or math.huge (positive infinity)
  128. "Pugil" Missing reload time or reload time has to be above 0
  129. "Pugil" Missing trigger type of weapon
  130. "Pulsar" Image should be in the form of "WeaponName.png"; current value: TurretPulsar.png
  131. "Pulsar MK I" Image should be in the form of "WeaponName.png"; current value: TurretPulsar.png
  132. "Pulsar MK II" Image should be in the form of "WeaponName.png"; current value: TurretPulsar.png
  133. "Pulsar MK III" Image should be in the form of "WeaponName.png"; current value: TurretPulsar.png
  134. "Rahn Prism (Gilded)" Image should be in the form of "WeaponName.png"; current value: RahnPrism.png
  135. "Rampart" Disposition must be between 0.5-1.55; default should be 0.5
  136. "Rampart" Missing InternalName
  137. "Rampart" Missing mastery rank unlock and mastery has to between 0 and 16 inclusive
  138. "Raplak Prism (Gilded)" Image should be in the form of "WeaponName.png"; current value: RaplakPrism.png
  139. "Rattleguts" Image should be in the form of "WeaponName.png"; current value: KitgunChamberRattleguts.png
  140. "Rattleguts" Magazine must be a value above 0
  141. "Rattleguts" Missing mastery rank unlock and mastery has to between 0 and 16 inclusive
  142. "Rattleguts" Missing reload time or reload time has to be above 0
  143. "Rattleguts (Primary)" Image should be in the form of "WeaponName.png"; current value: KitgunChamberRattleguts.png
  144. "Rattleguts (Primary)" Missing InternalName
  145. "Rattleguts (Primary)" Magazine must be a value above 0
  146. "Rattleguts (Primary)" Missing mastery rank unlock and mastery has to between 0 and 16 inclusive
  147. "Rattleguts (Primary)" Missing reload time or reload time has to be above 0
  148. "Razorflies" Image should be in the form of "WeaponName.png"; current value: Panel.png
  149. "Razorflies" Magazine must be a value above 0
  150. "Razorflies" MaxAmmo must be a value above 0 or math.huge (positive infinity)
  151. "Razorflies" Missing reload time or reload time has to be above 0
  152. "Razorflies" Missing trigger type of weapon
  153. "Shraksun Scaffold (Gilded)" Image should be in the form of "WeaponName.png"; current value: ShraksunScaffold.png
  154. "Shwaak Prism (Gilded)" Image should be in the form of "WeaponName.png"; current value: ShwaakPrism.png
  155. "Soaktron" Missing InternalName
  156. "Soaktron" Missing reload time or reload time has to be above 0
  157. "Sporelacer" Image should be in the form of "WeaponName.png"; current value: KitgunChamberSporelacer.png
  158. "Sporelacer" Magazine must be a value above 0
  159. "Sporelacer" Missing mastery rank unlock and mastery has to between 0 and 16 inclusive
  160. "Sporelacer" Missing reload time or reload time has to be above 0
  161. "Sporelacer (Primary)" Image should be in the form of "WeaponName.png"; current value: KitgunChamberSporelacer.png
  162. "Sporelacer (Primary)" Missing InternalName
  163. "Sporelacer (Primary)" Magazine must be a value above 0
  164. "Sporelacer (Primary)" Missing mastery rank unlock and mastery has to between 0 and 16 inclusive
  165. "Sporelacer (Primary)" Missing reload time or reload time has to be above 0
  166. "Talyn MK I" Image should be in the form of "WeaponName.png"; current value: TurretTalyn.png
  167. "Talyn MK II" Image should be in the form of "WeaponName.png"; current value: TurretTalyn.png
  168. "Talyn MK III" Image should be in the form of "WeaponName.png"; current value: TurretTalyn.png
  169. "Tombfinger" Image should be in the form of "WeaponName.png"; current value: KitgunChamberTombfinger.png
  170. "Tombfinger" Magazine must be a value above 0
  171. "Tombfinger" Missing mastery rank unlock and mastery has to between 0 and 16 inclusive
  172. "Tombfinger" Missing reload time or reload time has to be above 0
  173. "Tombfinger (Primary)" Image should be in the form of "WeaponName.png"; current value: KitgunChamberTombfinger.png
  174. "Tombfinger (Primary)" Missing InternalName
  175. "Tombfinger (Primary)" Magazine must be a value above 0
  176. "Tombfinger (Primary)" Missing mastery rank unlock and mastery has to between 0 and 16 inclusive
  177. "Tombfinger (Primary)" Missing reload time or reload time has to be above 0
  178. "Tunguska Cannon" Image should be in the form of "WeaponName.png"; current value: DomeCharge.png
  179. "Tunguska Cannon" Missing InternalName
  180. "Tycho Seeker" Image should be in the form of "WeaponName.png"; current value: OrdnanceTychoSeeker.png
  181. "Tycho Seeker MK I" Image should be in the form of "WeaponName.png"; current value: OrdnanceTychoSeeker.png
  182. "Tycho Seeker MK II" Image should be in the form of "WeaponName.png"; current value: OrdnanceTychoSeeker.png
  183. "Tycho Seeker MK III" Image should be in the form of "WeaponName.png"; current value: OrdnanceTychoSeeker.png
  184. "Unarmed" Image should be in the form of "WeaponName.png"; current value: Blank.png
  185. "Unarmed" Missing InternalName
  186. "Unarmed" Magazine must be a value above 0
  187. "Unarmed" MaxAmmo must be a value above 0 or math.huge (positive infinity)
  188. "Unarmed" Missing reload time or reload time has to be above 0
  189. "Unarmed" Missing trigger type of weapon
  190. "Velocitus (Atmosphere)" Image should be in the form of "WeaponName.png"; current value: Velocitus.png
  191. "Vermisplicer" Image should be in the form of "WeaponName.png"; current value: KitgunChamberVermisplicer.png
  192. "Vermisplicer" Magazine must be a value above 0
  193. "Vermisplicer" Missing mastery rank unlock and mastery has to between 0 and 16 inclusive
  194. "Vermisplicer" Missing reload time or reload time has to be above 0
  195. "Vermisplicer (Primary)" Image should be in the form of "WeaponName.png"; current value: KitgunChamberVermisplicer.png
  196. "Vermisplicer (Primary)" Missing InternalName
  197. "Vermisplicer (Primary)" Magazine must be a value above 0
  198. "Vermisplicer (Primary)" Missing mastery rank unlock and mastery has to between 0 and 16 inclusive
  199. "Vermisplicer (Primary)" Missing reload time or reload time has to be above 0
  200. "Vidar Apoc MK I" Image should be in the form of "WeaponName.png"; current value: TurretApoc.png
  201. "Vidar Apoc MK II" Image should be in the form of "WeaponName.png"; current value: TurretApoc.png
  202. "Vidar Apoc MK III" Image should be in the form of "WeaponName.png"; current value: TurretApoc.png
  203. "Vidar Carcinnox MK I" Image should be in the form of "WeaponName.png"; current value: TurretCarcinnox.png
  204. "Vidar Carcinnox MK II" Image should be in the form of "WeaponName.png"; current value: TurretCarcinnox.png
  205. "Vidar Carcinnox MK III" Image should be in the form of "WeaponName.png"; current value: TurretCarcinnox.png
  206. "Vidar Cryophon MK I" Image should be in the form of "WeaponName.png"; current value: TurretCryophon.png
  207. "Vidar Cryophon MK II" Image should be in the form of "WeaponName.png"; current value: TurretCryophon.png
  208. "Vidar Cryophon MK III" Image should be in the form of "WeaponName.png"; current value: TurretCryophon.png
  209. "Vidar Glazio MK I" Image should be in the form of "WeaponName.png"; current value: TurretGlazio.png
  210. "Vidar Glazio MK II" Image should be in the form of "WeaponName.png"; current value: TurretGlazio.png
  211. "Vidar Glazio MK III" Image should be in the form of "WeaponName.png"; current value: TurretGlazio.png
  212. "Vidar Laith MK I" Image should be in the form of "WeaponName.png"; current value: TurretLaith.png
  213. "Vidar Laith MK II" Image should be in the form of "WeaponName.png"; current value: TurretLaith.png
  214. "Vidar Laith MK III" Image should be in the form of "WeaponName.png"; current value: TurretLaith.png
  215. "Vidar Photor MK I" Image should be in the form of "WeaponName.png"; current value: TurretPhotor.png
  216. "Vidar Photor MK II" Image should be in the form of "WeaponName.png"; current value: TurretPhotor.png
  217. "Vidar Photor MK III" Image should be in the form of "WeaponName.png"; current value: TurretPhotor.png
  218. "Vidar Pulsar MK I" Image should be in the form of "WeaponName.png"; current value: TurretPulsar.png
  219. "Vidar Pulsar MK II" Image should be in the form of "WeaponName.png"; current value: TurretPulsar.png
  220. "Vidar Pulsar MK III" Image should be in the form of "WeaponName.png"; current value: TurretPulsar.png
  221. "Vidar Talyn MK I" Image should be in the form of "WeaponName.png"; current value: TurretTalyn.png
  222. "Vidar Talyn MK II" Image should be in the form of "WeaponName.png"; current value: TurretTalyn.png
  223. "Vidar Talyn MK III" Image should be in the form of "WeaponName.png"; current value: TurretTalyn.png
  224. "Vidar Vort MK I" Image should be in the form of "WeaponName.png"; current value: TurretVort.png
  225. "Vidar Vort MK II" Image should be in the form of "WeaponName.png"; current value: TurretVort.png
  226. "Vidar Vort MK III" Image should be in the form of "WeaponName.png"; current value: TurretVort.png
  227. "Vort MK I" Image should be in the form of "WeaponName.png"; current value: TurretVort.png
  228. "Vort MK II" Image should be in the form of "WeaponName.png"; current value: TurretVort.png
  229. "Vort MK III" Image should be in the form of "WeaponName.png"; current value: TurretVort.png
  230. "Xoris" Heavy attack must be greater than 0
  231. "Zetki Apoc MK I" Image should be in the form of "WeaponName.png"; current value: TurretApoc.png
  232. "Zetki Apoc MK II" Image should be in the form of "WeaponName.png"; current value: TurretApoc.png
  233. "Zetki Apoc MK III" Image should be in the form of "WeaponName.png"; current value: TurretApoc.png
  234. "Zetki Carcinnox MK I" Image should be in the form of "WeaponName.png"; current value: TurretCarcinnox.png
  235. "Zetki Carcinnox MK II" Image should be in the form of "WeaponName.png"; current value: TurretCarcinnox.png
  236. "Zetki Carcinnox MK III" Image should be in the form of "WeaponName.png"; current value: TurretCarcinnox.png
  237. "Zetki Cryophon MK I" Image should be in the form of "WeaponName.png"; current value: TurretCryophon.png
  238. "Zetki Cryophon MK II" Image should be in the form of "WeaponName.png"; current value: TurretCryophon.png
  239. "Zetki Cryophon MK III" Image should be in the form of "WeaponName.png"; current value: TurretCryophon.png
  240. "Zetki Glazio MK I" Image should be in the form of "WeaponName.png"; current value: TurretGlazio.png
  241. "Zetki Glazio MK II" Image should be in the form of "WeaponName.png"; current value: TurretGlazio.png
  242. "Zetki Glazio MK III" Image should be in the form of "WeaponName.png"; current value: TurretGlazio.png
  243. "Zetki Laith MK I" Image should be in the form of "WeaponName.png"; current value: TurretLaith.png
  244. "Zetki Laith MK II" Image should be in the form of "WeaponName.png"; current value: TurretLaith.png
  245. "Zetki Laith MK III" Image should be in the form of "WeaponName.png"; current value: TurretLaith.png
  246. "Zetki Photor MK I" Image should be in the form of "WeaponName.png"; current value: TurretPhotor.png
  247. "Zetki Photor MK II" Image should be in the form of "WeaponName.png"; current value: TurretPhotor.png
  248. "Zetki Photor MK III" Image should be in the form of "WeaponName.png"; current value: TurretPhotor.png
  249. "Zetki Pulsar MK I" Image should be in the form of "WeaponName.png"; current value: TurretPulsar.png
  250. "Zetki Pulsar MK II" Image should be in the form of "WeaponName.png"; current value: TurretPulsar.png
  251. "Zetki Pulsar MK III" Image should be in the form of "WeaponName.png"; current value: TurretPulsar.png
  252. "Zetki Talyn MK I" Image should be in the form of "WeaponName.png"; current value: TurretTalyn.png
  253. "Zetki Talyn MK II" Image should be in the form of "WeaponName.png"; current value: TurretTalyn.png
  254. "Zetki Talyn MK III" Image should be in the form of "WeaponName.png"; current value: TurretTalyn.png
  255. "Zetki Vort MK I" Image should be in the form of "WeaponName.png"; current value: TurretVort.png
  256. "Zetki Vort MK II" Image should be in the form of "WeaponName.png"; current value: TurretVort.png
  257. "Zetki Vort MK III" Image should be in the form of "WeaponName.png"; current value: TurretVort.png


---	WARFRAME weapon database to be used on the wiki.
--	
--	@module			weapons/data
--	@alias			data
--	@attribution	[[User:FINNER|FINNER]]
--	@attribution	[[User:Cephalon Scientia|Cephalon Scientia]]
--	@attribution	Everyone who contributes to adding new data or updating existing values in database
---	@require		[[Module:LuaSerializer]]
--	@release		stable
--	<nowiki>

-- TODO: Since horizontal partitions are accessed programmatically, this means
-- that this module can be tailored to serve specific user localizations.
-- All we need to do is to add a locale flag in here set to mw.getCurrentFrame():preprocess('{{int:Custom-lang}}'), 
-- a separate translation table (likely JSON) for mapping canonical internal names to localized names, 
-- and replace the Name key/Trigger key/index key with the localized counterpart.
-- In theory, any database access by requiring this module should contain the 
-- proper localization based on user's interface language setting.

local MODULE_LOCALIZATION = mw.site.namespaces[828].name

local data = {}

local slots = {
	{'primary', 'secondary', 'melee', 'archwing', 'companion', 'railjack', 'modular', 'misc'},

	primary = 'primary',
	secondary = 'secondary',
	melee = 'melee',

	archwing = 'archwing',
	['arch-gun'] = 'archwing',
	['arch-melee'] = 'archwing',
	['arch-gun (atmosphere)'] = 'archwing',

	companion = 'companion',
	['robotic'] = 'companion',
	['hound'] = 'companion',

	railjack = 'railjack',
	['railjack turret'] = 'railjack',
	['railjack ordnance'] = 'railjack',

	modular = 'modular',
	['amp'] = 'modular',
	['kitgun'] = 'modular',
	['zaw'] = 'modular',

	misc = 'misc',
	['emplacement'] = 'misc',
	['gear'] = 'misc',
	['nech-melee'] = 'misc',
	['unique'] = 'misc',
	['vehicle'] = 'misc',
}

-- Defining default metatable values
local dbMetatable = {
	-- Page title of database
	_pageName = 'Weapons/data',
	-- Flag to determine whether to use M:Weapons/Conclave/data or not
	_conclave = false
}
dbMetatable._pageTitle = MODULE_LOCALIZATION..':'..dbMetatable._pageName

---	Defining custom looping behavior with pairs() to iterate over multiple 
--	partitions while acting as one database table.
--	@function		data.__pairs
--	@param			{table} self Table self-reference
--	@return			{function} Iterator function
--	@return			{table} Contains key-pair values of slot names to corresponding horizontal partition
dbMetatable.__pairs = function(self)
		local temp = {}
		if (getmetatable(self)._conclave) then
			temp[1] = mw.loadData(getmetatable(self)._pageTitle)
		else
			for i, slot in ipairs(slots[1]) do
				temp[i] = mw.loadData(getmetatable(self)._pageTitle..'/'..slot)
			end
		end
		
		function next(t, key)
			return pairs(t)(t, key)
		end

		function __next(t, key)
			if not key then
				return next(t[1])
			else
				for i = 1, #t - 1 do
					if t[i][key] then
						if next(t[i], key) then
							return next(t[i], key)
						else
							return next(t[i + 1])
						end
					end
				end
				return next(t[#t], key)
			end
		end

		return __next, temp, nil
	end

---	Supporting indexing by slot name (returns array of weapon entries) or weapon name
--	(returns a weapon entry).
--	@function		data.__index
--	@param			{table} self Table self-reference
--	@param			{string} key Index key
--	@return			{table}
dbMetatable.__index = function(self, key)
		if (type(key) == 'number') then return nil end
		if (getmetatable(self)._conclave and key) then
			local conclaveData = mw.loadData(getmetatable(self)._pageTitle)
			-- TODO: Hacky fix to fix attempts at indexing by slot name in Conclave/data
			-- A more permanent solution would be to split Conclave/data into 8 partitions
			-- like with M:Weapons/data
			if (conclaveData[key] == nil) then
				return conclaveData	-- Return the whole table for iteration in M:Weapons/infobox
			end
			return conclaveData[key]
		end
		
		if key and slots[key:lower()] then
			return mw.loadData(getmetatable(self)._pageTitle..'/'..slots[key:lower()])
		end

		local weapon
		for _, slot in ipairs(slots[1]) do
			weapon = mw.loadData(getmetatable(self)._pageTitle..'/'..slot)[key]
			if weapon then return weapon end
		end
		return nil
	end

---	For changing which type of database to pull data from.
--	@function		__call
--	@usage			require('Module:Weapons/data')(true)
--	@param			{table} self Table self-reference
--	@param			{table} args Argument table; possible arguments:
--					* usePvPData - If true, use M:Weapons/Conclave/data, 
--								 if false use M:Weapons/data's partitions; default false
--	@return			{table} Database table
dbMetatable.__call = function(self, args)
		if (args.usePvPData == true) then
			getmetatable(self)._conclave = true
			local pageName = 'Weapons/Conclave/data'
			getmetatable(self)._pageName = pageName
			getmetatable(self)._pageTitle = MODULE_LOCALIZATION..':'..pageName
		end
		-- Define logic for additional named arguments before the return statement
		-- TODO: We can take advantage of calling a database table by adding additional arguments
		-- for filtering out content.
		return self
	end

---	Serializes database tables into a single string with no functions and metatables.
--	@function		__tostring
--	@param			{table} self Table self-reference
--	@return			{string} Serialized database
dbMetatable.__tostring = function(self)
		return require('Module:LuaSerializer')._serialize(getmetatable(self)._pageName)
	end

setmetatable(data, dbMetatable)

return data
Advertisement