Skip to content

Commit

Permalink
Re-enable SpecialEnergyCloud for powerups
Browse files Browse the repository at this point in the history
  • Loading branch information
dyceron committed Jul 9, 2024
1 parent 88a1de4 commit e37b295
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/open_samus_returns_rando/files/templates/randomizerpowerup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function RandomizerPowerup.OnPickedUp(resources, actorOrName)

Scenario.UpdateProgressiveItemModels()
if actorOrName ~= nil then
RandomizerPowerup.ActivateSpecialEnergy(actorOrName)
RandomizerPowerup.MarkLocationCollected(actorOrName)
end
RandomizerPowerup.IncrementInventoryIndex()
Expand Down Expand Up @@ -96,6 +97,20 @@ function RandomizerPowerup.MarkLocationCollected(actorOrName)
Blackboard.SetProp(playerSection, propName, "b", true)
end

function RandomizerPowerup.ActivateSpecialEnergy(actorOrName)
local name = actorOrName.sName
local cloud = ""
if name ~= nil then
if string.sub(name, 0, 8) == "LE_Power" then
cloud = string.sub(name, 11)
-- SuperMissile actor name has a typo, so explicity set the value of cloud
elseif name == "LE_PoweUp_SuperMissile" then
cloud = "_SuperMissile"
end
SpecialEnergyCloud.ActivateSpecialEnergy("TG_SpecialEnergyCloud" .. cloud)
end
end

function RandomizerPowerup.ObjectiveComplete()
if Game.GetItemAmount(Game.GetPlayerName(), "ITEM_ADN") == 39 then
Game.HUDIdleScreenLeave()
Expand Down

0 comments on commit e37b295

Please sign in to comment.