Skip to content

Commit

Permalink
add lightLevel to remove modifying global.darkness
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffGainsNGames committed Oct 2, 2023
1 parent 72e713b commit 43def94
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 43def94

Please sign in to comment.