Skip to content

Commit

Permalink
Merge pull request #88 from randovania/feature/cave-emmy-active
Browse files Browse the repository at this point in the history
Ensure the EMMI is active is Artaria by default
  • Loading branch information
henriquegemignani authored May 9, 2022
2 parents 7bdfbb0 + aca441c commit e620081
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 38 deletions.
21 changes: 11 additions & 10 deletions open_dread_rando/files/levels/s010_cave.lc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ function s010_cave.InitFromBlackboard()
CAVES_TUTO_MAP_ROOM_DONE = Scenario.ReadFromBlackboard(Scenario.LUAPropIDs.CAVES_TUTO_MAP_ROOM_DONE, false)
QUARENTINE_OPENED = Blackboard.GetProp("GAME_PROGRESS", "QUARENTINE_OPENED")
s010_cave.CheckScorpiusDead()
s010_cave.EmmyCaveSpawnSequence()

if Game.GetFromGameBlackboardSection("PlayedCutscenes", "CutScenePlayed[cutscenes/0049centralunitdetectsamus01/0049centralunitdetectsamus01.bmscu]") == 0 then
local L0_2 = Game.GetActor( "DoorEmmy11")
Expand Down Expand Up @@ -298,11 +299,11 @@ end

function s010_cave.EmmyCaveSpawnSequence()

local oActor1 = Game.GetActor("Door062 (PW-PW, Special)")
if oActor1 ~= nil then
oActor1.LIFE:CloseDoor(true, true, true)
oActor1.LIFE:LockDoor()
end
--local oActor1 = Game.GetActor("Door062 (PW-PW, Special)")
--if oActor1 ~= nil then
-- oActor1.LIFE:CloseDoor(true, true, true)
-- oActor1.LIFE:LockDoor()
--end

local oActor2 = Game.GetActor("PRP_CV_CentralUnitCaves")
if oActor2 ~= nil then
Expand All @@ -316,7 +317,7 @@ function s010_cave.EmmyCaveSpawnSequence()
oActor3.bEnabled = false
end

GUI.AddEmmyMissionLogEntry("#MLOG_ENCOUNTER_EMMY_CAVE")
--GUI.AddEmmyMissionLogEntry("#MLOG_ENCOUNTER_EMMY_CAVE")
if Scenario.CheckEmmyAlive(CurrentScenario.oEmmyEntity) then
CurrentScenario.oEmmyEntity.bEnabled = true
end
Expand Down Expand Up @@ -1140,10 +1141,10 @@ function s010_cave.OnSubAreaChange(old_subarea, old_actorgroup, new_subarea, new
end
end

local oActor = Game.GetActor("cutsceneplayer_37")
if oActor ~= nil then
oActor.CUTSCENE:TryLaunchCutscene()
end
--local oActor = Game.GetActor("cutsceneplayer_37")
--if oActor ~= nil then
-- oActor.CUTSCENE:TryLaunchCutscene()
--end
elseif old_subarea == "collision_camera_064" and new_subarea == "collision_camera_074" then
if disable_fade then
local oActor = Game.GetActor("TG_EnableSubareaChangeFade_001")
Expand Down
10 changes: 5 additions & 5 deletions open_dread_rando/files/levels/s020_magma.lc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -781,11 +781,11 @@ function s020_magma.OnSubAreaChange(old_subarea, old_actorgroup, new_subarea, ne
if oActor ~= nil then
oActor.CUTSCENE:TryLaunchCutscene()
end
elseif old_subarea == "collision_camera_052" and new_subarea == "collision_camera_020" then
local oActor = Game.GetActor("cutsceneplayer_38")
if oActor ~= nil then
oActor.CUTSCENE:TryLaunchCutscene()
end
--elseif old_subarea == "collision_camera_052" and new_subarea == "collision_camera_020" then
-- local oActor = Game.GetActor("cutsceneplayer_38")
-- if oActor ~= nil then
-- oActor.CUTSCENE:TryLaunchCutscene()
-- end
elseif old_subarea == "collision_camera_063" and new_subarea == "collision_camera_044" then
Game.PlayCurrentEnvironmentMusic()
elseif old_subarea == "collision_camera_022" and new_subarea == "collision_camera_030" then
Expand Down
28 changes: 15 additions & 13 deletions open_dread_rando/files/levels/s030_baselab.lc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ function s030_baselab.InitFromBlackboard()
LAB_EMMY_SPAWNED = Scenario.ReadFromBlackboard(Scenario.LUAPropIDs.LAB_EMMY_SPAWNED, false)
LAB_POSTXRELEASE_APPLIED = Scenario.ReadFromBlackboard(Scenario.LUAPropIDs.LAB_POSTXRELEASE_APPLIED, false)
QUARENTINE_OPENED = Blackboard.GetProp("GAME_PROGRESS", "QUARENTINE_OPENED")
s030_baselab.OnEnter_EmmyLAB_Presentation()

if QUARENTINE_OPENED == true then
s030_baselab.Activate_Setup_PostXRelease()
end
Expand Down Expand Up @@ -134,25 +136,25 @@ function s030_baselab.OnEnter_EmmyLAB_Presentation()


print("ACTIVANDO EMMY")
GUI.AddEmmyMissionLogEntry("#MLOG_ENCOUNTER_EMMY_LAB")
--GUI.AddEmmyMissionLogEntry("#MLOG_ENCOUNTER_EMMY_LAB")
local oActor = Game.GetActor("TG_EmmyLAB_Deactivation")
if oActor ~= nil then
oActor.bEnabled = false
end
Scenario.WriteToBlackboard(Scenario.LUAPropIDs.LAB_EMMY_SPAWNED, "b", true)
LAB_EMMY_SPAWNED = true
if Scenario.CheckEmmyAlive(CurrentScenario.oEmmyEntity) and CurrentScenario.oEmmyEntity ~= nil then
local oActor = Game.GetActor("LM_EmmyPresentation")
CurrentScenario.oEmmyEntity.bEnabled = false
CurrentScenario.oEmmyEntity.vPos = oActor.vPos
CurrentScenario.oEmmyEntity.vAng = oActor.vAng
CurrentScenario.oEmmyEntity.bEnabled = true
print("EMMY REACTIVADO")
end
local oShutter = Game.GetActor("doorshutter_001")
if oShutter ~= nil then
oShutter.ANIMATION:SetAction("opened", true)
end
--if Scenario.CheckEmmyAlive(CurrentScenario.oEmmyEntity) and CurrentScenario.oEmmyEntity ~= nil then
-- local oActor = Game.GetActor("LM_EmmyPresentation")
-- CurrentScenario.oEmmyEntity.bEnabled = false
-- CurrentScenario.oEmmyEntity.vPos = oActor.vPos
-- CurrentScenario.oEmmyEntity.vAng = oActor.vAng
-- CurrentScenario.oEmmyEntity.bEnabled = true
-- print("EMMY REACTIVADO")
--end
--local oShutter = Game.GetActor("doorshutter_001")
--if oShutter ~= nil then
-- oShutter.ANIMATION:SetAction("opened", true)
--end
end

function s030_baselab.EmmyLabSpawnSequenceEnd()
Expand Down
10 changes: 5 additions & 5 deletions open_dread_rando/files/levels/s050_forest.lc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ function s050_forest.SetupDebugGameBlackboard()
Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_METROIDNIZATION", "f", 0)
end




function s050_forest.IsEmmiActive()
return true
end



Expand Down Expand Up @@ -341,7 +341,7 @@ function s050_forest.OnEmmyForestGenerated(_ARG_0_, _ARG_1_)
AI.SetWorldGraphToEmmy("LE_WorldGraph", _ARG_1_.sName)
s050_forest.ChangePatrolEmmy("PATROLROUTE_03")
print("EMMY: Generation OK. Starting patrol: " .. _ARG_1_.AI.sCurrentPatrol)
if QUARENTINE_OPENED == true then
if s050_forest.IsEmmiActive() then
print("QUARANTINE IS OPENED")
else
CurrentScenario.oEmmyEntity.bEnabled = false
Expand Down Expand Up @@ -516,7 +516,7 @@ function s050_forest.OnWalkThroughEmmyDoor(_ARG_0_, _ARG_1_, _ARG_2_)



if QUARENTINE_OPENED == true and Scenario.CheckEmmyAlive(CurrentScenario.oEmmyEntity) then
if s050_forest.IsEmmiActive() and Scenario.CheckEmmyAlive(CurrentScenario.oEmmyEntity) then
if _ARG_1_ then
if CurrentScenario.oEmmyEntity ~= nil then
if _ARG_2_ then
Expand Down
10 changes: 5 additions & 5 deletions open_dread_rando/files/levels/s070_basesanc.lc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ function s070_basesanc.SetupDebugGameBlackboard()
Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_METROIDNIZATION", "f", 0)
end




function s070_basesanc.IsEmmiActive()
return true
end


local QUARENTINE_OPENED = Blackboard.GetProp("GAME_PROGRESS", "QUARENTINE_OPENED")
Expand Down Expand Up @@ -367,7 +367,7 @@ function s070_basesanc.OnCentralUnitEmmyReady(_ARG_0_, _ARG_1_)
s070_basesanc.ChangePatrolEmmy("PATROLROUTE_01")
print("EMMY: Generation OK. Starting patrol: " .. _ARG_1_.AI.sCurrentPatrol)

local L2_2 = Blackboard.GetProp("GAME_PROGRESS", "QUARENTINE_OPENED")
local L2_2 = s070_basesanc.IsEmmiActive()
if L2_2 == true and CurrentScenario.oEmmyEntity.AI.bTargetInsideEmmyZone then
print("QUARANTINE IS OPENED")
else
Expand Down Expand Up @@ -533,7 +533,7 @@ s070_basesanc.tEmmyDoor = nil
function s070_basesanc.OnWalkThroughEmmyDoor(_ARG_0_, _ARG_1_, _ARG_2_)


local L3_2 = Blackboard.GetProp("GAME_PROGRESS", "QUARENTINE_OPENED")
local L3_2 = s070_basesanc.IsEmmiActive()
if L3_2 == true and Scenario.CheckEmmyAlive(CurrentScenario.oEmmyEntity) then
local L4_2 = Game.GetActor("emmy_sanc_deactivated")

Expand Down
25 changes: 25 additions & 0 deletions open_dread_rando/static_fixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,32 @@ def add_callback_to_kraid(editor: PatcherEditor):
})


def activate_emmi_zones(editor: PatcherEditor):
# Remove the cutscene that plays when you enter the emmi zone for the first time
# This causes the border of the zone to not be revealed, but it should be possible to do that in another way
editor.remove_entity(
{
"scenario": "s010_cave",
"layer": "Cutscenes",
"actor": "cutscenetrigger_36"
},
None,
)

# Remove the cutscene that introduces the speed emmi
# This causes the border of the zone to not be revealed, but it should be possible to do that in another way
editor.remove_entity(
{
"scenario": "s030_baselab",
"layer": "cutscenes",
"actor": "cutscenetrigger_39"
},
None,
)


def apply_static_fixes(editor: PatcherEditor):
remove_problematic_x_layers(editor)
activate_emmi_zones(editor)
apply_one_sided_door_fixes(editor)
add_callback_to_kraid(editor)

0 comments on commit e620081

Please sign in to comment.