diff --git a/Assets/Resources/Sprites/Editor/GameIcons/holeInOne.png b/Assets/Resources/Sprites/Editor/GameIcons/holeInOne.png new file mode 100644 index 000000000..a9f9ed06c Binary files /dev/null and b/Assets/Resources/Sprites/Editor/GameIcons/holeInOne.png differ diff --git a/Assets/Resources/Sprites/Editor/GameIcons/holeInOne.png.meta b/Assets/Resources/Sprites/Editor/GameIcons/holeInOne.png.meta new file mode 100644 index 000000000..ac8139d6a --- /dev/null +++ b/Assets/Resources/Sprites/Editor/GameIcons/holeInOne.png.meta @@ -0,0 +1,123 @@ +fileFormatVersion: 2 +guid: 66c5a0179fc97ad4bbf9c088dc9db5fd +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Sprites/Editor/GameIcons/holeInOne_mask.png b/Assets/Resources/Sprites/Editor/GameIcons/holeInOne_mask.png new file mode 100644 index 000000000..3434d76c2 Binary files /dev/null and b/Assets/Resources/Sprites/Editor/GameIcons/holeInOne_mask.png differ diff --git a/Assets/Resources/Sprites/Editor/GameIcons/holeInOne_mask.png.meta b/Assets/Resources/Sprites/Editor/GameIcons/holeInOne_mask.png.meta new file mode 100644 index 000000000..79b00cc95 --- /dev/null +++ b/Assets/Resources/Sprites/Editor/GameIcons/holeInOne_mask.png.meta @@ -0,0 +1,123 @@ +fileFormatVersion: 2 +guid: 368af4564ea59b746abfd8d4984ed578 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyBop.anim b/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyBop.anim index f52c6c328..40e10d9bd 100644 --- a/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyBop.anim +++ b/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyBop.anim @@ -212,7 +212,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 + m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyIdle.anim b/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyIdle.anim index 452538adc..096a2bd8e 100644 --- a/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyIdle.anim +++ b/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyIdle.anim @@ -36,7 +36,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 + m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyPrepare.anim b/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyPrepare.anim index d832b63df..9836244f4 100644 --- a/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyPrepare.anim +++ b/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyPrepare.anim @@ -382,7 +382,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 + m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeySpin.anim b/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeySpin.anim index b1d770a90..4287616ff 100644 --- a/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeySpin.anim +++ b/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeySpin.anim @@ -4278,7 +4278,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 + m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyThrow.anim b/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyThrow.anim index 96e5d6300..068054842 100644 --- a/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyThrow.anim +++ b/Assets/Resources/Sprites/Games/HoleInOne/Animations/MonkeyThrow.anim @@ -641,7 +641,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 + m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/Scripts/Games/HoleInOne/HoleInOne.cs b/Assets/Scripts/Games/HoleInOne/HoleInOne.cs index 8d3ffba8d..680bab873 100644 --- a/Assets/Scripts/Games/HoleInOne/HoleInOne.cs +++ b/Assets/Scripts/Games/HoleInOne/HoleInOne.cs @@ -18,9 +18,15 @@ namespace HeavenStudio.Games.Loaders { return new Minigame("holeInOne", "Hole in One", "6ab99e", false, false, new List() { - new GameAction("testanims", "Test Animation") // Delete this one when the game is more competent + new GameAction("bop", "Bop") { - function = delegate { HoleInOne.instance.DoTestAnim(eventCaller.currentEntity.beat); }, + function = delegate { var e = eventCaller.currentEntity; HoleInOne.instance.ToggleBop(e.beat, e.length, e["bop"], e["autobop"]); }, + resizable = true, + parameters = new List() + { + new Param("bop", true, "Bop", "Toggle if the characters should bop for the duration of this event."), + new Param("autobop", false, "Bop (Auto)", "Toggle if the characters should automatically bop until another Bop event is reached.") + } }, new GameAction("mandrill", "Mandrill (no visuals)") { @@ -54,13 +60,31 @@ namespace HeavenStudio.Games void Awake() { HoleInOne.instance = this; + SetupBopRegion("holeInOne", "bop", "toggle"); } - // Delete this one when the game is more competent - public void DoTestAnim(double beat) + public override void OnBeatPulse(double beat) { - SoundByte.PlayOneShotGame("holeInOne/whale"); - MonkeyAnim.Play("MonkeySpin"); + if (BeatIsInBopRegion(beat)) MonkeyAnim.DoScaledAnimationAsync("MonkeyBop", 0.4f); + + } + + public void ToggleBop(double beat, float length, bool shouldBop, bool autoBop) + { + if (shouldBop) + { + for (int i = 0; i < length; i++) + { + BeatAction.New(instance, new List() + { + new BeatAction.Action(beat + i, delegate + { + MonkeyAnim.DoScaledAnimationAsync("MonkeyBop", 0.4f); + // TODO add bops for other characters + }) + }); + } + } } public void DoMandrill(double beat) @@ -104,6 +128,7 @@ namespace HeavenStudio.Games { SoundByte.PlayOneShotGame("holeInOne/mandrill4"); MonkeyAnim.Play("MonkeySpin"); + } public void MandrillMiss(PlayerActionEvent caller) @@ -114,7 +139,13 @@ namespace HeavenStudio.Games public void MonkeySuccess(PlayerActionEvent caller, float state) { - SoundByte.PlayOneShotGame("holeInOne/monkey3"); + double beat = caller.timer; + int randomSuccess = UnityEngine.Random.Range(1,5); + + MultiSound.Play(new MultiSound.Sound[] { + new MultiSound.Sound("holeInOne/monkey3", beat), + new MultiSound.Sound("holeInOne/hole" + randomSuccess, beat + 2f) + }); MonkeyAnim.Play("MonkeySpin"); }