Skip to content

Commit

Permalink
fix #275; ref #276
Browse files Browse the repository at this point in the history
fixed release weapon bugs

music now loops

increases opacity of lovely lullaby aura

rotated bug sprite to get facer to work properly
  • Loading branch information
micycle8778 committed Jan 8, 2024
1 parent 57cfec2 commit 00a8f0e
Show file tree
Hide file tree
Showing 21 changed files with 37 additions and 21 deletions.
Binary file modified Assets/Art/BugEnemySprite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions Assets/Prefabs/Enemies/BugEnemy.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6612840467964046646}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: -0.7071068, w: 0.7071068}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 2, y: 2, z: 2}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 2142963959086616992}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &4307154717410899638
SpriteRenderer:
m_ObjectHideFlags: 0
Expand Down
2 changes: 1 addition & 1 deletion Assets/Prefabs/Weapons/LovelyLullabyProjectile.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ SpriteRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: fa582e06ab758c545ab166494f4ea644, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 0.011764706}
m_Color: {r: 1, g: 1, b: 1, a: 0.09803922}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
Expand Down
2 changes: 1 addition & 1 deletion Assets/PrettyParasolSprite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public void OnSwingingAnimationEnd() {

void Start()
{
Debug.Assert(TryGetComponent(out animator));
PrettyParasol.Assert(TryGetComponent(out animator));
}
}
2 changes: 1 addition & 1 deletion Assets/Resources/Sounds/Music/DeathMusic.asset
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ MonoBehaviour:
pitch: 1
pitchVariance: 0
minimumDistance: 10
loop: 0
loop: 1
mixerGroup: {fileID: -5511264307445594271, guid: e61ba0ca00a19cd06b1d5c09bcb40e46, type: 2}
source: {fileID: 0}
2 changes: 1 addition & 1 deletion Assets/Resources/Sounds/Music/Level01Boss.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ MonoBehaviour:
pitch: 1
pitchVariance: 0
minimumDistance: 10
loop: 0
loop: 1
mixerGroup: {fileID: -5511264307445594271, guid: e61ba0ca00a19cd06b1d5c09bcb40e46, type: 2}
source: {fileID: 0}
2 changes: 1 addition & 1 deletion Assets/Resources/Sounds/Music/Level01Theme.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ MonoBehaviour:
pitch: 1
pitchVariance: 0
minimumDistance: 10
loop: 0
loop: 1
mixerGroup: {fileID: -5511264307445594271, guid: e61ba0ca00a19cd06b1d5c09bcb40e46, type: 2}
source: {fileID: 0}
2 changes: 1 addition & 1 deletion Assets/Resources/Sounds/Music/Level02Boss.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ MonoBehaviour:
pitch: 1
pitchVariance: 0
minimumDistance: 10
loop: 0
loop: 1
mixerGroup: {fileID: -5511264307445594271, guid: e61ba0ca00a19cd06b1d5c09bcb40e46, type: 2}
source: {fileID: 0}
2 changes: 1 addition & 1 deletion Assets/Resources/Sounds/Music/Level02Theme.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ MonoBehaviour:
pitch: 1
pitchVariance: 0
minimumDistance: 10
loop: 0
loop: 1
mixerGroup: {fileID: -5511264307445594271, guid: e61ba0ca00a19cd06b1d5c09bcb40e46, type: 2}
source: {fileID: 0}
2 changes: 1 addition & 1 deletion Assets/Resources/Sounds/Music/Level03Boss.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ MonoBehaviour:
pitch: 1
pitchVariance: 0
minimumDistance: 10
loop: 0
loop: 1
mixerGroup: {fileID: -5511264307445594271, guid: e61ba0ca00a19cd06b1d5c09bcb40e46, type: 2}
source: {fileID: 0}
2 changes: 1 addition & 1 deletion Assets/Resources/Sounds/Music/Level03Theme.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ MonoBehaviour:
pitch: 1
pitchVariance: 0
minimumDistance: 10
loop: 0
loop: 1
mixerGroup: {fileID: -5511264307445594271, guid: e61ba0ca00a19cd06b1d5c09bcb40e46, type: 2}
source: {fileID: 0}
2 changes: 1 addition & 1 deletion Assets/Resources/Sounds/Music/Level04Boss.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ MonoBehaviour:
pitch: 1
pitchVariance: 0
minimumDistance: 10
loop: 0
loop: 1
mixerGroup: {fileID: -5511264307445594271, guid: e61ba0ca00a19cd06b1d5c09bcb40e46, type: 2}
source: {fileID: 0}
2 changes: 1 addition & 1 deletion Assets/Resources/Sounds/Music/Level04Theme.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ MonoBehaviour:
pitch: 1
pitchVariance: 0
minimumDistance: 10
loop: 0
loop: 1
mixerGroup: {fileID: -5511264307445594271, guid: e61ba0ca00a19cd06b1d5c09bcb40e46, type: 2}
source: {fileID: 0}
2 changes: 1 addition & 1 deletion Assets/Resources/Sounds/Music/Level05Boss.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ MonoBehaviour:
pitch: 1
pitchVariance: 0
minimumDistance: 10
loop: 0
loop: 1
mixerGroup: {fileID: -5511264307445594271, guid: e61ba0ca00a19cd06b1d5c09bcb40e46, type: 2}
source: {fileID: 0}
2 changes: 1 addition & 1 deletion Assets/Resources/Sounds/Music/Level05Theme.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ MonoBehaviour:
pitch: 1
pitchVariance: 0
minimumDistance: 10
loop: 0
loop: 1
mixerGroup: {fileID: -5511264307445594271, guid: e61ba0ca00a19cd06b1d5c09bcb40e46, type: 2}
source: {fileID: 0}
2 changes: 1 addition & 1 deletion Assets/Resources/Sounds/Music/Level06Boss.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ MonoBehaviour:
pitch: 1
pitchVariance: 0
minimumDistance: 10
loop: 0
loop: 1
mixerGroup: {fileID: -5511264307445594271, guid: e61ba0ca00a19cd06b1d5c09bcb40e46, type: 2}
source: {fileID: 0}
2 changes: 1 addition & 1 deletion Assets/Resources/Sounds/Music/Level06Theme.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ MonoBehaviour:
pitch: 1
pitchVariance: 0
minimumDistance: 10
loop: 0
loop: 1
mixerGroup: {fileID: -5511264307445594271, guid: e61ba0ca00a19cd06b1d5c09bcb40e46, type: 2}
source: {fileID: 0}
2 changes: 1 addition & 1 deletion Assets/Resources/Sounds/Music/Level07Boss.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ MonoBehaviour:
pitch: 1
pitchVariance: 0
minimumDistance: 10
loop: 0
loop: 1
mixerGroup: {fileID: -5511264307445594271, guid: e61ba0ca00a19cd06b1d5c09bcb40e46, type: 2}
source: {fileID: 0}
2 changes: 1 addition & 1 deletion Assets/Resources/Sounds/Music/Level07Theme.asset
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ MonoBehaviour:
pitch: 1
pitchVariance: 0
minimumDistance: 10
loop: 0
loop: 1
mixerGroup: {fileID: -5511264307445594271, guid: e61ba0ca00a19cd06b1d5c09bcb40e46, type: 2}
source: {fileID: 0}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.Assertions;

public class PrettyParasol : ProjectileWeapon {
PrettyParasolSprite sprite;
Expand All @@ -7,8 +9,22 @@ public class PrettyParasol : ProjectileWeapon {

[SerializeField] GameObject spritePrefab;

/// <summary>
/// Ensures <paramref name="shouldBeTrue"/> is true by throwing an exception otherwise.
/// <para>This function is not optimized away during release builds, so it should
/// be used over <c>Debug.Assert</c> if <paramref name="shouldBeTrue"/>
/// is derived from side effects (e.g. <c>Assert(TryGetComponent(out etc))</c>)</para>
/// </summary>
/// <param name="shouldBeTrue">If false, this function will throw.</param>
/// <exception cref="System.Exception">Thrown when <paramref name="shouldBeTrue"/> is false.</exception>
public static void Assert(bool shouldBeTrue) {
if (!shouldBeTrue) {
throw new System.Exception("Assertion failed.");
}
}

void Setup() {
Debug.Assert(Instantiate(spritePrefab, Player.instance.transform).TryGetComponent(out sprite));
Assert(Instantiate(spritePrefab, Player.instance.transform).TryGetComponent(out sprite));

// we're only going to fire when the correct frame in the animation is displayed
sprite.ShouldFire += base.Fire;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void SetupExt(
base.Setup(weapon, target.transform.position, damage, pierceCount, speed, knockback, size, dotRate);

alt = UnityEngine.Random.Range(0f, 1f) < 0.5;
Debug.Assert(TryGetComponent(out animator));
PrettyParasol.Assert(TryGetComponent(out animator));
animator.SetBool("Alt", alt);

if (followTarget) {
Expand Down

0 comments on commit 00a8f0e

Please sign in to comment.