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

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


 1
 2一五七.全民吹气球(气球威力大、不伤主角、不降脑、彩色光、分散怪物注意力)
 3
 4	1.MT管理器打开游戏目录/assets/DLC0002/scripts/recipes.lua文件,在Recipe("heatrock", {Ingredient("rocks", 10),Ingredient("pickaxe", 1),Ingredient("flint", 3)}, RECIPETABS.SURVIVAL, TECH.SCIENCE_TWO)的下一行插入以下内容:
 5
 6Recipe("balloons_empty", {Ingredient("cutgrass", 1)}, RECIPETABS.SURVIVAL, TECH.NONE)
 7
 8
 9	2.MT管理器打开游戏目录/assets/DLC0002/scripts/actions.lua文件,将act.doer.components.sanity:DoDelta(-TUNING.SANITY_TINY)替换为act.doer.components.sanity:DoDelta(TUNING.SANITY_TINY)
10
11
12	3.MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/balloons_empty.lua文件,将下列内容:
13
14	inst:AddComponent("characterspecific")
15	inst.components.characterspecific:SetOwner("wes")
16
17	替换为:
18
19	--inst:AddComponent("characterspecific")
20	--inst.components.characterspecific:SetOwner("wes")
21
22
23	4.inst:DoTaskInTime(0, function() if not GetPlayer() or GetPlayer().prefab ~= "wes" then inst:Remove() end end)替换为以下内容:
24
25	--inst:DoTaskInTime(0, function() if not GetPlayer() or GetPlayer().prefab ~= "wes" then inst:Remove() end end)
26
27
28	5.MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/balloon.lua文件,将inst.components.combat:DoAreaAttack(inst, 2)替换为inst.components.combat:DoAreaAttack(inst, 8)
29
30
31	6.inst.components.combat:SetDefaultDamage(5)替换为以下内容:
32
33	inst.components.combat.playerdamagepercent = 0
34	inst.components.combat:SetDefaultDamage(500)
35	local light = inst.entity:AddLight() 
36	light:SetIntensity(.8)
37	light:SetRadius(2)
38	light:SetFalloff(.6)
39	light:Enable(true)
40	light:SetColour(colours[inst.colour_idx][1],colours[inst.colour_idx][2],colours[inst.colour_idx][3])
41	inst:AddTag("character")
42
43	即可让全部主角吹进化版气球,空气球在生存选项(画着绳套)下,用1个草制造。官方原本的气球只有wes有,且功能很烂,所以我改造了一下