第190页:近卫军
展开一九零.近卫军(主角受攻击自动出现机械护卫,不要与“菩萨低眉”一同修改)
用记事本打开游戏目录\data\DLC0001\scripts\prefabs\player_common.lua文件,在inst.Transform:SetFourFaced()的下一行插入以下内容:
local function OnAttacked(inst, data)
local spawn = ""
if math.random()<.1 then
spawn = "rook_nightmare"
elseif math.random()<.5 then
spawn = "bishop_nightmare"
else
spawn = "knight_nightmare"
end
SpawnAt("maxwell_smoke",inst)
local it = SpawnAt(spawn,inst)
if it.components.follower then
it.components.follower:SetLeader(GetPlayer())
end
end
inst:ListenForEvent("attacked", OnAttacked)
即可在主角受到攻击时,自动产生机械兵(共三种)保护主角。如果主角强制攻击(按Ctrl + 鼠标左键)其中一个机械兵,则其他机械兵会帮主角清理门户
更多相关内容请关注:饥荒专区
责任编辑:Shy夏夏