2022-06-26 06:48:14 +00:00
using HeavenStudio.Util ;
using System ;
using System.Collections.Generic ;
using UnityEngine ;
namespace HeavenStudio.Games.Loaders
{
using static Minigames ;
public static class AgbSpaceDanceLoader
{
public static Minigame AddGame ( EventCaller eventCaller ) {
2022-08-24 03:14:51 +00:00
return new Minigame ( "spaceDance" , "Space Dance \n<color=#eb5454>[WIP don't use]</color>" , "FFFF34" , false , false , new List < GameAction > ( )
2022-06-26 06:48:14 +00:00
{
2022-06-27 00:59:27 +00:00
new GameAction ( "turn right" , delegate { SpaceDance . instance . DoTurnRight ( eventCaller . currentEntity . beat ) ; } , 2.0f , false ) ,
new GameAction ( "sit down" , delegate { SpaceDance . instance . DoSitDown ( eventCaller . currentEntity . beat ) ; } , 2.0f , false ) ,
new GameAction ( "punch" , delegate { SpaceDance . instance . DoPunch ( eventCaller . currentEntity . beat ) ; } , 2.0f , false ) ,
new GameAction ( "bop" , delegate { SpaceDance . instance . Bop ( eventCaller . currentEntity . beat ) ; } , 1.0f , false ) ,
2022-06-26 06:48:14 +00:00
} ) ;
}
}
}
namespace HeavenStudio.Games
{
2022-06-27 00:59:27 +00:00
// using Scripts_SpaceDance;
2022-06-26 06:48:14 +00:00
public class SpaceDance : Minigame
{
2022-06-27 00:59:27 +00:00
public Animator DancerP ;
public Animator Dancer1 ;
public Animator Dancer2 ;
public Animator Dancer3 ;
public Animator Gramps ;
2022-06-27 16:07:27 +00:00
public Animator Hit ;
2022-06-27 00:59:27 +00:00
public GameObject Player ;
2022-06-26 06:48:14 +00:00
public static SpaceDance instance ;
// Start is called before the first frame update
void Awake ( )
{
instance = this ;
}
// Update is called once per frame
void Update ( )
{
if ( PlayerInput . Pressed ( ) & & ! IsExpectingInputNow ( ) )
{
2022-07-10 06:32:58 +00:00
Jukebox . PlayOneShotGame ( "spaceDance/inputBad" ) ;
// Look at this later, sound effect has some weird clipping on it sometimes?? popping. like. fucking popopop idk why its doing that its fine theres no sample weirdness ughh
2022-06-26 06:48:14 +00:00
}
}
2022-06-27 00:59:27 +00:00
public void DoTurnRight ( float beat )
{
2022-07-10 06:32:58 +00:00
ScheduleInput ( beat , 1f , InputType . DIRECTION_RIGHT_DOWN , RightSuccess , RightMiss , RightEmpty ) ;
2022-06-27 00:59:27 +00:00
MultiSound . Play ( new MultiSound . Sound [ ] {
2022-06-27 16:07:27 +00:00
new MultiSound . Sound ( "spaceDance/voicelessTurn" , beat ) ,
new MultiSound . Sound ( "spaceDance/dancerTurn" , beat ) ,
new MultiSound . Sound ( "spaceDance/dancerRight" , beat + 1.0f ) ,
2022-06-27 00:59:27 +00:00
} ) ;
BeatAction . New ( Player , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( beat , delegate { DancerP . Play ( "TurnRightStart" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat , delegate { Dancer1 . Play ( "TurnRightStart" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat , delegate { Dancer2 . Play ( "TurnRightStart" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat , delegate { Dancer3 . Play ( "TurnRightStart" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 1f , delegate { Dancer1 . Play ( "TurnRightDo" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 1f , delegate { Dancer2 . Play ( "TurnRightDo" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 1f , delegate { Dancer3 . Play ( "TurnRightDo" , - 1 , 0 ) ; } ) ,
} ) ;
}
public void DoSitDown ( float beat )
{
2022-07-10 06:32:58 +00:00
ScheduleInput ( beat , 1f , InputType . DIRECTION_DOWN_DOWN , SitSuccess , SitMiss , SitEmpty ) ;
2022-06-27 00:59:27 +00:00
MultiSound . Play ( new MultiSound . Sound [ ] {
2022-06-27 16:07:27 +00:00
new MultiSound . Sound ( "spaceDance/voicelessSit" , beat ) ,
new MultiSound . Sound ( "spaceDance/dancerLets" , beat ) ,
new MultiSound . Sound ( "spaceDance/dancerSit" , beat + 0.5f ) ,
new MultiSound . Sound ( "spaceDance/dancerDown" , beat + 1f ) ,
2022-06-27 00:59:27 +00:00
} ) ;
BeatAction . New ( Player , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( beat , delegate { DancerP . Play ( "SitDownStart" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat , delegate { Dancer1 . Play ( "SitDownStart" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat , delegate { Dancer2 . Play ( "SitDownStart" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat , delegate { Dancer3 . Play ( "SitDownStart" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 1f , delegate { Dancer1 . Play ( "SitDownDo" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 1f , delegate { Dancer2 . Play ( "SitDownDo" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 1f , delegate { Dancer3 . Play ( "SitDownDo" , - 1 , 0 ) ; } ) ,
} ) ;
}
public void DoPunch ( float beat )
{
ScheduleInput ( beat , 1.5f , InputType . STANDARD_DOWN , PunchSuccess , PunchMiss , PunchEmpty ) ;
MultiSound . Play ( new MultiSound . Sound [ ] {
2022-06-27 16:07:27 +00:00
new MultiSound . Sound ( "spaceDance/voicelessPunch" , beat ) ,
new MultiSound . Sound ( "spaceDance/dancerPa" , beat ) ,
new MultiSound . Sound ( "spaceDance/voicelessPunch" , beat + 0.5f ) ,
new MultiSound . Sound ( "spaceDance/dancerPa" , beat + 0.5f ) ,
new MultiSound . Sound ( "spaceDance/voicelessPunch" , beat + 1f ) ,
new MultiSound . Sound ( "spaceDance/dancerPa" , beat + 1f ) ,
new MultiSound . Sound ( "spaceDance/dancerPunch" , beat + 1.5f ) ,
2022-06-27 00:59:27 +00:00
} ) ;
BeatAction . New ( Player , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( beat , delegate { DancerP . Play ( "PunchStartInner" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat , delegate { Dancer1 . Play ( "PunchStartInner" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat , delegate { Dancer2 . Play ( "PunchStartInner" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat , delegate { Dancer3 . Play ( "PunchStartInner" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 0.5f , delegate { DancerP . Play ( "PunchStartOuter" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 0.5f , delegate { Dancer1 . Play ( "PunchStartOuter" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 0.5f , delegate { Dancer2 . Play ( "PunchStartOuter" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 0.5f , delegate { Dancer3 . Play ( "PunchStartOuter" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 1f , delegate { DancerP . Play ( "PunchStartInner" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 1f , delegate { Dancer1 . Play ( "PunchStartInner" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 1f , delegate { Dancer2 . Play ( "PunchStartInner" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 1f , delegate { Dancer3 . Play ( "PunchStartInner" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 1.5f , delegate { Dancer1 . Play ( "PunchDo" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 1.5f , delegate { Dancer2 . Play ( "PunchDo" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat + 1.5f , delegate { Dancer3 . Play ( "PunchDo" , - 1 , 0 ) ; } ) ,
} ) ;
}
public void Bop ( float beat )
{
BeatAction . New ( Player , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( beat , delegate { DancerP . Play ( "Bop" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat , delegate { Dancer1 . Play ( "Bop" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat , delegate { Dancer2 . Play ( "Bop" , - 1 , 0 ) ; } ) ,
new BeatAction . Action ( beat , delegate { Dancer3 . Play ( "Bop" , - 1 , 0 ) ; } ) ,
} ) ;
}
public void RightSuccess ( PlayerActionEvent caller , float state )
{
2022-06-27 16:07:27 +00:00
Jukebox . PlayOneShotGame ( "spaceDance/inputGood" ) ;
2022-06-27 00:59:27 +00:00
DancerP . Play ( "TurnRightDo" , - 1 , 0 ) ;
}
public void RightMiss ( PlayerActionEvent caller )
{
2022-06-27 16:07:27 +00:00
Jukebox . PlayOneShotGame ( "spaceDance/inputBad2" ) ;
DancerP . Play ( "Ouch" , - 1 , 0 ) ;
Hit . Play ( "HitTurn" , - 1 , 0 ) ;
2022-06-27 00:59:27 +00:00
}
public void RightEmpty ( PlayerActionEvent caller )
{
}
public void SitSuccess ( PlayerActionEvent caller , float state )
{
2022-06-27 16:07:27 +00:00
Jukebox . PlayOneShotGame ( "spaceDance/inputGood" ) ;
2022-06-27 00:59:27 +00:00
DancerP . Play ( "SitDownDo" , - 1 , 0 ) ;
}
public void SitMiss ( PlayerActionEvent caller )
{
2022-06-27 16:07:27 +00:00
Jukebox . PlayOneShotGame ( "spaceDance/inputBad2" ) ;
DancerP . Play ( "Ouch" , - 1 , 0 ) ;
Hit . Play ( "HitSit" , - 1 , 0 ) ;
2022-06-27 00:59:27 +00:00
}
public void SitEmpty ( PlayerActionEvent caller )
{
}
public void PunchSuccess ( PlayerActionEvent caller , float state )
{
2022-06-27 16:07:27 +00:00
Jukebox . PlayOneShotGame ( "spaceDance/inputGood" ) ;
2022-06-27 00:59:27 +00:00
DancerP . Play ( "PunchDo" , - 1 , 0 ) ;
}
public void PunchMiss ( PlayerActionEvent caller )
{
2022-06-27 16:07:27 +00:00
Jukebox . PlayOneShotGame ( "spaceDance/inputBad2" ) ;
DancerP . Play ( "Ouch" , - 1 , 0 ) ;
Hit . Play ( "HitPunch" , - 1 , 0 ) ;
2022-06-27 00:59:27 +00:00
}
public void PunchEmpty ( PlayerActionEvent caller )
{
}
2022-06-26 06:48:14 +00:00
}
}