Lots of tweaks, fixes and small additions + bop fixes and bop parity across almost all games with bops. (#331)

* Rhythm rally and cheer readers improvements

* Autobop for fan club

* Implemented new bop parity for fan club, rhythm rally and ssds

* Air rally easing improvements

* Fixed drumming practice stuff

* Tap trial has been unjankified yet again

* Cheer readers and catchy tune bops

* More bop parity

* MORE!!!!

* That should be all of them except space dance and dj school

---------

Co-authored-by: minenice55 <star.elementa@gmail.com>
This commit is contained in:
Rapandrasmus 2023-03-07 18:22:32 +01:00 committed by GitHub
parent f590bd8ff9
commit 182d9fc88c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 814 additions and 250 deletions

View File

@ -100,7 +100,7 @@ AnimationClip:
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0

View File

@ -100,7 +100,7 @@ AnimationClip:
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0

View File

@ -26,6 +26,28 @@ AnimatorState:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &-8536575254723551366
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1566214250506738524}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 1
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &-8227018334659877927
AnimatorState:
serializedVersion: 6
@ -118,7 +140,7 @@ AnimatorStateMachine:
m_Position: {x: 200, y: 0, z: 0}
- serializedVersion: 1
m_State: {fileID: 3296953716140674633}
m_Position: {x: 235, y: 65, z: 0}
m_Position: {x: 200, y: -130, z: 0}
- serializedVersion: 1
m_State: {fileID: 7743056096870309842}
m_Position: {x: 270, y: 130, z: 0}
@ -130,7 +152,7 @@ AnimatorStateMachine:
m_Position: {x: 340, y: 260, z: 0}
- serializedVersion: 1
m_State: {fileID: -2055505054754996262}
m_Position: {x: 375, y: 325, z: 0}
m_Position: {x: 420, y: 30, z: 0}
- serializedVersion: 1
m_State: {fileID: 7506107921285827103}
m_Position: {x: 410, y: 390, z: 0}
@ -171,6 +193,28 @@ AnimatorStateMachine:
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1566214250506738524}
--- !u!1101 &-4614138539304857086
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1566214250506738524}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 1
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &-3055481183117655903
AnimatorState:
serializedVersion: 6
@ -233,7 +277,8 @@ AnimatorState:
m_Name: DoubleTap
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_Transitions:
- {fileID: -4614138539304857086}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
@ -249,6 +294,28 @@ AnimatorState:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &-1208883606983524581
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1566214250506738524}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 1
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &-778023667584081209
AnimatorState:
serializedVersion: 6
@ -359,7 +426,8 @@ AnimatorState:
m_Name: Tap
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_Transitions:
- {fileID: -8536575254723551366}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
@ -463,7 +531,8 @@ AnimatorState:
m_Name: Bop
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_Transitions:
- {fileID: -1208883606983524581}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0

View File

@ -252,6 +252,28 @@ AnimatorStateTransition:
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &-1969844649597885357
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 7840951289603236239}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 1
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &-1428195464489766086
AnimatorState:
serializedVersion: 6
@ -337,7 +359,8 @@ AnimatorState:
m_Name: Bop
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_Transitions:
- {fileID: -1969844649597885357}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
@ -424,7 +447,7 @@ AnimatorStateMachine:
m_Position: {x: 485, y: 275, z: 0}
- serializedVersion: 1
m_State: {fileID: 1339875481458272543}
m_Position: {x: 520, y: 340, z: 0}
m_Position: {x: 10, y: -110, z: 0}
- serializedVersion: 1
m_State: {fileID: -7296182608361541101}
m_Position: {x: 555, y: 405, z: 0}

View File

@ -294,7 +294,7 @@ namespace HeavenStudio.Games
}
else
{
tweenForForth = Forthington.gameObject.transform.DOMoveZ(wayPointZForForth, .15f).SetEase(Ease.InOutCubic);
tweenForForth = Forthington.gameObject.transform.DOMoveZ(wayPointZForForth, .7f).SetEase(Ease.OutQuad);
}
}

View File

@ -40,12 +40,12 @@ namespace HeavenStudio.Games.Loaders
new GameAction("bop", "Bop")
{
function = delegate {var e = eventCaller.currentEntity; CatchyTune.instance.Bop(e.beat, e["left"], e["right"]); },
defaultLength = 1f,
function = delegate {var e = eventCaller.currentEntity; CatchyTune.instance.Bop(e.beat, e.length, e["bop"], e["bopAuto"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("left" , true, "Left", "Plalin bops head"),
new Param("right", true, "Right", "Alalin bops head")
new Param("bop", CatchyTune.WhoBops.Both, "Bop", "Should Plalin and Alalin bop?"),
new Param("bopAuto", CatchyTune.WhoBops.None, "Bop", "Should Plalin and Alalin auto bop?"),
},
},
new GameAction("background", "Background")
@ -80,6 +80,14 @@ namespace HeavenStudio.Games
Both
}
public enum WhoBops
{
Alalin,
Plalin,
Both,
None
}
public enum Background
{
Short,
@ -265,10 +273,51 @@ namespace HeavenStudio.Games
newFruit.SetActive(true);
}
public void Bop(float beat, bool left, bool right)
public void Bop(float beat, float length, int whoBops, int whoBopsAuto)
{
bopLeft = left;
bopRight = right;
bopLeft = whoBopsAuto == (int)WhoBops.Plalin || whoBopsAuto == (int)WhoBops.Both;
bopRight = whoBopsAuto == (int)WhoBops.Alalin || whoBopsAuto == (int)WhoBops.Both;
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
BopSingle(whoBops);
})
});
}
}
void BopSingle(int whoBops)
{
switch (whoBops)
{
case (int)WhoBops.Plalin:
if (stopCatchLeft == 0)
{
plalinAnim.Play("bop", 0, 0);
}
break;
case (int)WhoBops.Alalin:
if (stopCatchRight == 0)
{
alalinAnim.Play("bop", 0, 0);
}
break;
case (int)WhoBops.Both:
if (stopCatchRight == 0)
{
alalinAnim.Play("bop", 0, 0);
}
if (stopCatchLeft == 0)
{
plalinAnim.Play("bop", 0, 0);
}
break;
default:
break;
}
}
public void changeBG(int bg)

View File

@ -45,7 +45,7 @@ namespace HeavenStudio.Games.Loaders
new Param("solo", CheerReaders.WhoSpeaks.Both, "Who Speaks", "Who should say the voice line?")
}
},
new GameAction("rahRahSisBoomBaBoom", "Rah Rah Sis Boom Ba Boom!")
new GameAction("rahRahSisBoomBaBoom", "Rah-Rah Sis Boom Bah-Boom!")
{
function = delegate {var e = eventCaller.currentEntity; CheerReaders.instance.RahRahSisBoomBaBoom(e.beat, e["solo"], e["consecutive"]); CheerReaders.instance.SetIsDoingCue(e.beat, e.length);},
defaultLength = 4f,
@ -82,16 +82,21 @@ namespace HeavenStudio.Games.Loaders
},
new GameAction("yay", "Yay")
{
function = delegate {CheerReaders.instance.Yay(); },
defaultLength = 0.5f
},
new GameAction("bop", "Bop")
{
function = delegate {var e = eventCaller.currentEntity; CheerReaders.instance.BopToggle(e["toggle"]); },
function = delegate {CheerReaders.instance.Yay(eventCaller.currentEntity["solo"]); },
defaultLength = 0.5f,
parameters = new List<Param>()
{
new Param("toggle", false, "Should bop?", "Should the nerds bop?")
new Param("solo", CheerReaders.WhoSpeaks.Both, "Who Speaks", "Who should say the voice line?"),
}
},
new GameAction("bop", "Bop")
{
function = delegate {var e = eventCaller.currentEntity; CheerReaders.instance.BopToggle(e.beat, e.length, e["toggle"], e["toggle2"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("toggle", true, "Should bop?", "Should the nerds bop?"),
new Param("toggle2", false, "Should auto bop?", "Should the nerds auto bop?")
}
},
new GameAction("resetPose", "Reset Pose")
@ -214,21 +219,9 @@ namespace HeavenStudio.Games
void Update()
{
var cond = Conductor.instance;
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1) && shouldBop && canBop)
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1) && shouldBop)
{
foreach (var nerd in firstRow)
{
nerd.Bop();
}
foreach (var nerd in secondRow)
{
nerd.Bop();
}
foreach (var nerd in thirdRow)
{
nerd.Bop();
}
player.Bop();
BopSingle();
}
if (cond.isPlaying && !cond.isPaused)
@ -370,7 +363,7 @@ namespace HeavenStudio.Games
}
}
public void Yay()
public void Yay(int whoSpeaks)
{
if (!shouldYay) return;
if (shouldBeBlack)
@ -381,11 +374,6 @@ namespace HeavenStudio.Games
{
whiteYayParticle.Play();
}
foreach (var nerd in allGirls)
{
nerd.Yay();
}
player.Yay();
playerMask.SetActive(false);
missPoster.SetActive(false);
foreach (var mask in topMasks)
@ -400,12 +388,71 @@ namespace HeavenStudio.Games
{
mask.SetActive(false);
}
Jukebox.PlayOneShotGame("cheerReaders/All/yay");
switch (whoSpeaks)
{
case (int)WhoSpeaks.Solo:
Jukebox.PlayOneShotGame("cheerReaders/Solo/yayS");
player.Yay(true);
foreach (var nerd in allGirls)
{
nerd.Yay(true);
}
break;
case (int)WhoSpeaks.Girls:
Jukebox.PlayOneShotGame("cheerReaders/Girls/yayGirls");
foreach (var nerd in allGirls)
{
nerd.Yay(true);
}
player.Yay(false);
break;
default:
Jukebox.PlayOneShotGame("cheerReaders/All/yay");
foreach (var nerd in allGirls)
{
nerd.Yay(true);
}
player.Yay(true);
break;
}
}
public void BopToggle(bool startBop)
public void BopToggle(float beat, float length, bool startBop, bool bopAuto)
{
shouldBop = startBop;
shouldBop = bopAuto;
if (startBop)
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
BopSingle();
})
});
}
}
}
void BopSingle()
{
if (canBop)
{
foreach (var nerd in firstRow)
{
nerd.Bop();
}
foreach (var nerd in secondRow)
{
nerd.Bop();
}
foreach (var nerd in thirdRow)
{
nerd.Bop();
}
player.Bop();
}
}
public void SetIsDoingCue(float beat, float length, bool shouldSwitchColor = true)
@ -418,7 +465,7 @@ namespace HeavenStudio.Games
player.ResetFace();
doingCue = true;
cueBeat = beat;
cueLength = length;
cueLength = length - 1f;
if (!shouldSwitchColor) return;
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
@ -547,7 +594,7 @@ namespace HeavenStudio.Games
break;
}
}),
new BeatAction.Action(beat + 2.99f, delegate
new BeatAction.Action(beat + 2.5f, delegate
{
if (!doingCue) canBop = true;
})
@ -705,7 +752,7 @@ namespace HeavenStudio.Games
break;
}
}),
new BeatAction.Action(beat + 2.99f, delegate
new BeatAction.Action(beat + 2.5f, delegate
{
if (!doingCue) canBop = true;
})
@ -891,7 +938,7 @@ namespace HeavenStudio.Games
break;
}
}),
new BeatAction.Action(beat + 2.99f, delegate
new BeatAction.Action(beat + 2.5f, delegate
{
if (!doingCue) canBop = true;
})
@ -1101,7 +1148,7 @@ namespace HeavenStudio.Games
break;
}
}),
new BeatAction.Action(beat + 2.99f, delegate
new BeatAction.Action(beat + 3.5f, delegate
{
if (!doingCue) canBop = true;
})

View File

@ -52,9 +52,9 @@ namespace HeavenStudio.Games.Scripts_CheerReaders
faceAnim.Play(player ? "FaceItsOnHappy" : "FaceItsOnNPC", 0, 0);
}
public void Yay()
public void Yay(bool speak)
{
faceAnim.DoScaledAnimationAsync("FaceYay", 0.5f);
if (speak) faceAnim.DoScaledAnimationAsync("FaceYay", 0.5f);
BaseAnim.DoScaledAnimationAsync(bookIsWhite ? "WhiteYay" : "BlackYay", 0.5f);
}

View File

@ -19,7 +19,13 @@ namespace HeavenStudio.Games.Loaders
},
new GameAction("bop", "Bop")
{
function = delegate { ClappyTrio.instance.Bop(eventCaller.currentEntity.beat); }
function = delegate { var e = eventCaller.currentEntity; ClappyTrio.instance.BopToggle(e.beat, e.length, e["bop"], e["autoBop"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("bop", true, "Bop", "Should the lions bop?"),
new Param("autoBop", false, "Bop (Auto)", "Should the lions auto bop?")
}
},
new GameAction("prepare", "Prepare Stance")
{
@ -69,6 +75,9 @@ namespace HeavenStudio.Games
private ClappyTrioPlayer ClappyTrioPlayer;
public bool playerHitLast = false;
bool shouldBop;
public GameEvent bop = new GameEvent();
public static ClappyTrio instance { get; set; }
@ -90,6 +99,15 @@ namespace HeavenStudio.Games
}
}
void Update()
{
var cond = Conductor.instance;
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
{
if (shouldBop) Bop(cond.songPositionInBeats);
}
}
private void InitLions()
{
float startPos = -3.066667f;
@ -119,11 +137,6 @@ namespace HeavenStudio.Games
clapAction.Delete();
}
private void Update()
{
}
public void Clap(float beat, float length)
{
ClappyTrioPlayer.clapStarted = true;
@ -158,6 +171,22 @@ namespace HeavenStudio.Games
Jukebox.PlayOneShotGame("clappyTrio/ready");
}
public void BopToggle(float beat, float length, bool startBop, bool autoBop)
{
shouldBop = autoBop;
if (startBop)
{
for (int i = 0; i < length; i++)
{
float spawnBeat = beat + i;
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(spawnBeat, delegate { Bop(spawnBeat); })
});
}
}
}
public void Bop(float beat)
{
if (playerHitLast)

View File

@ -24,6 +24,8 @@ namespace HeavenStudio.Games.Scripts_DrummingPractice
private bool hitting = false;
private float canBopBeat = -2f;
// in the future: use the MiiStudio API to render any mii from a nintendo account / MNMS / Mii Studio code?
// figure out how to call the API from unity?
// used expressions: "normal", "smile", "sorrow"
@ -53,12 +55,13 @@ namespace HeavenStudio.Games.Scripts_DrummingPractice
public void Bop()
{
if (animator.IsAnimationNotPlaying())
if (Conductor.instance.GetPositionFromBeat(canBopBeat, 2f) > 1f)
animator.Play("Bop", 0, 0);
}
public void Prepare(int type)
public void Prepare(float beat, int type)
{
canBopBeat = beat;
count = type;
if (count % 2 == 0)
animator.Play("PrepareLeft", 0, 0);

View File

@ -16,9 +16,13 @@ namespace HeavenStudio.Games.Loaders
{
new GameAction("bop", "Bop")
{
function = delegate { var e = eventCaller.currentEntity; DrummingPractice.instance.SetBop(e.beat, e.length); },
defaultLength = 1f,
resizable = true
function = delegate { var e = eventCaller.currentEntity; DrummingPractice.instance.SetBop(e.beat, e.length, e["bop"], e["autoBop"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("bop", true, "Bop", "Should the drummers bop?"),
new Param("autoBop", true, "Bop (Auto)", "Should the drummers auto bop?")
}
},
new GameAction("drum", "Hit Drum")
{
@ -105,6 +109,7 @@ namespace HeavenStudio.Games
bool isMoving;
string moveAnim;
EasingFunction.Ease lastEase;
bool goBop = true;
public GameEvent bop = new GameEvent();
public int count = 0;
@ -131,7 +136,7 @@ namespace HeavenStudio.Games
var cond = Conductor.instance;
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
{
if (cond.songPositionInBeats >= bop.startBeat && Conductor.instance.songPositionInBeats < bop.startBeat + bop.length)
if (goBop)
{
Bop();
}
@ -140,9 +145,12 @@ namespace HeavenStudio.Games
if (isMoving && cond.isPlaying && !cond.isPaused)
{
float normalizedBeat = cond.GetPositionFromBeat(movingStartBeat, movingLength);
EasingFunction.Function func = EasingFunction.GetEasingFunction(lastEase);
float newPos = func(0f, 1f, normalizedBeat);
NPCDrummers.DoNormalizedAnimation(moveAnim, newPos);
if (normalizedBeat >= 0 && normalizedBeat <= 1f)
{
EasingFunction.Function func = EasingFunction.GetEasingFunction(lastEase);
float newPos = func(0f, 1f, normalizedBeat);
NPCDrummers.DoNormalizedAnimation(moveAnim, newPos);
}
}
foreach (SpriteRenderer streak in streaks)
@ -165,10 +173,19 @@ namespace HeavenStudio.Games
});
}
public void SetBop(float beat, float length)
public void SetBop(float beat, float length, bool shouldBop, bool autoBop)
{
bop.startBeat = beat;
bop.length = length;
goBop = autoBop;
if (shouldBop)
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate { Bop(); })
});
}
}
}
public void Bop()
@ -181,9 +198,9 @@ namespace HeavenStudio.Games
public void Prepare(float beat, bool applause)
{
int type = count % 2;
player.Prepare(type);
leftDrummer.Prepare(type);
rightDrummer.Prepare(type);
player.Prepare(beat, type);
leftDrummer.Prepare(beat, type);
rightDrummer.Prepare(beat, type);
count++;
SetFaces(0);

View File

@ -15,12 +15,12 @@ namespace HeavenStudio.Games.Loaders
{
new GameAction("bop", "Bop")
{
function = delegate { var e = eventCaller.currentEntity; FanClub.instance.Bop(e.beat, e.length, e["type"]); },
defaultLength = 0.5f,
resizable = true,
function = delegate { var e = eventCaller.currentEntity; FanClub.instance.Bop(e.beat, e.length, e["type"], e["type2"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("type", FanClub.IdolBopType.Both, "Bop target", "Who to make bop"),
new Param("type2", FanClub.IdolBopType.None, "Bop target (Auto)", "Who to make auto bop"),
}
},
new GameAction("yeah, yeah, yeah", "Yeah, Yeah, Yeah!")
@ -105,7 +105,8 @@ namespace HeavenStudio.Games
public enum IdolBopType {
Both,
Idol,
Spectators
Spectators,
None
}
public enum IdolAnimations {
Bop,
@ -178,6 +179,8 @@ namespace HeavenStudio.Games
private static float wantBigReady = Single.MinValue;
public float idolJumpStartTime = Single.MinValue;
private bool hasJumped = false;
private bool goBopIdol = true;
private bool goBopSpec = true;
//game scene
public static FanClub instance;
@ -282,7 +285,7 @@ namespace HeavenStudio.Games
var cond = Conductor.instance;
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
{
if (cond.songPositionInBeats >= bop.startBeat && cond.songPositionInBeats < bop.startBeat + bop.length)
if (goBopIdol)
{
if (!(cond.songPositionInBeats >= noBop.startBeat && cond.songPositionInBeats < noBop.startBeat + noBop.length))
idolAnimator.Play("IdolBeat" + GetPerformanceSuffix(), 0, 0);
@ -291,7 +294,7 @@ namespace HeavenStudio.Games
if (cond.ReportBeat(ref specBop.lastReportedBeat, specBop.startBeat % 1))
{
if (cond.songPositionInBeats >= specBop.startBeat && cond.songPositionInBeats < specBop.startBeat + specBop.length)
if (goBopSpec)
{
if (!(cond.songPositionInBeats >= noSpecBop.startBeat && cond.songPositionInBeats < noSpecBop.startBeat + noSpecBop.length))
BopAll();
@ -324,22 +327,36 @@ namespace HeavenStudio.Games
}
}
public void Bop(float beat, float length, int target = (int) IdolBopType.Both)
public void Bop(float beat, float length, int target = (int) IdolBopType.Both, int targetAuto = (int)IdolBopType.Both)
{
if (target == (int) IdolBopType.Both || target == (int) IdolBopType.Idol)
goBopIdol = targetAuto == (int)IdolBopType.Both || targetAuto == (int)IdolBopType.Idol;
goBopSpec = targetAuto == (int)IdolBopType.Both || targetAuto == (int)IdolBopType.Spectators;
for (int i = 0; i < length; i++)
{
bop.length = length;
bop.startBeat = beat;
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate { BopSingle(target); })
});
}
if (target == (int) IdolBopType.Both || target == (int) IdolBopType.Spectators)
SpecBop(beat, length);
}
public void SpecBop(float beat, float length)
void BopSingle(int target)
{
specBop.length = length;
specBop.startBeat = beat;
switch (target)
{
case (int)IdolBopType.Idol:
idolAnimator.Play("IdolBeat" + GetPerformanceSuffix(), 0, 0);
break;
case (int)IdolBopType.Spectators:
BopAll();
break;
case (int)IdolBopType.Both:
idolAnimator.Play("IdolBeat" + GetPerformanceSuffix(), 0, 0);
BopAll();
break;
default:
break;
}
}
private void DisableBop(float beat, float length)

View File

@ -15,11 +15,12 @@ namespace HeavenStudio.Games.Loaders
{
new GameAction("bop", "Bop")
{
function = delegate { KarateMan.instance.ToggleBop(eventCaller.currentEntity["toggle"]); },
defaultLength = 0.5f,
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.ToggleBop(e.beat, e.length, e["toggle2"], e["toggle"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("toggle", true, "Bop", "Whether to bop to the beat or not")
new Param("toggle2", true, "Bop", "Whether to bop to the beat or not"),
new Param("toggle", false, "Bop (Auto)", "Whether to auto bop to the beat or not")
},
inactiveFunction = delegate { KarateMan.ToggleBopUnloaded(eventCaller.currentEntity["toggle"]); }
},
@ -476,7 +477,7 @@ namespace HeavenStudio.Games
SetBgAndShadowCol(WantBgChangeStart, WantBgChangeLength, bgType, (int) currentShadowType, bgColour, customShadowColour, (int)currentBgEffect);
SetBgTexture(textureType, textureFilterType, filterColour, filterColour);
UpdateMaterialColour(BodyColor, HighlightColor, ItemColor);
ToggleBop(WantBop);
ToggleBop(0, 0, false, WantBop);
}
private void Update()
@ -1033,12 +1034,22 @@ namespace HeavenStudio.Games
Wind.windMain = windStrength;
}
public void ToggleBop(bool toggle)
public void ToggleBop(float beat, float length, bool toggle, bool autoBop)
{
Joe.shouldBop = autoBop;
if (toggle)
Joe.bop.length = Single.MaxValue;
else
Joe.bop.length = 0;
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
Joe.Bop();
})
});
}
}
}
public static void ToggleBopUnloaded(bool toggle)

View File

@ -13,6 +13,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public Animator anim;
public Animator FaceAnim;
public GameEvent bop = new GameEvent();
public bool shouldBop = true;
public SpriteRenderer[] Shadows;
public Color BombGlowTint;
@ -94,11 +95,9 @@ namespace HeavenStudio.Games.Scripts_KarateMan
anim.Play("Beat", -1, 0);
}
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1, false) && cond.songPositionInBeats > bop.startBeat && cond.songPositionInBeats < bop.startBeat + bop.length && cond.songPositionInBeats >= unPrepareTime && !inCombo)
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1, false) && shouldBop && cond.songPositionInBeats >= unPrepareTime && !inCombo)
{
anim.speed = 1f;
anim.Play("Beat", -1, 0);
lastChargeTime = Single.MinValue;
Bop();
}
if (inCombo && shouldComboId == -2)
@ -182,6 +181,13 @@ namespace HeavenStudio.Games.Scripts_KarateMan
}
public void Bop()
{
anim.speed = 1f;
anim.Play("Beat", -1, 0);
lastChargeTime = Single.MinValue;
}
public bool Punch(int forceHand = 0)
{
if (GameManager.instance.currentGame != "karateman") return false;

View File

@ -19,12 +19,13 @@ namespace HeavenStudio.Games.Loaders
{
new GameAction("bop", "Bop")
{
function = delegate { var e = eventCaller.currentEntity; Lockstep.instance.Bop(e.beat, e["toggle"]); },
function = delegate { var e = eventCaller.currentEntity; Lockstep.instance.Bop(e.beat, e.length, e["toggle"], e["toggle2"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("toggle", false, "Reset Pose", "Resets to idle pose.")
new Param("toggle", true, "Bop", "Should the stepswitchers bop?"),
new Param("toggle2", false, "Bop (Auto)", "Should the stepswitchers auto bop?"),
},
defaultLength = 1f,
},
new GameAction("marching", "Stepping")
{
@ -115,6 +116,8 @@ namespace HeavenStudio.Games
MissedOn = 2
}
bool offColorActive;
bool goBop;
public GameEvent bop = new GameEvent();
public static Lockstep instance;
@ -135,6 +138,15 @@ namespace HeavenStudio.Games
var cond = Conductor.instance;
if (cond.isPlaying && !cond.isPaused)
{
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
{
if (goBop)
{
stepswitcher0.DoScaledAnimationAsync("Bop", 0.5f);
stepswitcher1.DoScaledAnimationAsync("Bop", 0.5f);
stepswitcherP.DoScaledAnimationAsync("Bop", 0.5f);
}
}
if (queuedInputs.Count > 0)
{
foreach (var input in queuedInputs)
@ -160,21 +172,23 @@ namespace HeavenStudio.Games
}
public void Bop(float beat, bool reset)
public void Bop(float beat, float length, bool shouldBop, bool autoBop)
{
if (reset)
goBop = autoBop;
if (shouldBop)
{
stepswitcher0.DoScaledAnimationAsync("BopReset", 0.5f);
stepswitcher1.DoScaledAnimationAsync("BopReset", 0.5f);
stepswitcherP.DoScaledAnimationAsync("BopReset", 0.5f);
}
else
{
stepswitcher0.DoScaledAnimationAsync("Bop", 0.5f);
stepswitcher1.DoScaledAnimationAsync("Bop", 0.5f);
stepswitcherP.DoScaledAnimationAsync("Bop", 0.5f);
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
stepswitcher0.DoScaledAnimationAsync("Bop", 0.5f);
stepswitcher1.DoScaledAnimationAsync("Bop", 0.5f);
stepswitcherP.DoScaledAnimationAsync("Bop", 0.5f);
})
});
}
}
}

View File

@ -27,9 +27,14 @@ namespace HeavenStudio.Games.Loaders
{
new GameAction("bop", "Bop")
{
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.BopAction(e.beat, e.length); },
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.instance.BopAction(e.beat, e.length, e["bop"], e["autoBop"]); },
defaultLength = 1f,
resizable = true
resizable = true,
parameters = new List<Param>()
{
new Param("bop", true, "Bop", "Should the cadets bop?"),
new Param("autoBop", false, "Bop (Auto)", "Should the cadets auto bop?")
}
},
new GameAction("marching", "Cadets March")
@ -138,6 +143,7 @@ namespace HeavenStudio.Games
public static Color fillColor;
[Header("Game Events")]
bool goBop;
public GameEvent bop = new GameEvent();
public GameEvent noBop = new GameEvent();
public GameEvent marching = new GameEvent();
@ -252,7 +258,7 @@ namespace HeavenStudio.Games
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1, true))
{
if (currBeat >= bop.startBeat && currBeat < bop.startBeat + bop.length)
if (goBop)
{
Cadet1.DoScaledAnimationAsync("Bop", 0.5f);
Cadet2.DoScaledAnimationAsync("Bop", 0.5f);
@ -310,10 +316,25 @@ namespace HeavenStudio.Games
}
}
public void BopAction(float beat, float length)
public void BopAction(float beat, float length, bool shouldBop, bool autoBop)
{
bop.length = length;
bop.startBeat = beat;
goBop = autoBop;
if (shouldBop)
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
Cadet1.DoScaledAnimationAsync("Bop", 0.5f);
Cadet2.DoScaledAnimationAsync("Bop", 0.5f);
Cadet3.DoScaledAnimationAsync("Bop", 0.5f);
CadetPlayer.DoScaledAnimationAsync("Bop", 0.5f);
})
});
}
}
}
public static void PreMarch(float beat, float length)

View File

@ -49,13 +49,14 @@ namespace HeavenStudio.Games.Loaders
{
function = delegate {
var e = eventCaller.currentEntity;
MeatGrinder.instance.Bop(e.beat, e["bossBop"]);
MeatGrinder.instance.Bop(e.beat, e.length, e["bop"], e["bossBop"]);
},
parameters = new List<Param>()
{
new Param("bossBop", false, "Boss Bops?", "Does Boss bop?"),
new Param("bop", true, "Boss Bops?", "Does Boss bop?"),
new Param("bossBop", false, "Boss Bops? (Auto)", "Does Boss Auto bop?"),
},
defaultLength = 0.5f,
resizable = true,
priority = 4,
},
});
@ -144,9 +145,25 @@ namespace HeavenStudio.Games
};
}
public void Bop(float beat, bool doesBop)
public void Bop(float beat, float length, bool doesBop, bool autoBop)
{
bossBop = doesBop;
bossBop = autoBop;
if (doesBop)
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
if (!BossAnim.IsPlayingAnimationName("BossCall") && !BossAnim.IsPlayingAnimationName("BossSignal"))
{
BossAnim.DoScaledAnimationAsync(bossAnnoyed ? "BossMiss" : "Bop", 0.5f);
};
})
});
}
}
}
public static void PreInterval(float beat, float interval)

View File

@ -16,9 +16,13 @@ namespace HeavenStudio.Games.Loaders
{
new GameAction("bop", "Bop")
{
function = delegate { RhythmRally.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); },
defaultLength = 0.5f,
resizable = true
function = delegate {var e = eventCaller.currentEntity; RhythmRally.instance.Bop(e.beat, e.length, e["bop"], e["bopAuto"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("bop", true, "Bop", "Will the paddlers bop?"),
new Param("bopAuto", false, "Bop (Auto)", "Will the paddlers auto bop?")
}
},
new GameAction("whistle", "Whistle")
{
@ -27,25 +31,25 @@ namespace HeavenStudio.Games.Loaders
},
new GameAction("toss ball", "Toss Ball")
{
function = delegate { RhythmRally.instance.Toss(eventCaller.currentEntity.beat, eventCaller.currentEntity.length, 6f, true); },
defaultLength = 2f,
function = delegate { RhythmRally.instance.Toss(eventCaller.currentEntity.beat, eventCaller.currentEntity.length, 6f, true); },
defaultLength = 2f,
resizable = true
},
new GameAction("rally", "Rally")
{
function = delegate { RhythmRally.instance.Serve(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Normal); },
defaultLength = 4f,
function = delegate { RhythmRally.instance.Serve(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Normal); },
defaultLength = 4f,
resizable = true
},
new GameAction("slow rally", "Slow Rally")
{
function = delegate { RhythmRally.instance.Serve(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Slow); },
defaultLength = 8f,
function = delegate { RhythmRally.instance.Serve(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Slow); },
defaultLength = 8f,
resizable = true
},
new GameAction("fast rally", "Fast Rally")
{
function = delegate { RhythmRally.instance.PrepareFastRally(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Fast, eventCaller.currentEntity["muteAudio"]); },
function = delegate { RhythmRally.instance.PrepareFastRally(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Fast, eventCaller.currentEntity["muteAudio"]); },
defaultLength = 6f,
parameters = new List<Param>()
{
@ -54,16 +58,28 @@ namespace HeavenStudio.Games.Loaders
},
new GameAction("superfast rally", "Superfast Rally")
{
function = delegate { RhythmRally.instance.PrepareFastRally(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.SuperFast, eventCaller.currentEntity["muteAudio"]); },
function = delegate { RhythmRally.instance.PrepareFastRally(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.SuperFast, eventCaller.currentEntity["muteAudio"]); },
defaultLength = 12f,
parameters = new List<Param>()
{
new Param("muteAudio", false, "Mute Cowbell", "Whether the cowbell sound should play or not.")
}
},
new GameAction("tonktinktonk", "Tonk-Tink-Tonk (Stretchable)")
{
preFunction = delegate {var e = eventCaller.currentEntity; RhythmRally.TonkTinkTonkStretchable(e.beat, e.length); },
defaultLength = 4f,
resizable = true
},
new GameAction("superfast stretchable", "Superfast Rally (Stretchable)")
{
function = delegate { var e = eventCaller.currentEntity; RhythmRally.instance.SuperFastRallyStretchable(e.beat, e.length); },
defaultLength = 8f,
resizable = true
},
new GameAction("pose", "End Pose")
{
function = delegate { RhythmRally.instance.Pose(); },
function = delegate { RhythmRally.instance.Pose(); },
defaultLength = 0.5f
},
new GameAction("camera", "Camera Controls")
@ -72,15 +88,15 @@ namespace HeavenStudio.Games.Loaders
var e = eventCaller.currentEntity;
var rotation = new Vector3(0, e["valA"], 0);
RhythmRally.instance.ChangeCameraAngle(rotation, e["valB"], e.length, (Ease)e["type"], (RotateMode)e["type2"]);
},
defaultLength = 4,
resizable = true,
},
defaultLength = 4,
resizable = true,
parameters = new List<Param>() {
new Param("valA", new EntityTypes.Integer(-360, 360, 0), "Angle", "The rotation of the camera around the center of the table"),
new Param("valB", new EntityTypes.Float(0.5f, 4f, 1), "Zoom", "The camera's level of zoom (Lower value = Zoomed in)"),
new Param("type", Ease.Linear, "Ease", "The easing function to use"),
new Param("type2", RotateMode.Fast, "Rotation Mode", "The rotation mode to use")
}
}
},
});
}
@ -131,6 +147,7 @@ namespace HeavenStudio.Games
public Paddlers paddlers;
public GameEvent bop = new GameEvent();
private bool goBop = true;
public static RhythmRally instance;
@ -343,23 +360,45 @@ namespace HeavenStudio.Games
// Paddler bop animation.
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
{
if (currentBeat >= bop.startBeat && currentBeat < bop.startBeat + bop.length && !inPose)
if (goBop && !inPose)
{
if (!playerPrepping && (playerAnim.IsAnimationNotPlaying() || playerState.IsName("Idle") || playerState.IsName("Beat")))
playerAnim.DoScaledAnimationAsync("Beat", 0.5f);
if (!opponentPrepping && !opponentServing && !tossing && (opponentAnim.IsAnimationNotPlaying() || opponentState.IsName("Idle") || opponentState.IsName("Beat")))
opponentAnim.DoScaledAnimationAsync("Beat", 0.5f);
BopSingle();
}
}
opponentServing = false;
}
public void Bop(float beat, float length)
public void Bop(float beat, float length, bool bop, bool bopAuto)
{
bop.length = length;
bop.startBeat = beat;
goBop = bopAuto;
if (bop)
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
BopSingle();
})
});
}
}
}
void BopSingle()
{
var playerState = playerAnim.GetCurrentAnimatorStateInfo(0);
var opponentState = opponentAnim.GetCurrentAnimatorStateInfo(0);
bool playerPrepping = false; // Player using prep animation?
bool opponentPrepping = false; // Opponent using prep animation?
if (!playerPrepping && (playerAnim.IsAnimationNotPlaying() || playerState.IsName("Idle") || playerState.IsName("Beat")))
playerAnim.DoScaledAnimationAsync("Beat", 0.5f);
if (!opponentPrepping && !opponentServing && !tossing && (opponentAnim.IsAnimationNotPlaying() || opponentState.IsName("Idle") || opponentState.IsName("Beat")))
opponentAnim.DoScaledAnimationAsync("Beat", 0.5f);
}
public void Serve(float beat, RallySpeed speed)
@ -469,36 +508,39 @@ namespace HeavenStudio.Games
});
if (muteAudio) return;
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("rhythmRally/Tonk", beat),
new MultiSound.Sound("rhythmRally/Tink", beat + 0.5f),
new MultiSound.Sound("rhythmRally/Tonk", beat + 1f)
});
TonkTinkTonkStretchable(beat, 1.5f);
}
else if (speedChange == RallySpeed.SuperFast)
{
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 4f, delegate { Serve(beat + 4f, RallySpeed.SuperFast); }),
new BeatAction.Action(beat + 6f, delegate { Serve(beat + 6f, RallySpeed.SuperFast); }),
new BeatAction.Action(beat + 8f, delegate { Serve(beat + 8f, RallySpeed.SuperFast); }),
new BeatAction.Action(beat + 10f, delegate { Serve(beat + 10f, RallySpeed.SuperFast); })
});
SuperFastRallyStretchable(beat + 4f, 8f);
if (muteAudio) return;
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("rhythmRally/Tonk", beat),
new MultiSound.Sound("rhythmRally/Tink", beat + 0.5f),
new MultiSound.Sound("rhythmRally/Tonk", beat + 1f),
new MultiSound.Sound("rhythmRally/Tink", beat + 1.5f),
new MultiSound.Sound("rhythmRally/Tonk", beat + 2f),
new MultiSound.Sound("rhythmRally/Tink", beat + 2.5f),
new MultiSound.Sound("rhythmRally/Tonk", beat + 3f),
new MultiSound.Sound("rhythmRally/Tink", beat + 3.5f)
});
TonkTinkTonkStretchable(beat, 4f);
}
}
public static void TonkTinkTonkStretchable(float beat, float length)
{
List<MultiSound.Sound> soundsToPlay = new List<MultiSound.Sound>();
bool tink = false;
for (float i = 0; i < length; i += 0.5f)
{
soundsToPlay.Add(new MultiSound.Sound(tink ? "rhythmRally/Tink" : "rhythmRally/Tonk", beat + i));
tink = !tink;
}
MultiSound.Play(soundsToPlay.ToArray(), forcePlay: true);
}
public void SuperFastRallyStretchable(float beat, float length)
{
List<BeatAction.Action> servesToPerform = new List<BeatAction.Action>();
for (int i = 0; i < length; i += 2)
{
float beatToSpawn = beat + i;
servesToPerform.Add( new BeatAction.Action(beatToSpawn, delegate { Serve(beatToSpawn, RallySpeed.SuperFast); }) );
}
BeatAction.New(gameObject, servesToPerform);
}
}
}

View File

@ -33,11 +33,12 @@ namespace HeavenStudio.Games.Loaders
},
new GameAction("bop", "Bop")
{
function = delegate { var e = eventCaller.currentEntity; RhythmSomen.instance.ToggleBop(e["toggle"]); },
defaultLength = 0.5f,
function = delegate { var e = eventCaller.currentEntity; RhythmSomen.instance.ToggleBop(e.beat, e.length, e["toggle2"], e["toggle"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("toggle", false, "Bop?", "Should the somen man bop or not?")
new Param("toggle2", true, "Bop", "Should the somen man bop?"),
new Param("toggle", false, "Bop (Auto)", "Should the somen man bop automatically?")
}
}
});
@ -90,9 +91,22 @@ namespace HeavenStudio.Games
}
}
public void ToggleBop(bool bopOrNah)
public void ToggleBop(float beat, float length, bool bopOrNah, bool autoBop)
{
shouldBop = bopOrNah;
shouldBop = autoBop;
if (bopOrNah)
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
SomenPlayer.Play("HeadBob", -1, 0);
})
});
}
}
}
public void DoFarCrane(float beat)

View File

@ -45,14 +45,15 @@ namespace HeavenStudio.Games.Loaders
},
defaultLength = 4f
},
new GameAction("toggleBop", "Toggle Bop")
new GameAction("toggleBop", "Bop")
{
function = delegate {var e = eventCaller.currentEntity; Ringside.instance.ToggleBop(e["bop"]); },
function = delegate {var e = eventCaller.currentEntity; Ringside.instance.ToggleBop(e.beat, e.length, e["bop2"], e["bop"]); },
parameters = new List<Param>()
{
new Param("bop", false, "Bop?", "Whether the wrestler should bop or not."),
new Param("bop2", true, "Bop?", "Whether the wrestler should bop or not."),
new Param("bop", false, "Bop? (Auto)", "Whether the wrestler should bop automatically or not."),
},
defaultLength = 0.5f
resizable = true,
},
new GameAction("toggleSweat", "Toggle Sweat")
{
@ -181,9 +182,6 @@ namespace HeavenStudio.Games
allCameraEvents = tempEvents;
UpdateCameraZoom();
wrestlerAnim.Play("Idle", 0, 0);
reporterAnim.Play("IdleReporter", 0, 0);
shouldNotInput = false;
shouldBop = true;
}
@ -196,7 +194,7 @@ namespace HeavenStudio.Games
{
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
{
if (wrestlerAnim.IsPlayingAnimationName("Idle") && shouldBop)
if ((wrestlerAnim.IsPlayingAnimationName("Idle") || wrestlerAnim.IsPlayingAnimationName("BopPec") || wrestlerAnim.IsPlayingAnimationName("Bop")) && shouldBop)
{
if (UnityEngine.Random.Range(1, 18) == 1)
{
@ -286,9 +284,32 @@ namespace HeavenStudio.Games
}
public void ToggleBop(bool startBopping)
public void ToggleBop(float beat, float length, bool startBopping, bool autoBop)
{
shouldBop = startBopping;
shouldBop = autoBop;
if (startBopping)
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
if ((wrestlerAnim.IsPlayingAnimationName("Idle") || wrestlerAnim.IsPlayingAnimationName("BopPec") || wrestlerAnim.IsPlayingAnimationName("Bop")))
{
if (UnityEngine.Random.Range(1, 18) == 1)
{
wrestlerAnim.DoScaledAnimationAsync("BopPec");
}
else
{
wrestlerAnim.DoScaledAnimationAsync("Bop");
}
}
})
});
}
}
}
public void ToggleSweat(bool shouldSweat)

View File

@ -15,6 +15,16 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("samuraiSliceNtr", "Samurai Slice (DS)", "00165D", false, false, new List<GameAction>()
{
new GameAction("bop", "Bop")
{
function = delegate {var e = eventCaller.currentEntity; SamuraiSliceNtr.instance.Bop(e.beat, e.length, e["whoBops"], e["whoBopsAuto"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("whoBops", SamuraiSliceNtr.WhoBops.Both, "Who Bops?", "Who will bop?"),
new Param("whoBopsAuto", SamuraiSliceNtr.WhoBops.None, "Who Bops? (Auto)", "Who will automatically begin bopping?")
}
},
new GameAction("melon", "Melon")
{
function = delegate
@ -89,6 +99,17 @@ namespace HeavenStudio.Games
Melon2B2T,
}
public enum WhoBops
{
Samurai = 0,
Children = 1,
Both = 2,
None = 3
}
private bool goBopSamurai = true;
private bool goBopChild = true;
[Header("References")]
public NtrSamurai player;
public GameObject launcher;
@ -121,8 +142,8 @@ namespace HeavenStudio.Games
var cond = Conductor.instance;
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
{
player.Bop();
childParent.GetComponent<NtrSamuraiChild>().Bop();
if (goBopSamurai) player.Bop();
if (goBopChild) childParent.GetComponent<NtrSamuraiChild>().Bop();
}
if (PlayerInput.AltPressed())
@ -133,6 +154,38 @@ namespace HeavenStudio.Games
DoSlice();
}
public void Bop(float beat, float length, int whoBops, int whoBopsAuto)
{
goBopSamurai = whoBopsAuto == (int)WhoBops.Samurai || whoBopsAuto == (int)WhoBops.Both;
goBopChild = whoBopsAuto == (int)WhoBops.Children || whoBopsAuto == (int)WhoBops.Both;
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate { BopSingle(whoBops); })
});
}
}
void BopSingle(int whoBops)
{
switch (whoBops)
{
case (int)WhoBops.Samurai:
player.Bop();
break;
case (int)WhoBops.Children:
childParent.GetComponent<NtrSamuraiChild>().Bop();
break;
case (int)WhoBops.Both:
player.Bop();
childParent.GetComponent<NtrSamuraiChild>().Bop();
break;
default:
break;
}
}
public void DoStep()
{
Jukebox.PlayOneShotGame("samuraiSliceNtr/ntrSamurai_launchThrough");

View File

@ -41,12 +41,13 @@ namespace HeavenStudio.Games.Loaders
},
new GameAction("bop", "Bop")
{
function = delegate {var e = eventCaller.currentEntity; Tambourine.instance.Bop(e.beat, e["whoBops"]); },
function = delegate {var e = eventCaller.currentEntity; Tambourine.instance.Bop(e.beat, e.length, e["whoBops"], e["whoBopsAuto"]); },
parameters = new List<Param>()
{
new Param("whoBops", Tambourine.WhoBops.Both, "Who Bops", "Who will bop."),
new Param("whoBopsAuto", Tambourine.WhoBops.None, "Who Bops (Auto)", "Who will auto bop."),
},
defaultLength = 1f,
resizable = true,
priority = 4
},
new GameAction("success", "Success")
@ -110,14 +111,18 @@ namespace HeavenStudio.Games
float beatInterval = 8f;
float misses;
bool frogPresent;
bool monkeyGoBop;
bool handsGoBop;
Tween bgColorTween;
public GameEvent bop = new GameEvent();
public enum WhoBops
{
Monkey,
Player,
Both
Both,
None
}
static List<QueuedTambourineInput> queuedInputs = new List<QueuedTambourineInput>();
@ -148,6 +153,17 @@ namespace HeavenStudio.Games
void Update()
{
if (Conductor.instance.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
{
if (monkeyGoBop)
{
monkeyAnimator.Play("MonkeyBop", 0, 0);
}
if (handsGoBop)
{
handsAnimator.Play("Bop", 0, 0);
}
}
if (!Conductor.instance.isPlaying || Conductor.instance.isPaused)
{
if (queuedInputs.Count > 0) queuedInputs.Clear();
@ -242,27 +258,41 @@ namespace HeavenStudio.Games
}
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length + input.beatAwayFromStart, delegate { Bop(beat + length + input.beatAwayFromStart, (int)WhoBops.Monkey); })
new BeatAction.Action(beat + length + input.beatAwayFromStart, delegate { Bop(beat + length + input.beatAwayFromStart, 1, (int)WhoBops.Monkey, (int)WhoBops.None); })
});
}
queuedInputs.Clear();
}
public void Bop(float beat, int whoBops)
public void Bop(float beat, float length, int whoBops, int whoBopsAuto)
{
switch (whoBops)
monkeyGoBop = whoBopsAuto == (int)WhoBops.Monkey || whoBopsAuto == (int)WhoBops.Both;
handsGoBop = whoBopsAuto == (int)WhoBops.Player || whoBopsAuto == (int)WhoBops.Both;
for (int i = 0; i < length; i++)
{
case (int) WhoBops.Monkey:
monkeyAnimator.Play("MonkeyBop", 0, 0);
break;
case (int) WhoBops.Player:
handsAnimator.Play("Bop", 0, 0);
break;
case (int) WhoBops.Both:
monkeyAnimator.Play("MonkeyBop", 0, 0);
handsAnimator.Play("Bop", 0, 0);
break;
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
switch (whoBops)
{
case (int) WhoBops.Monkey:
monkeyAnimator.Play("MonkeyBop", 0, 0);
break;
case (int) WhoBops.Player:
handsAnimator.Play("Bop", 0, 0);
break;
case (int) WhoBops.Both:
monkeyAnimator.Play("MonkeyBop", 0, 0);
handsAnimator.Play("Bop", 0, 0);
break;
default:
break;
}
})
});
}
}
public void SuccessFace(float beat)

View File

@ -16,11 +16,12 @@ namespace HeavenStudio.Games.Loaders
{
new GameAction("bop", "Bop")
{
function = delegate { TapTrial.instance.Bop(eventCaller.currentEntity["toggle"]); },
defaultLength = .5f,
function = delegate { var e = eventCaller.currentEntity; TapTrial.instance.Bop(e.beat, e.length, e["toggle"], e["toggle2"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("toggle", false, "Bop", "Whether both will bop to the beat or not")
new Param("toggle", true, "Bop", "Whether both will bop to the beat or not"),
new Param("toggle2", false, "Bop (Auto)", "Whether both will bop automatically to the beat or not")
}
},
new GameAction("tap", "Tap")
@ -106,7 +107,6 @@ namespace HeavenStudio.Games
[SerializeField] ScrollForTap scroll;
[SerializeField] GameObject giraffe;
bool goBop = true, isPrep;
float lastReportedBeat = 0f;
bool hasJumped, isFinalJump;
public float jumpStartTime = Single.MinValue;
float jumpPos;
@ -116,6 +116,8 @@ namespace HeavenStudio.Games
[SerializeField] GameObject bg;
bool giraffeIsIn;
public GameEvent bop = new GameEvent();
public static TapTrial instance { get; set; }
private void Awake()
@ -125,18 +127,9 @@ namespace HeavenStudio.Games
private void Update()
{
if (goBop && !isPrep)
if (Conductor.instance.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
{
if (Conductor.instance.ReportBeat(ref lastReportedBeat))
{
if (monkeys[0].IsPlayingAnimationName("Idle")) monkeys[0].DoScaledAnimationAsync("Bop", 0.5f);
if (monkeys[1].IsPlayingAnimationName("Idle")) monkeys[1].DoScaledAnimationAsync("Bop", 0.5f);
if (player.anim.IsPlayingAnimationName("Idle")) player.anim.DoScaledAnimationAsync("Bop", 0.5f);
}
else if (Conductor.instance.songPositionInBeats < lastReportedBeat)
{
lastReportedBeat = Mathf.Round(Conductor.instance.songPositionInBeats);
}
if (goBop) SingleBop();
}
jumpPos = Conductor.instance.GetPositionFromBeat(jumpStartTime, 1f);
@ -174,9 +167,29 @@ namespace HeavenStudio.Games
}
}
public void Bop(bool isBopping)
void SingleBop()
{
goBop = isBopping;
if (!isPrep)
{
if (monkeys[0].GetCurrentAnimatorStateInfo(0).IsName("Idle")) monkeys[0].DoScaledAnimationAsync("Bop", 0.5f);
if (monkeys[1].GetCurrentAnimatorStateInfo(0).IsName("Idle")) monkeys[1].DoScaledAnimationAsync("Bop", 0.5f);
if (player.anim.GetCurrentAnimatorStateInfo(0).IsName("Idle")) player.anim.DoScaledAnimationAsync("Bop", 0.5f);
}
}
public void Bop(float beat, float length, bool isBopping, bool autoBop)
{
goBop = autoBop;
if (isBopping)
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate { SingleBop(); })
});
}
}
}
public void Tap(float beat)

View File

@ -39,9 +39,13 @@ namespace HeavenStudio.Games.Loaders
},
new GameAction("bop", "Bop")
{
function = delegate {TapTroupe.instance.Bop(); },
defaultLength = 1f,
function = delegate {var e = eventCaller.currentEntity; TapTroupe.instance.Bop(e.beat, e.length, e["bop"], e["bopAuto"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("bop", true, "Bop", "Should the tappers bop?"),
new Param("bopAuto", false, "Bop (Auto)", "Should the tappers auto bop?")
}
},
new GameAction("spotlights", "Toggle Spotlights")
{
@ -114,8 +118,10 @@ namespace HeavenStudio.Games
private bool shouldDoSecondBam;
private bool missedTaps;
private bool canSpit = true;
private bool goBop;
private bool useTutorialMissFace;
private TapTroupeTapper.TapAnim currentTapAnim;
public GameEvent bop = new GameEvent();
public struct QueuedSteps
{
public float beat;
@ -186,6 +192,10 @@ namespace HeavenStudio.Games
var cond = Conductor.instance;
if (cond.isPlaying && !cond.isPaused)
{
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1) && goBop)
{
BopSingle();
}
if (queuedSteps.Count > 0)
{
foreach (var step in queuedSteps)
@ -563,7 +573,25 @@ namespace HeavenStudio.Games
MultiSound.Play(soundsToPlay.ToArray(), forcePlay: true);
}
public void Bop()
public void Bop(float beat, float length, bool shouldBop, bool autoBop)
{
goBop = autoBop;
if (shouldBop)
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
BopSingle();
})
});
}
}
}
public void BopSingle()
{
playerTapper.Bop();
playerCorner.Bop();

View File

@ -101,11 +101,12 @@ namespace HeavenStudio.Games.Loaders
},
new GameAction("bop", "Bop")
{
function = delegate { TheDazzles.instance.shouldBop = eventCaller.currentEntity["toggle"]; },
defaultLength = 0.5f,
function = delegate { var e = eventCaller.currentEntity; TheDazzles.instance.Bop(e.beat, e.length, e["toggle2"], e["toggle"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("toggle", false, "Should bop?", "Should the dazzles bop?")
new Param("toggle2", true, "Should bop?", "Should the dazzles bop?"),
new Param("toggle", false, "Should auto bop?", "Should the dazzles auto bop?")
}
},
@ -295,6 +296,28 @@ namespace HeavenStudio.Games
}
}
public void Bop(float beat, float length, bool goBop, bool autoBop)
{
shouldBop = autoBop;
if (goBop)
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
foreach (var girl in npcGirls)
{
girl.Bop();
}
player.Bop();
})
});
}
}
}
public void ForceHold()
{
shouldHold = true;

View File

@ -31,17 +31,16 @@ namespace HeavenStudio.Games.Loaders
},
defaultLength = 3,
},
new GameAction("toggleBubble", "Toggle Speech Bubble")
new GameAction("bop", "Bop")
{
function = delegate { TrickClass.instance.BubbleToggle(); },
defaultLength = 1,
},
new GameAction("bop", "")
{
function = delegate { var e = eventCaller.currentEntity; TrickClass.instance.Bop(e.beat, e.length); },
function = delegate { var e = eventCaller.currentEntity; TrickClass.instance.Bop(e.beat, e.length, e["bop"], e["autoBop"]); },
resizable = true,
hidden = true
}
parameters = new List<Param>()
{
new Param("bop", true, "Bop", "Should the girl and boy bop?"),
new Param("autoBop", false, "Bop (Auto)", "Should the girl and boy auto bop?")
}
},
});
}
}
@ -87,6 +86,7 @@ namespace HeavenStudio.Games
public static TrickClass instance;
public GameEvent bop = new GameEvent();
bool goBop = true;
public float playerCanDodge = Single.MinValue;
float playerBopStart = Single.MinValue;
@ -107,7 +107,7 @@ namespace HeavenStudio.Games
private void Update()
{
var cond = Conductor.instance;
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1) && goBop)
{
if (cond.songPositionInBeats > playerBopStart)
playerAnim.DoScaledAnimationAsync("Bop");
@ -154,10 +154,27 @@ namespace HeavenStudio.Games
}
}
public void Bop(float beat, float length)
public void Bop(float beat, float length, bool shouldBop, bool autoBop)
{
bop.startBeat = beat;
bop.length = length;
var cond = Conductor.instance;
goBop = autoBop;
if (shouldBop)
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
if (cond.songPositionInBeats > playerBopStart)
playerAnim.DoScaledAnimationAsync("Bop");
if (cond.songPositionInBeats > girlBopStart)
girlAnim.DoScaledAnimationAsync("Bop");
})
});
}
}
}
public void BubbleToggle()