2023-03-27 02:26:11 +00:00
using HeavenStudio.Util ;
2023-05-23 04:09:46 +00:00
using HeavenStudio.Common ;
2023-03-27 02:26:11 +00:00
using System ;
using System.Collections.Generic ;
2023-05-23 04:09:46 +00:00
using System.Linq ;
2023-03-27 02:26:11 +00:00
using UnityEngine ;
namespace HeavenStudio.Games.Loaders
{
using static Minigames ;
public static class ntrMunchyMonkLoader
{
public static Minigame AddGame ( EventCaller eventCaller ) {
2023-04-02 02:28:23 +00:00
return new Minigame ( "munchyMonk" , "Munchy Monk" , "b9fffc" , false , false , new List < GameAction > ( )
2023-03-27 02:26:11 +00:00
{
new GameAction ( "Bop" , "Bop" )
{
function = delegate {
var e = eventCaller . currentEntity ;
2023-12-05 22:38:52 +00:00
MunchyMonk . instance . Bop ( e . beat , e . length , e [ "bop" ] ) ;
2023-03-27 02:26:11 +00:00
} ,
parameters = new List < Param > ( )
{
2023-05-23 04:09:46 +00:00
new Param ( "bop" , true , "Monk Bops?" , "Does the monk bop?" ) ,
new Param ( "autoBop" , false , "Monk Bops? (Auto)" , "Does the monk auto bop?" ) ,
2023-03-27 02:26:11 +00:00
} ,
2023-12-05 22:38:52 +00:00
resizable = true
2023-03-27 02:26:11 +00:00
} ,
new GameAction ( "MonkMove" , "Monk Move" )
{
function = delegate {
var e = eventCaller . currentEntity ;
2023-05-23 04:09:46 +00:00
MunchyMonk . instance . MonkMove ( e . beat , e . length , e [ "goToSide" ] , e [ "ease" ] ) ;
2023-03-27 02:26:11 +00:00
} ,
2023-06-10 19:18:45 +00:00
defaultLength = 8f ,
2023-03-27 02:26:11 +00:00
resizable = true ,
parameters = new List < Param > ( )
{
2023-05-23 04:09:46 +00:00
new Param ( "goToSide" , MunchyMonk . WhichSide . Right , "Go to Which Side?" , "Which side the Monk will move to" ) ,
new Param ( "ease" , EasingFunction . Ease . Linear , "Ease" , "Which ease should the movement have?" ) ,
} ,
2023-03-27 02:26:11 +00:00
} ,
new GameAction ( "One" , "One" )
{
2023-05-07 04:45:44 +00:00
function = delegate {
var e = eventCaller . currentEntity ;
MunchyMonk . PreOneGoCue ( e . beat , e [ "oneColor" ] ) ;
} ,
2023-05-23 04:09:46 +00:00
inactiveFunction = delegate {
var e = eventCaller . currentEntity ;
MunchyMonk . PreOneGoCue ( e . beat , e [ "oneColor" ] ) ;
} ,
2023-03-27 02:26:11 +00:00
defaultLength = 2f ,
parameters = new List < Param > ( )
{
new Param ( "oneColor" , new Color ( 1 , 1 , 1 , 1 ) , "Color" , "Change the color of the dumpling" )
} ,
} ,
new GameAction ( "TwoTwo" , "Two Two" )
{
defaultLength = 2f ,
parameters = new List < Param > ( )
{
2023-05-23 04:09:46 +00:00
new Param ( "twoColor1" , new Color ( 1 , 0.51f , 0.45f , 1 ) , "1st Dumpling Color" , "Change the color of the first dumpling" ) ,
new Param ( "twoColor2" , new Color ( 1 , 0.51f , 0.45f , 1 ) , "2nd Dumpling Color" , "Change the color of the second dumpling" ) ,
2023-03-27 02:26:11 +00:00
} ,
preFunctionLength = 0.5f ,
preFunction = delegate {
var e = eventCaller . currentEntity ;
2023-05-23 04:09:46 +00:00
MunchyMonk . PreTwoTwoCue ( e . beat , e [ "twoColor1" ] , e [ "twoColor2" ] ) ;
2023-03-27 02:26:11 +00:00
} ,
} ,
new GameAction ( "Three" , "Three" )
{
2023-05-07 04:45:44 +00:00
function = delegate {
var e = eventCaller . currentEntity ;
2023-05-23 04:09:46 +00:00
MunchyMonk . PreThreeGoCue ( e . beat , e [ "threeColor1" ] , e [ "threeColor2" ] , e [ "threeColor3" ] ) ;
} ,
inactiveFunction = delegate {
var e = eventCaller . currentEntity ;
MunchyMonk . PreThreeGoCue ( e . beat , e [ "threeColor1" ] , e [ "threeColor2" ] , e [ "threeColor3" ] ) ;
2023-05-07 04:45:44 +00:00
} ,
2023-03-27 02:26:11 +00:00
defaultLength = 4f ,
parameters = new List < Param > ( )
{
2023-05-23 04:09:46 +00:00
new Param ( "threeColor1" , new Color ( 0.34f , 0.77f , 0.36f , 1 ) , "1st Dumpling Color" , "Change the color of the first dumpling" ) ,
new Param ( "threeColor2" , new Color ( 0.34f , 0.77f , 0.36f , 1 ) , "2nd Dumpling Color" , "Change the color of the second dumpling" ) ,
new Param ( "threeColor3" , new Color ( 0.34f , 0.77f , 0.36f , 1 ) , "3rd Dumpling Color" , "Change the color of the third dumpling" ) ,
2023-03-27 02:26:11 +00:00
} ,
} ,
new GameAction ( "Modifiers" , "Modifiers" )
{
function = delegate {
var e = eventCaller . currentEntity ;
2023-05-23 04:09:46 +00:00
MunchyMonk . Modifiers ( e . beat , e [ "inputsTil" ] , e [ "resetLevel" ] , e [ "setLevel" ] , e [ "disableBaby" ] , e [ "shouldBlush" ] ) ;
2023-03-27 02:26:11 +00:00
} ,
defaultLength = 0.5f ,
parameters = new List < Param > ( )
{
new Param ( "inputsTil" , new EntityTypes . Integer ( 0 , 50 , 10 ) , "How Many 'til Growth?" , "How many dumplings are needed to grow the stache?" ) ,
2023-05-23 04:09:46 +00:00
new Param ( "resetLevel" , false , "Remove Hair" , "Instantly remove all hair" ) ,
new Param ( "setLevel" , new EntityTypes . Integer ( 0 , 4 , 0 ) , "Set Growth Level" , "Instantly grow hair" ) ,
2023-03-27 02:26:11 +00:00
new Param ( "disableBaby" , false , "Disable Baby?" , "Make baby active or not" ) ,
2023-05-23 04:09:46 +00:00
new Param ( "shouldBlush" , true , "Should Monk Blush?" , "Makes the Monk blush or not after eating" ) ,
2023-03-27 02:26:11 +00:00
} ,
} ,
new GameAction ( "MonkAnimation" , "Monk Animations" )
{
function = delegate {
var e = eventCaller . currentEntity ;
2023-05-23 04:09:46 +00:00
MunchyMonk . instance . PlayMonkAnim ( e . beat , e [ "whichAnim" ] , e [ "vineBoom" ] ) ;
2023-03-27 02:26:11 +00:00
} ,
2023-06-04 04:30:42 +00:00
inactiveFunction = delegate {
var e = eventCaller . currentEntity ;
MunchyMonk . instance . PlayMonkAnimInactive ( e [ "vineBoom" ] ) ;
} ,
2023-03-27 02:26:11 +00:00
parameters = new List < Param > ( )
{
new Param ( "whichAnim" , MunchyMonk . WhichMonkAnim . Stare , "Which Animation" , "Which animation will the Monk play?" ) ,
2023-05-23 04:09:46 +00:00
new Param ( "vineBoom" , false , "Vine Boom" , "Just guess with this one." ) ,
2023-03-27 02:26:11 +00:00
}
} ,
new GameAction ( "ScrollBackground" , "Scroll Background" )
{
function = delegate {
var e = eventCaller . currentEntity ;
2023-05-23 04:09:46 +00:00
MunchyMonk . instance . ScrollBG ( e . beat , e . length , e [ "scrollSpeed" ] , e [ "ease" ] ) ;
2023-03-27 02:26:11 +00:00
} ,
2023-05-23 04:09:46 +00:00
defaultLength = 1f ,
resizable = true ,
2023-03-27 02:26:11 +00:00
parameters = new List < Param > ( )
{
2023-05-23 04:09:46 +00:00
new Param ( "scrollSpeed" , new EntityTypes . Float ( 0 , 20 , 5 ) , "Scroll Speed" , "What should the scroll speed be?" ) ,
new Param ( "ease" , EasingFunction . Ease . Linear , "Ease" , "Which ease should the scroll ramp up have?" ) ,
2023-03-27 02:26:11 +00:00
}
} ,
2023-06-10 19:18:45 +00:00
new GameAction ( "CloudMonkey" , "Cloud Monkey" )
{
function = delegate {
var e = eventCaller . currentEntity ;
MunchyMonk . instance . MoveCloudMonkey ( e . beat , e . length , e [ "start" ] , e [ "direction" ] ) ;
} ,
parameters = new List < Param > ( )
{
new Param ( "start" , true , "Start Moving" , "Start moving the monkey" ) ,
new Param ( "direction" , MunchyMonk . WhichSide . Right , "Direction" , "The direction the monkey will move." ) ,
} ,
defaultLength = 8f ,
resizable = true ,
} ,
2023-05-28 17:34:44 +00:00
} ,
new List < string > ( ) { "ntr" , "normal" } ,
"ntrshugyo" , "en" ,
new List < string > ( ) { "en" }
) ;
2023-03-27 02:26:11 +00:00
}
}
}
namespace HeavenStudio.Games
{
using Scripts_MunchyMonk ;
public class MunchyMonk : Minigame
{
2023-05-23 04:09:46 +00:00
public List < Dumpling > dumplings = new List < Dumpling > ( ) ;
static List < QueuedDumpling > queuedOnes = new List < QueuedDumpling > ( ) ;
static List < QueuedDumpling > queuedTwoTwos = new List < QueuedDumpling > ( ) ;
static List < QueuedDumpling > queuedThrees = new List < QueuedDumpling > ( ) ;
struct QueuedDumpling
2023-03-27 02:26:11 +00:00
{
2023-06-10 19:17:06 +00:00
public double beat ;
2023-05-23 04:09:46 +00:00
public Color color1 ;
public Color color2 ;
public Color color3 ;
2023-03-27 02:26:11 +00:00
}
public enum WhichMonkAnim
{
Stare ,
Blush ,
2023-05-23 04:09:46 +00:00
}
public enum WhichSide
{
Right ,
Left ,
2023-03-27 02:26:11 +00:00
}
[Header("Objects")]
[SerializeField] GameObject Baby ;
[SerializeField] GameObject BrowHolder ;
[SerializeField] GameObject StacheHolder ;
[SerializeField] GameObject DumplingObj ;
2023-06-10 19:18:45 +00:00
[SerializeField] GameObject CloudMonkey ;
[SerializeField] ScrollObject CloudMonkeyScroll ;
2023-03-27 02:26:11 +00:00
[Header("Animators")]
[SerializeField] Animator OneGiverAnim ;
[SerializeField] Animator TwoGiverAnim ;
[SerializeField] Animator ThreeGiverAnim ;
[SerializeField] Animator BrowAnim ;
[SerializeField] Animator StacheAnim ;
2023-05-23 04:09:46 +00:00
[SerializeField] Animator MonkHolderAnim ;
2023-03-27 02:26:11 +00:00
public Animator MonkAnim ;
public Animator MonkArmsAnim ;
[Header("Variables")]
2023-05-23 04:09:46 +00:00
[SerializeField] Sprite [ ] dumplingSprites ;
2023-06-10 19:17:06 +00:00
public double lastReportedBeat = 0f ;
2023-03-27 02:26:11 +00:00
public bool needBlush ;
public bool isStaring ;
2023-05-23 04:09:46 +00:00
// these variables are static so that they can be set outside of the game/stay the same between game switches
static public int howManyGulps ;
static public int growLevel = 0 ;
static public int inputsTilGrow = 10 ;
static bool noBlush ;
static bool disableBaby ;
// the variables for scroll
bool scrollRampUp ;
2023-06-10 19:17:06 +00:00
double scrollBeat ;
2023-06-10 20:55:10 +00:00
double scrollLength ;
2023-05-23 04:09:46 +00:00
float scrollMod ;
static float scrollModCurrent = 0 ;
EasingFunction . Ease scrollEase ;
// the variables for the monk moving
bool isMoving ;
2023-06-10 19:17:06 +00:00
double movingStartBeat ;
2023-06-10 20:55:10 +00:00
double movingLength ;
2023-05-23 04:09:46 +00:00
string moveAnim ;
EasingFunction . Ease lastEase ;
ScrollObject [ ] scrollObjects ;
2023-03-27 02:26:11 +00:00
const string sfxName = "munchyMonk/" ;
public static MunchyMonk instance ;
private void Awake ( )
{
instance = this ;
2023-05-23 04:09:46 +00:00
Baby . SetActive ( ! disableBaby ) ;
2023-12-05 22:38:52 +00:00
SetupBopRegion ( "munchyMonk" , "Bop" , "autoBop" ) ;
2023-05-23 04:09:46 +00:00
}
private void Start ( )
{
scrollObjects = FindObjectsByType < ScrollObject > ( FindObjectsSortMode . None ) ;
2023-06-04 04:30:42 +00:00
foreach ( var obj in scrollObjects ) obj . SpeedMod = scrollModCurrent ;
2023-06-10 19:18:45 +00:00
if ( growLevel > 0 ) {
StacheHolder . SetActive ( true ) ;
StacheAnim . Play ( $"Idle{growLevel}" ) ;
if ( growLevel = = 4 ) {
BrowHolder . SetActive ( true ) ;
BrowAnim . Play ( "Idle" ) ;
}
}
2023-05-23 04:09:46 +00:00
}
private void OnDestroy ( )
{
2023-06-10 19:18:45 +00:00
// reset static variables only when the game is stopped (so that it carries over between game switches)
if ( ! Conductor . instance . NotStopped ( ) ) {
if ( queuedOnes . Count > 0 ) queuedOnes . Clear ( ) ;
if ( queuedTwoTwos . Count > 0 ) queuedThrees . Clear ( ) ;
if ( queuedThrees . Count > 0 ) queuedThrees . Clear ( ) ;
howManyGulps = 0 ;
growLevel = 0 ;
inputsTilGrow = 10 ;
noBlush = false ;
disableBaby = false ;
2023-06-03 23:30:17 +00:00
}
2023-06-10 19:18:45 +00:00
foreach ( var evt in scheduledInputs ) evt . Disable ( ) ;
2023-03-27 02:26:11 +00:00
}
private void Update ( )
{
// input stuff
2023-10-29 19:44:47 +00:00
if ( PlayerInput . GetIsAction ( InputAction_BasicPress ) & & ! IsExpectingInputNow ( InputAction_BasicPress ) ) {
2023-03-27 02:26:11 +00:00
MonkArmsAnim . DoScaledAnimationAsync ( "WristSlap" , 0.5f ) ;
2023-06-10 19:17:06 +00:00
SoundByte . PlayOneShotGame ( sfxName + "slap" ) ;
2023-03-27 02:26:11 +00:00
isStaring = false ;
2023-05-23 04:09:46 +00:00
// early input stuff
2023-06-04 04:30:42 +00:00
if ( dumplings . Count ! = 0 ) InputFunctions ( 3 ) ;
2023-03-27 02:26:11 +00:00
}
// blushes when done eating but not when staring
2023-12-06 01:59:36 +00:00
if ( needBlush
& & ! MonkAnim . IsPlayingAnimationNames ( "Eat" , "Stare" , "Barely" , "Miss" )
2023-05-23 04:09:46 +00:00
& & ! isStaring
2023-12-06 01:59:36 +00:00
& & ! noBlush )
2023-03-27 02:26:11 +00:00
{
MonkAnim . DoScaledAnimationAsync ( "Blush" , 0.5f ) ;
needBlush = false ;
}
// sets hair stuff active when it needs to be
2023-05-23 04:09:46 +00:00
if ( growLevel > 0 ) {
StacheHolder . SetActive ( true ) ;
if ( growLevel = = 4 ) BrowHolder . SetActive ( true ) ;
}
2023-03-27 02:26:11 +00:00
2023-05-23 04:09:46 +00:00
// resets the monk when game is stopped
2023-06-04 04:30:42 +00:00
if ( ! Conductor . instance . NotStopped ( ) ) MonkAnim . DoScaledAnimationAsync ( "Idle" , 0.5f ) ;
2023-03-27 02:26:11 +00:00
2023-05-23 04:09:46 +00:00
if ( isMoving ) {
float normalizedBeat = Conductor . instance . GetPositionFromBeat ( movingStartBeat , movingLength ) ;
EasingFunction . Function func = EasingFunction . GetEasingFunction ( lastEase ) ;
float newPos = func ( 0f , 1f , normalizedBeat ) ;
MonkHolderAnim . DoNormalizedAnimation ( moveAnim , newPos ) ;
2023-06-04 04:30:42 +00:00
if ( normalizedBeat > = 1f ) isMoving = false ;
2023-05-23 04:09:46 +00:00
}
if ( scrollRampUp ) {
float normalizedBeat = Conductor . instance . GetPositionFromBeat ( scrollBeat , scrollLength ) ;
EasingFunction . Function func = EasingFunction . GetEasingFunction ( scrollEase ) ;
float newPos = func ( scrollModCurrent , scrollMod , normalizedBeat ) ;
if ( normalizedBeat > = 1f ) {
scrollRampUp = false ;
scrollModCurrent = scrollMod ;
}
2023-06-04 04:30:42 +00:00
foreach ( var obj in scrollObjects ) obj . SpeedMod = newPos ;
2023-05-23 04:09:46 +00:00
}
2023-03-27 02:26:11 +00:00
2023-06-10 19:18:45 +00:00
if ( CloudMonkey . transform . position . x < - 5 | | CloudMonkey . transform . position . x > 15.5 ) {
CloudMonkey . SetActive ( false ) ;
}
2023-03-27 02:26:11 +00:00
// cue queuing stuff
if ( queuedOnes . Count > 0 ) {
2023-06-04 04:30:42 +00:00
foreach ( var dumpling in queuedOnes ) OneGoCue ( dumpling . beat , dumpling . color1 ) ;
2023-03-27 02:26:11 +00:00
queuedOnes . Clear ( ) ;
}
if ( queuedTwoTwos . Count > 0 ) {
2023-06-04 04:30:42 +00:00
foreach ( var dumpling in queuedTwoTwos ) TwoTwoCue ( dumpling . beat , dumpling . color1 , dumpling . color2 ) ;
2023-03-27 02:26:11 +00:00
queuedTwoTwos . Clear ( ) ;
}
if ( queuedThrees . Count > 0 ) {
2023-06-04 04:30:42 +00:00
foreach ( var dumpling in queuedThrees ) ThreeGoCue ( dumpling . beat , dumpling . color1 , dumpling . color2 , dumpling . color3 ) ;
2023-03-27 02:26:11 +00:00
queuedThrees . Clear ( ) ;
}
}
2023-11-23 16:19:39 +00:00
public override void OnBeatPulse ( double beat )
2023-03-27 02:26:11 +00:00
{
2023-12-06 01:59:36 +00:00
if ( ( MonkAnim . IsAnimationNotPlaying ( ) | | MonkAnim . IsPlayingAnimationNames ( "Bop" , "Idle" ) )
2023-12-05 22:38:52 +00:00
& & BeatIsInBopRegion ( beat )
2023-11-23 16:19:39 +00:00
& & ! isStaring )
{
MonkAnim . DoScaledAnimationAsync ( "Bop" , 0.5f ) ;
}
2023-05-23 04:09:46 +00:00
2023-12-06 01:59:36 +00:00
if ( ! MonkAnim . IsPlayingAnimationNames ( "Blush" , "Stare" ) )
2023-11-23 16:19:39 +00:00
{
if ( growLevel = = 4 ) BrowAnim . DoScaledAnimationAsync ( "Bop" , 0.5f ) ;
if ( growLevel > 0 ) StacheAnim . DoScaledAnimationAsync ( $"Bop{growLevel}" , 0.5f ) ;
}
2023-06-10 19:18:45 +00:00
2023-11-23 16:19:39 +00:00
if ( CloudMonkey . activeInHierarchy ) //Why activeInHierarchy? - Rasmus
{
CloudMonkey . GetComponent < Animator > ( ) . DoScaledAnimationAsync ( "Bop" , 0.5f ) ; //DONT DO THIS!!! GetComponent is a really expensive operation - Rasmus
2023-03-27 02:26:11 +00:00
}
}
2023-12-05 22:38:52 +00:00
public void Bop ( double beat , double length , bool bop )
2023-03-27 02:26:11 +00:00
{
2023-12-05 22:38:52 +00:00
if ( ! bop ) return ;
List < BeatAction . Action > actions = new ( ) ;
for ( int i = 0 ; i < length ; i + + )
{
actions . Add ( new ( beat + i , delegate
{
needBlush = false ;
MonkAnim . DoScaledAnimationAsync ( "Bop" , 0.5f ) ;
if ( growLevel = = 4 ) BrowAnim . DoScaledAnimationAsync ( "Bop" , 0.5f ) ;
if ( growLevel > 0 ) StacheAnim . DoScaledAnimationAsync ( $"Bop{growLevel}" , 0.5f ) ;
} ) ) ;
2023-05-23 04:09:46 +00:00
}
2023-12-05 22:38:52 +00:00
if ( actions . Count > 0 ) BeatAction . New ( this , actions ) ;
2023-03-27 02:26:11 +00:00
}
2023-05-23 04:09:46 +00:00
public void InputFunctions ( int whichVar , float state = 0 )
{
switch ( whichVar )
{
case 1 :
2023-06-04 04:30:42 +00:00
dumplings [ dumplings . Count - 1 ] . HitFunction ( state ) ;
2023-05-23 04:09:46 +00:00
break ;
case 2 :
2023-06-04 04:30:42 +00:00
dumplings [ dumplings . Count - 1 ] . MissFunction ( ) ;
2023-05-23 04:09:46 +00:00
break ;
case 3 :
2023-06-04 04:30:42 +00:00
dumplings [ dumplings . Count - 1 ] . EarlyFunction ( ) ;
2023-05-23 04:09:46 +00:00
break ;
}
dumplings . RemoveAt ( dumplings . Count - 1 ) ;
}
public void Hit ( PlayerActionEvent caller , float state )
{
if ( dumplings . Count > 0 ) InputFunctions ( 1 , state ) ;
}
public void Miss ( PlayerActionEvent caller )
{
if ( dumplings . Count > 0 ) InputFunctions ( 2 ) ;
}
public void Early ( PlayerActionEvent caller ) { }
2023-06-10 19:17:06 +00:00
public static void PreOneGoCue ( double beat , Color firstColor )
2023-03-27 02:26:11 +00:00
{
2023-06-04 04:30:42 +00:00
PlaySoundSequence ( "munchyMonk" , "one_go" , beat ) ;
2023-03-27 02:26:11 +00:00
2023-06-10 19:18:45 +00:00
queuedOnes . Add ( new QueuedDumpling ( ) {
beat = beat ,
color1 = firstColor ,
} ) ;
2023-03-27 02:26:11 +00:00
}
2023-06-10 19:17:06 +00:00
public void OneGoCue ( double beat , Color firstColor )
2023-03-27 02:26:11 +00:00
{
2023-09-11 22:28:04 +00:00
BeatAction . New ( this , new List < BeatAction . Action > ( ) {
2023-05-23 04:09:46 +00:00
new BeatAction . Action ( beat , delegate {
OneGiverAnim . DoScaledAnimationAsync ( "GiveIn" , 0.5f ) ;
// dumpling
Dumpling DumplingClone = Instantiate ( DumplingObj , gameObject . transform ) . GetComponent < Dumpling > ( ) ;
DumplingClone . dumplingColor = firstColor ;
DumplingClone . startBeat = beat ;
DumplingClone . sr . sprite = dumplingSprites [ 0 ] ;
dumplings . Add ( DumplingClone ) ;
2023-10-29 19:44:47 +00:00
ScheduleInput ( beat , 1f , InputAction_BasicPress , Hit , Miss , Early ) ;
2023-05-23 04:09:46 +00:00
} ) ,
new BeatAction . Action ( beat + 0.5f , delegate {
OneGiverAnim . DoScaledAnimationAsync ( "GiveOut" , 0.5f ) ;
} ) ,
2023-03-27 02:26:11 +00:00
} ) ;
}
2023-06-10 19:17:06 +00:00
public static void PreTwoTwoCue ( double beat , Color firstColor , Color secondColor )
2023-03-27 02:26:11 +00:00
{
2023-06-04 04:30:42 +00:00
PlaySoundSequence ( "munchyMonk" , "two_go" , beat ) ;
2023-05-23 04:09:46 +00:00
queuedTwoTwos . Add ( new QueuedDumpling ( ) {
beat = beat ,
color1 = firstColor ,
color2 = secondColor ,
} ) ;
2023-03-27 02:26:11 +00:00
}
2023-06-10 19:17:06 +00:00
public void TwoTwoCue ( double beat , Color firstColor , Color secondColor )
2023-03-27 02:26:11 +00:00
{
2023-09-11 22:28:04 +00:00
BeatAction . New ( this , new List < BeatAction . Action > ( ) {
2023-03-27 02:26:11 +00:00
new BeatAction . Action ( beat - 0.5f , delegate {
2023-05-23 04:09:46 +00:00
TwoGiverAnim . DoScaledAnimationAsync ( "GiveIn" , 0.5f ) ;
2023-03-27 02:26:11 +00:00
// first dumpling
2023-05-23 04:09:46 +00:00
Dumpling DumplingClone1 = Instantiate ( DumplingObj , gameObject . transform ) . GetComponent < Dumpling > ( ) ;
DumplingClone1 . dumplingColor = firstColor ;
2023-03-27 02:26:11 +00:00
DumplingClone1 . startBeat = beat - 0.5f ;
2023-05-23 04:09:46 +00:00
DumplingClone1 . sr . sprite = dumplingSprites [ 1 ] ;
dumplings . Add ( DumplingClone1 ) ;
2023-10-29 19:44:47 +00:00
ScheduleInput ( beat , 1f , InputAction_BasicPress , Hit , Miss , Early ) ;
2023-05-23 04:09:46 +00:00
//DumplingClone1.otherAnim = DumplingClone2.gameObject.GetComponent<Animator>();
} ) ,
2023-03-27 02:26:11 +00:00
new BeatAction . Action ( beat , delegate {
2023-05-23 04:09:46 +00:00
TwoGiverAnim . DoScaledAnimationAsync ( "GiveOut" , 0.5f ) ;
// second dumpling
Dumpling DumplingClone2 = Instantiate ( DumplingObj , gameObject . transform ) . GetComponent < Dumpling > ( ) ;
DumplingClone2 . dumplingColor = secondColor ;
DumplingClone2 . startBeat = beat - 0.5f ;
DumplingClone2 . sr . sprite = dumplingSprites [ 2 ] ;
dumplings . Add ( DumplingClone2 ) ;
2023-10-29 19:44:47 +00:00
ScheduleInput ( beat , 1.5f , InputAction_BasicPress , Hit , Miss , Early ) ;
2023-05-23 04:09:46 +00:00
} ) ,
2023-03-27 02:26:11 +00:00
} ) ;
}
2023-06-10 19:17:06 +00:00
public static void PreThreeGoCue ( double beat , Color firstColor , Color secondColor , Color thirdColor )
2023-03-27 02:26:11 +00:00
{
2023-06-04 04:30:42 +00:00
PlaySoundSequence ( "munchyMonk" , "three_go" , beat ) ;
2023-03-27 02:26:11 +00:00
2023-05-23 04:09:46 +00:00
queuedThrees . Add ( new QueuedDumpling ( ) {
beat = beat ,
color1 = firstColor ,
color2 = secondColor ,
color3 = thirdColor ,
} ) ;
2023-03-27 02:26:11 +00:00
}
2023-06-10 19:17:06 +00:00
public void ThreeGoCue ( double beat , Color firstColor , Color secondColor , Color thirdColor )
2023-03-27 02:26:11 +00:00
{
2023-09-11 22:28:04 +00:00
BeatAction . New ( instance , new List < BeatAction . Action > ( ) {
2023-03-27 02:26:11 +00:00
new BeatAction . Action ( beat , delegate {
2023-05-23 04:09:46 +00:00
// first in
ThreeGiverAnim . DoScaledAnimationAsync ( "GiveIn" , 0.5f ) ;
// first dumpling
Dumpling DumplingClone1 = Instantiate ( DumplingObj , gameObject . transform ) . GetComponent < Dumpling > ( ) ;
DumplingClone1 . dumplingColor = firstColor ;
2023-03-27 02:26:11 +00:00
DumplingClone1 . startBeat = beat ;
2023-05-23 04:09:46 +00:00
DumplingClone1 . sr . sprite = dumplingSprites [ 3 ] ;
dumplings . Add ( DumplingClone1 ) ;
2023-10-29 19:44:47 +00:00
ScheduleInput ( beat , 1f , InputAction_BasicPress , Hit , Miss , Early ) ; } ) ,
2023-03-27 02:26:11 +00:00
new BeatAction . Action ( beat + 0.5f , delegate {
2023-05-23 04:09:46 +00:00
// first out
2023-03-27 02:26:11 +00:00
ThreeGiverAnim . DoScaledAnimationAsync ( "GiveOut" , 0.5f ) ; } ) ,
2023-05-23 04:09:46 +00:00
new BeatAction . Action ( beat + 1.3f , delegate {
// second in
ThreeGiverAnim . DoScaledAnimationAsync ( "GiveIn" , 0.5f ) ;
// second dumpling
Dumpling DumplingClone2 = Instantiate ( DumplingObj , gameObject . transform ) . GetComponent < Dumpling > ( ) ;
DumplingClone2 . dumplingColor = secondColor ;
DumplingClone2 . startBeat = beat + 1.3f ;
DumplingClone2 . sr . sprite = dumplingSprites [ 4 ] ;
dumplings . Add ( DumplingClone2 ) ;
2023-10-29 19:44:47 +00:00
ScheduleInput ( beat , 2f , InputAction_BasicPress , Hit , Miss , Early ) ; } ) ,
2023-05-23 04:09:46 +00:00
2023-03-27 02:26:11 +00:00
new BeatAction . Action ( beat + 1.75f , delegate {
2023-05-23 04:09:46 +00:00
// second out
2023-03-27 02:26:11 +00:00
ThreeGiverAnim . DoScaledAnimationAsync ( "GiveOut" , 0.5f ) ; } ) ,
2023-05-23 04:09:46 +00:00
new BeatAction . Action ( beat + 2.3f , delegate {
// third in
ThreeGiverAnim . DoScaledAnimationAsync ( "GiveIn" , 0.5f ) ;
// third dumpling
Dumpling DumplingClone3 = Instantiate ( DumplingObj , gameObject . transform ) . GetComponent < Dumpling > ( ) ;
DumplingClone3 . dumplingColor = thirdColor ;
DumplingClone3 . startBeat = beat + 2.3f ;
DumplingClone3 . sr . sprite = dumplingSprites [ 5 ] ;
dumplings . Add ( DumplingClone3 ) ;
2023-10-29 19:44:47 +00:00
ScheduleInput ( beat , 3f , InputAction_BasicPress , Hit , Miss , Early ) ; } ) ,
2023-05-23 04:09:46 +00:00
new BeatAction . Action ( beat + 2.75f , delegate {
// third out
2023-03-27 02:26:11 +00:00
ThreeGiverAnim . DoScaledAnimationAsync ( "GiveOut" , 0.5f ) ; } ) ,
} ) ;
}
2023-06-10 19:17:06 +00:00
public void PlayMonkAnim ( double beat , int whichAnim , bool vineBoom )
2023-03-27 02:26:11 +00:00
{
switch ( whichAnim )
{
case 1 :
MonkAnim . DoScaledAnimationAsync ( "Blush" , 0.5f ) ;
needBlush = false ;
break ;
2023-05-23 04:09:46 +00:00
default :
MonkAnim . DoScaledAnimationAsync ( "Stare" , 0.5f ) ;
isStaring = true ;
2023-03-27 02:26:11 +00:00
break ;
}
2023-05-23 04:09:46 +00:00
// it's in zeo's video; no reason not to include it :)
2023-06-10 19:17:06 +00:00
if ( vineBoom ) SoundByte . PlayOneShotGame ( "fanClub/arisa_dab" , forcePlay : true ) ;
2023-03-27 02:26:11 +00:00
}
2023-06-04 04:30:42 +00:00
public void PlayMonkAnimInactive ( bool vineBoom )
{
2023-06-10 19:17:06 +00:00
if ( vineBoom ) SoundByte . PlayOneShotGame ( "fanClub/arisa_dab" , forcePlay : true ) ;
2023-06-04 04:30:42 +00:00
}
2023-06-10 20:55:10 +00:00
public void MonkMove ( double beat , double length , int goToSide , int ease )
2023-03-27 02:26:11 +00:00
{
2023-05-23 04:09:46 +00:00
movingStartBeat = beat ;
movingLength = length ;
moveAnim = ( goToSide = = 0 ? "GoRight" : "GoLeft" ) ;
isMoving = true ;
lastEase = ( EasingFunction . Ease ) ease ;
2023-03-27 02:26:11 +00:00
}
2023-06-10 19:17:06 +00:00
public static void Modifiers ( double beat , int inputsTilGrow , bool resetLevel , int setLevel , bool disableBaby , bool shouldBlush )
2023-03-27 02:26:11 +00:00
{
2023-06-10 19:18:45 +00:00
if ( MunchyMonk . inputsTilGrow ! = inputsTilGrow ) {
// no matter what you set inputsTilGrow to, it will reset howManyGulps to a value inbetween the level-ups relative to the old level and old inputsTilGrow.
MunchyMonk . howManyGulps = ( ( inputsTilGrow * MunchyMonk . growLevel ) + inputsTilGrow * ( MunchyMonk . howManyGulps % MunchyMonk . inputsTilGrow ) / MunchyMonk . inputsTilGrow ) ;
MunchyMonk . inputsTilGrow = inputsTilGrow ;
}
if ( setLevel ! = 0 ) {
MunchyMonk . growLevel = setLevel ;
MunchyMonk . howManyGulps = setLevel * inputsTilGrow ;
if ( GameManager . instance . currentGame = = "munchyMonk" ) {
MunchyMonk . instance . StacheAnim . Play ( $"Idle{setLevel}" , 0 , 0 ) ;
MunchyMonk . instance . StacheHolder . SetActive ( true ) ;
}
}
2023-05-23 04:09:46 +00:00
if ( resetLevel ) {
MunchyMonk . growLevel = 0 ;
MunchyMonk . howManyGulps = 0 ;
2023-06-10 19:18:45 +00:00
if ( GameManager . instance . currentGame = = "munchyMonk" ) MunchyMonk . instance . StacheHolder . SetActive ( false ) ;
2023-05-23 04:09:46 +00:00
}
MunchyMonk . noBlush = ! shouldBlush ;
MunchyMonk . disableBaby = disableBaby ;
2023-03-27 02:26:11 +00:00
2023-05-23 04:09:46 +00:00
if ( GameManager . instance . currentGame = = "munchyMonk" )
MunchyMonk . instance . Baby . SetActive ( ! disableBaby ) ;
2023-03-27 02:26:11 +00:00
}
2023-06-10 20:55:10 +00:00
public void ScrollBG ( double beat , double length , float scrollSpeed , int ease )
2023-03-27 02:26:11 +00:00
{
2023-05-23 04:09:46 +00:00
scrollBeat = beat ;
scrollLength = length ;
scrollMod = scrollSpeed ;
scrollRampUp = true ;
scrollEase = ( EasingFunction . Ease ) ease ;
2023-03-27 02:26:11 +00:00
}
2023-06-10 19:18:45 +00:00
2023-06-10 20:55:10 +00:00
public void MoveCloudMonkey ( double beat , double length , bool go , int direction )
2023-06-10 19:18:45 +00:00
{
bool wasActive = CloudMonkey . activeInHierarchy ;
CloudMonkey . SetActive ( true ) ;
2023-06-10 20:55:10 +00:00
CloudMonkeyScroll . SpeedMod = ( float ) ( ( direction = = 0 ? 34 : - 34 ) / length ) * ( Conductor . instance . songBpm / 100 ) ;
2023-06-10 19:18:45 +00:00
CloudMonkeyScroll . AutoScroll = go ;
if ( ! wasActive ) CloudMonkey . transform . position = new Vector3 ( ( direction = = 0 ? - 5f : 15.5f ) , 0 , 0 ) ;
}
2023-03-27 02:26:11 +00:00
}
}