代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。

原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html



一五七.全民吹气球(气球威力大、不伤主角、不降脑、彩色光、分散怪物注意力)

	1.用MT管理器打开游戏目录/assets/DLC0002/scripts/recipes.lua文件,在Recipe("heatrock", {Ingredient("rocks", 10),Ingredient("pickaxe", 1),Ingredient("flint", 3)}, RECIPETABS.SURVIVAL, TECH.SCIENCE_TWO)的下一行插入以下内容:

Recipe("balloons_empty", {Ingredient("cutgrass", 1)}, RECIPETABS.SURVIVAL, TECH.NONE)


	2.用MT管理器打开游戏目录/assets/DLC0002/scripts/actions.lua文件,将act.doer.components.sanity:DoDelta(-TUNING.SANITY_TINY)替换为act.doer.components.sanity:DoDelta(TUNING.SANITY_TINY)


	3.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/balloons_empty.lua文件,将下列内容:

	inst:AddComponent("characterspecific")
	inst.components.characterspecific:SetOwner("wes")

	替换为:

	--inst:AddComponent("characterspecific")
	--inst.components.characterspecific:SetOwner("wes")


	4.将inst:DoTaskInTime(0, function() if not GetPlayer() or GetPlayer().prefab ~= "wes" then inst:Remove() end end)替换为以下内容:

	--inst:DoTaskInTime(0, function() if not GetPlayer() or GetPlayer().prefab ~= "wes" then inst:Remove() end end)


	5.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/balloon.lua文件,将inst.components.combat:DoAreaAttack(inst, 2)替换为inst.components.combat:DoAreaAttack(inst, 8)


	6.将inst.components.combat:SetDefaultDamage(5)替换为以下内容:

	inst.components.combat.playerdamagepercent = 0
	inst.components.combat:SetDefaultDamage(500)
	local light = inst.entity:AddLight() 
	light:SetIntensity(.8)
	light:SetRadius(2)
	light:SetFalloff(.6)
	light:Enable(true)
	light:SetColour(colours[inst.colour_idx][1],colours[inst.colour_idx][2],colours[inst.colour_idx][3])
	inst:AddTag("character")

	即可让全部主角吹进化版气球,空气球在生存选项(画着绳套)下,用1个草制造。官方原本的气球只有wes有,且功能很烂,所以我改造了一下