Fan Club Sound Fix (#613)

* title screen prompt won't switch out of mouse

* fix fan club crowd sounds not being scheduled properly

* remove extra rain drop from kman particle (again smh)
This commit is contained in:
minenice55 2024-01-07 18:45:25 -05:00 committed by GitHub
parent 84d766bb7e
commit ba6c1a52bb
5 changed files with 84 additions and 72 deletions

View file

@ -51,5 +51,5 @@
"temp/": true,
"Temp/": true
},
"dotnet.defaultSolution": "HeavenStudio-AstrlJelly.sln"
"dotnet.defaultSolution": "HeavenStudio.sln"
}

View file

@ -26958,7 +26958,7 @@ MonoBehaviour:
- name: crowd_hai
sequence:
game: 1
force: 0
force: 1
clips:
- clip: fanClub/crowd_hai_jp
beat: 0
@ -27100,7 +27100,7 @@ MonoBehaviour:
- name: crowd_kamone
sequence:
game: 1
force: 0
force: 1
clips:
- clip: fanClub/crowd_ka_jp
beat: 0
@ -27133,7 +27133,7 @@ MonoBehaviour:
- name: crowd_iina
sequence:
game: 1
force: 0
force: 1
clips:
- clip: fanClub/crowd_ii_jp
beat: 0

View file

@ -10,7 +10,8 @@ namespace HeavenStudio.Games.Loaders
using static Minigames;
public static class NtrIdolLoader
{
public static Minigame AddGame(EventCaller eventCaller) {
public static Minigame AddGame(EventCaller eventCaller)
{
return new Minigame("fanClub", "Fan Club", "ff78ff", false, false, new List<GameAction>()
{
new GameAction("bop", "Bop")
@ -33,7 +34,7 @@ namespace HeavenStudio.Games.Loaders
new Param("toggle2", false, "Disable response SFX", "Disable the monkeys's response")
},
inactiveFunction = delegate { var e = eventCaller.currentEntity; FanClub.WarnHai(e.beat, e["toggle"]);},
preFunction = delegate { var e = eventCaller.currentEntity; FanClub.HaiSound(e.beat, e["toggle"]); }
preFunction = delegate { var e = eventCaller.currentEntity; FanClub.HaiSound(e.beat, e["toggle"], e["toggle2"]); }
},
new GameAction("I suppose", "I Suppose!")
{
@ -47,7 +48,7 @@ namespace HeavenStudio.Games.Loaders
new Param("alt", false, "Alternate cue", "Use an alternate cue")
},
inactiveFunction = delegate { var e = eventCaller.currentEntity; FanClub.WarnKamone(e.beat, e["toggle"], 0, e["type"], e["alt"]);},
preFunction = delegate { var e = eventCaller.currentEntity; FanClub.KamoneSound(e.beat, e["toggle"], 0, e["type"], e["alt"]); }
preFunction = delegate { var e = eventCaller.currentEntity; FanClub.KamoneSound(e.beat, e["toggle"], e["toggle2"], 0, e["type"], e["alt"]); }
},
new GameAction("double clap", "Double Clap")
{
@ -106,9 +107,9 @@ namespace HeavenStudio.Games.Loaders
function = delegate { var e = eventCaller.currentEntity; FanClub.instance.FinalCheer(e.beat); },
},
},
new List<string>() {"ntr", "normal"},
new List<string>() { "ntr", "normal" },
"ntridol", "jp",
new List<string>() {"jp"}
new List<string>() { "jp" }
);
}
}
@ -120,13 +121,15 @@ namespace HeavenStudio.Games
public class FanClub : Minigame
{
public enum IdolBopType {
public enum IdolBopType
{
Both,
Idol,
Spectators,
None
}
public enum IdolAnimations {
public enum IdolAnimations
{
Bop,
PeaceVocal,
Peace,
@ -140,23 +143,27 @@ namespace HeavenStudio.Games
Dab,
None
}
public enum KamoneResponseType {
public enum KamoneResponseType
{
Through,
Jump,
ThroughFast,
JumpFast,
}
public enum StageAnimations {
public enum StageAnimations
{
Reset,
Flash,
Spot
}
public enum IdolPerformanceType {
public enum IdolPerformanceType
{
Normal,
Arrange,
// Tour(this one is fan made so ?)
}
public enum IdolType {
public enum IdolType
{
All,
Idol,
LeftDancer,
@ -188,7 +195,7 @@ namespace HeavenStudio.Games
// end userdata
public bool JudgementPaused { get => noJudgement; }
public bool JudgementInputPaused { get => noJudgementInput; set => noJudgementInput = value;}
public bool JudgementInputPaused { get => noJudgementInput; set => noJudgementInput = value; }
//arisa's animation controller
private Animator idolAnimator;
@ -210,11 +217,11 @@ namespace HeavenStudio.Games
private GameEvent noSpecBop = new GameEvent();
private double idolJumpStartTime = double.MinValue;
private static int performanceType = (int) IdolPerformanceType.Normal;
private static int performanceType = (int)IdolPerformanceType.Normal;
private bool responseToggle = false;
private static double wantHais = double.MinValue;
private static double wantKamone = double.MinValue;
private static int wantKamoneType = (int) KamoneResponseType.Through;
private static int wantKamoneType = (int)KamoneResponseType.Through;
private static bool wantKamoneAlt = false;
private static double wantBigReady = double.MinValue;
private bool hasJumped = false;
@ -280,7 +287,7 @@ namespace HeavenStudio.Games
}
}
if (performanceType != (int) IdolPerformanceType.Normal)
if (performanceType != (int)IdolPerformanceType.Normal)
{
idolAnimator.Play("NoPose" + GetPerformanceSuffix(), -1, 0);
}
@ -304,7 +311,7 @@ namespace HeavenStudio.Games
}
}
FanClub.SetPerformanceType((int) IdolPerformanceType.Normal);
FanClub.SetPerformanceType((int)IdolPerformanceType.Normal);
var choreoTypeEvts = EventCaller.GetAllInGameManagerList("fanClub", new string[] { "set performance type" });
foreach (var e in choreoTypeEvts)
{
@ -319,14 +326,14 @@ namespace HeavenStudio.Games
{
switch (performanceType)
{
case (int) IdolPerformanceType.Arrange:
case (int)IdolPerformanceType.Arrange:
return "Arrange";
default:
return "";
}
}
public static void SetPerformanceType(int type = (int) IdolPerformanceType.Normal)
public static void SetPerformanceType(int type = (int)IdolPerformanceType.Normal)
{
performanceType = type;
if (GameManager.instance.currentGame == "fanClub")
@ -387,9 +394,9 @@ namespace HeavenStudio.Games
{
hasJumped = true;
float yMul = jumpPos * 2f - 1f;
float yWeight = -(yMul*yMul) + 1f;
float yWeight = -(yMul * yMul) + 1f;
ArisaRootMotion.transform.localPosition = new Vector3(0, 2f * yWeight + 0.25f);
ArisaShadow.transform.localScale = new Vector3((1f-yWeight*0.8f) * IDOL_SHADOW_SCALE, (1f-yWeight*0.8f) * IDOL_SHADOW_SCALE, 1f);
ArisaShadow.transform.localScale = new Vector3((1f - yWeight * 0.8f) * IDOL_SHADOW_SCALE, (1f - yWeight * 0.8f) * IDOL_SHADOW_SCALE, 1f);
}
else
{
@ -399,7 +406,7 @@ namespace HeavenStudio.Games
}
}
public void Bop(double beat, float length, int target = (int) IdolBopType.Both, int targetAuto = (int)IdolBopType.Both)
public void Bop(double beat, float length, int target = (int)IdolBopType.Both, int targetAuto = (int)IdolBopType.Both)
{
for (int i = 0; i < length; i++)
{
@ -543,15 +550,15 @@ namespace HeavenStudio.Games
{
switch (type)
{
case (int) StageAnimations.Reset:
case (int)StageAnimations.Reset:
StageAnimator.Play("Bg", -1, 0);
ToSpot();
break;
case (int) StageAnimations.Flash:
case (int)StageAnimations.Flash:
StageAnimator.Play("Bg_Light", -1, 0);
ToSpot();
break;
case (int) StageAnimations.Spot:
case (int)StageAnimations.Spot:
StageAnimator.Play("Bg_Spot", -1, 0);
ToSpot(false);
break;
@ -566,7 +573,7 @@ namespace HeavenStudio.Games
if (unspot)
spectatorMat.SetColor("_Color", new Color(1, 1, 1, 1));
else
spectatorMat.SetColor("_Color", new Color(117/255f, 177/255f, 209/255f, 1));
spectatorMat.SetColor("_Color", new Color(117 / 255f, 177 / 255f, 209 / 255f, 1));
}
private void DoIdolJump(double beat, float length = 3f)
@ -657,8 +664,6 @@ namespace HeavenStudio.Games
new BeatAction.Action(beat + 6f, delegate { PlayOneClap(beat + 6f); DoIdolClaps();}),
new BeatAction.Action(beat + 7f, delegate { PlayOneClap(beat + 7f); DoIdolClaps();}),
});
if (!noResponse) PlaySoundSequence("fanClub", "crowd_hai", beat + 4f);
}
public static void WarnHai(double beat, bool noSound = false, int type = 0)
@ -666,8 +671,9 @@ namespace HeavenStudio.Games
wantHais = beat;
}
public static void HaiSound(double beat, bool noSound = false, int type = 0)
public static void HaiSound(double beat, bool noSound = false, bool noResponse = false, int type = 0)
{
if (!noResponse) PlaySoundSequence("fanClub", "crowd_hai", beat + 4f);
if (noSound) return;
PlaySoundSequence("fanClub", "arisa_hai", beat);
}
@ -679,10 +685,10 @@ namespace HeavenStudio.Games
}
const float CALL_LENGTH = 2.5f;
public void CallKamone(double beat, bool noSound = false, bool noResponse = false, int type = 0, int responseType = (int) KamoneResponseType.Through, bool alt = false)
public void CallKamone(double beat, bool noSound = false, bool noResponse = false, int type = 0, int responseType = (int)KamoneResponseType.Through, bool alt = false)
{
bool doJump = (responseType == (int) KamoneResponseType.Jump || responseType == (int) KamoneResponseType.JumpFast);
bool isBig = (responseType == (int) KamoneResponseType.ThroughFast || responseType == (int) KamoneResponseType.JumpFast);
bool doJump = (responseType == (int)KamoneResponseType.Jump || responseType == (int)KamoneResponseType.JumpFast);
bool isBig = (responseType == (int)KamoneResponseType.ThroughFast || responseType == (int)KamoneResponseType.JumpFast);
DisableResponse(beat, 2f);
responseToggle = true;
@ -718,22 +724,20 @@ namespace HeavenStudio.Games
}
}),
});
if (!noResponse) PlaySoundSequence("fanClub", alt ? "crowd_iina" : "crowd_kamone", beat + 2f);
}
public static void WarnKamone(double beat, bool noSound = false, int type = 0, int responseType = (int) KamoneResponseType.Through, bool alt = false)
public static void WarnKamone(double beat, bool noSound = false, int type = 0, int responseType = (int)KamoneResponseType.Through, bool alt = false)
{
wantKamone = beat;
wantKamoneType = responseType;
wantKamoneAlt = alt;
}
public static void KamoneSound(double beat, bool noSound = false, int type = 0, int responseType = (int) KamoneResponseType.Through, bool alt = false)
public static void KamoneSound(double beat, bool noSound = false, bool noResponse = false, int type = 0, int responseType = (int)KamoneResponseType.Through, bool alt = false)
{
if (!noResponse) PlaySoundSequence("fanClub", alt ? "crowd_iina" : "crowd_kamone", beat + 2f);
if (noSound) return;
if (responseType == (int) KamoneResponseType.ThroughFast || responseType == (int) KamoneResponseType.JumpFast)
if (responseType == (int)KamoneResponseType.ThroughFast || responseType == (int)KamoneResponseType.JumpFast)
{
PlaySoundSequence("fanClub", alt ? "arisa_iina_fast" : "arisa_kamone_fast", beat);
}
@ -743,7 +747,7 @@ namespace HeavenStudio.Games
}
}
public void ContinueKamone(double beat, int type = 0, int responseType = (int) KamoneResponseType.Through, bool alt = false)
public void ContinueKamone(double beat, int type = 0, int responseType = (int)KamoneResponseType.Through, bool alt = false)
{
CallKamone(beat, true, true, type, responseType, alt);
}

View file

@ -91,8 +91,16 @@ namespace HeavenStudio.InputSystem
public override void UpdateState()
{
if (GameManager.instance == null) return;
Camera cam = GameManager.instance.CursorCam;
Camera cam;
if (GameManager.instance == null || GameManager.instance.CursorCam == null)
{
cam = Camera.main;
}
else
{
cam = GameManager.instance.CursorCam;
}
if (cam == null) return;
hasFlicked = false;
hasSwiped = false;

View file

@ -142,15 +142,15 @@ namespace HeavenStudio
SoundByte.PlayOneShot("ui/UIEnter");
var nextController = newController;
var lastController = PlayerInput.GetInputController(1);
if (newController is InputMouse)
if ((newController is InputMouse) && (lastController is not InputMouse))
{
Debug.Log("Mouse used, selecting keyboard instead");
nextController = controllers[0];
}
Debug.Log("Assigning controller: " + newController.GetDeviceName());
var lastController = PlayerInput.GetInputController(1);
if (lastController != nextController)
{
if (nextController == null)