1 Star 1 Fork 1

游戏程序龙之介/黑帝斯源码拆解学习

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Art.lua 1.99 KB
一键复制 编辑 原始数据 按行查看 历史
赵元恺 提交于 2023-03-08 16:11 . feat: 新增TraitScript相关注释
local checkShadows = false
function DoPlayerShadows( currentRun )
local shadowIds = GetIds({ Name = "PlayerShadows" })
local heroId = currentRun.Hero.ObjectId
local inShadow = "InShadow"
local outOfShadow = "OutOfShadow"
checkShadows = true
while( checkShadows ) do
NotifyOnCollide({ Id = heroId, DestinationIds = shadowIds, Notify = inShadow })
waitUntil( inShadow )
SetThingProperty({ Property = "Ambient", Value = 0.7, DestinationId = currentRun.Hero.ObjectId })
if checkShadows then
NotifyNotColliding({ Id = heroId, DestinationIds = shadowIds, Notify = outOfShadow })
waitUntil( outOfShadow )
SetThingProperty({ Property = "Ambient", Value = 0.0, DestinationId = currentRun.Hero.ObjectId })
end
end
end
function SetupRoomArt( currentRun, currentRoom )
local currentArea = currentRun.CurrentRoom.RoomSetName
if currentArea == "Secrets" then
thread( DoPlayerShadows, currentRun )
CreateAnimation({ Name = "ReflectionBlob", DestinationId = currentRun.Hero.ObjectId, OffsetY = 100, Scale = 1 })
elseif currentArea == "Tartarus" then
thread( DoPlayerShadows, currentRun )
end
if currentRoom.FootstepAnimationL ~= nil then
SwapAnimation({ Name = "FireFootstepL-Spawner", DestinationName = currentRoom.FootstepAnimationL })
end
if currentRoom.FootstepAnimationR ~= nil then
SwapAnimation({ Name = "FireFootstepR-Spawner", DestinationName = currentRoom.FootstepAnimationR })
end
if currentRoom.SwapAnimations ~= nil then
for fromAnim, toAnim in pairs( currentRoom.SwapAnimations ) do
SwapAnimation({ Name = fromAnim, DestinationName = toAnim })
end
end
if currentRoom.SwapSounds ~= nil then
for fromSound, toSound in pairs( currentRoom.SwapSounds ) do
SwapSound({ Name = fromSound, DestinationName = toSound })
end
end
end
function TeardownRoomArt( currentRun, currentRoom )
checkShadows = false
killWaitUntilThreads("InShadow")
killWaitUntilThreads("OutOfShadow")
SetThingProperty({ Property = "Ambient", Value = 0.0, DestinationId = currentRun.Hero.ObjectId })
end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/NoGameNoLife1234_admin/HadesSource.git
git@gitee.com:NoGameNoLife1234_admin/HadesSource.git
NoGameNoLife1234_admin
HadesSource
黑帝斯源码拆解学习
master

搜索帮助