更改

跳到导航 跳到搜索
添加9,189字节 、 2024年9月10日 (星期二)
fix the mess, add rest of page
第1行: 第1行: −
  此页面解释游戏是如何存储、解析怪物数据。
+
  ←[[模组:目录|目录]]
 +
{{翻译}}
 +
This page explains how the game stores and parses monster data. This is an advanced guide for mod developers.
   −
== 原始数据==
+
==Raw data==
怪物数据存储在<samp>Content\Data\Monsters.xnb</samp>
+
Monster data is stored in <samp>Content\Data\Monsters.xnb</samp>, which can be [[Modding:Editing XNB files#unpacking|unpacked for editing]]. Here's the raw data as of {{version|1.5.1}} for reference:
   −
== 格式==
+
{{collapse|Data|content=<syntaxhighlight lang="json">
 +
{
 +
  "Green Slime": "24/5/0/0/false/1000/766 .75 766 .05 153 .1 66 .015 92 .15 96 .005 99 .001/1/.01/4/2/.00/true/3/Green Slime",
 +
  "Dust Spirit": "40/6/0/0/false/1000/382 .5 433 .01 336 .001 84 .02 414 .02 97 .005 99 .001/2/.00/4/3/.00/true/2/Dust Spirit",
 +
  "Bat": "24/6/0/0/true/1000/767 .9 767 .4 108 .001 287 .02 96 .005 99 .001/1/.01/4/3/.00/true/3/Bat",
 +
  "Frost Bat": "36/7/0/0/true/1000/767 .9 767 .55 108 .001 287 .02 97 .005 99 .001/1/.01/4/3/.00/true/7/Frost Bat",
 +
  "Lava Bat": "80/15/0/0/true/1000/767 .9 767 .7 108 .001 287 .02 98 .005 99 .001/1/.01/4/3/.00/true/15/Lava Bat",
 +
  "Iridium Bat": "300/30/0/0/true/1000/386 .9 386 .5 386 .25 386 .1 288 .05 768 .5 773 .05 349 .05 787 .05 337 .008/1/.01/4/3/.00/true/22/Iridium Bat",
 +
  "Stone Golem": "45/5/0/0/false/1000/390 .9 80 .1 382 .1 380 .1 96 .005 99 .001/5/.01/3/2/.00/true/5/Stone Golem",
 +
  "Wilderness Golem": "30/5/0/0/false/1000/771 .9 771 .5 770 .5 382 .1 86 .005 72 .001/1/.01/3/2/.00/true/5/Wilderness Golem",
 +
  "Grub": "20/4/0/0/false/1000/684 .6 273 .05 273 .05 157 .02 114 .005 96 .005 99 .001/0/.005/3/1/.00/true/2/Grub",
 +
  "Fly": "22/6/0/0/true/1000/684 .9 157 .02 114 .005 96 .005 99 .001/1/.005/13/2/.0/true/10/Fly",
 +
  "Frost Jelly": "106/7/0/0/false/1000/766 .75 412 .08 70 .02 98 .015 92 .5 97 .005 99 .001/0/.01/4/2/.0/true/6/Frost Jelly",
 +
  "Sludge": "205/16/0/0/false/1000/766 .8 157 .1 -4 .1 72 .01 92 .5 98 .005 99 .001/0/.01/4/2/.0/true/10/Sludge",
 +
  "Shadow Guy": "125/20/0/0/false/0/769 .75 769 .1 329 .02 337 .002 336 .01 335 .02 334 .04 203 .04 293 .03 108 .003 -4 .1 98 .005 99 .001/2/.01/-1/2/.0/true/15/Shadow Guy",
 +
  "Ghost": "96/10/0/3/false/0/768 .95 768 .1 156 .08 338 .08 -6 .2 97 .005 99 .001/3/.01/12/4/.0/true/15/Ghost",
 +
  "Carbon Ghost": "190/25/0/3/false/0/749 .99 338 .1/3/.01/12/4/.0/true/20/Carbon Ghost",
 +
  "Duggy": "40/6/0/0/false/0/286 .25 535 .25 280 .03 105 .02 86 .1 72 .01 96 .005 99 .001/0/.01/1/2/.0/true/10/Duggy",
 +
  "Rock Crab": "30/5/0/0/false/0/717 .15 286 .4 96 .005 99 .001/1/0/1/2/.0/true/4/Rock Crab",
 +
  "Lava Crab": "120/15/0/0/false/0/717 .25 287 .4 98 .005 99 .001/3/0/1/3/.0/true/12/Lava Crab",
 +
  "Iridium Crab": "240/15/0/0/false/0/732 .5 386 .5 386 .5 386 .5/3/0/1/3/.0/true/20/Iridium Crab",
 +
  "Fireball": "1/18/0/0/true/0/72 .0000001/0/0/-1/3/.00/false/0/Fireball",
 +
  "Squid Kid": "1/18/0/0/true/0/768 .75 814 .2 336 .05 287 .1 288 .05 98 .005 99 .001/2/0/6/3/.0/true/15/Squid Kid",
 +
  "Skeleton Warrior": "300/12/1/3/false/0/769 .25 105 .03 106 .03 166 .001 60 .04 232 .04 72 .03 74 .01 97 .005 99 .001/3/0/5/2/.0/true/15/Skeleton Warrior",
 +
  "Crow": "1/0/0/1/false/0/-4 .9/3/0/5/2/.0/false/1/Crow",
 +
  "Frog": "1/0/0/1/false/0/-4 .9/3/0/5/2/.0/false/1/Frog",
 +
  "Cat": "300/0/0/0/false/0/-6 .001/3/0/6/2/.0/false/0/Cat",
 +
  "Shadow Brute": "160/18/0/0/false/0/769 .75 769 .1 337 .002 336 .01 335 .02 334 .04 203 .04 108 .003 -4 .1 98 .005 99 .001 74 .0005/2/.01/8/3/.0/true/15/Shadow Brute",
 +
  "Shadow Shaman": "80/17/0/0/false/0/769 .75 769 .2 337 .002 336 .01 335 .02 334 .04 108 .003 -4 .1 98 .005 99 .001 74 .0005/2/.01/8/3/.0/true/15/Shadow Shaman",
 +
  "Skeleton": "140/10/0/2/false/2000/881 .5 881 .4 881 .2 579 .005/1/.01/8/2/.0/true/8/Skeleton",
 +
  "Skeleton Mage": "60/5/0/2/false/2000/80 0/1/.01/8/2/.0/true/8/Skeleton Mage",
 +
  "Metal Head": "40/15/0/0/false/2000/768 .65 378 .1 378 .1 380 .1 380 .1 382 .1 98 .005 99 .001/8/.01/8/2/.0/true/6/Metal Head",
 +
  "Spiker": "5/15/0/0/false/2000/378 .1 378 .1 380 .1 380 .1 382 .1/4/.01/8/2/.0/true/1/Spiker",
 +
  "Bug": "1/8/0/0/false/2000/684 .76 157 .02 114 .005 96 .005 99 .001/0/0/-1/2/.0/true/1/Bug",
 +
  "Mummy": "260/30/0/3/false/1000/768 .99 428 .2 428 .05 768 .15 243 .04 856 .01 99 .001 74 .001/0/.01/8/2/.0/true/20/Mummy",
 +
  "Big Slime": "60/5/0/0/false/1000/766 .99 766 .9 766 .4 99 .001/0/.01/5/2/.0/true/7/Big Slime",
 +
  "Serpent": "150/23/0/2/true/1000/769 .99 769 .15 287 .15 226 .06 446 .008 74 .001/0/.01/13/2/.0/true/20/Serpent",
 +
  "Pepper Rex": "300/15/0/0/false/1000/80 0/5/.01/3/2/.0/true/7/Pepper Rex",
 +
  "Tiger Slime": "415/23/0/0/false/1000/766 .8 157 .1 -4 .1 72 .01 92 .5 98 .005 99 .001/0/.01/4/2/.0/true/20/Tiger Slime",
 +
  "Lava Lurk": "220/15/0/0/false/1000/881 .5 881 .4 881 .2 852 .15/5/.01/3/2/.0/true/12/Lava Lurk",
 +
  "Hot Head": "250/18/0/0/false/2000/768 .65 287 .1 378 .1 378 .1 380 .1 380 .1 382 .1 833 .1 833 .1 98 .005 99 .001/8/.01/8/2/.0/true/16/Hot Head",
 +
  "Magma Sprite": "220/15/0/0/true/2000/848 .5 848 .2/8/.01/8/2/.0/true/15/Magma Sprite",
 +
  "Magma Duggy": "380/16/0/0/false/0/831 .5 831 .5 288 .4 848 .4 848 .15/0/.01/1/2/.0/true/18/Magma Duggy",
 +
  "Magma Sparker": "310/15/0/0/true/2000/848 .5 848 .2/8/.01/8/2/.0/true/17/Magma Sparker",
 +
  "False Magma Cap": "290/15/0/0/false/0/851 .99 848 .5 848 .2/3/0/1/3/.0/true/14/False Magma Cap",
 +
  "Dwarvish Sentry": "300/18/0/0/true/0/60 .1 62 .1 64 .1 66 .1 68 .1 70 .1 72 .1/5/0/-1/3/.0/true/15/Dwarvish Sentry",
 +
  "Putrid Ghost": "500/25/0/3/false/0/749 .99/3/.01/12/4/.0/true/25/Putrid Ghost",
 +
  "Shadow Sniper": "300/18/0/0/false/0/769 .75 769 .1 337 .002 336 .01 335 .02 334 .04 203 .04 108 .003 -4 .1 98 .005 99 .001 74 .0005/2/.1/8/3/.0/true/20/Shadow Sniper",
 +
  "Spider": "200/15/0/0/false/0/769 .75 769 .1 337 .002 336 .01 335 .02 334 .04 203 .04 108 .003 -4 .1 98 .005 99 .001 74 .0005/2/.1/8/3/.0/true/15/Spider",
 +
  "Royal Serpent": "150/23/0/2/true/1000/769 .99 769 .15 287 .15 226 .06 446 .008 74 .001/0/.01/13/2/.0/true/20/Royal Serpent",
 +
  "Blue Squid": "80/18/0/0/true/0/768 .75 814 .2 336 .05 287 .1 288 .05 98 .005 99 .001/2/0/6/3/.0/true/15/Blue Squid"
 +
}
 +
</syntaxhighlight>}}
 +
 
 +
==Format==
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! 下标
+
! Index
! 字段
+
! Field
! 样例值
+
! Example Value
 
|-
 
|-
 
| 0
 
| 0
第73行: 第129行:  
|}
 
|}
   −
== 特定怪物==
+
Index 4 designates "gliders": monsters that fly above the ground. Although [[Ghost]]s are not listed as gliders in the data, they are overridden to be gliders in the game code.
=== 史莱姆sprites===
+
 
 +
Index 6 contains a list of object ID numbers, each followed by the probability of that object being chosen. Multiple objects can be chosen from the list. "Extra drop items" in the game code supplement this list for several monster types.
 +
 
 +
Index 12 designates "mine monsters": monsters whose stats and drops are buffed for players who have reached the bottom of the mines. These include the [[Wilderness Golem]] and other monsters that do not actually occur in the mines. This field is ''false'' only for non-monsters that use the monster data file, such as the fireball projectile launched by the [[Squid Kid]].
 +
 
 +
Note that many of the values stored in the monster data are altered by the game code under specific circumstances. These include being in different parts of the mines, having reached the bottom of the mines, and having a higher combat skill level.
 +
 
 +
==Monster-specific notes==
 +
===Slime sprites===
 
[[File:Green Slime Notes.png|right|128px]]
 
[[File:Green Slime Notes.png|right|128px]]
史莱姆sprites是一个完整的模组,其相关的部件分布在sprite表上。每个史莱姆都使用相同的grey sprite,根据史莱姆的类型进行着色和随机透明度值。
  −
第1行用于闲暇状态和正常移动状态。
  −
第2行到第4行表面上相同,但大多数情况似乎没使用(在特定攻击结束时,第2行会断断续续出现,但确切的条件需要进一步的测试)
  −
第5行在攻击动画中使用。
     −
在sprite表区域6包含了史莱姆通过“交配仪式”以及死亡粒子的图标。交配粒子用于寻找伴侣、拒绝伴侣和接受拒绝。
+
[[Slime]] sprites are entirely modular, with the associated parts spread out across the sprite sheet. Every slime uses the same grey sprite, coloring it with a tint mask based on the type of slime, along with a random transparency value. Row 1 is used for the idle state and normal movement. Rows 2 through 4, while apparently identical, appear unused in most cases (row 2 appears sporadically at the end of certain attacks, but further testing is needed for exact conditions). Row 5 is used for the attack animation.
 +
 
 +
Area 6 on the sprite sheet contains assets for the "mating ritual" slimes can go through, as well as their death particles. The mating particles (going clockwise) are used for seeking a mate, rejecting a mate, and receiving a rejection.
 +
 
 +
Area 7 contains the assets for the eyes. Slime eyes are placed dynamically on their sprite based on their current action. When the slime is facing down, the eyes are placed directly on top of the sprite; when facing left, only the right eye is rendered, and moved slightly left; when facing right, only the left eye is rendered and moved slightly right; when facing up, the eyes are rendered directly behind the slime. The eyes, going clockwise, are used for their idle state, during attacks, during the "evil" state (each slime has a chance to turn "evil" when first hit, and gains a stat boost), and taking damage.
 +
 
 +
Area 8 is the antenna attached to "male" slimes. It appears to animate independently of the slime itself, rocking back and forth somewhat at random. As with the main sprite, this uses a tint mask to take on the color of the slime variant.
 +
 
 +
Area 9 is the antenna attached to "special" slimes, and animates in the same way as the "male" antenna. However, this one doesn't use the tint mask, instead using whatever raw color is on the sprite sheet.
 +
 
 +
==Monster IDs==
 +
Each monster type has a unique ID (stored in the <samp>Name</samp> field) which can be used to spawn it (e.g. via [[Modding:Console commands|console commands]]), and is used to track kills for the [[Adventurer's Guild]] monster eradication goals. These are the IDs for vanilla monsters:
 +
 
 +
{| class="wikitable sortable"
 +
|-
 +
! monster
 +
! ID
 +
|-
 +
| [[Bat]]
 +
| <samp>Bat</samp>
 +
|-
 +
| [[Slimes|Big Slime]]
 +
| <samp>BigSlime</samp>
 +
|-
 +
| [[Blue Squid]]
 +
| <samp>Blue Squid</samp>
 +
|-
 +
| [[Bug]]
 +
| <samp>Bug</samp>
 +
|-
 +
| [[Cave Fly]]
 +
| <samp>Fly</samp>
 +
|-
 +
| [[Duggy]]
 +
| <samp>Duggy</samp>
 +
|-
 +
| [[Dust Sprite]]
 +
| <samp>Dust Spirit</samp>
 +
|-
 +
| [[Dwarvish Sentry]]
 +
| <samp>Dwarvish Sentry</samp>
 +
|-
 +
| [[Ghost]]
 +
| <samp>Ghost</samp>
 +
|-
 +
| [[Grub]]
 +
| <samp>Grub</samp>
 +
|-
 +
| [[Lava Crab]]
 +
| <samp>Lava Crab</samp>
 +
|-
 +
| [[Lava Lurk]]
 +
| <samp>Lava Lurk</samp>
 +
|-
 +
| [[Metal Head]]
 +
| <samp>Metal Head</samp>
 +
|-
 +
| [[Mummy]]
 +
| <samp>Mummy</samp>
 +
|-
 +
| [[Pepper Rex]]
 +
| <samp>Pepper Rex</samp>
 +
|-
 +
| [[Rock Crab]]
 +
| <samp>Rock Crab</samp>
 +
|-
 +
| [[Serpent]]
 +
| <samp>Serpent</samp>
 +
|-
 +
| [[Shadow Brute]]
 +
| <samp>Shadow Brute</samp>
 +
|-
 +
| [[Shadow Shaman]]
 +
| <samp>Shadow Shaman</samp>
 +
|-
 +
| [[Shadow Sniper]]
 +
| <samp>Shadow Sniper</samp>
 +
|-
 +
| [[Slimes|Slime]]
 +
| <samp>Green Slime</samp>
 +
|-
 +
| [[Spider]]
 +
| <samp>Spider</samp>
 +
|-
 +
| Spiker
 +
| <samp>Spiker</samp>
 +
|-
 +
| [[Squid Kid]]
 +
| <samp>Squid Kid</samp>
 +
|-
 +
| [[Stone Golem]]
 +
| <samp>Stone Golem</samp>
 +
|-
 +
| [[Wilderness Golem]]
 +
| <samp>Wilderness Golem</samp>
 +
|}
   −
区域7包含了眼睛的图标。史莱姆的眼睛是根据史莱姆当前动作动态地放置在「史莱姆sprite」上。当史莱姆面朝下,眼睛直接放置在sprite上;当史莱姆面朝左,只有右眼渲染,并稍微向左移动;当史莱姆面朝右,只有左眼渲染,并稍微向右移动;当史莱姆面朝上,眼睛则在史莱姆的后面。这些眼睛图标(按顺时针方向)分别表示闲暇状态、攻击期间、恶魔状态期间和受到伤害。
+
Note that many other monsters are variants of the above (''e.g.'' [[Haunted Skull]] is a variant of [[Bat]]), and have the same ID.
   −
区域8是附着在“雄性”史莱姆的天线,它的动画独立出现。
+
[[Category:模组]]
   −
区域9是附着在“特殊”史莱姆的天线。
+
[[en:Modding:Monster data]]
 +
[[ru:Модификации:Монстры]]
界面管理员、patroller、结构式讨论监督员管理员、translators
114,135

个编辑

导航菜单