specialized games 2

This commit is contained in:
minenice55 2023-09-22 23:33:49 -04:00
parent 1acf16a45a
commit f53d68f22e
10 changed files with 1646 additions and 34 deletions

View file

@ -150,6 +150,12 @@ AnimatorStateMachine:
- serializedVersion: 1
m_State: {fileID: -6301654628326570588}
m_Position: {x: 280, y: 340, z: 0}
- serializedVersion: 1
m_State: {fileID: 8252196376475842327}
m_Position: {x: 500, y: 190, z: 0}
- serializedVersion: 1
m_State: {fileID: 6780057120146691061}
m_Position: {x: 500, y: 240, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
@ -160,6 +166,32 @@ AnimatorStateMachine:
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -1826418598434636915}
--- !u!1102 &6780057120146691061
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: UnPrepare
m_Speed: -1
m_CycleOffset: 1
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: d2bedeec3b142194ba6e5208112acce1, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &7485310372438117339
AnimatorState:
serializedVersion: 6
@ -186,3 +218,29 @@ AnimatorState:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &8252196376475842327
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Prepare
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: d2bedeec3b142194ba6e5208112acce1, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d2bedeec3b142194ba6e5208112acce1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -97,7 +97,7 @@ namespace HeavenStudio.Games
}
public static PlayerInput.InputAction InputAction_TouchPress =
new("RvlDateTouchRelease", new int[] { IAEmptyCat, IAPressCat, IAEmptyCat },
new("RvlDateTouchPress", new int[] { IAEmptyCat, IAPressCat, IAEmptyCat },
IA_Empty, IA_TouchBasicPress, IA_Empty);
public static PlayerInput.InputAction InputAction_TouchRelease =
new("RvlDateTouchRelease", new int[] { IAEmptyCat, IAReleaseCat, IAEmptyCat },

View file

@ -1,4 +1,5 @@
using HeavenStudio.Util;
using HeavenStudio.InputSystem;
using System;
using System.Collections.Generic;
using UnityEngine;
@ -29,25 +30,35 @@ namespace HeavenStudio.Games.Scripts_OctopusMachine
void Update()
{
if (queuePrepare && Conductor.instance.NotStopped()) {
if (!(isPreparing || isSqueezed || anim.IsPlayingAnimationName("Release") || anim.IsPlayingAnimationName("Pop")))
if (queuePrepare && Conductor.instance.NotStopped())
{
if (!(isPreparing || isSqueezed || anim.IsPlayingAnimationName("Release") || anim.IsPlayingAnimationName("Pop")))
{
anim.DoScaledAnimationAsync("Prepare", 0.5f);
isPreparing = true;
queuePrepare = false;
}
}
if (isActive && player)
{
if (PlayerInput.Pressed() && !game.IsExpectingInputNow(InputType.STANDARD_DOWN)) {
if (PlayerInput.GetIsAction(OctopusMachine.InputAction_BasicPress) && !game.IsExpectingInputNow(OctopusMachine.InputAction_BasicPress))
{
OctoAction("Squeeze");
SoundByte.PlayOneShotGame("nearMiss");
game.hasMissed = true;
}
if (PlayerInput.PressedUp() && !game.IsExpectingInputNow(InputType.STANDARD_UP)) {
OctoAction(PlayerInput.Pressing() ? "Pop" : "Release");
if (PlayerInput.GetIsAction(OctopusMachine.InputAction_BasicRelease) && !game.IsExpectingInputNow(OctopusMachine.InputAction_BasicRelease))
{
OctoAction("Release");
SoundByte.PlayOneShotGame("nearMiss");
game.hasMissed = true;
}
else if (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch
&& PlayerInput.GetIsAction(OctopusMachine.InputAction_FlickRelease) && !game.IsExpectingInputNow(OctopusMachine.InputAction_FlickRelease))
{
OctoAction("Pop");
SoundByte.PlayOneShotGame("nearMiss");
game.hasMissed = true;
}
@ -65,7 +76,7 @@ namespace HeavenStudio.Games.Scripts_OctopusMachine
&& !anim.IsPlayingAnimationName("Pop")
&& !isPreparing
&& !isSqueezed
&& !cantBop )
&& !cantBop)
{
PlayAnimation(game.bopStatus);
}
@ -74,7 +85,8 @@ namespace HeavenStudio.Games.Scripts_OctopusMachine
public void PlayAnimation(int whichBop)
{
if (whichBop == 2 && player) whichBop = 3;
anim.DoScaledAnimationAsync(whichBop switch {
anim.DoScaledAnimationAsync(whichBop switch
{
0 => "Bop",
1 => "Happy",
2 => "Angry",
@ -98,7 +110,7 @@ namespace HeavenStudio.Games.Scripts_OctopusMachine
isActive = enable;
}
public void OctoAction(string action)
public void OctoAction(string action)
{
if (action != "Release" || (Conductor.instance.songPositionInBeatsAsDouble - lastSqueezeBeat) > 0.15f) SoundByte.PlayOneShotGame($"octopusMachine/{action.ToLower()}");
if (action == "Squeeze") lastSqueezeBeat = Conductor.instance.songPositionInBeatsAsDouble;
@ -109,7 +121,7 @@ namespace HeavenStudio.Games.Scripts_OctopusMachine
queuePrepare = false;
}
public void AnimationColor(int poppingColor)
public void AnimationColor(int poppingColor)
{
foreach (var sprite in sr) sprite.material.SetColor("_ColorAlpha", (poppingColor == 0 ? OctopusMachine.octopodesColor : OctopusMachine.octopodesSqueezedColor));
if (poppingColor == 1) isSqueezed = true;

View file

@ -428,15 +428,15 @@ namespace HeavenStudio.Games
var queuedInputs = new List<BeatAction.Action>();
foreach (var squeeze in queuedSqueezes) {
queuedInputs.Add(new BeatAction.Action(beat + squeeze, delegate { octopodes[1].OctoAction("Squeeze"); }));
ScheduleInput(beat, beatInterval + squeeze, InputType.STANDARD_DOWN, SqueezeHit, Miss, Miss);
ScheduleInput(beat, beatInterval + squeeze, InputAction_BasicPress, SqueezeHit, Miss, Miss);
}
foreach (var release in queuedReleases) {
queuedInputs.Add(new BeatAction.Action(beat + release, delegate { octopodes[1].OctoAction("Release"); }));
ScheduleInput(beat, beatInterval + release, InputType.STANDARD_UP, ReleaseHit, Miss, Miss);
ScheduleInput(beat, beatInterval + release, InputAction_BasicRelease, ReleaseHit, Miss, Miss);
}
foreach (var pop in queuedPops) {
queuedInputs.Add(new BeatAction.Action(beat + pop, delegate { octopodes[1].OctoAction("Pop"); }));
ScheduleInput(beat, beatInterval + pop, InputType.STANDARD_UP, PopHit, Miss, Miss);
ScheduleInput(beat, beatInterval + pop, InputAction_FlickRelease, PopHit, Miss, Miss);
}
queuedSqueezes.Clear();
queuedReleases.Clear();

View file

@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Util;
using HeavenStudio.InputSystem;
using System.Diagnostics.CodeAnalysis;
namespace HeavenStudio.Games.Loaders
@ -198,6 +199,39 @@ namespace HeavenStudio.Games
private List<RandomPress> randomPresses = new();
const int IALeft = 0;
const int IARight = 1;
protected static bool IA_PadLeft(out double dt)
{
return PlayerInput.GetPadDown(InputController.ActionsPad.Up, out dt)
|| PlayerInput.GetPadDown(InputController.ActionsPad.Down, out dt)
|| PlayerInput.GetPadDown(InputController.ActionsPad.Left, out dt)
|| PlayerInput.GetPadDown(InputController.ActionsPad.Right, out dt);
}
protected static bool IA_TouchLeft(out double dt)
{
return PlayerInput.GetTouchDown(InputController.ActionsTouch.Left, out dt);
}
protected static bool IA_PadRight(out double dt)
{
return PlayerInput.GetPadDown(InputController.ActionsPad.East, out dt);
}
protected static bool IA_TouchRight(out double dt)
{
return PlayerInput.GetTouchDown(InputController.ActionsTouch.Right, out dt);
}
public static PlayerInput.InputAction InputAction_Left =
new("AgbQuizLeft", new int[] { IALeft, IALeft, IALeft },
IA_PadLeft, IA_TouchLeft, IA_BatonBasicPress);
// Baton Style only has one button
public static PlayerInput.InputAction InputAction_Right =
new("AgbQuizRight", new int[] { IARight, IARight, IAEmptyCat },
IA_PadRight, IA_TouchRight, IA_Empty);
void Awake()
{
instance = this;
@ -225,11 +259,11 @@ namespace HeavenStudio.Games
float normalizedBeat = cond.GetPositionFromBeat(playerStartBeat, playerLength);
if (normalizedBeat >= 0f && normalizedBeat <= 1f)
{
if (PlayerInput.Pressed())
if (PlayerInput.GetIsAction(InputAction_Right))
{
ContesteePressButton(false);
}
if (PlayerInput.GetAnyDirectionDown())
if (PlayerInput.GetIsAction(InputAction_Left))
{
ContesteePressButton(true);
}
@ -532,11 +566,11 @@ namespace HeavenStudio.Games
bool isDpad = relevantInputs[i].datamodel == "quizShow/dPad";
if (isDpad)
{
ScheduleAutoplayInput(beat, length + inputBeat, InputType.DIRECTION_DOWN, AutoplayDPad, Nothing, Nothing);
ScheduleAutoplayInput(beat, length + inputBeat, InputAction_Left, AutoplayDPad, Nothing, Nothing);
}
else
{
ScheduleAutoplayInput(beat, length + inputBeat, InputType.STANDARD_DOWN, AutoplayAButton, Nothing, Nothing);
ScheduleAutoplayInput(beat, length + inputBeat, InputAction_Right, AutoplayAButton, Nothing, Nothing);
}
}

View file

@ -1,4 +1,5 @@
using HeavenStudio.Util;
using HeavenStudio.InputSystem;
using System;
using System.Collections.Generic;
using UnityEngine;
@ -162,6 +163,26 @@ namespace HeavenStudio.Games
public static Ringside instance;
const int IAAltDownCat = 4;
protected static bool IA_PadAltPress(out double dt)
{
return PlayerInput.GetPadDown(InputController.ActionsPad.South, out dt);
}
protected static bool IA_BatonAltPress(out double dt)
{
return PlayerInput.GetSqueezeDown(out dt);
}
protected static bool IA_TouchAltPress(out double dt)
{
return PlayerInput.GetTouchDown(InputController.ActionsTouch.Tap, out dt)
&& instance.IsExpectingInputNow(InputAction_Alt);
}
public static PlayerInput.InputAction InputAction_Alt =
new("RvlInterviewAlt", new int[] { IAAltDownCat, IAAltDownCat, IAAltDownCat },
IA_PadAltPress, IA_TouchAltPress, IA_BatonAltPress);
void OnDestroy()
{
if (queuedPoses.Count > 0) queuedPoses.Clear();
@ -217,15 +238,29 @@ namespace HeavenStudio.Games
}
}
}
if (PlayerInput.Pressed() && !IsExpectingInputNow(InputType.STANDARD_DOWN) && !shouldNotInput)
if (PlayerInput.GetIsAction(InputAction_BasicPress) && !IsExpectingInputNow(InputAction_BasicPress) && !shouldNotInput)
{
if ((PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch)
|| (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch && !IsExpectingInputNow(InputAction_Alt)))
{
Ringside.instance.ScoreMiss(0.5);
wrestlerAnim.DoScaledAnimationAsync("YeMiss", 0.25f);
SoundByte.PlayOneShotGame($"ringside/confusedanswer");
if (reporterAnim.IsPlayingAnimationName("IdleReporter")) reporterAnim.Play("IdleLate", 0, 0);
}
}
if ( PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch
&& PlayerInput.GetIsAction(InputAction_FlickPress) && !IsExpectingInputNow(InputAction_FlickPress) && !shouldNotInput)
{
Ringside.instance.ScoreMiss(0.5);
wrestlerAnim.DoScaledAnimationAsync("YeMiss", 0.25f);
SoundByte.PlayOneShotGame($"ringside/confusedanswer");
if (reporterAnim.IsPlayingAnimationName("IdleReporter")) reporterAnim.Play("IdleLate", 0, 0);
SoundByte.PlayOneShotGame($"ringside/muscles2");
wrestlerAnim.DoScaledAnimationAsync("BigGuyTwo", 0.5f);
reporterAnim.Play("FlinchReporter", 0, 0);
SoundByte.PlayOneShotGame("ringside/barely");
}
if (PlayerInput.AltPressed() && !IsExpectingInputNow(InputType.STANDARD_ALT_DOWN) && !shouldNotInput)
if (PlayerInput.GetIsAction(InputAction_Alt) && !IsExpectingInputNow(InputAction_Alt) && !shouldNotInput)
{
Ringside.instance.ScoreMiss(0.5);
@ -233,7 +268,6 @@ namespace HeavenStudio.Games
wrestlerAnim.Play($"Pose{randomPose}", 0, 0);
reporterAnim.Play("FlinchReporter", 0, 0);
SoundByte.PlayOneShotGame($"ringside/yell{UnityEngine.Random.Range(1, 7)}Raw");
SoundByte.PlayOneShotGame("ringside/barely");
wrestlerTransform.localScale = new Vector3(1.1f, 1.1f, 1f);
BeatAction.New(instance, new List<BeatAction.Action>()
{
@ -391,7 +425,7 @@ namespace HeavenStudio.Games
new MultiSound.Sound($"ringside/that{currentQuestion}", beat + 0.5f),
new MultiSound.Sound($"ringside/true{currentQuestion}", beat + 1f),
}, forcePlay: true);
ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, JustQuestion, Miss, Nothing);
ScheduleInput(beat, 2f, InputAction_BasicPress, JustQuestion, Miss, Nothing);
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.5f, delegate { reporterAnim.DoScaledAnimationAsync("ThatTrue", 0.5f); }),
@ -416,8 +450,8 @@ namespace HeavenStudio.Games
new MultiSound.Sound($"ringside/guy{currentQuestion}", beat + 2f),
}, forcePlay: true);
ScheduleInput(beat, 2.5f, InputType.STANDARD_DOWN, JustBigGuyFirst, MissBigGuyOne, Nothing);
ScheduleInput(beat, 3f, InputType.STANDARD_DOWN, JustBigGuySecond, MissBigGuyTwo, Nothing);
ScheduleInput(beat, 2.5f, InputAction_BasicPress, JustBigGuyFirst, MissBigGuyOne, Nothing);
ScheduleInput(beat, 3f, InputAction_FlickPress, JustBigGuySecond, MissBigGuyTwo, Nothing);
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 2f, delegate { reporterAnim.Play("True", 0, 0); }),
@ -617,7 +651,7 @@ namespace HeavenStudio.Games
public void PoseCheck(double beat)
{
ScheduleInput(beat, 2f, InputType.STANDARD_ALT_DOWN, JustPoseForTheFans, MissPose, Nothing);
ScheduleInput(beat, 2f, InputAction_Alt, JustPoseForTheFans, MissPose, Nothing);
}
public void ChangeFlashColor(Color color, float beats)

View file

@ -19,7 +19,6 @@ namespace HeavenStudio.Games.Scripts_TrickClass
public int type;
[NonSerialized] public BezierCurve3D curve;
PlayerActionEvent hitProg;
private TrickClass game;
@ -33,7 +32,7 @@ namespace HeavenStudio.Games.Scripts_TrickClass
float flyPos = cond.GetPositionFromBeat(startBeat, flyBeats);
transform.position = curve.GetPoint(flyPos);
hitProg = game.ScheduleInput(startBeat, dodgeBeats, InputType.STANDARD_DOWN, DodgeJustOrNg, DodgeMiss, DodgeThrough, CanDodge);
game.ScheduleInput(startBeat, dodgeBeats, TrickClass.InputAction_FlickPress, DodgeJustOrNg, DodgeMiss, DodgeThrough, CanDodge);
}
// Update is called once per frame

View file

@ -96,7 +96,11 @@ namespace HeavenStudio.Games
double playerBopStart = double.MinValue;
double girlBopStart = double.MinValue;
bool showBubble = true;
bool playerReady;
public static PlayerInput.InputAction InputAction_TouchPressing =
new("PcoTrickTouching", new int[] { IAEmptyCat, IAPressingCat, IAEmptyCat },
IA_Empty, IA_TouchBasicPressing, IA_Empty);
void OnDestroy()
{
@ -117,7 +121,7 @@ namespace HeavenStudio.Games
var cond = Conductor.instance;
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1) && goBop)
{
if (cond.songPositionInBeatsAsDouble > playerBopStart)
if ((!playerReady) && cond.songPositionInBeatsAsDouble > playerBopStart)
playerAnim.DoScaledAnimationAsync("Bop");
if (cond.songPositionInBeatsAsDouble > girlBopStart)
@ -155,7 +159,18 @@ namespace HeavenStudio.Games
}
}
if (PlayerInput.Pressed() && !IsExpectingInputNow() && (playerCanDodge <= Conductor.instance.songPositionInBeatsAsDouble))
if (PlayerInput.GetIsAction(InputAction_TouchPressing) && (!playerReady) && (playerCanDodge <= Conductor.instance.songPositionInBeatsAsDouble))
{
playerAnim.DoScaledAnimationAsync("Prepare");
playerReady = true;
}
if ((!PlayerInput.GetIsAction(InputAction_TouchPressing)) && playerReady && (playerCanDodge <= Conductor.instance.songPositionInBeatsAsDouble))
{
playerAnim.DoScaledAnimationAsync("UnPrepare");
playerReady = false;
}
if (PlayerInput.GetIsAction(InputAction_FlickPress) && !IsExpectingInputNow(InputAction_FlickPress) && (playerCanDodge <= Conductor.instance.songPositionInBeatsAsDouble))
{
PlayerDodge(true);
playerCanDodge = Conductor.instance.songPositionInBeatsAsDouble + 0.6f;
@ -174,7 +189,7 @@ namespace HeavenStudio.Games
{
new BeatAction.Action(beat + i, delegate
{
if (cond.songPositionInBeatsAsDouble > playerBopStart)
if ((!playerReady) && cond.songPositionInBeatsAsDouble > playerBopStart)
playerAnim.DoScaledAnimationAsync("Bop");
if (cond.songPositionInBeatsAsDouble > girlBopStart)
@ -281,12 +296,14 @@ namespace HeavenStudio.Games
SoundByte.PlayOneShotGame("trickClass/player_dodge");
playerAnim.DoScaledAnimationAsync("Dodge", slow ? 0.6f : 1f);
playerBopStart = Conductor.instance.songPositionInBeatsAsDouble + 0.75f;
playerReady = false;
}
public void PlayerDodgeNg()
{
playerAnim.DoScaledAnimationAsync("DodgeNg");
playerReady = false;
playerBopStart = Conductor.instance.songPositionInBeatsAsDouble + 0.75f;
playerCanDodge = Conductor.instance.songPositionInBeatsAsDouble + 0.15f;
}
@ -294,6 +311,7 @@ namespace HeavenStudio.Games
public void PlayerThrough()
{
playerAnim.DoScaledAnimationAsync("Through");
playerReady = false;
playerBopStart = Conductor.instance.songPositionInBeatsAsDouble + 0.75f;
playerCanDodge = Conductor.instance.songPositionInBeatsAsDouble + 0.15f;
}