Improved plugins and added new
This commit is contained in:
1 parent
9f4f8bf523
commit
a740fec7c8
149 files changed
+4383
-199
No files matched your search
@@ -5,9 +5,9 @@ namespace Skopje.BossHealth
|
||||
/// <summary>
|
||||
/// Look of the boss health bar. This is the file to edit.
|
||||
///
|
||||
/// Sprites are chosen by the name shown on an Image's Sprite field in the game.
|
||||
/// Leave a name empty to copy the in-game XP progress bar sprite.
|
||||
/// After changing a name, rebuild the plugin.
|
||||
/// Sprites are chosen by the name shown on an Image's Sprite field in the game.
|
||||
/// Leave a fill name empty to use a solid rectangle.
|
||||
/// After changing a name, rebuild the plugin.
|
||||
/// </summary>
|
||||
public static class BossBarStyle
|
||||
{
|
||||
@@ -17,15 +17,17 @@ namespace Skopje.BossHealth
|
||||
|
||||
public static readonly Color HealthColor = new Color(0.86f, 0.1f, 0.1f, 1f);
|
||||
public static readonly Color DelayColor = new Color(1f, 0.48f, 0.08f, 1f);
|
||||
public static readonly Color ImmuneColor = new Color(0.62f, 0.62f, 0.62f, 1f);
|
||||
public static readonly Color ImmuneDelayColor = new Color(0.4f, 0.4f, 0.4f, 1f);
|
||||
public static readonly Color BackgroundColor = new Color(0.04f, 0.04f, 0.04f, 0.8f);
|
||||
public static readonly Color LabelColor = Color.white;
|
||||
|
||||
// The white bar waits this long after the last hit, then drains toward the real health.
|
||||
// The orange bar waits this long after the last hit, then drains toward the real health.
|
||||
public const float DelaySeconds = 0.6f;
|
||||
public const float DelayDrainPerSecond = 0.75f;
|
||||
|
||||
public static readonly Vector2 BarSize = new Vector2(392f, 13f);
|
||||
public const float TopClearance = 100f;
|
||||
public const float TopClearance = 25f;
|
||||
public const float TrackPadding = 2f;
|
||||
public const float LabelHeight = 26f;
|
||||
public const float LabelFontSize = 20f;
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace Skopje.BossHealth
|
||||
{
|
||||
_nextReadTime = Time.unscaledTime + FightReadSeconds;
|
||||
if (_fights[0].StillGoing(out float ratio))
|
||||
Present(_fights[0].Name, ratio);
|
||||
Present(_fights[0].Name, ratio, _fights[0].IsImmune());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -223,10 +223,10 @@ namespace Skopje.BossHealth
|
||||
}
|
||||
|
||||
if (_fights[0].StillGoing(out float ratio))
|
||||
Present(_fights[0].Name, ratio);
|
||||
Present(_fights[0].Name, ratio, _fights[0].IsImmune());
|
||||
}
|
||||
|
||||
void Present(string bossName, float ratio)
|
||||
void Present(string bossName, float ratio, bool immune)
|
||||
{
|
||||
EnsureBar();
|
||||
if (!_hasSample || _bossName != bossName)
|
||||
@@ -255,9 +255,15 @@ namespace Skopje.BossHealth
|
||||
if (_label != null)
|
||||
_label.text = bossName;
|
||||
if (_healthImage != null)
|
||||
{
|
||||
_healthImage.color = immune ? BossBarStyle.ImmuneColor : BossBarStyle.HealthColor;
|
||||
_healthImage.fillAmount = _health;
|
||||
}
|
||||
if (_delayImage != null)
|
||||
{
|
||||
_delayImage.color = immune ? BossBarStyle.ImmuneDelayColor : BossBarStyle.DelayColor;
|
||||
_delayImage.fillAmount = _delay;
|
||||
}
|
||||
}
|
||||
|
||||
void AnimateDelay()
|
||||
@@ -443,9 +449,8 @@ namespace Skopje.BossHealth
|
||||
{
|
||||
XpProgressBar xpBar = FindXpBar();
|
||||
Image xpImage = xpBar != null ? xpBar.ProgressBar : null;
|
||||
Sprite xpSprite = xpImage != null ? xpImage.sprite : null;
|
||||
Sprite healthSprite = ResolveSprite(BossBarStyle.HealthSpriteName, xpSprite) ?? SolidSprite();
|
||||
Sprite delaySprite = ResolveSprite(BossBarStyle.DelaySpriteName, healthSprite) ?? healthSprite;
|
||||
Sprite healthSprite = ResolveSprite(BossBarStyle.HealthSpriteName, null) ?? SolidSprite();
|
||||
Sprite delaySprite = ResolveSprite(BossBarStyle.DelaySpriteName, null) ?? healthSprite;
|
||||
Sprite backgroundSprite = ResolveSprite(BossBarStyle.BackgroundSpriteName, FrameSprite(xpImage, healthSprite));
|
||||
|
||||
_barRoot = new GameObject("BossHealthBar");
|
||||
@@ -846,6 +851,18 @@ namespace Skopje.BossHealth
|
||||
return obj != null;
|
||||
}
|
||||
|
||||
static bool SafeDamageable(MetalskyBoss boss)
|
||||
{
|
||||
try
|
||||
{
|
||||
return boss.IsDamageable;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
static bool SafeDead(MetalskyBoss boss)
|
||||
{
|
||||
try
|
||||
@@ -875,6 +892,7 @@ namespace Skopje.BossHealth
|
||||
public string Name;
|
||||
|
||||
public abstract bool StillGoing(out float ratio);
|
||||
public abstract bool IsImmune();
|
||||
}
|
||||
|
||||
sealed class AnaFight : Fight
|
||||
@@ -904,6 +922,11 @@ namespace Skopje.BossHealth
|
||||
return false;
|
||||
return TryRatio(_boss.EnemyControl, out ratio);
|
||||
}
|
||||
|
||||
public override bool IsImmune()
|
||||
{
|
||||
return !IsTrue(_boss.IsVulnerable);
|
||||
}
|
||||
}
|
||||
|
||||
sealed class VesnaFight : Fight
|
||||
@@ -931,6 +954,11 @@ namespace Skopje.BossHealth
|
||||
return false;
|
||||
return TryRatio(_boss.EnemyControl, out ratio);
|
||||
}
|
||||
|
||||
public override bool IsImmune()
|
||||
{
|
||||
return !IsTrue(_boss.Visibility);
|
||||
}
|
||||
}
|
||||
|
||||
sealed class MetalskyFight : Fight
|
||||
@@ -950,6 +978,11 @@ namespace Skopje.BossHealth
|
||||
return false;
|
||||
return TryRatio(_boss.PawnStatus, out ratio);
|
||||
}
|
||||
|
||||
public override bool IsImmune()
|
||||
{
|
||||
return !SafeDamageable(_boss);
|
||||
}
|
||||
}
|
||||
|
||||
sealed class TeofanFight : Fight
|
||||
@@ -975,6 +1008,25 @@ namespace Skopje.BossHealth
|
||||
control = _brain.GetComponentInChildren<EnemyControlAStar>(true);
|
||||
return TryRatio(control, out ratio);
|
||||
}
|
||||
|
||||
public override bool IsImmune()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_brain.blockHelper != null && _brain.blockHelper.IsBlocking)
|
||||
return true;
|
||||
|
||||
TeofanBossState state = _brain.CurrentState;
|
||||
return state == TeofanBossState.DissolveIn
|
||||
|| state == TeofanBossState.FallenInteract
|
||||
|| state == TeofanBossState.EndPhase
|
||||
|| state == TeofanBossState.Despawned;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Skopje.BossHealth")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9f4f8bf5235790c04718d7ca24b0f3f76e93b270")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Skopje.BossHealth")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Skopje.BossHealth")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
0acf9d2f1a6c359332339552562b4ad3180ad1d45517bc93e22ec640b2c677b6
|
||||
abb2aafca8f9c38e16a185b614682f24e0da3a5492f3ed24b1aa588b0f35f2fc
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user