Background
攻略Factorio

异星工厂修改文件隐藏武器解锁方法

墨非
2/5/2018

在 Factorio 的文件结构中,弹药定义位于 `X:\Factorio\data\base\prototypes\item\ammo.lua`。要定位雷管弹药 `railgun-dart`,请在该文件中搜索 `name = "railgun-dart"`。 找到对应的段落后会看到类似下面的 Lua 表结构: ``` { type = "ammo", name = "railgun-dart", icon = "__base__/graphics/icons/railgun-ammo.png", flags = {"goes-to-main-inventory"}, ammo_type = { category = "railgun", target_type = "direction", action = { type = "line", -- 弹药效果类型 range = 25, -- 距离(图示为 128) width = 0.5, -- 实际伤害宽度(图示为 32) source_effects = { type = "create-entity", entity_name = "railgun-beam" -- 弹药实体 }, action_delivery = { type = "instant", -- 造成伤害的方式 target_effects = { type = "damage", damage = { amount = 100, type = "physical" } -- 伤害数值与类型 } } } }, magazine_size = 5, -- 每发弹夹弹药数量 subgroup = "ammo", order = "c[railgun]", stack_size = 200 -- 堆叠数量 } ``` 上述代码展示了雷管弹药的完整定义,包括其类型、图标、属性、伤害效果以及库存信息。