Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rudderbucky committed Jun 21, 2020
1 parent f09c0a7 commit efff4ad
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
8 changes: 6 additions & 2 deletions Assets/Scripts/Abilities/Ability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,15 @@ IEnumerator Blinker(Transform indicator, GameObject glowPrefab)
{
while(blinking)
{
indicator.GetComponent<SpriteRenderer>().color = indicator.GetComponent<SpriteRenderer>().color == Color.cyan ? originalIndicatorColor : Color.cyan;
var color = indicator.GetComponent<SpriteRenderer>().color == Color.cyan ? originalIndicatorColor : Color.cyan;
color.a = (Core.invisible ? (Core.faction == 0 ? 0.2f: 0f) : 1f);
indicator.GetComponent<SpriteRenderer>().color = color;
if(glowPrefab) glowPrefab.SetActive(!glowPrefab.activeSelf);
yield return new WaitForSeconds(0.125F);
}
indicator.GetComponent<SpriteRenderer>().color = originalIndicatorColor;
var resetColor = originalIndicatorColor;
resetColor.a = (Core.invisible ? (Core.faction == 0 ? 0.2f: 0f) : 1f);
indicator.GetComponent<SpriteRenderer>().color = resetColor;
}

/// <summary>
Expand Down
3 changes: 2 additions & 1 deletion Assets/Scripts/Game Object Definitions/AI/AirCraftAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,13 @@ private void Update()
aggroTarget = null;
}

// Stealth if module is not BattleAI to not interfere with it
if (!(module is BattleAI) && craft.GetHealth()[0] < craft.GetMaxHealth()[0] * 0.25f)
{
var abilities = craft.GetAbilities();
if(abilities != null)
{
var stealths = abilities.Where((x) => { return x.GetID() == 24; });
var stealths = abilities.Where((x) => { return (x != null) && x.GetID() == 24; });
foreach (var stealth in stealths)
{
stealth.Tick("activate");
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Game Object Definitions/AI/BattleAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ AIData.entities[i] is Turret &&

if (craft.GetHealth()[0] < craft.GetMaxHealth()[0] * 0.25f)
{
var stealths = abilities.Where((x) => { return x.GetID() == 24; });
var stealths = abilities.Where((x) => { return (x != null) && x.GetID() == 24; });
foreach (var stealth in stealths)
{
stealth.Tick("activate");
Expand Down
7 changes: 7 additions & 0 deletions Assets/Scripts/Game Object Definitions/ShellPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ public void Detach() {
spriteRenderer.sortingLayerName = "Air Entities";
if(shooter)
shooter.GetComponent<SpriteRenderer>().sortingLayerName = "Air Entities";

// when a part detaches it should always be completely visible
var renderers = GetComponentsInChildren<SpriteRenderer>();
foreach(var rend in renderers)
{
rend.color += new Color(0, 0, 0, 1);
}
}

void OnDestroy() {
Expand Down

0 comments on commit efff4ad

Please sign in to comment.