HeavenStudioPlus/Assets/Scripts/Games/CatchOfTheDay/BGFish.cs
playinful 75e248c97b
Catch of the Day (bugfixes) (#814)
* Freeze Frame

Hey, I'm about done with Freeze Frame and I'm just gonna commit the game as it is right now, it's almost done thx
-playinful

* Freeze Frame - finishing touches before finalized assets

Still waiting to implement the upscaled assets and the sound effects. Code-wise this is as much as I can do for now.

* i fixed a couple bugs

the dim screen is back and no input duplication when switching games. hallelujah

* FreezeFrame randomness update

hey AJ so i was cleaning my room when i was struck by an idea for how to make the randomization more consistent without seeding. *yes unfortunately* it requires a static variable but i promise u i used it responsibly.

* initial commit

* mar 13

* Updated cloud particles

* 3/22

* First PR

* corrected a mistake

* forgot to change that goofy ahh icon

* Bugfixes

Fixed a bug where fishes could be reeled in before the bite animation played and get stuck in the bite animation.
Fixed a bug where the count-in for the pausegill played at the incorrect time.
Fixed a bug where the threefish would cause a scene transition at the incorrect time.

* Crossfade close to done

* The Long Awaited Crossfade Update

* added sort key

* one last quick bugfix (hopefully)

---------

Co-authored-by: minenice55 <star.elementa@gmail.com>
2024-04-05 01:28:01 +00:00

82 lines
No EOL
2.9 KiB
C#

using System.Collections;
using System.Collections.Generic;
using HeavenStudio;
using HeavenStudio.Games;
using HeavenStudio.Util;
using Jukebox;
using UnityEditor.Playables;
using UnityEngine;
using UnityEngine.Rendering;
namespace HeavenStudio.Games.Scripts_CatchOfTheDay
{
public class BGFish : MonoBehaviour
{
[SerializeField] Animator _Animator;
[SerializeField] SpriteRenderer _Sprite;
[SerializeField] FleeAnimation FleeAnim;
[SerializeField] bool FlipSprite;
private bool Out = false;
public void SetColor(Color color)
{
_Sprite.color = color;
}
public void Flee()
{
bool doFlip = transform.localScale.x < 0;// i hate this. it works
switch (FleeAnim)
{
case FleeAnimation.WestSouthWest:
_Animator.DoScaledAnimationAsync(doFlip ? "BGFishOut_ESE" : "BGFishOut_WSW", 0.5f);
break;
case FleeAnimation.SouthWest:
_Animator.DoScaledAnimationAsync(doFlip ? "BGFishOut_SE" : "BGFishOut_SW", 0.5f);
break;
case FleeAnimation.WestNorthWest:
_Animator.DoScaledAnimationAsync(doFlip ? "BGFishOut_ENE" : "BGFishOut_WNW", 0.5f);
break;
case FleeAnimation.NorthWest:
_Animator.DoScaledAnimationAsync(doFlip ? "BGFishOut_NE" : "BGFishOut_NW", 0.5f);
break;
case FleeAnimation.West:
_Animator.DoScaledAnimationAsync(doFlip ? "BGFishOut_E" : "BGFishOut_W", 0.5f);
break;
case FleeAnimation.EastSouthEast:
_Animator.DoScaledAnimationAsync(doFlip ? "BGFishOut_WSW" : "BGFishOut_ESE", 0.5f);
break;
case FleeAnimation.SouthEast:
_Animator.DoScaledAnimationAsync(doFlip ? "BGFishOut_SW" : "BGFishOut_SE", 0.5f);
break;
case FleeAnimation.EastNorthEast:
_Animator.DoScaledAnimationAsync(doFlip ? "BGFishOut_WNW" : "BGFishOut_ENE", 0.5f);
break;
case FleeAnimation.NorthEast:
_Animator.DoScaledAnimationAsync(doFlip ? "BGFishOut_NW" : "BGFishOut_NE", 0.5f);
break;
case FleeAnimation.East:
default:
_Animator.DoScaledAnimationAsync(doFlip ? "BGFishOut_W" : "BGFishOut_E", 0.5f);
break;
}
Out = true;
}
public enum FleeAnimation : int
{
East = 0,
EastSouthEast = 1,
SouthEast = 2,
EastNorthEast = 3,
NorthEast = 4,
West = 8,
WestSouthWest = 9,
SouthWest = 10,
WestNorthWest = 11,
NorthWest = 12,
}
}
}