Skip to content

Commit

Permalink
Ability information
Browse files Browse the repository at this point in the history
  • Loading branch information
limtis0 committed Mar 7, 2023
1 parent f174eab commit 804da62
Showing 1 changed file with 82 additions and 3 deletions.
85 changes: 82 additions & 3 deletions PlayableDracula.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public static class PlayableDracula
private static readonly Sprite droppedSkull;
private static readonly Sprite hudIcon;

const string PlaceholderSkill = "TriplePierce_4";
const string DraculaSkillKey = "DraculaSkill";
const string PlaceholderSkillKey = "TriplePierce_4";

static PlayableDracula()
{
Expand Down Expand Up @@ -162,7 +163,7 @@ private static void PrefixSetSkills(Weapon __instance)
{
if (IsDracula(__instance))
{
__instance.skills[0]._key = PlaceholderSkill;
__instance.skills[0]._key = DraculaSkillKey;
}
}

Expand Down Expand Up @@ -227,7 +228,7 @@ private static void SetDraculaObtainability(GearManager gearManager, bool obtain
[HarmonyPrefix]
[HarmonyPatch(typeof(Weapon), nameof(Weapon.mainIcon), MethodType.Getter)]
[HarmonyPatch(typeof(Weapon), nameof(Weapon.subIcon), MethodType.Getter)]
private static bool PrefixMainIcon(Weapon __instance, ref Sprite __result)
private static bool PrefixHudIcon(Weapon __instance, ref Sprite __result)
{
if (IsDracula(__instance))
{
Expand All @@ -238,6 +239,84 @@ private static bool PrefixMainIcon(Weapon __instance, ref Sprite __result)
return true;
}

[HarmonyPrefix]
[HarmonyPatch(typeof(Gear), nameof(Gear.displayName), MethodType.Getter)]
[HarmonyPatch(typeof(Weapon), nameof(Weapon.activeName), MethodType.Getter)]
private static bool PrefixSkullName(Gear __instance, ref string __result)
{
if (IsDracula(__instance))
{
__result = "Dracula";
return false;
}

return true;
}

[HarmonyPrefix]
[HarmonyPatch(typeof(Gear), nameof(Gear.description), MethodType.Getter)]
private static bool PrefixSkullDescription(Gear __instance, ref string __result)
{
if (IsDracula(__instance))
{
__result =
$"Normal attacks have a {Plugin.BleedChancePercent.Value}% chance to inflict <color=#C30012>Wound</color>.\n" +
$"Restore {Plugin.OnBleedHealing.Value} HP when inflicting an enemy with <color=#C30012>Bleed</color>.\n" +
$"This skull's gauge fills up on dealing damage to enemies.\n" +
$"When gauge is full, next inflicted <color=#C30012>Bleed</color> will restore {Plugin.FullGaugeHealingMultiplyBy.Value} times more HP.";
return false;
}

return true;
}

[HarmonyPrefix]
[HarmonyPatch(typeof(Weapon), nameof(Weapon.activeDescription), MethodType.Getter)]
private static bool PrefixActiveDescription(Weapon __instance, ref string __result)
{
if (IsDracula(__instance))
{
__result = "Does nothing on swap :)";
return false;
}

return true;
}

[HarmonyPrefix]
[HarmonyPatch(typeof(SkillInfo), nameof(SkillInfo.displayName), MethodType.Getter)]
private static bool PrefixSkillName(SkillInfo __instance, ref string __result)
{
if (__instance.key == DraculaSkillKey)
{
__result = "Swift Strike";
return false;
}

return true;
}

[HarmonyPrefix]
[HarmonyPatch(typeof(SkillInfo), nameof(SkillInfo.description), MethodType.Getter)]
private static bool PrefixSkillDescription(SkillInfo __instance, ref string __result)
{
if (__instance.key == DraculaSkillKey)
{
__result = "Dash forward and barrage enemies with piercing strikes, dealing <color=#F25D1C>Physical damage</color>.";
return false;
}

return true;
}

[HarmonyPrefix]
[HarmonyPatch(typeof(GearResource), nameof(GearResource.GetSkillIcon))]
private static void PrefixGetSkillIcon(ref string name)
{
if (name == DraculaSkillKey)
name = PlaceholderSkillKey;
}

#endregion
}
}

0 comments on commit 804da62

Please sign in to comment.