Difference between revisions of "Modding:Weapon data"

From Stardew Valley Wiki
Jump to navigation Jump to search
(→‎Melee weapons: + base level field)
Line 84: Line 84:
 
| 2
 
| 2
 
| ''20''
 
| ''20''
| min damage
+
| minimum damage ouput
 
|-
 
|-
 
| 3
 
| 3
 
| ''30''
 
| ''30''
| max damage
+
| maximum damage output
 
|-
 
|-
 
| 4
 
| 4
 
| ''.8''
 
| ''.8''
| knockback
+
| knockback (weight) - determines how far the target will get pushed away when hit
 
|-
 
|-
 
| 5
 
| 5
 
| ''8''
 
| ''8''
| speed
+
| speed - determines how fast the user can attack
 
|-
 
|-
 
| 6
 
| 6
 
| ''5''
 
| ''5''
| added precision
+
| added precision - decreases the chance that a strike will cause no damage
 
|-
 
|-
 
| 7
 
| 7
 
| ''0''
 
| ''0''
| added defense
+
| added defense - affects how much damage the user takes
 
|-
 
|-
 
| 8
 
| 8
 
| ''0''
 
| ''0''
| type ("1" for dagger, "2" for club/hammer, "0" or "3" for sword, "4" for slingshot)
+
| type ("0" for stabbing sword, "1" for dagger, "2" for club/hammer, "3" for slashing sword, "4" for slingshot)
 
|-
 
|-
 
| 9
 
| 9

Revision as of 17:16, 4 October 2019

Index

This page explains how the game stores and parses weapon data. This is an advanced guide for mod developers.

Raw data

Weapon sprites are in TileSheets\Weapons.xnb, and weapon data (parsed by the MeleeWeapon constructor) is in Data\Weapons.xnb. The files can be unpacked for editing. Here's the raw data as of 1.3.36 for reference:

Data 
{
  "0": "Rusty Sword/A rusty, dull old sword./2/5/1/0/0/0/3/-1/-1/0/.02/3",
  "1": "Silver Saber/Plated with silver to deter rust./8/15/1/0/1/1/0/50/45/0/.02/3",
  "2": "Dark Sword/It's glowing with a mysterious energy./10/30/1/0/0/0/0/-1/-1/0/.05/3.5",
  "3": "Holy Blade/It feels hopeful to wield./18/24/1.2/0/5/0/3/-1/-1/0/.02/3",
  "4": "Galaxy Sword/It's unlike anything you've ever seen./60/80/1/8/0/0/0/-1/-1/0/.02/3",
  "5": "Bone Sword/A very light piece of sharpened bone./20/30/.8/8/5/0/0/74/50/0/.02/3",
  "6": "Iron Edge/A heavy broadsword./12/25/1.2/-4/0/1/3/44/-1/0/.02/3",
  "7": "Templar's Blade/It once belonged to an honorable knight./22/29/1/0/10/1/3/90/50/0/0/3",
  "8": "Obsidian Edge/It's incredibly sharp./30/45/1/-2/0/0/0/121/100/0/.02/3.2",
  "9": "Lava Katana/A powerful blade forged in a pool of churning lava./55/64/1.2/0/0/3/0/-1/-1/2/.015/3.5",
  "10": "Claymore/It's really heavy./20/32/1.3/-8/0/2/3/86/50/0/.02/3",
  "11": "Steel Smallsword/A standard metal blade./4/8/1/4/0/0/0/26/-1/0/.02/3",
  "12": "Wooden Blade/Not bad for a piece of carved wood./3/7/1/0/0/0/0/3/-1/0/.02/3",
  "13": "Insect Head/Not very pleasant to wield./10/20/1/4/9/0/0/-1/-1/0/.04/3",
  "14": "Neptune's Glaive/An heirloom from beyond the Gem Sea./18/35/1.4/-2/6/2/3/-1/-1/0/.02/3",
  "15": "Forest Sword/Made powerful by forest magic./8/18/1/4/5/1/0/-1/-1/0/.02/3",
  "16": "Carving Knife/A small, light blade./1/3/.5/0/0/0/1/18/-1/0/.04/3",
  "17": "Iron Dirk/A common dagger./2/4/.5/0/0/0/1/62/50/0/.03/3",
  "18": "Burglar's Shank/A weapon of choice for the swift and silent./7/12/.5/0/5/0/1/114/100/0/.04/3.5",
  "19": "Shadow Dagger/When you hold the blade to your ear you can hear 1,000 souls shrieking./10/20/.5/0/0/0/1/80/50/0/.04/3",
  "20": "Elf Blade/Only the nimble hands of an elf could craft this./3/5/.5/0/5/0/1/-1/-1/0/.04/3",
  "21": "Crystal Dagger/The blade is made of purified quartz./4/10/1/0/10/0/1/-1/-1/0/.03/4",
  "22": "Wind Spire/A swift little blade./1/5/1/0/0/0/1/-1/-1/0/.02/3.2",
  "23": "Galaxy Dagger/It's unlike anything you've seen./30/40/1/3/0/0/1/-1/-1/0/.02/3",
  "24": "Wood Club/A solid piece of wood, crudely chiseled into a club shape./9/16/1.5/-8/0/0/2/32/-1/0/.02/3",
  "25": "Alex's Bat/The sweet spot is dented from Alex's famous Grand Slam./1/3/1/-8/0/0/2/-1/-1/0/.02/3",
  "26": "Lead Rod/It's incredibly heavy./18/27/1.5/-16/0/0/2/56/50/1/.02/3",
  "27": "Wood Mallet/The solid head packs a punch. Relatively light for a club./15/24/1.3/-4/1/0/2/68/50/0/.02/3",
  "28": "The Slammer/An extremely heavy gavel that'll send foes flying./40/55/1.5/-12/0/0/2/128/100/2/.02/3",
  "29": "Galaxy Hammer/It's made from an ultra-light material you've seen before./70/90/1/-4/0/0/2/-1/-1/0/.02/3",
  "30": "Sam's Old Guitar/It's seen better days./1/3/1/-6/0/0/2/-1/-1/0/.02/3",
  "31": "Femur/An old, heavy bone caked in centuries of grime./6/11/1.5/-4/0/0/2/10/-1/0/.02/3",
  "32": "Slingshot/Requires stones for ammo./1/3/1/308/0/0/4/-1/-1/0/.02/3",
  "33": "Master Slingshot/Requires stones for ammo./1/3/1/308/0/0/4/-1/-1/0/.02/3",
  "34": "Galaxy Slingshot/It looks really powerful./1/3/1/308/0/0/4/-1/-1/0/.02/3",
  "35": "Elliott's Pencil/Elliott used this to write his book. It's sharp!/1/3/1/308/0/0/1/-1/-1/0/.02/3",
  "36": "Maru's Wrench/A big, metal wrench. It smells like Maru./1/3/1/308/0/0/2/-1/-1/0/.02/3",
  "37": "Harvey's Mallet/It brings back memories of Harvey's clinic./1/3/1/308/0/0/2/-1/-1/0/.02/3",
  "38": "Penny's Fryer/Penny's favorite frying pan. There's some rubbery gunk stuck to the inside./1/3/1/308/0/0/2/-1/-1/0/.02/3",
  "39": "Leah's Whittler/Leah's favorite tool for shaping driftwood./1/3/1/308/0/0/1/-1/-1/0/.02/3",
  "40": "Abby's Planchette/It's made from fine marblewood./1/3/1/308/0/0/1/-1/-1/0/.02/3",
  "41": "Seb's Lost Mace/One of Sebastian's medieval replicas./1/3/1/308/0/0/2/-1/-1/0/.02/3",
  "42": "Haley's Iron/It's searing hot and smells like Haley's hair./1/3/1/308/0/0/0/-1/-1/0/.02/3",
  "43": "Pirate's Sword/It looks like a pirate owned this once./8/14/1/4/0/0/3/40/-1/0/.02/3",
  "44": "Cutlass/A finely crafted blade./9/17/1/4/0/0/0/-1/-1/0/.02/3",
  "45": "Wicked Kris/The blade is made of an iridium alloy./24/30/.5/0/8/0/1/-1/-1/2/.06/3",
  "46": "Kudgel/A brute's companion./27/40/1.6/-10/0/0/2/107/100/0/.02/3.1",
  "47": "Scythe/It can cut grass into hay, if you've built a silo./1/3/1/0/0/0/0/-1/-1/0/.02/3",
  "48": "Yeti Tooth/It's icy cold to the touch./26/42/1/0/0/4/0/-1/-1/0/.02/3.2",
  "49": "Rapier/An elegant blade./15/25/1/4/0/0/0/100/95/2/.02/3",
  "50": "Steel Falchion/Light and powerful./26/38/1/8/5/0/0/142/100/0/.02/3.4",
  "51": "Broken Trident/It came from the sea, but it's still sharp./15/26/.5/0/8/0/1/-1/-1/2/.02/3",
  "52": "Tempered Broadsword/It looks like it could withstand anything./29/44/1.2/-6/0/3/0/135/100/1/.02/3"
}

Format

Melee weapons

The weapon data in Data\Weapons.xnb contains fifteen fields for melee weapons:

index example value description
0 Bone Sword name
1 A very light piece of sharpened bone. description
2 20 minimum damage ouput
3 30 maximum damage output
4 .8 knockback (weight) - determines how far the target will get pushed away when hit
5 8 speed - determines how fast the user can attack
6 5 added precision - decreases the chance that a strike will cause no damage
7 0 added defense - affects how much damage the user takes
8 0 type ("0" for stabbing sword, "1" for dagger, "2" for club/hammer, "3" for slashing sword, "4" for slingshot)
9 74 The base mine level. When a container can drop a weapon based on field 10, there are two chances for a weapon to be chosen as a possible drop: (a) if its base mine level is closest to the current mine level, or (b) based on a probability equal to a Gaussian function defined by the formula e(-(current mine level - base mine level)2 / (2 * 122)). A match from the eligible weapons is then chosen randomly to drop.
10 50 The minimum mine level on which the item can be found in containers.
11 0 added area of effect
12 .02 critical chance
13 3 critical multiplier
14 display name (non-English files only)

Weapons have a hardcoded category of -98 (Object.weaponCategory).