Skip to content

Commit

Permalink
Merge branch 'rhelmot:master' into feature/light-beams
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy-Vidaurri authored Sep 5, 2024
2 parents 3bb5451 + 9f913be commit aff0c90
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 22 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,4 @@ dist
edited_maps
.vscode
promo
!**/packages/lib-stripped/
16 changes: 8 additions & 8 deletions Randomizer/RandoLogic/RandoLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<EntityData> 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++)
Expand All @@ -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)
Expand All @@ -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;
}
Expand Down
24 changes: 10 additions & 14 deletions Randomizer/Randomizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,49 +35,45 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Celeste">
<HintPath>..\packages\Celeste.exe</HintPath>
<HintPath>..\packages\lib-stripped\Celeste.exe</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="FNA">
<HintPath>..\packages\FNA.dll</HintPath>
<HintPath>..\packages\lib-stripped\FNA.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MMHOOK_Celeste">
<HintPath>..\packages\MMHOOK_Celeste.dll</HintPath>
<HintPath>..\packages\lib-stripped\MMHOOK_Celeste.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Mono.Cecil">
<HintPath>..\packages\Mono.Cecil.dll</HintPath>
<HintPath>..\packages\lib-stripped\Mono.Cecil.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Mono.Cecil.Mdb">
<HintPath>..\packages\Mono.Cecil.Mdb.dll</HintPath>
<HintPath>..\packages\lib-stripped\Mono.Cecil.Mdb.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Mono.Cecil.Pdb">
<HintPath>..\packages\Mono.Cecil.Pdb.dll</HintPath>
<HintPath>..\packages\lib-stripped\Mono.Cecil.Pdb.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Mono.Cecil.Rocks">
<HintPath>..\packages\Mono.Cecil.Rocks.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Steamworks.NET">
<HintPath>..\packages\Steamworks.NET.dll</HintPath>
<HintPath>..\packages\lib-stripped\Mono.Cecil.Rocks.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="YamlDotNet">
<HintPath>..\packages\YamlDotNet.dll</HintPath>
<HintPath>..\packages\lib-stripped\YamlDotNet.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MonoMod.Utils">
<HintPath>..\packages\MonoMod.Utils.dll</HintPath>
<HintPath>..\packages\lib-stripped\MonoMod.Utils.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MonoMod.RuntimeDetour">
<HintPath>..\packages\MonoMod.RuntimeDetour.dll</HintPath>
<HintPath>..\packages\lib-stripped\MonoMod.RuntimeDetour.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
Expand Down
Binary file added packages/lib-stripped/Celeste.exe
Binary file not shown.
Binary file added packages/lib-stripped/FNA.dll
Binary file not shown.
Binary file added packages/lib-stripped/MMHOOK_Celeste.dll
Binary file not shown.
Binary file added packages/lib-stripped/Mono.Cecil.Mdb.dll
Binary file not shown.
Binary file added packages/lib-stripped/Mono.Cecil.Pdb.dll
Binary file not shown.
Binary file added packages/lib-stripped/Mono.Cecil.Rocks.dll
Binary file not shown.
Binary file added packages/lib-stripped/Mono.Cecil.dll
Binary file not shown.
Binary file added packages/lib-stripped/MonoMod.RuntimeDetour.dll
Binary file not shown.
Binary file added packages/lib-stripped/MonoMod.Utils.dll
Binary file not shown.
Binary file added packages/lib-stripped/YamlDotNet.dll
Binary file not shown.

0 comments on commit aff0c90

Please sign in to comment.