Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small stuff #3509

Merged
merged 5 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion objects/power/fu_atmosfilter/fu_atmosfilter.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "/scripts/effectUtil.lua"
require "/scripts/fupower.lua"

function init()
power.init()
Expand Down Expand Up @@ -47,4 +48,4 @@ function containerCallback()
end
end
storage.effects = #effects > 0 and effects or nil
end
end
2 changes: 1 addition & 1 deletion objects/power/fu_atmosfilter/fu_atmosfilter.object
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}
],

"scripts" : [ "/scripts/fupower.lua","/objects/power/fu_atmosfilter/fu_atmosfilter.lua" ],
"scripts" : [ "/objects/power/fu_atmosfilter/fu_atmosfilter.lua" ],
"scriptDelta" : 60,

"objectType" : "container",
Expand Down
14 changes: 8 additions & 6 deletions objects/power/fu_atmosfilter/fu_atmosfilterwarped.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "/scripts/effectUtil.lua"
require "/scripts/fupower.lua"

function init()
power.init()
Expand All @@ -7,12 +8,13 @@ function init()
end
self=util.mergeTable(self or {},config.getParameter("atmos") or {})
itemList=root.assetJson("/objects/power/fu_atmosfilter/warpedItemList.json")
self.interval=1.0
end

function update(dt)
if self and self.range and itemList and (storage.effects or self.objectEffects) then
if not deltaTime or deltaTime > 1.0 then
if power.consume(config.getParameter('isn_requiredPower')) then
if (not deltaTime) or (deltaTime >= self.interval) then
if self and self.range and itemList and (storage.effects or self.objectEffects) then
if power.consume(config.getParameter('isn_requiredPower')*(deltaTime or self.interval)) then
animator.setAnimationState("switchState", "on")
if storage.effects then
for _,effect in pairs(storage.effects) do
Expand All @@ -34,10 +36,10 @@ function update(dt)
end
deltaTime=0
else
deltaTime=deltaTime+dt
animator.setAnimationState("switchState", "off")
end
else
animator.setAnimationState("switchState", "off")
deltaTime=deltaTime+dt
end
power.update(dt)
end
Expand Down Expand Up @@ -69,4 +71,4 @@ function containerCallback()
storage.messages = #messageList > 0 and messageList or nil
end

--effectUtil.effectTypesInRange(effect,range,types,duration,teamType)
--effectUtil.effectTypesInRange(effect,range,types,duration,teamType)
12 changes: 0 additions & 12 deletions objects/power/isn_atmosregulator/isn_atmosregenerator.lua

This file was deleted.

11 changes: 0 additions & 11 deletions objects/power/isn_atmosregulator/isn_atmosregulator.lua

This file was deleted.

2 changes: 1 addition & 1 deletion objects/power/isn_atmosregulator/isn_atmosregulator.object
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}
],

"scripts" : [ "/scripts/fupower.lua","/objects/power/fu_atmosfilter/fu_atmosfilter.lua" ],
"scripts" : [ "/objects/power/fu_atmosfilter/fu_atmosfilter.lua" ],
"scriptDelta" : 60,

"atmos" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
}
],

"scripts" : [ "/scripts/fupower.lua","/objects/power/fu_atmosfilter/fu_atmosfilter.lua" ],
"scripts" : [ "/objects/power/fu_atmosfilter/fu_atmosfilter.lua" ],
"scriptDelta" : 60,

"objectType" : "container",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
}
],

"scripts" : [ "/scripts/fupower.lua","/objects/power/fu_atmosfilter/fu_atmosfilterwarped.lua" ],
"scriptDelta" : 60,
"scripts" : [ "/objects/power/fu_atmosfilter/fu_atmosfilterwarped.lua" ],
"scriptDelta" : 10,

"objectType" : "container",
"openSounds" : [ "/sfx/objects/metalbox_open.ogg" ],
Expand Down
Loading