Skip to content

Commit

Permalink
add lightLevel to remove modifying global.darkness (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffGainsNGames authored Oct 3, 2023
1 parent 72e713b commit a1fdb26
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions YAMS-LIB/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2147,14 +2147,16 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te

// Flashlight
PrependGMLInCode(characterVarsCode, "global.flashlightLevel = 0;");
ReplaceGMLInCode(gmData.Code.ByName("gml_Script_ApplyLightPreset"), "global.darkness", "lightLevel");
PrependGMLInCode(gmData.Code.ByName("gml_Script_ApplyLightPreset"),
"""
global.darkness -= global.flashlightLevel
if (global.darkness < 0)
global.darkness = 0
if (global.darkness > 4)
global.darkness = 4
""");
"""
var lightLevel = 0
lightLevel = global.darkness - global.flashlightLevel
if (lightLevel < 0)
lightLevel = 0
if (lightLevel > 4)
lightLevel = 4
""");

// Set starting items
bool alreadyAddedMissiles = false;
Expand Down

0 comments on commit a1fdb26

Please sign in to comment.