如何添加生物
https://stendhalgame.org/wiki/HowToAddCreaturesStendhal
您可以通过几个非常简单的步骤将新生物添加到游戏中:
在xml文件中编辑生物
在文件夹data\conf\creatures中,您将找到包含游戏中所有生物描述的xml文件。 例如。
<creature name="deer">
<type class="animal" subclass="deer" tileid="animal.png:9"/>
<description></description>
<attributes>
<atk value="5"/>
<def value="9"/>
<hp value="20"/>
<speed value="1.0"/>
<size value="1,1"/>
</attributes>
<level value="0"/>
<experience value="0"/>
<respawn value="900"/>
<corpse name="animal"/>
<drops>
<item value="meat" quantity="[1,3]" probability="60.0"/>
<item value="ham" quantity="[1,2]" probability="30.0"/>
<item value="antidote" quantity="[1,1]" probability="5.0"/>
</drops>
<equips>
</equips>
<ai>
<profile name="non_offensive"/>
<profile name="animal"/>
<profile name="coward"/>
<profile name="patrolling"/>
</ai>
</creature>
了解它是如何工作的很重要。
我们必须为该生物命名,并在生物标签中完成。 然后我们在type标签上指定类和子类。 该类应该是适用于一系列生物(例如,矮人)的一般描述。 子类需要是图像的名称,必须位于:
data/
sprites/
monsters/
class/
subclass.png
type标签内的下一个属性是tileid,它指向logic/creature/class.png文件中此怪物精灵的文件和位置(从0开始)。
在attributes标记内,您可以指定实体具有的属性:
- ATK 它是一个与生物可以造成的伤害成比例的值。 另请注意,总攻击也与生物等级成正比。
- DEF 它是一个与生物可以阻挡的伤害量成比例的值。 另请注意,总防御也与生物等级成正比。
- HP 是健康衡量标准
- Speed 是生物移动的速度。 范围从0到1,1比赛是玩家的速度。
- Size 它的大小是瓦片中生物的地面上的碰撞区域的大小:通常为1x1
下面是等级和经验标签。 该等级用于攻击和防御的伤害计算,以及玩家击中或击中玩家的机会,以及玩家测量生物的机会。 经验决定玩家通过杀死这个生物获得的奖励。 respawn是重生的时间。 实际重生使用无记忆分布,因此如果你等待重生时间,你有超过一半的机会找到该生物,但重生本身并不完全取决于该生物最后被杀的时间。
下面是drop标签,指定生物在被杀死时掉落的内容。 每个物品都有被丢弃的概率(概率属性)和可能被丢弃的数量(数量属性)。 如果你只想让它丢弃一个物品,我们仍然将数量写在1和1之间,如[1,1]。
装备物品到生物
你可以装备物品到生物的插槽:
- 右手
- 左手
- 盔甲
- 头部
- 腿部
- 脚部
Equipping with defensive items does not change the attack or def so it is not worth doing at the moment. Equipping with weapons makes the creature hit with the rate of the weapon. It does not add to the attack. If a creature is equipped with weapon of rate less than 5, is attacking faster, so it needs a smaller attack than other creatures of similar level. Likewise slower hitting creatures should hit harder to have the same overall effect.
Unless you want the creature to attack with a rate other than the default of 5, it is a good idea not to equip creatures ( because they take more memory ). Archers should equip arrows and bows so they have something to shoot with.
If a creature equips a weapon the drops are not changed.
尸体
你可以指定生物应该使用的尸体图像,并说明尸体有多大(如果大于1x1)。 图像是data/sprites/corpse。 对于比上面的例子更大的尸体(鹿使用animal),语法是:
<corpse name="giant_humanoid" width="2" height="2"/>
AI profiles
这些是如上例所示添加的。
-
offensive/non offensive
-
patrolling/non patrolling
-
coward/stupid coward/brave
-
animal/human
-
archer
射手异形生物使用远程攻击,它总是试图呆在一些远离它正在攻击的东西的瓦片上。 ai配置文件会在正常生物之上添加一些攻击,因此射手的攻击次数应该比同等级别的生物少。 -
lifesteal
生命周期配置文件的参数介于0和1之间。让我们举例说明。 我们有一些生命值为0.5的生物。 他击中了一名玩家并对玩家造成20马力的伤害。 这意味着他'生命'的10马力的伤害可以治愈他。 玩家伤害的程度与正常情况一样多,但该生物可以治疗任何伤害的50%。 -
heal
生物可以有一个治疗轮廓,它有两个参数[regen amount,turns]。 对于params [5,50]来说,每次经过一定次数后,它就会治疗5 HP。 第二个数字决定了回合数,它越大,间隔越长。 -
poison
有参数[偶然,毒物]的有毒生物每次击中你都有可能/ 100次中毒。 你的防守并没有帮助你防御有毒的生物。 他们使用特定的有毒物品进行毒害,这样每次中毒的总量,每次丢失的健康频率和数量都来自毒物本身。 -
rare
有些生物的产卵概率非常低(平均重生时间很长,比如6周),市长不应要求这些生物作为杀戮,也不会出现在死亡竞赛中,这会破坏它们的新奇性。 对于这些使用罕见的ai配置文件。 它们不能在raid中被召唤,除非在测试服务器中,再次确保它们的意外不会被破坏。 -
hidden
隐藏的生物根本不会在stendhal网页上显示生物。