饥荒-哈姆雷特 菩萨低眉 (敌人攻击你时角色自动 加满血条、San值,敌人直接死亡)

注意 修改前 请进行备份

注意 修改前 请进行备份

注意 修改前 请进行备份

 

1.在需要添加此功能的DLC中 进行修改

找到 某个DLC下的payler_common.lua文件 (修改前 请备份此文件

如果哈姆雷特是DLC00003 那么需要在 以下 路径中修改

DLC00003/scripts/prefabs/player_common.lua

2.然后 用记事本 打开player_common.lua 文件 查找到以下代码

 

inst:AddComponent("grue")

 

3.然后将下列代码插入到  inst:AddComponent("grue")的上方

local function OnAttacked(inst, data)
    inst.components.health:DoDelta(inst.components.health.maxhealth)
    inst.components.sanity:DoDelta(inst.components.sanity.max)
    if data.attacker.components.health then
        data.attacker.components.health:DoDelta(-3000)
    end	
end
inst:ListenForEvent("attacked", OnAttacked)

4.保存

重新启动饥荒 选择对应的修改后的DLC进行游戏即可

 

注意: 如果启动时报错 直接将备份的文件还原

 

posted @ 2020-05-12 16:29  飞尽堂前燕  阅读(435)  评论(0编辑  收藏  举报