Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Commit

Permalink
#30 New modifications:
Browse files Browse the repository at this point in the history
Minos can now crush attack instead of rider kick
Minos can now make a judgement kick instead of projectile punch at the end of the combo
Fixed an issue where outro gets interrupted by the big explosion attack
  • Loading branch information
eternalUnion committed May 26, 2023
1 parent 086419f commit e5a7f1f
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 1 deletion.
28 changes: 27 additions & 1 deletion Ultrapain/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,12 @@ public enum SwordsMachineSecondPhase
public static FloatField minosPrimeExplosionSize;
public static FloatField minosPrimeExplosionDamage;

public static BoolField minosPrimeCrushAttackToggle;
public static FloatSliderField minosPrimeCrushAttackChance;

public static BoolField minosPrimeComboExplosiveEndToggle;
public static FloatSliderField minosPrimeComboExplosiveEndChance;

public static BoolField minosPrimeComboExplosionToggle;
public static FloatField minosPrimeComboExplosionSize;
public static FloatField minosPrimeComboExplosionDamage;
Expand Down Expand Up @@ -1306,7 +1312,7 @@ public static void Initialize()
};
minosPrimeTeleportTrailDuration = new FloatField(minosPrimePanel, "Duration", "minosPrimeTeleportTrailDuration", 0.5f, 0, float.PositiveInfinity);

new ConfigHeader(minosPrimePanel, "Combo Explosion Finish");
new ConfigHeader(minosPrimePanel, "Combo Explosive Finish");
minosPrimeComboExplosionToggle = new BoolField(minosPrimePanel, "Enabled", "minosPrimeComboExplosionToggle", true);
minosPrimeComboExplosionSize = new FloatField(minosPrimePanel, "Explosion size multiplier", "minosPrimeComboExplosionSize", 1f, 0f, float.MaxValue);
minosPrimeComboExplosionDamage = new FloatField(minosPrimePanel, "Explosion damage multiplier", "minosPrimeComboExplosionDamage", 1f, 0f, float.MaxValue);
Expand All @@ -1331,6 +1337,26 @@ public static void Initialize()
};
minosPrimeExplosionToggle.TriggerValueChangeEvent();

new ConfigHeader(minosPrimePanel, "Crush Attack");
minosPrimeCrushAttackToggle = new BoolField(minosPrimePanel, "Enabled", "minosPrimeCrushAttackToggle", true);
minosPrimeCrushAttackToggle.onValueChange += (BoolField.BoolValueChangeEvent e) =>
{
dirtyField = true;
minosPrimeCrushAttackChance.interactable = e.value;
};
minosPrimeCrushAttackChance = new FloatSliderField(minosPrimePanel, "Chance", "minosPrimeCrushAttackChance", new Tuple<float, float>(0, 100), 50);
minosPrimeCrushAttackToggle.TriggerValueChangeEvent();

new ConfigHeader(minosPrimePanel, "End Combo With Dropkick");
minosPrimeComboExplosiveEndToggle = new BoolField(minosPrimePanel, "Enabled", "minosPrimeComboExplosiveEndToggle", true);
minosPrimeComboExplosiveEndToggle.onValueChange += (BoolField.BoolValueChangeEvent e) =>
{
dirtyField = true;
minosPrimeComboExplosiveEndChance.interactable = e.value;
};
minosPrimeComboExplosiveEndChance = new FloatSliderField(minosPrimePanel, "Chance", "minosPrimeComboExplosiveEndChance", new Tuple<float, float>(0, 100), 50);
minosPrimeComboExplosiveEndToggle.TriggerValueChangeEvent();

// V2 - FIRST
new ConfigHeader(v2FirstPanel, "Knuckleblaster");
ConfigDivision v2FirstKnuckleBlasterDiv = new ConfigDivision(v2FirstPanel, "v2FirstKnuckleBlasterDiv");
Expand Down
57 changes: 57 additions & 0 deletions Ultrapain/Patches/MinosPrime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,43 @@ static void Postfix(MinosPrime __instance, EnemyIdentifier ___eid)
}
}

// aka DIE
class MinosPrime_RiderKick
{
static bool Prefix(MinosPrime __instance, ref bool ___previouslyRiderKicked)
{
if (UnityEngine.Random.Range(0, 99.9f) > ConfigManager.minosPrimeCrushAttackChance.value)
return true;

___previouslyRiderKicked = true;

Vector3 vector = MonoSingleton<PlayerTracker>.Instance.PredictPlayerPosition(0.5f);
Transform target = MonoSingleton<PlayerTracker>.Instance.GetPlayer();
if (vector.y < target.position.y)
{
vector.y = target.position.y;
}

__instance.Teleport(vector + Vector3.up * 25f, __instance.transform.position);
__instance.SendMessage("DropAttack");
return false;
}
}

// End of PREPARE THYSELF
class MinosPrime_ProjectileCharge
{
static bool Prefix(MinosPrime __instance, Animator ___anim)
{
string clipname = ___anim.GetCurrentAnimatorClipInfo(0)[0].clip.name;
if (clipname != "Combo" || UnityEngine.Random.Range(0, 99.9f) > ConfigManager.minosPrimeComboExplosiveEndChance.value)
return true;

___anim.Play("Dropkick", 0, (1.0815f - 0.4279f) / 2.65f);
return false;
}
}

class MinosPrime_Ascend
{
static bool Prefix(MinosPrime __instance, EnemyIdentifier ___eid, Animator ___anim, ref bool ___vibrating)
Expand All @@ -276,4 +313,24 @@ static bool Prefix(MinosPrime __instance, EnemyIdentifier ___eid, Animator ___an
return false;
}
}

class MinosPrime_Death
{
static bool Prefix(MinosPrime __instance, Animator ___anim, ref bool ___vibrating)
{
MinosPrimeFlag flag = __instance.GetComponent<MinosPrimeFlag>();
if (flag == null)
return true;

if (!flag.explosionAttack)
return true;

flag.explosionAttack = false;
___vibrating = false;
___anim.speed = 1f;
___anim.Play("Walk", 0, 0f);

return true;
}
}
}
5 changes: 5 additions & 0 deletions Ultrapain/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,11 @@ private static void PatchAllEnemies()
harmonyTweaks.Patch(GetMethod<MinosPrime>("Combo"), postfix: GetHarmonyMethod(GetMethod<MinosPrime_Combo>("Postfix")));
harmonyTweaks.Patch(GetMethod<MinosPrime>("StopAction"), postfix: GetHarmonyMethod(GetMethod<MinosPrime_StopAction>("Postfix")));
harmonyTweaks.Patch(GetMethod<MinosPrime>("Ascend"), prefix: GetHarmonyMethod(GetMethod<MinosPrime_Ascend>("Prefix")));
harmonyTweaks.Patch(GetMethod<MinosPrime>("Death"), prefix: GetHarmonyMethod(GetMethod<MinosPrime_Death>("Prefix")));
if (ConfigManager.minosPrimeCrushAttackToggle.value)
harmonyTweaks.Patch(GetMethod<MinosPrime>("RiderKick"), prefix: GetHarmonyMethod(GetMethod<MinosPrime_RiderKick>("Prefix")));
if (ConfigManager.minosPrimeComboExplosiveEndToggle.value)
harmonyTweaks.Patch(GetMethod<MinosPrime>("ProjectileCharge"), prefix: GetHarmonyMethod(GetMethod<MinosPrime_ProjectileCharge>("Prefix")));

if (ConfigManager.schismSpreadAttackToggle.value)
harmonyTweaks.Patch(GetMethod<ZombieProjectiles>("ShootProjectile"), postfix: GetHarmonyMethod(GetMethod<ZombieProjectile_ShootProjectile_Patch>("Postfix")));
Expand Down

0 comments on commit e5a7f1f

Please sign in to comment.