fan club face poser

This commit is contained in:
minenice55
2024-05-11 01:07:59 -04:00
parent 6c59c07574
commit 5ee3e990bb
65 changed files with 9574 additions and 1373 deletions

View File

@ -61,6 +61,30 @@ namespace HeavenStudio.Games.Loaders
inactiveFunction = delegate { var e = eventCaller.currentEntity; FanClub.WarnBigReady(e.beat, e["toggle"]); },
preFunction = delegate { var e = eventCaller.currentEntity; FanClub.BigReadySound(e.beat, e["toggle"]); }
},
new GameAction("arisa faceposer", "Idol Face Poser")
{
function = delegate { var e = eventCaller.currentEntity; FanClub.instance.SetArisaFacePoser(e["poserOn"], e["mouth"], e["mouthEnd"], e["eyeL"], e["eyeR"], e["eyex"], e["eyey"], e["eyeEaseEnable"], e.beat, e.length, e["eyeEase"]); },
resizable = true,
defaultLength = 1,
parameters = new List<Param>()
{
new Param("poserOn", true, "Enable Face Poser", "Enables Face Poser on Arisa.", new List<Param.CollapseParam>()
{
new Param.CollapseParam((x, _) => (bool)x, new string[] { "mouth", "eyeL", "eyeR", "eyex", "eyey" }),
}),
new Param("mouth", FanClub.MouthShape.Normal, "Mouth Shape", "Sets mouth shape."),
new Param("mouthEnd", FanClub.MouthShape.Normal, "Last Mouth Shape", "Sets mouth shape at the end of the event."),
new Param("eyeL", FanClub.EyeShape.Normal, "Left Eye Shape", "Sets left eye shape."),
new Param("eyeR", FanClub.EyeShape.Normal, "Right Eye Shape", "Sets right eye shape."),
new Param("eyex", new EntityTypes.Float(-1f, 1f, 0f), "Horizontal Eye Movement", "Sets horizontal eye movement."),
new Param("eyey", new EntityTypes.Float(-1f, 1f, 0f), "Vertical Eye Movement", "Sets vertical eye movement."),
new Param("eyeEaseEnable", true, "Ease Eye Movement", "Enable easing for eye movement.", new List<Param.CollapseParam>()
{
new Param.CollapseParam((x, _) => (bool)x, new string[] { "eyeEase" }),
}),
new Param("eyeEase", Util.EasingFunction.Ease.Instant, "Easing Type", "Set the type of easing for eye movement."),
}
},
new GameAction("play idol animation", "Idol Choreography")
{
function = delegate { var e = eventCaller.currentEntity; FanClub.instance.PlayAnim(e.beat, e.length, e["type"], e["who"]); },
@ -170,6 +194,26 @@ namespace HeavenStudio.Games
LeftDancer,
RightDancer
}
public enum MouthShape
{
Normal,
A,
E,
I,
O,
U,
Frown
}
public enum EyeShape
{
Normal,
HalfClosed,
Closed,
Smug,
SmugFlipped,
Wink,
Shine
}
// userdata here
[Header("Animators")]
@ -200,6 +244,7 @@ namespace HeavenStudio.Games
//arisa's animation controller
private Animator idolAnimator;
private NtrIdolAri arisaController;
// blue's animation controller
private Animator backupRAnimator;
@ -304,6 +349,7 @@ namespace HeavenStudio.Games
{
Blue.Init();
Orange.Init();
arisaController = Arisa.GetComponent<NtrIdolAri>();
var amieWalkEvts = EventCaller.GetAllInGameManagerList("fanClub", new string[] { "friend walk" });
foreach (var e in amieWalkEvts)
@ -640,6 +686,31 @@ namespace HeavenStudio.Games
}
}
System.Threading.CancellationTokenSource mouthCancel = null;
public void SetArisaFacePoser(bool enable, int mouth, int mouthEnd, int eyeL, int eyeR, float eyeX, float eyeY, bool ease, double beat, float length, int easeType)
{
if (mouthCancel != null)
{
mouthCancel.Cancel();
mouthCancel = null;
}
arisaController.ToggleFacePoser(enable);
arisaController.SetMouthShape(mouth);
arisaController.SetEyeShape(eyeL, eyeR);
if (ease)
{
arisaController.SetEyeTargetEase(beat, length, eyeX, eyeY, (Util.EasingFunction.Ease)easeType);
}
else
{
arisaController.SetEyeTarget(eyeX, eyeY);
}
mouthCancel = BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length, delegate { arisaController.SetMouthShape(mouthEnd);}),
});
}
const float HAIS_LENGTH = 4.5f;
public void CallHai(double beat, bool noSound = false, bool noResponse = false, int type = 0)
{