Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/tas-check/run-locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ set -xeo pipefail

case "$1" in
"Celeste")
TAS_URL="https://github.com/VampireFlower/CelesteTAS/archive/0747f018e7c92abcd1bf900bd02d24de2be190e4.zip"
TAS_PATH="CelesteTAS-0747f018e7c92abcd1bf900bd02d24de2be190e4/0 - 100%.tas"
TAS_URL="https://github.com/VampireFlower/CelesteTAS/archive/49f624c3947d28b60e48cf15d2789b5bb0880931.zip"
TAS_PATH="CelesteTAS-49f624c3947d28b60e48cf15d2789b5bb0880931/0 - 100%.tas"
;;

"StrawberryJam2021")
TAS_URL="https://github.com/VampireFlower/StrawberryJamTAS/archive/39ff44444566e56667df665effce88cf272aef75.zip"
TAS_PATH="StrawberryJamTAS-39ff44444566e56667df665effce88cf272aef75/0-SJ All Levels.tas"
BUNDLE_DOWNLOAD="https://celestemodupdater.0x0a.de/pinned-mods/StrawberryJam2021-Bundle-d7d15a6d.zip"
TAS_URL="https://github.com/VampireFlower/StrawberryJamTAS/archive/c6621edccff1df2aec0531d377a8475ceff55e29.zip"
TAS_PATH="StrawberryJamTAS-c6621edccff1df2aec0531d377a8475ceff55e29/0-SJ All Levels.tas"
BUNDLE_DOWNLOAD="https://celestemodupdater.0x0a.de/pinned-mods/StrawberryJam2021-Bundle-b55b9595.zip"
;;

*)
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tas-sync-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ jobs:
matrix:
tas:
- name: Celeste 100%
url: "https://github.com/VampireFlower/CelesteTAS/archive/0747f018e7c92abcd1bf900bd02d24de2be190e4.zip"
path: "CelesteTAS-0747f018e7c92abcd1bf900bd02d24de2be190e4/0 - 100%.tas"
url: "https://github.com/VampireFlower/CelesteTAS/archive/49f624c3947d28b60e48cf15d2789b5bb0880931.zip"
path: "CelesteTAS-49f624c3947d28b60e48cf15d2789b5bb0880931/0 - 100%.tas"

- name: Strawberry Jam All Levels
url: "https://github.com/VampireFlower/StrawberryJamTAS/archive/39ff44444566e56667df665effce88cf272aef75.zip"
path: "StrawberryJamTAS-39ff44444566e56667df665effce88cf272aef75/0-SJ All Levels.tas"
bundle: "https://celestemodupdater.0x0a.de/pinned-mods/StrawberryJam2021-Bundle-d7d15a6d.zip"
url: "https://github.com/VampireFlower/StrawberryJamTAS/archive/c6621edccff1df2aec0531d377a8475ceff55e29.zip"
path: "StrawberryJamTAS-c6621edccff1df2aec0531d377a8475ceff55e29/0-SJ All Levels.tas"
bundle: "https://celestemodupdater.0x0a.de/pinned-mods/StrawberryJam2021-Bundle-b55b9595.zip"

runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down
48 changes: 47 additions & 1 deletion Celeste.Mod.mm/Patches/Dust.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
using Microsoft.Xna.Framework;
using System;
using Celeste;
using Microsoft.Xna.Framework;
using Mono.Cecil;
using Monocle;
using MonoMod;
using MonoMod.Cil;

namespace Celeste {
// Dust is static.
Expand All @@ -7,5 +13,45 @@ class patch_Dust {
public static void Burst(Vector2 position, float direction, int count = 1) {
Dust.Burst(position, direction, count, null);
}

[MonoModIgnore]
[PatchDustBurst]
public static extern void Burst(Vector2 position, float direction, int count, ParticleType particleType);

[MonoModIgnore]
[PatchDustBurst]
public static extern void BurstFG(Vector2 position, float direction, int count, float range, ParticleType particleType);

}
}

namespace MonoMod {

/// <summary>
/// Add an early return if Engine.Scene is not a Level, to avoid a crash.
/// </summary>
[MonoModCustomMethodAttribute(nameof(MonoModRules.PatchDustBurst))]
class PatchDustBurstAttribute : Attribute {}

static partial class MonoModRules {

public static void PatchDustBurst(ILContext context, CustomAttribute attrib) {
ILCursor cursor = new ILCursor(context);

ILLabel beforeRet = cursor.DefineLabel();
int loc = -1;

cursor.GotoNext(MoveType.After,
instr => instr.MatchIsinst(out var _),
instr => instr.MatchStloc(out loc));
cursor.EmitLdloc(loc);
cursor.EmitBrfalse(beforeRet);

cursor.GotoNext(MoveType.Before,
instr => instr.MatchRet());
cursor.MarkLabel(beforeRet);
}

}

}