Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make hitting metroids with charge beam and other beams show a message #176

Merged
merged 1 commit into from
Feb 22, 2024
Merged
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
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
Loading