diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..e2366564 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,33 @@ +name: CI + +on: + push: + branches: '**' + paths: + - 'Randomizer/**' + - '.github/**' + pull_request: + branches: '**' + paths: + - 'Randomizer/**' + - '.github/**' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Prepare + run: mkdir -p ${{ github.workspace }}/dist + + - name: Build and Bundle + run: bash ${{ github.workspace }}/bundle.sh + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: CelesteRandomizer + path: ${{ github.workspace }}/dist/Randomizer_*.zip + diff --git a/.gitignore b/.gitignore index e33db852..8bb3e946 100644 --- a/.gitignore +++ b/.gitignore @@ -246,3 +246,4 @@ dist edited_maps .vscode promo +!**/packages/lib-stripped/ \ No newline at end of file diff --git a/Randomizer/RandoLogic/RandoLogic.cs b/Randomizer/RandoLogic/RandoLogic.cs index 0577923b..aafcce60 100644 --- a/Randomizer/RandoLogic/RandoLogic.cs +++ b/Randomizer/RandoLogic/RandoLogic.cs @@ -660,8 +660,6 @@ private void PlaceTheoPhone(MapData map) char at(int xx, int yy) => yy >= lines.Count ? '0' : xx >= lines[yy].Length ? '0' : lines[yy][xx]; var height = lines.Count; var width = lines.Select(j => j.Length).Max(); - IEnumerable spinners = lvl.Entities.Where(e => e.Name == "spinner" || e.Name == "spikesUp" || - e.Name == "greenBlocks" || e.Name == "redBlocks" || e.Name == "yellowBlocks"); var found = false; int x = 0, y = 0; for (int i = 0; i < 20 && !found; i++) @@ -680,13 +678,15 @@ private void PlaceTheoPhone(MapData map) { y++; } - var safe = !spinners.Where(e => + var BehindEnt = lvl.Entities.Where(e => { - var entWidth = e.Name != "spinner" ? e.Width : 8; - var entHeight = e.Name != "spinner" && e.Name != "spikesUp" ? e.Height : 0; - return e.Position.X / 8 + entWidth / 8 >= x && e.Position.X / 8 - 1 <= x && e.Position.Y / 8 + entHeight / 8 == y; - }).Any(); + // entities that don't have these fields default to 0, + // but to be certain the player can see the phone, check one tile over + var entWidth = e.Width + 8; + var entHeight = e.Height + 8; + return e.Position.X / 8 + entWidth / 8 >= x && e.Position.X / 8 - 1 <= x && e.Position.Y / 8 + entHeight / 8 >= y && e.Position.Y / 8 - 1 <= y; + }).Any(); var InsideRoof = lvl.FgDecals.Where(fg => { if (fg.Scale.X < 0) @@ -695,7 +695,7 @@ private void PlaceTheoPhone(MapData map) } return (fg.Position.X) / 8 <= x && (fg.Position.X + 8 * fg.Scale.X) / 8 >= x && (fg.Position.Y + 4) / 8 == y; }).Any(); - if (at(x + 1, y - 1) == '0' && at(x + 1, y) != '0' && safe && !InsideRoof) + if (at(x + 1, y - 1) == '0' && at(x + 1, y) != '0' && !BehindEnt && !InsideRoof) { found = true; } diff --git a/Randomizer/Randomizer.csproj b/Randomizer/Randomizer.csproj index 661a95eb..70a83dd4 100644 --- a/Randomizer/Randomizer.csproj +++ b/Randomizer/Randomizer.csproj @@ -35,49 +35,45 @@ - ..\packages\Celeste.exe + ..\packages\lib-stripped\Celeste.exe False - ..\packages\FNA.dll + ..\packages\lib-stripped\FNA.dll False - ..\packages\MMHOOK_Celeste.dll + ..\packages\lib-stripped\MMHOOK_Celeste.dll False - ..\packages\Mono.Cecil.dll + ..\packages\lib-stripped\Mono.Cecil.dll False - ..\packages\Mono.Cecil.Mdb.dll + ..\packages\lib-stripped\Mono.Cecil.Mdb.dll False - ..\packages\Mono.Cecil.Pdb.dll + ..\packages\lib-stripped\Mono.Cecil.Pdb.dll False - ..\packages\Mono.Cecil.Rocks.dll - False - - - ..\packages\Steamworks.NET.dll + ..\packages\lib-stripped\Mono.Cecil.Rocks.dll False - ..\packages\YamlDotNet.dll + ..\packages\lib-stripped\YamlDotNet.dll False - ..\packages\MonoMod.Utils.dll + ..\packages\lib-stripped\MonoMod.Utils.dll False - ..\packages\MonoMod.RuntimeDetour.dll + ..\packages\lib-stripped\MonoMod.RuntimeDetour.dll False diff --git a/packages/lib-stripped/Celeste.exe b/packages/lib-stripped/Celeste.exe new file mode 100644 index 00000000..a8b45747 Binary files /dev/null and b/packages/lib-stripped/Celeste.exe differ diff --git a/packages/lib-stripped/FNA.dll b/packages/lib-stripped/FNA.dll new file mode 100644 index 00000000..82398263 Binary files /dev/null and b/packages/lib-stripped/FNA.dll differ diff --git a/packages/lib-stripped/MMHOOK_Celeste.dll b/packages/lib-stripped/MMHOOK_Celeste.dll new file mode 100644 index 00000000..f1214be7 Binary files /dev/null and b/packages/lib-stripped/MMHOOK_Celeste.dll differ diff --git a/packages/lib-stripped/Mono.Cecil.Mdb.dll b/packages/lib-stripped/Mono.Cecil.Mdb.dll new file mode 100644 index 00000000..30c75653 Binary files /dev/null and b/packages/lib-stripped/Mono.Cecil.Mdb.dll differ diff --git a/packages/lib-stripped/Mono.Cecil.Pdb.dll b/packages/lib-stripped/Mono.Cecil.Pdb.dll new file mode 100644 index 00000000..8398257e Binary files /dev/null and b/packages/lib-stripped/Mono.Cecil.Pdb.dll differ diff --git a/packages/lib-stripped/Mono.Cecil.Rocks.dll b/packages/lib-stripped/Mono.Cecil.Rocks.dll new file mode 100644 index 00000000..abb4ab74 Binary files /dev/null and b/packages/lib-stripped/Mono.Cecil.Rocks.dll differ diff --git a/packages/lib-stripped/Mono.Cecil.dll b/packages/lib-stripped/Mono.Cecil.dll new file mode 100644 index 00000000..205bab27 Binary files /dev/null and b/packages/lib-stripped/Mono.Cecil.dll differ diff --git a/packages/lib-stripped/MonoMod.RuntimeDetour.dll b/packages/lib-stripped/MonoMod.RuntimeDetour.dll new file mode 100644 index 00000000..9a2dc53d Binary files /dev/null and b/packages/lib-stripped/MonoMod.RuntimeDetour.dll differ diff --git a/packages/lib-stripped/MonoMod.Utils.dll b/packages/lib-stripped/MonoMod.Utils.dll new file mode 100644 index 00000000..4c5433b8 Binary files /dev/null and b/packages/lib-stripped/MonoMod.Utils.dll differ diff --git a/packages/lib-stripped/YamlDotNet.dll b/packages/lib-stripped/YamlDotNet.dll new file mode 100644 index 00000000..2978ac9b Binary files /dev/null and b/packages/lib-stripped/YamlDotNet.dll differ