第182页:泡泡糖
展开一八二.泡泡糖(吃黄油吹个保护泡泡)
用记事本打开游戏目录\data\scripts\prefabs\butter.lua文件,在inst.components.edible.hungervalue = TUNING.CALORIES_MED的下一行插入以下内容:
local function proc(inst, eater)
eater.components.health:SetInvincible(true)
inst:AddTag("forcefield")
local fx = SpawnPrefab("forcefieldfx")
fx.entity:SetParent(eater.entity)
fx.Transform:SetPosition(0, 0.2, 0)
local fx_hitanim = function()
fx.AnimState:PlayAnimation("hit")
fx.AnimState:PushAnimation("idle_loop")
end
fx:ListenForEvent("blocked", fx_hitanim, eater)
inst.active = true
eater:DoTaskInTime(60, function()
fx:RemoveEventCallback("blocked", fx_hitanim, eater)
fx.kill_fx(fx)
if inst:IsValid() then
eater.components.health:SetInvincible(false)
inst:RemoveTag("forcefield")
eater:DoTaskInTime(5, function() inst.active = false end)
end
end)
end
local function oneaten(inst, eater)
proc(inst, eater)
end
inst.components.edible:SetOnEatenFn(oneaten)
即可吃黄油后60秒内身边环绕一个保护泡,敌人无法伤到主角。黄油可以靠杀蝴蝶掉落,也可以用本修改技巧的“栽种尖刺灌木产黄油”得到
更多相关内容请关注:饥荒专区
责任编辑:Shy夏夏