2022-07-25 02:04:55 +00:00
< < < < < < < HEAD
2022-06-29 05:37:14 +00:00
using System.Collections.Generic ;
using UnityEngine ;
using HeavenStudio.Util ;
namespace HeavenStudio.Games.Loaders
{
using static Minigames ;
public static class CtrFirstContact
{
public static Minigame AddGame ( EventCaller eventCaller )
{
return new Minigame ( "firstContact" , "First Contact" , "008c97" , false , false , new List < GameAction > ( )
{
new GameAction ( "beat intervals" , delegate { FirstContact . instance . SetIntervalStart ( eventCaller . currentEntity . beat , eventCaller . currentEntity . length ) ; } , 4f , true ) ,
2022-07-08 05:27:10 +00:00
new GameAction ( "alien speak" , delegate { FirstContact . instance . alienSpeak ( eventCaller . currentEntity . beat , eventCaller . currentEntity . valA ) ; } , 0.5f , false , new List < Param > ( )
{
new Param ( "valA" , new EntityTypes . Float ( . 8f , 1.5f , 1f ) , "Pitch" )
} ) ,
2022-06-29 05:37:14 +00:00
new GameAction ( "alien turnover" , delegate { FirstContact . instance . alienTurnOver ( eventCaller . currentEntity . beat ) ; } , 0.5f , false ) ,
new GameAction ( "alien success" , delegate { FirstContact . instance . alienSuccess ( eventCaller . currentEntity . beat ) ; } , 1f , false ) ,
2022-07-11 05:53:25 +00:00
new GameAction ( "mission control" , delegate { FirstContact . instance . missionControlDisplay ( eventCaller . currentEntity . beat , eventCaller . currentEntity . toggle , eventCaller . currentEntity . length ) ; } , 1f , true , new List < Param >
2022-06-29 05:37:14 +00:00
{
new Param ( "toggle" , false , "Stay" , "If it's the end of the remix/song" )
} ) ,
2022-07-25 02:04:55 +00:00
new GameAction ( "look at" , delegate { FirstContact . instance . lookAtDirection ( eventCaller . currentEntity . type , eventCaller . currentEntity . type ) ; } , . 5f , false , new List < Param > ( )
2022-06-29 05:37:14 +00:00
{
new Param ( "type" , FirstContact . alienLookAt . lookAtTranslator , "alien look at what" , "[Alien] will look at what" ) ,
new Param ( "type" , FirstContact . translatorLookAt . lookAtAlien , "translator look at what" , "[Translator] will look at what" ) ,
} ) ,
2022-07-25 02:04:55 +00:00
new GameAction ( "live bar beat" , delegate { FirstContact . instance . liveBarBeat ( eventCaller . currentEntity . toggle ) ; } , . 5f , false , new List < Param > ( )
{
new Param ( "toggle" , true , "On Beat" , "If the live bar animation will be on beat or not" )
} ) ,
//new GameAction("Version of First Contact", delegate { FirstContact.instance.versionOfFirstContact(eventCaller.currentEntity.type); }, .5f, false, new List<Param>
//{
// new Param("type", FirstContact.VersionOfContact.FirstContact, "Version", "Version of First Contact to play"),
//}),
} ) ;
}
}
}
namespace HeavenStudio.Games
{
//using Scripts_FirstContact;
public class FirstContact : Minigame
{
public static FirstContact instance { get ; private set ; }
[Header("Properties")]
public int alienSpeakCount ;
public int translatorSpeakCount ;
public bool hasMissed ;
private float lastReportedBeat = 0 ;
[Header("Components")]
[SerializeField] GameObject alien ;
[SerializeField] GameObject translator ;
//[SerializeField] GameObject alienSpeech;
[SerializeField] GameObject dummyHolder ;
[SerializeField] GameObject missionControl ;
[SerializeField] GameObject liveBar ;
[Header("Variables")]
public bool intervalStarted ;
//float intervalStartBeat;
public float beatInterval = 4f ;
public bool isCorrect , noHitOnce , isSpeaking ;
//public int version;
public float lookAtLength = 1f ;
bool onBeat ;
float liveBarBeatOffset ;
//public enum VersionOfContact
//{
// FirstContact,
// CitrusRemix,
// SecondContact
//}
public enum alienLookAt
{
lookAtTranslator ,
idle
}
public enum translatorLookAt
{
lookAtAlien ,
idle
}
private void Awake ( )
{
instance = this ;
}
public void SetIntervalStart ( float beat , float interval )
{
if ( ! intervalStarted )
{
//alienSpeakCount = 0;
//translatorSpeakCount = 0;
intervalStarted = true ;
}
//intervalStartBeat = beat;
beatInterval = interval ;
}
private void Update ( )
{
//This is taken from the conductor script
if ( Conductor . instance . ReportBeat ( ref lastReportedBeat , offset : liveBarBeatOffset ) )
{
liveBar . GetComponent < Animator > ( ) . Play ( "liveBar" , 0 , 0 ) ;
}
else if ( Conductor . instance . songPositionInBeats < lastReportedBeat )
{
lastReportedBeat = Mathf . Round ( Conductor . instance . songPositionInBeats ) ;
}
if ( PlayerInput . Pressed ( ) & & ! IsExpectingInputNow ( ) & & ! noHitOnce & & ! isSpeaking & & ! missionControl . activeInHierarchy )
{
Jukebox . PlayOneShotGame ( "firstContact/" + randomizerLines ( ) ) ;
BeatAction . New ( this . gameObject , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( . 5f , delegate { translator . GetComponent < Animator > ( ) . Play ( "translator_speak" , 0 , 0 ) ; } ) ,
} ) ;
}
if ( ( PlayerInput . Pressed ( ) & & ! IsExpectingInputNow ( ) & & isSpeaking ) )
{
hasMissed = true ;
}
}
//public void versionOfFirstContact(int type)
//{
// version = type;
//}
public void liveBarBeat ( bool onBeat )
{
if ( onBeat )
{
liveBarBeatOffset = 0 ;
}
else
{
liveBarBeatOffset = . 5f ;
}
}
public void lookAtDirection ( int alienLookAt , int translatorLookAt )
{
Debug . Log ( alienLookAt ) ;
Debug . Log ( translatorLookAt ) ;
switch ( alienLookAt )
{
case 0 :
alien . GetComponent < Animator > ( ) . Play ( "alien_lookAt" , 0 , 0 ) ;
break ;
case 1 :
alien . GetComponent < Animator > ( ) . Play ( "alien_idle" , 0 , 0 ) ;
break ;
}
switch ( translatorLookAt )
{
case 0 :
translator . GetComponent < Animator > ( ) . Play ( "translator_lookAtAlien" , 0 , 0 ) ;
break ;
case 1 :
translator . GetComponent < Animator > ( ) . Play ( "translator_idle" , 0 , 0 ) ;
break ;
}
}
public void alienSpeak ( float beat , float pitch )
{
Jukebox . PlayOneShotGame ( "firstContact/alien" , beat , pitch ) ;
+ + alienSpeakCount ;
var random = Random . Range ( 0 , 2 ) ;
string textToPut = "" ;
if ( random = = 0 )
{
textToPut = "translator_lookAtAlien" ;
}
else
{
textToPut = "translator_lookAtAlien_nod" ;
}
ScheduleInput ( beat , beatInterval , InputType . STANDARD_DOWN , alienTapping , alienOnMiss , AlienEmpty ) ;
BeatAction . New ( alien , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( beat , delegate { alien . GetComponent < Animator > ( ) . Play ( "alien_talk" , 0 , 0 ) ; } ) ,
new BeatAction . Action ( beat , delegate
{
if ( ! isSpeaking )
{
translator . GetComponent < Animator > ( ) . Play ( textToPut , 0 , 0 ) ;
}
} ) ,
} ) ;
}
public void alienTurnOver ( float beat )
{
SetIntervalStart ( beat , beatInterval ) ;
Jukebox . PlayOneShotGame ( "firstContact/turnover" ) ;
BeatAction . New ( alien , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( beat , delegate { alien . GetComponent < Animator > ( ) . Play ( "alien_point" , 0 , 0 ) ; } ) ,
new BeatAction . Action ( beat + . 5f , delegate { alien . GetComponent < Animator > ( ) . Play ( "alien_idle" , 0 , 0 ) ; } ) ,
new BeatAction . Action ( beat + . 5f ,
delegate
{
if ( ! isSpeaking )
{
translator . GetComponent < Animator > ( ) . Play ( "translator_idle" , 0 , 0 ) ;
}
} )
} ) ;
isSpeaking = true ;
}
public void alienSuccess ( float beat )
{
string [ ] sfxStrings = { "" , "" } ;
string animString = "" ;
if ( alienSpeakCount = = translatorSpeakCount )
{
sfxStrings [ 0 ] = "firstContact/success_1" ;
sfxStrings [ 1 ] = "firstContact/success_2" ;
animString = "alien_success" ;
}
else if ( alienSpeakCount ! = translatorSpeakCount )
{
sfxStrings [ 0 ] = "firstContact/failAlien_1" ;
sfxStrings [ 1 ] = "firstContact/failAlien_2" ;
animString = "alien_fail" ;
}
string [ ] sounds = new string [ ] { sfxStrings [ 0 ] , sfxStrings [ 0 ] } ;
var sound = new MultiSound . Sound [ ]
{
new MultiSound . Sound ( sounds [ 0 ] , beat ) ,
new MultiSound . Sound ( sounds [ 1 ] , beat + . 5f )
} ;
MultiSound . Play ( sound ) ;
BeatAction . New ( alien , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( beat , delegate { alien . GetComponent < Animator > ( ) . Play ( animString , 0 , 0 ) ; } ) ,
new BeatAction . Action ( beat + . 5f , delegate { alien . GetComponent < Animator > ( ) . Play ( animString , 0 , 0 ) ; } )
} ) ;
BeatAction . New ( translator . gameObject , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( beat , delegate { translator . GetComponent < Animator > ( ) . Play ( "translator_idle" , 0 , 0 ) ; } ) ,
} ) ;
alienSpeakCount = 0 ;
translatorSpeakCount = 0 ;
intervalStarted = false ;
isSpeaking = false ;
hasMissed = false ;
noHitOnce = false ;
}
public void missionControlDisplay ( float beat , bool stay , float length )
{
missionControl . SetActive ( true ) ;
string textToPut = "" ;
if ( alienSpeakCount = = translatorSpeakCount )
{
textToPut = "missionControl_success" ;
}
else
{
textToPut = "missionControl_fail" ;
}
BeatAction . New ( missionControl , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( length , delegate { missionControl . GetComponentInParent < Animator > ( ) . Play ( textToPut , 0 , 0 ) ; } ) ,
new BeatAction . Action ( length , delegate { alien . GetComponentInParent < Animator > ( ) . Play ( "alien_idle" , 0 , 0 ) ; } ) ,
new BeatAction . Action ( length , delegate { translator . GetComponent < Animator > ( ) . Play ( "translator_idle" , 0 , 0 ) ; } ) ,
} ) ;
if ( ! stay )
{
BeatAction . New ( missionControl , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( beat + length , delegate { missionControl . SetActive ( false ) ; } ) ,
} ) ;
}
else
{
missionControl . SetActive ( true ) ;
}
alienSpeakCount = 0 ;
translatorSpeakCount = 0 ;
isSpeaking = false ;
}
public void alienTapping ( PlayerActionEvent caller , float beat ) //OnHit
{
if ( ! noHitOnce )
{
+ + translatorSpeakCount ;
Jukebox . PlayOneShotGame ( "firstContact/" + randomizerLines ( ) ) ;
isCorrect = true ;
BeatAction . New ( this . gameObject , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( . 5f , delegate { translator . GetComponent < Animator > ( ) . Play ( "translator_speak" , 0 , 0 ) ; } ) ,
} ) ;
}
else if ( noHitOnce )
{
Jukebox . PlayOneShotGame ( "firstContact/slightlyFail" ) ;
BeatAction . New ( this . gameObject , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( . 5f , delegate { translator . GetComponent < Animator > ( ) . Play ( "translator_eh" , 0 , 0 ) ; } ) ,
} ) ;
}
}
public void alienOnMiss ( PlayerActionEvent caller ) //OnMiss
{
if ( ! noHitOnce )
{
Jukebox . PlayOneShotGame ( "firstContact/alienNoHit" ) ;
noHitOnce = true ;
}
BeatAction . New ( alien , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( . 5f , delegate { alien . GetComponent < Animator > ( ) . Play ( "alien_noHit" , 0 , 0 ) ; } ) ,
} ) ;
}
public void AlienEmpty ( PlayerActionEvent caller ) //OnEmpty
{
//empty
}
public int randomizerLines ( )
{
return Random . Range ( 1 , 11 ) ;
}
}
}
= = = = = = =
using System.Collections.Generic ;
using UnityEngine ;
using HeavenStudio.Util ;
namespace HeavenStudio.Games.Loaders
{
using static Minigames ;
public static class CtrFirstContact
{
public static Minigame AddGame ( EventCaller eventCaller )
{
return new Minigame ( "firstContact" , "First Contact" , "008c97" , false , false , new List < GameAction > ( )
{
new GameAction ( "beat intervals" , delegate { FirstContact . instance . SetIntervalStart ( eventCaller . currentEntity . beat , eventCaller . currentEntity . length ) ; } , 4f , true ) ,
new GameAction ( "alien speak" , delegate { FirstContact . instance . alienSpeak ( eventCaller . currentEntity . beat , eventCaller . currentEntity . valA ) ; } , 0.5f , false , new List < Param > ( )
{
new Param ( "valA" , new EntityTypes . Float ( . 8f , 1.5f , 1f ) , "Pitch" )
} ) ,
new GameAction ( "alien turnover" , delegate { FirstContact . instance . alienTurnOver ( eventCaller . currentEntity . beat ) ; } , 0.5f , false ) ,
new GameAction ( "alien success" , delegate { FirstContact . instance . alienSuccess ( eventCaller . currentEntity . beat ) ; } , 1f , false ) ,
new GameAction ( "mission control" , delegate { FirstContact . instance . missionControlDisplay ( eventCaller . currentEntity . beat , eventCaller . currentEntity . toggle , eventCaller . currentEntity . length ) ; } , 1f , true , new List < Param >
{
new Param ( "toggle" , false , "Stay" , "If it's the end of the remix/song" )
} ) ,
new GameAction ( "look at" , delegate { FirstContact . instance . lookAtDirection ( eventCaller . currentEntity . type , eventCaller . currentEntity . type ) ; } , . 5f , false , new List < Param > ( )
{
new Param ( "type" , FirstContact . alienLookAt . lookAtTranslator , "alien look at what" , "[Alien] will look at what" ) ,
new Param ( "type" , FirstContact . translatorLookAt . lookAtAlien , "translator look at what" , "[Translator] will look at what" ) ,
} ) ,
new GameAction ( "live bar beat" , delegate { FirstContact . instance . liveBarBeat ( eventCaller . currentEntity . toggle ) ; } , . 5f , false , new List < Param > ( )
{
new Param ( "toggle" , true , "On Beat" , "If the live bar animation will be on beat or not" )
} ) ,
2022-06-29 05:37:14 +00:00
//new GameAction("Version of First Contact", delegate { FirstContact.instance.versionOfFirstContact(eventCaller.currentEntity.type); }, .5f, false, new List<Param>
//{
// new Param("type", FirstContact.VersionOfContact.FirstContact, "Version", "Version of First Contact to play"),
//}),
2022-07-11 05:53:25 +00:00
} ) ;
2022-06-29 05:37:14 +00:00
}
}
}
namespace HeavenStudio.Games
{
2022-07-03 08:42:18 +00:00
//using Scripts_FirstContact;
2022-06-29 05:37:14 +00:00
public class FirstContact : Minigame
{
public static FirstContact instance { get ; private set ; }
[Header("Properties")]
public int alienSpeakCount ;
public int translatorSpeakCount ;
public bool hasMissed ;
2022-07-11 05:53:25 +00:00
private float lastReportedBeat = 0 ;
2022-06-29 05:37:14 +00:00
[Header("Components")]
[SerializeField] GameObject alien ;
2022-07-03 08:42:18 +00:00
[SerializeField] GameObject translator ;
//[SerializeField] GameObject alienSpeech;
2022-06-29 05:37:14 +00:00
[SerializeField] GameObject dummyHolder ;
[SerializeField] GameObject missionControl ;
[SerializeField] GameObject liveBar ;
[Header("Variables")]
public bool intervalStarted ;
//float intervalStartBeat;
public float beatInterval = 4f ;
public bool isCorrect , noHitOnce , isSpeaking ;
//public int version;
public float lookAtLength = 1f ;
2022-07-25 02:04:55 +00:00
bool onBeat ;
float liveBarBeatOffset ;
2022-06-29 05:37:14 +00:00
2022-07-03 08:42:18 +00:00
2022-06-29 05:37:14 +00:00
//public enum VersionOfContact
//{
// FirstContact,
// CitrusRemix,
// SecondContact
//}
public enum alienLookAt
{
lookAtTranslator ,
idle
}
public enum translatorLookAt
{
lookAtAlien ,
idle
}
private void Awake ( )
{
instance = this ;
2022-07-03 08:42:18 +00:00
}
public void SetIntervalStart ( float beat , float interval = 4f )
{
if ( ! intervalStarted )
{
//alienSpeakCount = 0;
//translatorSpeakCount = 0;
intervalStarted = true ;
}
//intervalStartBeat = beat;
beatInterval = interval ;
2022-06-29 05:37:14 +00:00
}
private void Update ( )
{
//This is taken from the conductor script
2022-07-25 02:04:55 +00:00
if ( Conductor . instance . ReportBeat ( ref lastReportedBeat , offset : liveBarBeatOffset ) )
2022-06-29 05:37:14 +00:00
{
liveBar . GetComponent < Animator > ( ) . Play ( "liveBar" , 0 , 0 ) ;
}
else if ( Conductor . instance . songPositionInBeats < lastReportedBeat )
{
lastReportedBeat = Mathf . Round ( Conductor . instance . songPositionInBeats ) ;
}
2022-07-03 08:42:18 +00:00
2022-07-08 05:27:10 +00:00
if ( PlayerInput . Pressed ( ) & & ! IsExpectingInputNow ( ) & & ! noHitOnce & & ! isSpeaking )
2022-07-03 08:42:18 +00:00
{
Jukebox . PlayOneShotGame ( "firstContact/" + randomizerLines ( ) ) ;
BeatAction . New ( this . gameObject , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( . 5f , delegate { translator . GetComponent < Animator > ( ) . Play ( "translator_speak" , 0 , 0 ) ; } ) ,
} ) ;
}
2022-07-08 05:27:10 +00:00
if ( ( PlayerInput . Pressed ( ) & & ! IsExpectingInputNow ( ) & & isSpeaking ) )
2022-07-03 08:42:18 +00:00
{
hasMissed = true ;
}
2022-06-29 05:37:14 +00:00
}
//public void versionOfFirstContact(int type)
//{
// version = type;
//}
2022-07-25 02:04:55 +00:00
public void liveBarBeat ( bool onBeat )
{
if ( onBeat )
{
liveBarBeatOffset = 0 ;
}
else
{
liveBarBeatOffset = . 5f ;
}
}
2022-06-29 05:37:14 +00:00
public void lookAtDirection ( int alienLookAt , int translatorLookAt )
{
2022-07-25 02:04:55 +00:00
Debug . Log ( alienLookAt ) ;
Debug . Log ( translatorLookAt ) ;
2022-06-29 05:37:14 +00:00
switch ( alienLookAt )
{
case 0 :
alien . GetComponent < Animator > ( ) . Play ( "alien_lookAt" , 0 , 0 ) ;
break ;
case 1 :
alien . GetComponent < Animator > ( ) . Play ( "alien_idle" , 0 , 0 ) ;
break ;
}
switch ( translatorLookAt )
{
case 0 :
translator . GetComponent < Animator > ( ) . Play ( "translator_lookAtAlien" , 0 , 0 ) ;
break ;
case 1 :
translator . GetComponent < Animator > ( ) . Play ( "translator_idle" , 0 , 0 ) ;
break ;
}
}
2022-07-08 05:27:10 +00:00
public void alienSpeak ( float beat , float pitch )
2022-06-29 05:37:14 +00:00
{
2022-07-08 05:27:10 +00:00
Jukebox . PlayOneShotGame ( "firstContact/alien" , beat , pitch ) ;
2022-07-03 08:42:18 +00:00
+ + alienSpeakCount ;
2022-06-29 05:37:14 +00:00
var random = Random . Range ( 0 , 2 ) ;
string textToPut = "" ;
if ( random = = 0 )
{
textToPut = "translator_lookAtAlien" ;
}
else
{
textToPut = "translator_lookAtAlien_nod" ;
}
2022-07-03 08:42:18 +00:00
ScheduleInput ( beat , beatInterval , InputType . STANDARD_DOWN , alienTapping , alienOnMiss , AlienEmpty ) ;
2022-06-29 05:37:14 +00:00
BeatAction . New ( alien , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( beat , delegate { alien . GetComponent < Animator > ( ) . Play ( "alien_talk" , 0 , 0 ) ; } ) ,
2022-07-08 05:27:10 +00:00
new BeatAction . Action ( beat , delegate
{
if ( ! isSpeaking )
{
translator . GetComponent < Animator > ( ) . Play ( textToPut , 0 , 0 ) ;
}
} ) ,
2022-06-29 05:37:14 +00:00
} ) ;
}
public void alienTurnOver ( float beat )
{
2022-07-03 08:42:18 +00:00
if ( ! intervalStarted )
{
SetIntervalStart ( beat , beatInterval ) ;
}
if ( intervalStarted )
{
SetIntervalStart ( beat , beatInterval ) ;
}
2022-06-29 05:37:14 +00:00
Jukebox . PlayOneShotGame ( "firstContact/turnover" ) ;
BeatAction . New ( alien , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( beat , delegate { alien . GetComponent < Animator > ( ) . Play ( "alien_point" , 0 , 0 ) ; } ) ,
new BeatAction . Action ( beat + . 5f , delegate { alien . GetComponent < Animator > ( ) . Play ( "alien_idle" , 0 , 0 ) ; } ) ,
2022-07-08 05:27:10 +00:00
new BeatAction . Action ( beat + . 5f ,
delegate
{
if ( ! isSpeaking )
{
translator . GetComponent < Animator > ( ) . Play ( "translator_idle" , 0 , 0 ) ;
}
} )
2022-06-29 05:37:14 +00:00
} ) ;
isSpeaking = true ;
}
public void alienSuccess ( float beat )
{
2022-07-11 05:53:25 +00:00
string [ ] sfxStrings = { "" , "" } ;
string animString = "" ;
2022-06-29 05:37:14 +00:00
if ( alienSpeakCount = = translatorSpeakCount )
{
2022-07-11 05:53:25 +00:00
sfxStrings [ 0 ] = "firstContact/success_1" ;
sfxStrings [ 1 ] = "firstContact/success_2" ;
animString = "alien_success" ;
2022-06-29 05:37:14 +00:00
}
else if ( alienSpeakCount ! = translatorSpeakCount )
{
2022-07-11 05:53:25 +00:00
sfxStrings [ 0 ] = "firstContact/failAlien_1" ;
sfxStrings [ 1 ] = "firstContact/failAlien_2" ;
animString = "alien_fail" ;
}
2022-06-29 05:37:14 +00:00
2022-07-11 05:53:25 +00:00
string [ ] sounds = new string [ ] { sfxStrings [ 0 ] , sfxStrings [ 0 ] } ;
var sound = new MultiSound . Sound [ ]
{
new MultiSound . Sound ( sounds [ 0 ] , beat ) ,
new MultiSound . Sound ( sounds [ 1 ] , beat + . 5f )
} ;
2022-06-29 05:37:14 +00:00
2022-07-11 05:53:25 +00:00
MultiSound . Play ( sound ) ;
BeatAction . New ( alien , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( beat , delegate { alien . GetComponent < Animator > ( ) . Play ( animString , 0 , 0 ) ; } ) ,
new BeatAction . Action ( beat + . 5f , delegate { alien . GetComponent < Animator > ( ) . Play ( animString , 0 , 0 ) ; } )
} ) ;
BeatAction . New ( translator . gameObject , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( beat , delegate { translator . GetComponent < Animator > ( ) . Play ( "translator_idle" , 0 , 0 ) ; } ) ,
} ) ;
2022-06-29 05:37:14 +00:00
alienSpeakCount = 0 ;
translatorSpeakCount = 0 ;
isSpeaking = false ;
hasMissed = false ;
noHitOnce = false ;
}
2022-07-11 05:53:25 +00:00
public void missionControlDisplay ( float beat , bool stay , float length )
2022-06-29 05:37:14 +00:00
{
missionControl . SetActive ( true ) ;
string textToPut = "" ;
if ( alienSpeakCount = = translatorSpeakCount )
{
textToPut = "missionControl_success" ;
}
else
{
textToPut = "missionControl_fail" ;
}
BeatAction . New ( missionControl , new List < BeatAction . Action > ( )
{
2022-07-11 05:53:25 +00:00
new BeatAction . Action ( length , delegate { missionControl . GetComponentInParent < Animator > ( ) . Play ( textToPut , 0 , 0 ) ; } ) ,
new BeatAction . Action ( length , delegate { alien . GetComponentInParent < Animator > ( ) . Play ( "alien_idle" , 0 , 0 ) ; } ) ,
new BeatAction . Action ( length , delegate { translator . GetComponent < Animator > ( ) . Play ( "translator_idle" , 0 , 0 ) ; } ) ,
2022-06-29 05:37:14 +00:00
} ) ;
if ( ! stay )
{
BeatAction . New ( missionControl , new List < BeatAction . Action > ( )
{
2022-07-25 02:04:55 +00:00
new BeatAction . Action ( length , delegate { missionControl . SetActive ( false ) ; } ) ,
2022-06-29 05:37:14 +00:00
} ) ;
}
else
{
missionControl . SetActive ( true ) ;
}
alienSpeakCount = 0 ;
translatorSpeakCount = 0 ;
isSpeaking = false ;
}
2022-07-03 08:42:18 +00:00
public void alienTapping ( PlayerActionEvent caller , float beat ) //OnHit
{
if ( ! noHitOnce )
{
+ + translatorSpeakCount ;
Jukebox . PlayOneShotGame ( "firstContact/" + randomizerLines ( ) ) ;
isCorrect = true ;
BeatAction . New ( this . gameObject , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( . 5f , delegate { translator . GetComponent < Animator > ( ) . Play ( "translator_speak" , 0 , 0 ) ; } ) ,
} ) ;
}
else if ( noHitOnce )
{
Jukebox . PlayOneShotGame ( "firstContact/slightlyFail" ) ;
BeatAction . New ( this . gameObject , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( . 5f , delegate { translator . GetComponent < Animator > ( ) . Play ( "translator_eh" , 0 , 0 ) ; } ) ,
} ) ;
}
}
public void alienOnMiss ( PlayerActionEvent caller ) //OnMiss
{
if ( ! noHitOnce )
{
Jukebox . PlayOneShotGame ( "firstContact/alienNoHit" ) ;
noHitOnce = true ;
}
BeatAction . New ( alien , new List < BeatAction . Action > ( )
{
new BeatAction . Action ( . 5f , delegate { alien . GetComponent < Animator > ( ) . Play ( "alien_noHit" , 0 , 0 ) ; } ) ,
} ) ;
}
public void AlienEmpty ( PlayerActionEvent caller ) //OnEmpty
{
//empty
}
public int randomizerLines ( )
{
return Random . Range ( 1 , 11 ) ;
}
2022-06-29 05:37:14 +00:00
}
}
2022-07-25 02:04:55 +00:00
> > > > > > > 92577 ae3e26692484725c03508d1652d5ddafb25