-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to enforce screw attack for BG2
- Loading branch information
Showing
3 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using UndertaleModLib; | ||
using UndertaleModLib.Decompiler; | ||
using UndertaleModLib.Models; | ||
|
||
namespace YAMS_LIB.patches.geometry; | ||
|
||
public class EnforceScrewForBG2 | ||
{ | ||
public static void Apply(UndertaleData gmData, GlobalDecompileContext decompileContext, SeedObject seedObject) | ||
{ | ||
UndertaleCode? characterVarsCode = gmData.Code.ByName("gml_Script_load_character_vars"); | ||
characterVarsCode.AppendGMLInCode($"global.enforceScrewForBG2 = {(seedObject.Patches.EnforceScrewForBG2 ? "1" : "0")};"); | ||
|
||
gmData.Code.ByName("gml_Object_Rooma3c03Fix_Collision_267").ReplaceGMLInCode("global.screwattack == 0", "!global.screwattack && !global.enforceScrewForBG2"); | ||
} | ||
} |