游戏达人
  
- 贡献度
- 80
- 金元
- 19062
- 积分
- 2236
- 精华
- 1
- 注册时间
- 2010-11-27
|
靚仔 发表于 2013-12-18 21:42 
把更新发一下
二0七.我是巨鹿(按键盘HOME键主角变身巨鹿,按END键还原)
用记事本打开游戏目录\data\scripts\prefabs\player_common.lua文件,在inst:AddComponent("playercontroller")的下一行插入以下内容:
TheInput:AddKeyUpHandler(KEY_HOME, function()
if inst.components.inventory:Has("goldnugget", 30) then
inst.components.inventory:ConsumeByName("goldnugget", 30)
inst.components.locomotor:Stop()
inst.components.playercontroller:Enable(false)
inst.AnimState:PlayAnimation("idle_shiver_pre")
inst.AnimState:PushAnimation("idle_shiver_loop")
inst.AnimState:PushAnimation("idle_shiver_pst", false)
inst:DoTaskInTime(1, function()
inst.AnimState:SetBank("deerclops")
inst.AnimState:SetBuild("deerclops_build")
inst:SetStateGraph("SGdeerclops")
inst.AnimState:PlayAnimation("idle_loop", true)
inst.Transform:SetScale(1.5,1.5,1.5)
shadow:SetSize( 6, 3.5 )
local pos = GetPlayer():GetPosition()
GetSeasonManager():DoLightningStrike(pos)
inst.components.health:SetInvincible(true)
inst.components.hunger:Pause()
inst.components.combat:SetDefaultDamage(500)
inst.components.combat.hiteffectsymbol = "deerclops_body"
inst.components.combat.onhitotherfn = function()
inst.SoundEmitter:PlaySound("dontstarve/creatures/deerclops/attack")
inst.components.playercontroller:ShakeCamera(inst, "FULL", 0.5, 0.05, 2, 40)
end
inst.components.combat.playerdamagepercent = 0
inst.components.combat:SetAreaDamage(10, 1)
inst:AddComponent("heater")
inst.components.heater.heat = 180
inst.components.playercontroller:Enable(true)
end )
end
end )
TheInput:AddKeyUpHandler(KEY_END, function()
inst.components.locomotor:Stop()
inst.components.playercontroller:Enable(false)
inst.AnimState:PlayAnimation("taunt")
inst:DoTaskInTime(1, function()
inst.AnimState:SetBank("wilson")
inst.AnimState:SetBuild(name)
inst:SetStateGraph("SGwilson")
inst.AnimState:PlayAnimation("idle")
inst.Transform:SetScale(1,1,1)
shadow:SetSize( 1.3, .6 )
local pos = GetPlayer():GetPosition()
GetSeasonManager():DoLightningStrike(pos)
inst.components.health:SetInvincible(false)
inst.components.hunger:Resume()
inst.components.combat:SetDefaultDamage(TUNING.UNARMED_DAMAGE)
inst.components.combat.hiteffectsymbol = "torso"
inst.components.combat.onhitotherfn = nil
inst.components.combat:SetAreaDamage(0, 0)
inst:RemoveComponent("heater")
inst.components.playercontroller:Enable(true)
end )
end )
即可在你深陷绝境之时,对电脑屏幕大喊“我是巨鹿”,并同时按下键盘HOME键,主角将变身无敌巨鹿(锁血、锁饥饿、不怕冷),对敌人展开恐怖的报复吧(按Ctrl + 鼠标左键攻击)。每次变身将消耗30个黄金,身上黄金数不足时不会变身。想要变化回主角时,按键盘END键即可。注意,由于巨鹿变身时会招来闪电,并且本身具备大面积杀伤的能力,所以请远离基地变身,且尽量不要带同伴。修改过“神奇跳跃”的话,不要在变身巨鹿时跳跃
二一三.观赏蜘蛛(用蛛丝种关在笼中的蜘蛛,喂腐烂食物产种子)
1.用记事本打开游戏目录\data\scripts\prefabs\spoiledfood.lua文件,在inst:AddComponent("inspectable")的下一行插入inst:AddComponent("tradable")
2.用记事本打开游戏目录\data\scripts\prefabs\silk.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容:
local function OnDeploy (inst, pt)
local cage = SpawnPrefab("birdcage")
cage.Transform:SetPosition(pt.x, pt.y, pt.z)
cage.AnimState:SetMultColour(0/255,255/255,0/255,1)
cage:AddTag("cages")
cage:RemoveComponent("occupiable")
cage:RemoveComponent("trader")
cage:AddComponent("trader")
cage.components.trader:SetAcceptTest(function(cage, item)
if item.prefab == "spoiled_food" then return true end
return false
end )
cage.components.trader.onaccept = function(cage, giver, item)
for k = 1, math.random(5) do
local names = {"carrot_seeds","corn_seeds","pumpkin_seeds","eggplant_seeds","durian_seeds","pomegranate_seeds","dragonfruit_seeds"}
local name = names[math.random(#names)]
cage.components.lootdropper:SpawnLootPrefab(name)
end
end
local animal = SpawnPrefab("silk")
animal.AnimState:SetBank("spider_queen")
animal.AnimState:SetBuild("spider_queen_build")
animal.AnimState:PlayAnimation("idle", true)
animal.Transform:SetScale(0.35, 0.35, 0.35)
animal.components.inventoryitem.canbepickedup = false
local follower = animal.entity:AddFollower()
follower:FollowSymbol( cage.GUID, "swap_object", -10, -220, -0.1 )
cage:RemoveComponent("workable")
cage:AddComponent("workable")
cage.components.workable:SetWorkAction(ACTIONS.HAMMER)
cage.components.workable:SetWorkLeft(1)
cage.components.workable:SetOnFinishCallback(function(cage, worker)
SpawnPrefab("collapse_small").Transform:SetPosition(cage.Transform:GetWorldPosition())
cage.SoundEmitter:PlaySound("dontstarve/common/destroy_wood")
cage:Remove()
animal:Remove()
end )
inst.components.stackable:Get():Remove()
end
inst:AddComponent("deployable")
inst.components.deployable.ondeploy = OnDeploy
3.用记事本打开游戏目录\data\scripts\prefabs\birdcage.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容:
local function onsave(inst, data)
if inst:HasTag("cages") then
data.cages = true
end
end
local function onload(inst, data)
if data and data.cages then
inst.AnimState:SetMultColour(0/255,255/255,0/255,1)
inst:AddTag("cages")
inst:RemoveComponent("occupiable")
inst:RemoveComponent("trader")
inst:AddComponent("trader")
inst.components.trader:SetAcceptTest(function(inst, item)
if item.prefab == "spoiled_food" then return true end
return false
end )
inst.components.trader.onaccept = function(inst, giver, item)
for k = 1, math.random(5) do
local names = {"carrot_seeds","corn_seeds","pumpkin_seeds","eggplant_seeds","durian_seeds","pomegranate_seeds","dragonfruit_seeds"}
local name = names[math.random(#names)]
inst.components.lootdropper:SpawnLootPrefab(name)
end
end
local animal = SpawnPrefab("silk")
animal.AnimState:SetBank("spider_queen")
animal.AnimState:SetBuild("spider_queen_build")
animal.AnimState:PlayAnimation("idle", true)
animal.Transform:SetScale(0.35, 0.35, 0.35)
animal.components.inventoryitem.canbepickedup = false
local follower = animal.entity:AddFollower()
follower:FollowSymbol( inst.GUID, "swap_object", -10, -220, -0.1 )
inst:RemoveComponent("workable")
inst:AddComponent("workable")
inst.components.workable:SetWorkAction(ACTIONS.HAMMER)
inst.components.workable:SetWorkLeft(1)
inst.components.workable:SetOnFinishCallback(function(inst, worker)
SpawnPrefab("collapse_small").Transform:SetPosition(inst.Transform:GetWorldPosition())
inst.SoundEmitter:PlaySound("dontstarve/common/destroy_wood")
inst:Remove()
animal:Remove()
end )
end
end
inst.OnSave = onsave
inst.OnLoad = onload
即可用蛛丝种关在笼中的蜘蛛,喂它腐烂食物,会掉落随机品种的植物种子。观赏蜘蛛会不定期脱落蛛丝,不想要观赏蜘蛛了,用锤子砸掉即可
|
|