Skip to content

Commit

Permalink
Refactor actororname check
Browse files Browse the repository at this point in the history
  • Loading branch information
dyceron committed Jul 9, 2024
1 parent 033a1be commit 1516d18
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ function RandomizerPowerup.OnPickedUp(resources, actorOrName)

Scenario.UpdateProgressiveItemModels()
if actorOrName ~= nil then
RandomizerPowerup.ActivateSpecialEnergy(actorOrName)
RandomizerPowerup.MarkLocationCollected(actorOrName)
RandomizerPowerup.GetName(actorOrName)
end
RandomizerPowerup.IncrementInventoryIndex()
RL.UpdateRDVClient(false)
Expand All @@ -72,7 +71,7 @@ function RandomizerPowerup.PropertyForLocation(actorOrName)
return "c_" .. actorOrName
end

function RandomizerPowerup.MarkLocationCollected(actorOrName)
function RandomizerPowerup.GetName(actorOrName)
local name
-- normal pickups
if actorOrName.sName ~= nil then
Expand All @@ -85,6 +84,11 @@ function RandomizerPowerup.MarkLocationCollected(actorOrName)
if name == nil then
return
end
RandomizerPowerup.MarkLocationCollected(name)
RandomizerPowerup.ActivateSpecialEnergy(name)
end

function RandomizerPowerup.MarkLocationCollected(name)
local playerSection = Game.GetPlayerBlackboardSectionName()
local currentScenario = Scenario.CurrentScenarioID
local propScenario = currentScenario
Expand All @@ -97,8 +101,7 @@ function RandomizerPowerup.MarkLocationCollected(actorOrName)
Blackboard.SetProp(playerSection, propName, "b", true)
end

function RandomizerPowerup.ActivateSpecialEnergy(actorOrName)
local name = actorOrName.sName
function RandomizerPowerup.ActivateSpecialEnergy(name)
local cloud = "TG_SpecialEnergyCloud"

-- Powerups
Expand Down

0 comments on commit 1516d18

Please sign in to comment.