Skip to content

Commit

Permalink
Make hitting metroids with charge beam and other beams show a message (
Browse files Browse the repository at this point in the history
  • Loading branch information
Miepee authored Feb 22, 2024
1 parent ae3dd72 commit a28a76f
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions YAMS-LIB/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Globalization;
using System.ComponentModel.Design;
using System.Globalization;
using System.Reflection;
using System.Text.Json;
using NaturalSort.Extension;
Expand Down Expand Up @@ -1166,11 +1167,38 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te
// Make Charge Beam always hit metroids
foreach (string name in new[]
{
"gml_Object_oMAlpha_Collision_439", "gml_Object_oMGamma_Collision_439", "gml_Object_oMZeta_Collision_439", "gml_Object_oMZetaBodyMask_Collision_439",
"gml_Object_oMAlpha_Collision_439", "gml_Object_oMGamma_Collision_439", "gml_Object_oMZeta_Collision_439",
"gml_Object_oMOmegaMask2_Collision_439", "gml_Object_oMOmegaMask3_Collision_439"
})
{
gmData.Code.ByName(name).ReplaceGMLInCode("&& global.missiles == 0 && global.smissiles == 0", "");
var codeEntry = gmData.Code.ByName(name);
codeEntry.ReplaceGMLInCode("&& global.missiles == 0 && global.smissiles == 0", "");
if (codeEntry.GetGMLCode().Contains("""
else
{
"""))
{


codeEntry.ReplaceGMLInCode("""
else
{
""",
"""
else
{
if (oBeam.chargebeam) popup_text("Unequip beams to deal Charge damage")
""");
}
else
{
codeEntry.AppendGMLInCode("""
else
{
if (oBeam.chargebeam) popup_text("Unequip beams to deal Charge damage")
}
""");
}
}

// Replace Metroids counters with DNA counters
Expand Down

0 comments on commit a28a76f

Please sign in to comment.