mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-22 09:35:11 +00:00
fix #631
This commit is contained in:
parent
db6fd6c9fa
commit
478f77132b
4 changed files with 32 additions and 35 deletions
|
@ -316,17 +316,24 @@ namespace HeavenStudio.Games
|
||||||
|
|
||||||
if (PlayerInput.GetIsAction(InputAction_Press) && !IsExpectingInputNow(InputAction_Press))
|
if (PlayerInput.GetIsAction(InputAction_Press) && !IsExpectingInputNow(InputAction_Press))
|
||||||
{
|
{
|
||||||
translator.DoScaledAnimationAsync("translator_eh", 0.5f);
|
|
||||||
if (isSpeaking)
|
if (isSpeaking)
|
||||||
{
|
{
|
||||||
if (callDiagIndex == 0)
|
if (noHitOnce || callDiagIndex == 0)
|
||||||
|
{
|
||||||
FailContact();
|
FailContact();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
SoundByte.PlayOneShotGame("firstContact/ALIEN_PLAYER_A", -1, SoundByte.GetPitchFromSemiTones(UnityEngine.Random.Range(-3, 3), false));
|
||||||
TrailingContact();
|
TrailingContact();
|
||||||
|
ScoreMiss();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (!noHitOnce && !missionControl.activeInHierarchy)
|
else if (!noHitOnce && !missionControl.activeInHierarchy)
|
||||||
{
|
{
|
||||||
|
translator.DoScaledAnimationAsync("translator_eh", 0.5f);
|
||||||
SoundByte.PlayOneShotGame("firstContact/ALIEN_PLAYER_MISS2_A", -1, SoundByte.GetPitchFromSemiTones(UnityEngine.Random.Range(-2, 1), false));
|
SoundByte.PlayOneShotGame("firstContact/ALIEN_PLAYER_MISS2_A", -1, SoundByte.GetPitchFromSemiTones(UnityEngine.Random.Range(-2, 1), false));
|
||||||
|
ScoreMiss();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -414,7 +421,7 @@ namespace HeavenStudio.Games
|
||||||
{
|
{
|
||||||
var input = inputs[i];
|
var input = inputs[i];
|
||||||
double relativeBeat = input.beat - intervalBeat;
|
double relativeBeat = input.beat - intervalBeat;
|
||||||
ScheduleInput(beat, length + relativeBeat, InputAction_Press, AlienTapping, AlienOnMiss, AlienEmpty);
|
ScheduleInput(beat, length + relativeBeat, InputAction_Press, AlienTapping, AlienOnMiss, AlienEmpty, CanAlienTapping);
|
||||||
callDiagList.Add((input["dialogue"], input["newline"]));
|
callDiagList.Add((input["dialogue"], input["newline"]));
|
||||||
}
|
}
|
||||||
BeatAction.New(this, new List<BeatAction.Action>()
|
BeatAction.New(this, new List<BeatAction.Action>()
|
||||||
|
@ -422,6 +429,7 @@ namespace HeavenStudio.Games
|
||||||
new BeatAction.Action(beat, delegate
|
new BeatAction.Action(beat, delegate
|
||||||
{
|
{
|
||||||
isSpeaking = true;
|
isSpeaking = true;
|
||||||
|
hasMissed = false;
|
||||||
SoundByte.PlayOneShotGame("firstContact/turnover");
|
SoundByte.PlayOneShotGame("firstContact/turnover");
|
||||||
alienTextbox.SetActive(false);
|
alienTextbox.SetActive(false);
|
||||||
alien.Play("alien_point", 0, 0);
|
alien.Play("alien_point", 0, 0);
|
||||||
|
@ -582,56 +590,38 @@ namespace HeavenStudio.Games
|
||||||
hasMissed = true;
|
hasMissed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanAlienTapping()
|
||||||
|
{
|
||||||
|
return !(hasMissed || noHitOnce);
|
||||||
|
}
|
||||||
|
|
||||||
public void AlienTapping(PlayerActionEvent caller, float state) //OnHit
|
public void AlienTapping(PlayerActionEvent caller, float state) //OnHit
|
||||||
{
|
{
|
||||||
if (hasMissed && callDiagIndex == 0)
|
(string dialogue, bool showNewline) = callDiagList[callDiagIndex];
|
||||||
|
translateTextbox.SetActive(true);
|
||||||
|
if (showNewline)
|
||||||
{
|
{
|
||||||
caller.isEligible = false;
|
ResetTranslateTextbox(true);
|
||||||
ScoreMiss();
|
|
||||||
return;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (noHitOnce)
|
|
||||||
{
|
|
||||||
caller.isEligible = false;
|
|
||||||
FailContact();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state >= 1f || state <= -1f)
|
if (state >= 1f || state <= -1f)
|
||||||
{
|
{
|
||||||
SoundByte.PlayOneShotGame("firstContact/ALIEN_PLAYER_A", -1, SoundByte.GetPitchFromSemiTones(UnityEngine.Random.Range(-3, 3), false));
|
SoundByte.PlayOneShotGame("firstContact/ALIEN_PLAYER_A", -1, SoundByte.GetPitchFromSemiTones(UnityEngine.Random.Range(-3, 3), false));
|
||||||
translator.DoScaledAnimationAsync("translator_speak", 0.5f);
|
|
||||||
if (callDiagIndex == 0) return;
|
|
||||||
TrailingContact();
|
TrailingContact();
|
||||||
|
callDiagIndex++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
translator.DoScaledAnimationAsync("translator_speak", 0.5f);
|
translator.DoScaledAnimationAsync("translator_speak", 0.5f);
|
||||||
SoundByte.PlayOneShotGame("firstContact/ALIEN_PLAYER_A", -1, SoundByte.GetPitchFromSemiTones(UnityEngine.Random.Range(-3, 3), false));
|
SoundByte.PlayOneShotGame("firstContact/ALIEN_PLAYER_A", -1, SoundByte.GetPitchFromSemiTones(UnityEngine.Random.Range(-3, 3), false));
|
||||||
SoundByte.PlayOneShotGame("firstContact/ALIEN_PLAYER_B");
|
SoundByte.PlayOneShotGame("firstContact/ALIEN_PLAYER_B");
|
||||||
if (hasMissed)
|
respDiagBuffer += dialogue;
|
||||||
{
|
UpdateTranslateTextbox();
|
||||||
caller.isEligible = false;
|
callDiagIndex++;
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
(string dialogue, bool showNewline) = callDiagList[callDiagIndex];
|
|
||||||
if (showNewline)
|
|
||||||
{
|
|
||||||
ResetTranslateTextbox(true);
|
|
||||||
}
|
|
||||||
respDiagBuffer += dialogue;
|
|
||||||
translateTextbox.SetActive(true);
|
|
||||||
UpdateTranslateTextbox();
|
|
||||||
callDiagIndex++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AlienOnMiss(PlayerActionEvent caller) //OnMiss
|
public void AlienOnMiss(PlayerActionEvent caller) //OnMiss
|
||||||
{
|
{
|
||||||
if (!noHitOnce)
|
if (!noHitOnce && !hasMissed)
|
||||||
{
|
{
|
||||||
SoundByte.PlayOneShotGame("firstContact/alienNoHit");
|
SoundByte.PlayOneShotGame("firstContact/alienNoHit");
|
||||||
noHitOnce = true;
|
noHitOnce = true;
|
||||||
|
|
|
@ -18,8 +18,10 @@ namespace HeavenStudio
|
||||||
public static int InitInputControllers()
|
public static int InitInputControllers()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
inputDevices = new List<InputController>();
|
||||||
InputController[] controllers;
|
InputController[] controllers;
|
||||||
PlayerInputRefresh = new();
|
PlayerInputRefresh = new();
|
||||||
|
PlayerInputCleanUp = null;
|
||||||
|
|
||||||
controllers = InputJoyshockInitializer.Initialize();
|
controllers = InputJoyshockInitializer.Initialize();
|
||||||
if (controllers != null)
|
if (controllers != null)
|
||||||
|
|
|
@ -80,8 +80,10 @@ namespace {context.TargetClass.Namespace}
|
||||||
sb.IndentLevel(3);
|
sb.IndentLevel(3);
|
||||||
|
|
||||||
sb.Append($@"
|
sb.Append($@"
|
||||||
|
inputDevices = new List<InputController>();
|
||||||
InputController[] controllers;
|
InputController[] controllers;
|
||||||
PlayerInputRefresh = new();
|
PlayerInputRefresh = new();
|
||||||
|
PlayerInputCleanUp = null;
|
||||||
");
|
");
|
||||||
|
|
||||||
foreach (var loadRunner in loadRunners)
|
foreach (var loadRunner in loadRunners)
|
||||||
|
|
|
@ -26,5 +26,8 @@ MonoBehaviour:
|
||||||
- Assets/Editor/SpritesheetScaler.cs
|
- Assets/Editor/SpritesheetScaler.cs
|
||||||
- Assets/Scripts/USG.g/LoadMinigames.Minigames.MinigameLoaderGenerator.g.cs
|
- Assets/Scripts/USG.g/LoadMinigames.Minigames.MinigameLoaderGenerator.g.cs
|
||||||
- Assets/Scripts/Games/TheDazzles/TheDazzles.cs
|
- Assets/Scripts/Games/TheDazzles/TheDazzles.cs
|
||||||
|
- Assets/Scripts/Games/FirstContact/FirstContact.cs
|
||||||
|
- Assets/Scripts/SourceGenerators/ControllerLoaderGenerator.cs
|
||||||
|
- Assets/Scripts/InputSystem/PlayerInput.cs
|
||||||
PathsToSkipImportEvent: []
|
PathsToSkipImportEvent: []
|
||||||
PathsToIgnoreOverwriteSettingOnAttribute: []
|
PathsToIgnoreOverwriteSettingOnAttribute: []
|
||||||
|
|
Loading…
Reference in a new issue