Skip to content

Commit

Permalink
Merge branch 'main' into surface_connection
Browse files Browse the repository at this point in the history
  • Loading branch information
dyceron committed Sep 21, 2023
2 parents 0164fc7 + 5c8e66f commit 9581172
Show file tree
Hide file tree
Showing 39 changed files with 11,433 additions and 391 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.10"

- name: Install Python packages
run: python -m pip install --upgrade pip setuptools build
Expand All @@ -50,12 +50,11 @@ jobs:
fail-fast: false
matrix:
python:
- {version: '3.9', wheel: 'cp39-cp39'}
- {version: '3.10', wheel: 'cp310-cp310'}

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
Expand Down
9 changes: 5 additions & 4 deletions open_samus_returns_rando/bmsld_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def all_actor_groups(scenario: Bmsld) -> Iterator[tuple[str, Container]]:
for sub_area in scenario.raw.sub_areas:
yield sub_area.name, sub_area

def add_actor_to_group(group: Container, actor_name: str):
group.names.append(actor_name)
def add_actor_to_group(group: Container, actor_name: str, pos: int = -1):
group.names.insert(pos, actor_name)

def get_actor_group(scenario: Bmsld, group_name: str) -> Container:
group = next(
Expand All @@ -25,14 +25,14 @@ def get_actor_group(scenario: Bmsld, group_name: str) -> Container:
return group

def add_actor_to_entity_groups(scenario: Bmsld, collision_camera_name: str, actor_name: str, all_groups: bool = False):
def comapre_func(first: str, second: str) -> bool:
def compare_func(first: str, second: str) -> bool:
if all_groups:
return first.startswith(f"eg_SubArea_{second}")
else:
return first == f"eg_SubArea_{second}"

collision_camera_groups = [group for group_name, group in all_actor_groups(scenario)
if comapre_func(group_name, collision_camera_name)]
if compare_func(group_name, collision_camera_name)]
if len(collision_camera_groups) == 0:
raise Exception(f"No entity group found for {collision_camera_name}")
for group in collision_camera_groups:
Expand All @@ -47,6 +47,7 @@ def all_actor_group_names_for_actor(scenario: Bmsld, actor_name: str) -> list[st
]

def remove_actor_from_group(scenario: Bmsld, group_name: str, actor_name: str):
LOG.debug("Remove actor %s from group %s", actor_name, group_name)
group = get_actor_group(scenario, group_name)
group.names.remove(actor_name)

Expand Down
40 changes: 40 additions & 0 deletions open_samus_returns_rando/files/heatzone.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
HeatZone = {}
function HeatZone.main()
end
function HeatZone.OnPlayerDead()
Game.GetPlayerInfo():ResetHeatZoneCount()
Game.GetPlayer():StopEntityLoopWithFade("actors/samus/damage_alarm.wav", 0.6)
end
function HeatZone.OnEnter(_ARG_0_, _ARG_1_, _ARG_2_)
if _ARG_2_ == true then
HeatZone.OnEnter()
end
end
function HeatZone.PlaySound()
Game.GetPlayer():PlayEntityLoop("actors/samus/damage_alarm.wav", 0.4, 100000, 110000, 1, false)
Game.PlayEntitySound("levels/lava_pain_0" .. math.random(2) .. ".wav", Game.GetPlayer().sName, 0.45, 500, 5000, 0.9)
end

function HeatZone.OnEnter()
if Game.GetPlayerInfo().iHeatZoneCount == 0 and Game.GetVariaSuitOn() < 1 then
Game.AddSF(0.0, "HeatZone.PlaySound", "")
guicallbacks.OnPlayerContinuousDamageStart()
utils.LOG(utils.LOGTYPE_LOGIC, "heatzoneenter")
end
Game.GetPlayerInfo():IncrementHeatZoneCount()
end
function HeatZone.OnExit(_ARG_0_, _ARG_1_, _ARG_2_)
if _ARG_2_ == true then
HeatZone.OnExit()
end
end
function HeatZone.OnExit()
Game.GetPlayerInfo():DecrementHeatZoneCount()
if Game.GetPlayerInfo().iHeatZoneCount == 0 then
Game.GetPlayer():StopEntityLoopWithFade("actors/samus/damage_alarm.wav", 0.6)
guicallbacks.OnPlayerContinuousDamageEnd()
utils.LOG(utils.LOGTYPE_LOGIC, "heatzoneexit")
elseif Game.GetPlayerInfo().iHeatZoneCount < 0 then
Game.GetPlayerInfo():ResetHeatZoneCount()
end
end
30 changes: 15 additions & 15 deletions open_samus_returns_rando/files/levels/s033_area3b.lua
Original file line number Diff line number Diff line change
Expand Up @@ -422,21 +422,21 @@ function s033_area3b.OnGamma_004_B_Generated(_ARG_0_, _ARG_1_)
_ARG_1_.AI:AddElectricMinesLogicPath(2, "PATH_Gamma004_B_mines_002")
_ARG_1_.AI:AddElectricMinesLogicPath(2, "PATH_Gamma004_B_mines_003")
_ARG_1_.AI:AddIdleLogicPath("PATH_Gamma004_B_Idle")
Gamma.SetArenaLife(_ARG_0_, _ARG_1_)
if Gamma.GetNumValveUsed(_ARG_0_) == 0 then
_ARG_1_.AI:AddValve("LE_Valve_Gamma_004_B_001")
_ARG_1_.AI:AddValve("LE_Valve_Gamma_004_B_002")
_ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.6)
_ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 60)
_ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
end
if Gamma.GetNumValveUsed(_ARG_0_) == 1 then
_ARG_1_.AI:AddValve("LE_Valve_Gamma_004_B_001")
_ARG_1_.AI:AddValve("LE_Valve_Gamma_004_B_002")
_ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.3)
_ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 90)
_ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
end
-- Gamma.SetArenaLife(_ARG_0_, _ARG_1_)
-- if Gamma.GetNumValveUsed(_ARG_0_) == 0 then
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_004_B_001")
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_004_B_002")
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.6)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 60)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
-- end
-- if Gamma.GetNumValveUsed(_ARG_0_) == 1 then
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_004_B_001")
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_004_B_002")
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.3)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 90)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
-- end
end
end
function s033_area3b.OnGamma_004_C_Trigger()
Expand Down
30 changes: 15 additions & 15 deletions open_samus_returns_rando/files/levels/s036_area3c.lua
Original file line number Diff line number Diff line change
Expand Up @@ -249,21 +249,21 @@ function s036_area3c.OnGamma_007_A_Generated(_ARG_0_, _ARG_1_)
_ARG_1_.AI:AddElectricMinesLogicPath(2, "PATH_Gamma007_A_mines_003")
_ARG_1_.AI:AddElectricMinesLogicPath(2, "PATH_Gamma007_A_mines_004")
_ARG_1_.AI:AddIdleLogicPath("PATH_Gamma007_A_Idle")
Gamma.SetArenaLife(_ARG_0_, _ARG_1_)
if Gamma.GetNumValveUsed(_ARG_0_) == 0 then
_ARG_1_.AI:AddValve("LE_Valve_Gamma_007_A_001")
_ARG_1_.AI:AddValve("LE_Valve_Gamma_007_A_002")
_ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.6)
_ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 60)
_ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
end
if Gamma.GetNumValveUsed(_ARG_0_) == 1 then
_ARG_1_.AI:AddValve("LE_Valve_Gamma_007_A_001")
_ARG_1_.AI:AddValve("LE_Valve_Gamma_007_A_002")
_ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.3)
_ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 90)
_ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
end
-- Gamma.SetArenaLife(_ARG_0_, _ARG_1_)
-- if Gamma.GetNumValveUsed(_ARG_0_) == 0 then
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_007_A_001")
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_007_A_002")
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.6)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 60)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
-- end
-- if Gamma.GetNumValveUsed(_ARG_0_) == 1 then
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_007_A_001")
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_007_A_002")
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.3)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 90)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
-- end
end
end
function s036_area3c.OnGamma_007_B_Trigger()
Expand Down
30 changes: 15 additions & 15 deletions open_samus_returns_rando/files/levels/s040_area4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,21 @@ function s040_area4.OnGamma_001_A_Generated(_ARG_0_, _ARG_1_)
_ARG_1_.AI:AddElectricMinesLogicPath(2, "PATH_Gamma001_A_mines_002")
_ARG_1_.AI:AddElectricMinesLogicPath(2, "PATH_Gamma001_A_mines_003")
_ARG_1_.AI:AddIdleLogicPath("PATH_Gamma001_A_Idle")
Gamma.SetArenaLife(_ARG_0_, _ARG_1_)
if Gamma.GetNumValveUsed(_ARG_0_) == 0 then
_ARG_1_.AI:AddValve("LE_Valve_Gamma_001_A_001")
_ARG_1_.AI:AddValve("LE_Valve_Gamma_001_A_002")
_ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.6)
_ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 60)
_ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
end
if Gamma.GetNumValveUsed(_ARG_0_) == 1 then
_ARG_1_.AI:AddValve("LE_Valve_Gamma_001_A_001")
_ARG_1_.AI:AddValve("LE_Valve_Gamma_001_A_002")
_ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.3)
_ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 90)
_ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
end
-- Gamma.SetArenaLife(_ARG_0_, _ARG_1_)
-- if Gamma.GetNumValveUsed(_ARG_0_) == 0 then
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_001_A_001")
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_001_A_002")
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.6)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 60)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
-- end
-- if Gamma.GetNumValveUsed(_ARG_0_) == 1 then
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_001_A_001")
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_001_A_002")
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.3)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 90)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
-- end
end
end
function s040_area4.OnGamma_001_B_Trigger()
Expand Down
30 changes: 15 additions & 15 deletions open_samus_returns_rando/files/levels/s050_area5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,21 @@ function s050_area5.OnGamma_002_A_Generated(_ARG_0_, _ARG_1_)
_ARG_1_.AI:AddElectricMinesLogicPath(2, "PATH_Gamma002_A_mines_002")
_ARG_1_.AI:AddElectricMinesLogicPath(2, "PATH_Gamma002_A_mines_003")
_ARG_1_.AI:AddIdleLogicPath("PATH_Gamma002_A_Idle_001")
Gamma.SetArenaLife(_ARG_0_, _ARG_1_)
if Gamma.GetNumValveUsed(_ARG_0_) == 0 then
_ARG_1_.AI:AddValve("LE_Valve_Gamma_002_A_001")
_ARG_1_.AI:AddValve("LE_Valve_Gamma_002_A_002")
_ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.6)
_ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 60)
_ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
end
if Gamma.GetNumValveUsed(_ARG_0_) == 1 then
_ARG_1_.AI:AddValve("LE_Valve_Gamma_002_A_001")
_ARG_1_.AI:AddValve("LE_Valve_Gamma_002_A_002")
_ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.3)
_ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 90)
_ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
end
-- Gamma.SetArenaLife(_ARG_0_, _ARG_1_)
-- if Gamma.GetNumValveUsed(_ARG_0_) == 0 then
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_002_A_001")
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_002_A_002")
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.6)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 60)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
-- end
-- if Gamma.GetNumValveUsed(_ARG_0_) == 1 then
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_002_A_001")
-- _ARG_1_.AI:AddValve("LE_Valve_Gamma_002_A_002")
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveLifePct", 0.3)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveTime", 90)
-- _ARG_1_.AI:AddBlackboardParam("fGotoValveSamusLife", 99)
-- end
end
end
function s050_area5.OnGamma_002_B_Trigger()
Expand Down
28 changes: 28 additions & 0 deletions open_samus_returns_rando/files/randomizer_powerup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -300,3 +300,31 @@ function RandomizerBabyHatchling.OnPickedUp(actor, progression)
RandomizerPowerup.OnPickedUp(actor, progression)
Game.GetDefaultPlayer("Samus").BABYHATCHLINGCREATION:SpawnBaby()
end

RandomizerScanningPulse = {}
setmetatable(RandomizerScanningPulse, {__index = RandomizerPowerup})
function RandomizerScanningPulse.OnPickedUp(actor, progression)
RandomizerPowerup.OnPickedUp(actor, progression)
Player.SetAbilityUnlocked("ScanningPulse", true)
end

RandomizerEnergyShield = {}
setmetatable(RandomizerEnergyShield, {__index = RandomizerPowerup})
function RandomizerEnergyShield.OnPickedUp(actor, progression)
RandomizerPowerup.OnPickedUp(actor, progression)
Player.SetAbilityUnlocked("EnergyShield", true)
end

RandomizerEnergyWave = {}
setmetatable(RandomizerEnergyWave, {__index = RandomizerPowerup})
function RandomizerEnergyWave.OnPickedUp(actor, progression)
RandomizerPowerup.OnPickedUp(actor, progression)
Player.SetAbilityUnlocked("EnergyWave", true)
end

RandomizerPhaseDisplacement = {}
setmetatable(RandomizerPhaseDisplacement, {__index = RandomizerPowerup})
function RandomizerPhaseDisplacement.OnPickedUp(actor, progression)
RandomizerPowerup.OnPickedUp(actor, progression)
Player.SetAbilityUnlocked("PhaseDisplacement", true)
end
5 changes: 5 additions & 0 deletions open_samus_returns_rando/files/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@
"type": "boolean",
"description": "Remove the Grapple Block in the path to Area 3 Interior (West) from Area 3 Interior (East).",
"default": false
},
"nerf_super_missiles": {
"type": "boolean",
"description": "Removes the Super Missile weakness on Missile shields.",
"default": false
}
},
"additionalProperties": false
Expand Down
Loading

0 comments on commit 9581172

Please sign in to comment.