mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 10:47:39 +02:00
Fan Club Retouch (#416)
* new sprites not done * more sprites more anim chanegs * almost done * INSANE * sheet done * its done * re-implement improved squat sprite * remove many unused assets allow games to be hidden in the editor * start animations of backup dancers * finish backup dancer animations * add effects to backup dancers' tree * add dancers to the prefab * import new sprites * backup dancers fully functional * game camera now updates in LateUpdate() * touched some anims * oops * oops 2 * add audience applause fix the mapped cellanim shaders --------- Co-authored-by: minenice55 <star.elementa@gmail.com>
This commit is contained in:
@ -109,7 +109,10 @@ namespace HeavenStudio
|
||||
UpdateCameraTranslate();
|
||||
UpdateCameraRotate();
|
||||
SetShakeIntensity();
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
Camera cam = GetCamera();
|
||||
// rotate position by additional rotation
|
||||
Vector3 userPos = Quaternion.Euler(additionalRotEluer) * position;
|
||||
|
@ -13,7 +13,7 @@ namespace HeavenStudio.Games.Loaders
|
||||
public static class NtrFlickLoader
|
||||
{
|
||||
public static Minigame AddGame(EventCaller eventCaller) {
|
||||
return new Minigame("builtToScaleDS", "Built To Scale (DS)", "1ad21a", true, false, new List<GameAction>()
|
||||
return new Minigame("builtToScaleDS", "Built To Scale (DS)", "1ad21a", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("spawn blocks", "Widget")
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ namespace HeavenStudio.Games.Loaders
|
||||
public static class NtrDogNinjaLoader
|
||||
{
|
||||
public static Minigame AddGame(EventCaller eventCaller) {
|
||||
return new Minigame("dogNinja", "Dog Ninja", "554899", true, false, new List<GameAction>()
|
||||
return new Minigame("dogNinja", "Dog Ninja", "554899", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("Bop", "Bop")
|
||||
{
|
||||
|
@ -60,11 +60,12 @@ namespace HeavenStudio.Games.Loaders
|
||||
},
|
||||
new GameAction("play idol animation", "Idol Coreography")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; FanClub.instance.PlayAnim(e.beat, e.length, e["type"]); },
|
||||
function = delegate { var e = eventCaller.currentEntity; FanClub.instance.PlayAnim(e.beat, e.length, e["type"], e["who"]); },
|
||||
resizable = true,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("type", FanClub.IdolAnimations.Bop, "Animation", "Animation to play")
|
||||
new Param("type", FanClub.IdolAnimations.Bop, "Animation", "Animation to play"),
|
||||
new Param("who", FanClub.IdolType.All, "Target Idol", "Target to play the animation on")
|
||||
}
|
||||
},
|
||||
new GameAction("play stage animation", "Stage Coreography")
|
||||
@ -76,6 +77,17 @@ namespace HeavenStudio.Games.Loaders
|
||||
new Param("type", FanClub.StageAnimations.Flash, "Animation", "Animation to play")
|
||||
}
|
||||
},
|
||||
new GameAction("friend walk", "Backup Dancers Entrance")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; FanClub.instance.DancerTravel(e.beat, e.length, e["exit"], e["instant"]); },
|
||||
defaultLength = 16f,
|
||||
resizable = true,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("exit", false, "Exit", "Backup dancers exit instead"),
|
||||
new Param("instant", false, "Instant Travel", "Backup dancers instantly finish their travel"),
|
||||
}
|
||||
},
|
||||
new GameAction("set performance type", "Coreography Type")
|
||||
{
|
||||
|
||||
@ -87,6 +99,10 @@ namespace HeavenStudio.Games.Loaders
|
||||
},
|
||||
inactiveFunction = delegate { var e = eventCaller.currentEntity; FanClub.SetPerformanceType(e["type"]); }
|
||||
},
|
||||
new GameAction("finish", "Applause")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; FanClub.instance.FinalCheer(e.beat); },
|
||||
},
|
||||
},
|
||||
new List<string>() {"ntr", "normal"},
|
||||
"ntridol", "jp",
|
||||
@ -138,38 +154,62 @@ namespace HeavenStudio.Games
|
||||
Arrange,
|
||||
// Tour(this one is fan made so ?)
|
||||
}
|
||||
public enum IdolType {
|
||||
All,
|
||||
Idol,
|
||||
LeftDancer,
|
||||
RightDancer
|
||||
}
|
||||
|
||||
// userdata here
|
||||
[Header("Animators")]
|
||||
//stage
|
||||
public Animator StageAnimator;
|
||||
[SerializeField] Animator StageAnimator;
|
||||
|
||||
[Header("Objects")]
|
||||
public GameObject Arisa;
|
||||
public GameObject ArisaRootMotion;
|
||||
public GameObject ArisaShadow;
|
||||
public GameObject spectator;
|
||||
public GameObject spectatorAnchor;
|
||||
// our girl
|
||||
[SerializeField] GameObject Arisa;
|
||||
[SerializeField] GameObject ArisaRootMotion;
|
||||
[SerializeField] GameObject ArisaShadow;
|
||||
|
||||
// spectators
|
||||
[SerializeField] GameObject spectator;
|
||||
[SerializeField] GameObject spectatorAnchor;
|
||||
|
||||
// backup dancers
|
||||
[SerializeField] NtrIdolAmie Blue;
|
||||
[SerializeField] NtrIdolAmie Orange;
|
||||
|
||||
[Header("References")]
|
||||
public Material spectatorMat;
|
||||
[SerializeField] Material spectatorMat;
|
||||
|
||||
// end userdata
|
||||
|
||||
public bool JudgementPaused { get => noJudgement; }
|
||||
public bool JudgementInputPaused { get => noJudgementInput; set => noJudgementInput = value;}
|
||||
|
||||
//arisa's animation controller
|
||||
private Animator idolAnimator;
|
||||
|
||||
// blue's animation controller
|
||||
private Animator backupRAnimator;
|
||||
|
||||
// orange's animation controller
|
||||
private Animator backupLAnimator;
|
||||
|
||||
//spectators
|
||||
private NtrIdolFan Player;
|
||||
private List<GameObject> Spectators;
|
||||
public NtrIdolFan Player;
|
||||
|
||||
//bop-type animations
|
||||
public GameEvent bop = new GameEvent();
|
||||
public GameEvent specBop = new GameEvent();
|
||||
public GameEvent noBop = new GameEvent();
|
||||
public GameEvent noResponse = new GameEvent();
|
||||
public GameEvent noCall = new GameEvent();
|
||||
public GameEvent noSpecBop = new GameEvent();
|
||||
private GameEvent bop = new GameEvent();
|
||||
private GameEvent specBop = new GameEvent();
|
||||
private GameEvent noBop = new GameEvent();
|
||||
private GameEvent noResponse = new GameEvent();
|
||||
private GameEvent noCall = new GameEvent();
|
||||
private GameEvent noSpecBop = new GameEvent();
|
||||
|
||||
private float idolJumpStartTime = Single.MinValue;
|
||||
private static int performanceType = (int) IdolPerformanceType.Normal;
|
||||
private bool responseToggle = false;
|
||||
private static float wantHais = Single.MinValue;
|
||||
@ -177,10 +217,11 @@ namespace HeavenStudio.Games
|
||||
private static int wantKamoneType = (int) KamoneResponseType.Through;
|
||||
private static bool wantKamoneAlt = false;
|
||||
private static float wantBigReady = Single.MinValue;
|
||||
public float idolJumpStartTime = Single.MinValue;
|
||||
private bool hasJumped = false;
|
||||
private bool goBopIdol = true;
|
||||
private bool goBopSpec = true;
|
||||
private bool noJudgement = false;
|
||||
private bool noJudgementInput = false;
|
||||
|
||||
//game scene
|
||||
public static FanClub instance;
|
||||
@ -192,6 +233,8 @@ namespace HeavenStudio.Games
|
||||
instance = this;
|
||||
Spectators = new List<GameObject>();
|
||||
idolAnimator = Arisa.GetComponent<Animator>();
|
||||
backupRAnimator = Blue.GetComponent<Animator>();
|
||||
backupLAnimator = Orange.GetComponent<Animator>();
|
||||
|
||||
// procedurally spawning the spectators
|
||||
// from middle of viewport:
|
||||
@ -239,6 +282,33 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
|
||||
ToSpot();
|
||||
noJudgement = false;
|
||||
noJudgementInput = false;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Blue.Init();
|
||||
Orange.Init();
|
||||
|
||||
var amieWalkEvts = EventCaller.GetAllInGameManagerList("fanClub", new string[] { "friend walk" });
|
||||
foreach (var e in amieWalkEvts)
|
||||
{
|
||||
if (e.beat <= Conductor.instance.songPositionInBeatsAsDouble)
|
||||
{
|
||||
DancerTravel(e.beat, e.length, e["exit"], e["instant"]);
|
||||
}
|
||||
}
|
||||
|
||||
FanClub.SetPerformanceType((int) IdolPerformanceType.Normal);
|
||||
var choreoTypeEvts = EventCaller.GetAllInGameManagerList("fanClub", new string[] { "set performance type" });
|
||||
foreach (var e in choreoTypeEvts)
|
||||
{
|
||||
if (e.beat <= Conductor.instance.songPositionInBeatsAsDouble)
|
||||
{
|
||||
FanClub.SetPerformanceType(e["type"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetPerformanceSuffix()
|
||||
@ -288,7 +358,11 @@ namespace HeavenStudio.Games
|
||||
if (goBopIdol)
|
||||
{
|
||||
if (!(cond.songPositionInBeats >= noBop.startBeat && cond.songPositionInBeats < noBop.startBeat + noBop.length))
|
||||
{
|
||||
idolAnimator.Play("IdolBeat" + GetPerformanceSuffix(), 0, 0);
|
||||
Blue.PlayAnimState("Beat");
|
||||
Orange.PlayAnimState("Beat");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -309,19 +383,12 @@ namespace HeavenStudio.Games
|
||||
hasJumped = true;
|
||||
float yMul = jumpPos * 2f - 1f;
|
||||
float yWeight = -(yMul*yMul) + 1f;
|
||||
//TODO: idol start position
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hasJumped)
|
||||
{
|
||||
//DisableBop(cond.songPositionInBeats, 1.5f);
|
||||
//TODO: landing anim
|
||||
}
|
||||
idolJumpStartTime = Single.MinValue;
|
||||
//TODO: idol start position
|
||||
ArisaRootMotion.transform.localPosition = new Vector3(0, 0);
|
||||
ArisaShadow.transform.localScale = new Vector3(IDOL_SHADOW_SCALE, IDOL_SHADOW_SCALE, 1f);
|
||||
}
|
||||
@ -346,12 +413,16 @@ namespace HeavenStudio.Games
|
||||
{
|
||||
case (int)IdolBopType.Idol:
|
||||
idolAnimator.Play("IdolBeat" + GetPerformanceSuffix(), 0, 0);
|
||||
Blue.PlayAnimState("Beat");
|
||||
Orange.PlayAnimState("Beat");
|
||||
break;
|
||||
case (int)IdolBopType.Spectators:
|
||||
BopAll();
|
||||
break;
|
||||
case (int)IdolBopType.Both:
|
||||
idolAnimator.Play("IdolBeat" + GetPerformanceSuffix(), 0, 0);
|
||||
Blue.PlayAnimState("Beat");
|
||||
Orange.PlayAnimState("Beat");
|
||||
BopAll();
|
||||
break;
|
||||
default:
|
||||
@ -394,66 +465,74 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
}
|
||||
|
||||
public void PlayAnim(float beat, float length, int type)
|
||||
public void PlayAnim(float beat, float length, int type, int who)
|
||||
{
|
||||
idolJumpStartTime = Single.MinValue;
|
||||
DisableResponse(beat, length + 0.5f);
|
||||
DisableBop(beat, length + 0.5f);
|
||||
DisableCall(beat, length + 0.5f);
|
||||
|
||||
switch (type)
|
||||
if (who is (int)IdolType.All or (int)IdolType.LeftDancer)
|
||||
Orange.PlayAnim(beat, length, type);
|
||||
if (who is (int)IdolType.All or (int)IdolType.RightDancer)
|
||||
Blue.PlayAnim(beat, length, type);
|
||||
|
||||
if (who is (int)IdolType.All or (int)IdolType.Idol)
|
||||
{
|
||||
case (int) IdolAnimations.Bop:
|
||||
idolAnimator.Play("IdolBeat" + GetPerformanceSuffix(), -1, 0);
|
||||
break;
|
||||
case (int) IdolAnimations.PeaceVocal:
|
||||
idolAnimator.Play("IdolPeace" + GetPerformanceSuffix(), -1, 0);
|
||||
break;
|
||||
case (int) IdolAnimations.Peace:
|
||||
idolAnimator.Play("IdolPeaceNoSync" + GetPerformanceSuffix(), -1, 0);
|
||||
break;
|
||||
case (int) IdolAnimations.Clap:
|
||||
idolAnimator.Play("IdolCrap" + GetPerformanceSuffix(), -1, 0);
|
||||
break;
|
||||
case (int) IdolAnimations.Call:
|
||||
BeatAction.New(Arisa, new List<BeatAction.Action>()
|
||||
switch (type)
|
||||
{
|
||||
case (int)IdolAnimations.Bop:
|
||||
idolAnimator.Play("IdolBeat" + GetPerformanceSuffix(), -1, 0);
|
||||
break;
|
||||
case (int)IdolAnimations.PeaceVocal:
|
||||
idolAnimator.Play("IdolPeace" + GetPerformanceSuffix(), -1, 0);
|
||||
break;
|
||||
case (int)IdolAnimations.Peace:
|
||||
idolAnimator.Play("IdolPeaceNoSync" + GetPerformanceSuffix(), -1, 0);
|
||||
break;
|
||||
case (int)IdolAnimations.Clap:
|
||||
idolAnimator.Play("IdolCrap" + GetPerformanceSuffix(), -1, 0);
|
||||
break;
|
||||
case (int)IdolAnimations.Call:
|
||||
BeatAction.New(Arisa, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { Arisa.GetComponent<Animator>().Play("IdolCall0" + GetPerformanceSuffix(), -1, 0); }),
|
||||
new BeatAction.Action(beat + 0.75f, delegate { Arisa.GetComponent<Animator>().Play("IdolCall1" + GetPerformanceSuffix(), -1, 0); }),
|
||||
});
|
||||
break;
|
||||
case (int) IdolAnimations.Response:
|
||||
idolAnimator.Play("IdolResponse" + GetPerformanceSuffix(), -1, 0);
|
||||
break;
|
||||
case (int) IdolAnimations.Jump:
|
||||
DoIdolJump(beat, length);
|
||||
break;
|
||||
case (int) IdolAnimations.BigCall:
|
||||
BeatAction.New(Arisa, new List<BeatAction.Action>()
|
||||
break;
|
||||
case (int)IdolAnimations.Response:
|
||||
idolAnimator.Play("IdolResponse" + GetPerformanceSuffix(), -1, 0);
|
||||
break;
|
||||
case (int)IdolAnimations.Jump:
|
||||
DoIdolJump(beat, length);
|
||||
break;
|
||||
case (int)IdolAnimations.BigCall:
|
||||
BeatAction.New(Arisa, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { Arisa.GetComponent<Animator>().Play("IdolBigCall0" + GetPerformanceSuffix(), -1, 0); }),
|
||||
new BeatAction.Action(beat + length, delegate { Arisa.GetComponent<Animator>().Play("IdolBigCall1" + GetPerformanceSuffix(), -1, 0); }),
|
||||
});
|
||||
break;
|
||||
case (int) IdolAnimations.Squat:
|
||||
BeatAction.New(Arisa, new List<BeatAction.Action>()
|
||||
break;
|
||||
case (int)IdolAnimations.Squat:
|
||||
BeatAction.New(Arisa, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { Arisa.GetComponent<Animator>().Play("IdolSquat0" + GetPerformanceSuffix(), -1, 0); }),
|
||||
new BeatAction.Action(beat + length, delegate { Arisa.GetComponent<Animator>().Play("IdolSquat1" + GetPerformanceSuffix(), -1, 0); }),
|
||||
});
|
||||
break;
|
||||
case (int) IdolAnimations.Wink:
|
||||
BeatAction.New(Arisa, new List<BeatAction.Action>()
|
||||
break;
|
||||
case (int)IdolAnimations.Wink:
|
||||
BeatAction.New(Arisa, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { Arisa.GetComponent<Animator>().Play("IdolWink0" + GetPerformanceSuffix(), -1, 0); }),
|
||||
new BeatAction.Action(beat + length, delegate { Arisa.GetComponent<Animator>().Play("IdolWink1" + GetPerformanceSuffix(), -1, 0); }),
|
||||
});
|
||||
break;
|
||||
case (int) IdolAnimations.Dab:
|
||||
idolAnimator.Play("IdolDab" + GetPerformanceSuffix(), -1, 0);
|
||||
Jukebox.PlayOneShotGame("fanClub/arisa_dab");
|
||||
break;
|
||||
default: break;
|
||||
break;
|
||||
case (int)IdolAnimations.Dab:
|
||||
idolAnimator.Play("IdolDab" + GetPerformanceSuffix(), -1, 0);
|
||||
Jukebox.PlayOneShotGame("fanClub/arisa_dab");
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -479,6 +558,8 @@ namespace HeavenStudio.Games
|
||||
public void ToSpot(bool unspot = true)
|
||||
{
|
||||
Arisa.GetComponent<NtrIdolAri>().ToSpot(unspot);
|
||||
Blue.ToSpot(unspot);
|
||||
Orange.ToSpot(unspot);
|
||||
if (unspot)
|
||||
spectatorMat.SetColor("_Color", new Color(1, 1, 1, 1));
|
||||
else
|
||||
@ -506,6 +587,8 @@ namespace HeavenStudio.Games
|
||||
if (!(Conductor.instance.songPositionInBeats >= noResponse.startBeat && Conductor.instance.songPositionInBeats < noResponse.startBeat + noResponse.length))
|
||||
{
|
||||
idolAnimator.Play("IdolCrap" + GetPerformanceSuffix(), -1, 0);
|
||||
Blue.PlayAnimState("Crap");
|
||||
Orange.PlayAnimState("Crap");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -518,6 +601,8 @@ namespace HeavenStudio.Games
|
||||
idolAnimator.Play("IdolPeace" + GetPerformanceSuffix(), -1, 0);
|
||||
else
|
||||
idolAnimator.Play("IdolPeaceNoSync" + GetPerformanceSuffix(), -1, 0);
|
||||
Blue.PlayAnimState("Peace");
|
||||
Orange.PlayAnimState("Peace");
|
||||
}
|
||||
}
|
||||
|
||||
@ -608,22 +693,25 @@ namespace HeavenStudio.Games
|
||||
|
||||
BeatAction.New(Arisa, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { DoIdolCall(0, isBig); }),
|
||||
new BeatAction.Action(beat, delegate { DoIdolCall(0, isBig); Blue.PlayAnimState("Beat"); Orange.PlayAnimState("Beat"); }),
|
||||
new BeatAction.Action(beat + (isBig ? 1f : 0.75f), delegate { DoIdolCall(1, isBig); }),
|
||||
new BeatAction.Action(beat + 1f, delegate { PlayPrepare(); }),
|
||||
new BeatAction.Action(beat + 1f, delegate { PlayPrepare(); Blue.PlayAnimState("Beat"); Orange.PlayAnimState("Beat"); }),
|
||||
|
||||
new BeatAction.Action(beat + 2f, delegate { PlayLongClap(beat + 2f); DoIdolResponse(); }),
|
||||
new BeatAction.Action(beat + 3f, delegate { DoIdolResponse(); }),
|
||||
new BeatAction.Action(beat + 2f, delegate { PlayLongClap(beat + 2f); DoIdolResponse(); Blue.PlayAnimState("Beat"); Orange.PlayAnimState("Beat"); }),
|
||||
new BeatAction.Action(beat + 3f, delegate { DoIdolResponse(); Blue.PlayAnimState("Beat"); Orange.PlayAnimState("Beat"); }),
|
||||
new BeatAction.Action(beat + 3.5f, delegate { PlayOneClap(beat + 3.5f); }),
|
||||
new BeatAction.Action(beat + 4f, delegate { PlayChargeClap(beat + 4f); DoIdolResponse(); }),
|
||||
new BeatAction.Action(beat + 4f, delegate { PlayChargeClap(beat + 4f); DoIdolResponse(); Blue.PlayAnimState("Beat"); Orange.PlayAnimState("Beat"); }),
|
||||
new BeatAction.Action(beat + 5f, delegate { PlayJump(beat + 5f);
|
||||
if (doJump)
|
||||
{
|
||||
DoIdolJump(beat + 5f);
|
||||
Blue.DoIdolJump(beat + 5f);
|
||||
Orange.DoIdolJump(beat + 5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
DoIdolResponse();
|
||||
Blue.PlayAnimState("Beat"); Orange.PlayAnimState("Beat");
|
||||
}
|
||||
}),
|
||||
});
|
||||
@ -744,13 +832,35 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
}
|
||||
|
||||
private void PlayOneClap(float beat)
|
||||
private void PlayOneClap(float beat, int who = -1)
|
||||
{
|
||||
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
|
||||
if (who != -1)
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { PlayAnimationAll("FanClap", true, true);}),
|
||||
new BeatAction.Action(beat + 0.1f, delegate { PlayAnimationAll("FanFree", true, true);}),
|
||||
});
|
||||
if (who == 3)
|
||||
{
|
||||
if (GameManager.instance.autoplay)
|
||||
{
|
||||
Player.ClapStart(true, false, 0.1f);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Jukebox.PlayOneShotGame("fanClub/play_clap", volume: 0.08f);
|
||||
Jukebox.PlayOneShotGame("fanClub/crap_impact", pitch: UnityEngine.Random.Range(0.95f, 1.05f), volume: 0.1f);
|
||||
BeatAction.New(Spectators[who], new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { Spectators[who].GetComponent<Animator>().Play("FanClap", -1, 0); }),
|
||||
new BeatAction.Action(beat + 0.1f, delegate { Spectators[who].GetComponent<Animator>().Play("FanFree", -1, 0); }),
|
||||
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { PlayAnimationAll("FanClap", true, true);}),
|
||||
new BeatAction.Action(beat + 0.1f, delegate { PlayAnimationAll("FanFree", true, true);}),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void PlayLongClap(float beat)
|
||||
@ -801,5 +911,82 @@ namespace HeavenStudio.Games
|
||||
Spectators[i].GetComponent<NtrIdolFan>().MakeAngry(i > 3);
|
||||
}
|
||||
}
|
||||
|
||||
public void DancerTravel(float beat, float length, bool exit, bool instant)
|
||||
{
|
||||
if (instant)
|
||||
{
|
||||
Blue.FinishEntrance(exit);
|
||||
Orange.FinishEntrance(exit);
|
||||
}
|
||||
else
|
||||
{
|
||||
Blue.StartEntrance(beat, length, exit);
|
||||
Orange.StartEntrance(beat, length, exit);
|
||||
}
|
||||
}
|
||||
|
||||
public void FinalCheer(float beat)
|
||||
{
|
||||
if (noJudgement) return;
|
||||
noJudgement = true;
|
||||
noJudgementInput = false;
|
||||
goBopSpec = false;
|
||||
|
||||
// recreation of sub61
|
||||
BeatAction.New(this.gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { StartClapLoop(beat, 1);}),
|
||||
|
||||
new BeatAction.Action(beat + (2f/3f), delegate { StartClapLoop(beat + (2f/3f), 0);}),
|
||||
new BeatAction.Action(beat + (2f/3f), delegate { StartClapLoop(beat + (2f/3f), 3);}),
|
||||
|
||||
new BeatAction.Action(beat + (2f/3f) + 0.25f, delegate { StartClapLoop(beat + (2f/3f) + 0.25f, 6);}),
|
||||
new BeatAction.Action(beat + (2f/3f) + 0.25f, delegate { StartClapLoop(beat + (2f/3f) + 0.25f, 8);}),
|
||||
|
||||
new BeatAction.Action(beat + (2f/3f) + 0.5f, delegate { StartClapLoop(beat + (2f/3f) + 0.5f, 7);}),
|
||||
new BeatAction.Action(beat + (2f/3f) + 0.5f, delegate { StartClapLoop(beat + (2f/3f) + 0.5f, 4);}),
|
||||
|
||||
new BeatAction.Action(beat + 1.5f, delegate { StartClapLoop(beat + 1.5f, 2);}),
|
||||
new BeatAction.Action(beat + 1.5f, delegate { StartClapLoop(beat + 1.5f, 11);}),
|
||||
|
||||
new BeatAction.Action(beat + 1.5f + (1f/3f), delegate { StartClapLoop(beat + 1.5f + (1f/3f), 5);}),
|
||||
new BeatAction.Action(beat + 1.5f + (1f/3f), delegate { StartClapLoop(beat + 1.5f + (1f/3f), 10);}),
|
||||
|
||||
new BeatAction.Action(beat + 2f + (1f/3f), delegate { StartClapLoop(beat + 2f + (1f/3f), 9);}),
|
||||
|
||||
// 0x113
|
||||
new BeatAction.Action(beat + 6f , delegate { CheckApplause();}),
|
||||
});
|
||||
|
||||
MultiSound.Play(new MultiSound.Sound[] {
|
||||
new MultiSound.Sound("fanClub/play_jump", beat, pitch: 1f, volume: 0.6f),
|
||||
new MultiSound.Sound("fanClub/play_jump", beat + (2f/3f), pitch: 0.98f, volume: 0.5f),
|
||||
new MultiSound.Sound("fanClub/play_jump", beat + (2f/3f) + 0.25f, pitch: UnityEngine.Random.Range(0.9f, 1.05f), volume: 0.6f),
|
||||
new MultiSound.Sound("fanClub/play_jump", beat + (2f/3f) + 0.5f, pitch: UnityEngine.Random.Range(0.9f, 1.05f), volume: 0.6f),
|
||||
new MultiSound.Sound("fanClub/play_jump", beat + 1.5f, pitch: UnityEngine.Random.Range(0.9f, 1.05f), volume: 0.6f),
|
||||
new MultiSound.Sound("fanClub/play_jump", beat + 1.5f + (1f/3f), pitch: UnityEngine.Random.Range(0.9f, 1.05f), volume: 0.6f),
|
||||
new MultiSound.Sound("fanClub/play_jump", beat + 2f + (1f/3f), pitch: UnityEngine.Random.Range(0.9f, 1.05f), volume: 0.6f),
|
||||
});
|
||||
}
|
||||
|
||||
void StartClapLoop(float beat, int who)
|
||||
{
|
||||
BeatAction.New(Spectators[who], new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { PlayOneClap(beat, who); }),
|
||||
new BeatAction.Action(beat + 0.5f, delegate { StartClapLoop(beat + 0.5f, who); }),
|
||||
});
|
||||
}
|
||||
|
||||
void CheckApplause()
|
||||
{
|
||||
if (!noJudgementInput)
|
||||
{
|
||||
AngerOnMiss();
|
||||
// fuck you
|
||||
FanClub.instance.ScoreMiss(69);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
231
Assets/Scripts/Games/FanClub/NtrIdolAmie.cs
Normal file
231
Assets/Scripts/Games/FanClub/NtrIdolAmie.cs
Normal file
@ -0,0 +1,231 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
using HeavenStudio.Util;
|
||||
|
||||
using static HeavenStudio.Games.FanClub;
|
||||
|
||||
namespace HeavenStudio.Games.Scripts_FanClub
|
||||
{
|
||||
public class NtrIdolAmie : MonoBehaviour
|
||||
{
|
||||
[Header("Params")]
|
||||
[SerializeField] float stepDistance = 1f;
|
||||
[SerializeField] float startPostion = 0f;
|
||||
[SerializeField] float rootYPos = 0f;
|
||||
|
||||
[Header("Objects")]
|
||||
[SerializeField] ParticleSystem clapEffect;
|
||||
[SerializeField] ParticleSystem winkEffect;
|
||||
[SerializeField] GameObject rootTransform;
|
||||
[SerializeField] GameObject shadow;
|
||||
|
||||
[Header("References")]
|
||||
public Material coreMat;
|
||||
|
||||
Animator anim;
|
||||
float startStepBeat = float.MaxValue;
|
||||
float stepLength = 16f;
|
||||
bool exiting = false;
|
||||
int currentAnim = 0;
|
||||
float startJumpTime = float.MinValue;
|
||||
bool hasJumped = false;
|
||||
|
||||
const int StepCount = 8;
|
||||
const int AnimCount = StepCount * 2;
|
||||
|
||||
Conductor cond;
|
||||
|
||||
private void Update() {
|
||||
if (cond.songPositionInBeatsAsDouble >= startStepBeat + stepLength)
|
||||
{
|
||||
FinishEntrance(exiting);
|
||||
startStepBeat = float.MaxValue;
|
||||
currentAnim = 0;
|
||||
}
|
||||
else if (cond.songPositionInBeatsAsDouble >= startStepBeat)
|
||||
{
|
||||
currentAnim = (int)((cond.songPositionInBeatsAsDouble - startStepBeat) / (stepLength / AnimCount));
|
||||
float startAnimBeat = startStepBeat + (stepLength / AnimCount) * currentAnim;
|
||||
float endAnimBeat = startAnimBeat + (stepLength / AnimCount);
|
||||
float prog = (float)((cond.songPositionInBeatsAsDouble - startAnimBeat - 0.75) / (endAnimBeat - startAnimBeat));
|
||||
prog = Mathf.Clamp01(prog * 4);
|
||||
if (exiting)
|
||||
{
|
||||
currentAnim = AnimCount - currentAnim;
|
||||
prog = (float)((cond.songPositionInBeatsAsDouble - startAnimBeat) / (endAnimBeat - startAnimBeat));
|
||||
prog = Mathf.Clamp01(prog * 4);
|
||||
}
|
||||
anim.DoScaledAnimation(currentAnim % 2 == 0 ? "WalkB" : "WalkA", startAnimBeat - (exiting ? 0.75f : 0), stepLength / AnimCount);
|
||||
if (exiting)
|
||||
rootTransform.transform.localPosition = new Vector3(startPostion + stepDistance * currentAnim - stepDistance * prog, rootYPos);
|
||||
else
|
||||
rootTransform.transform.localPosition = new Vector3(startPostion + stepDistance * currentAnim + stepDistance * prog, rootYPos);
|
||||
}
|
||||
|
||||
if (startStepBeat == float.MaxValue)
|
||||
{
|
||||
//idol jumping physics
|
||||
float jumpPos = cond.GetPositionFromBeat(startJumpTime, 1f);
|
||||
float IDOL_SHADOW_SCALE = 1.18f;
|
||||
if (cond.songPositionInBeats >= startJumpTime && cond.songPositionInBeats < startJumpTime + 1f)
|
||||
{
|
||||
hasJumped = true;
|
||||
float yMul = jumpPos * 2f - 1f;
|
||||
float yWeight = -(yMul*yMul) + 1f;
|
||||
rootTransform.transform.localPosition = new Vector3(startPostion + stepDistance * AnimCount, rootYPos + (2f * yWeight + 0.25f));
|
||||
shadow.transform.localScale = new Vector3((1f-yWeight*0.8f) * IDOL_SHADOW_SCALE, (1f-yWeight*0.8f) * IDOL_SHADOW_SCALE, 1f);
|
||||
|
||||
anim.DoScaledAnimation("Jump", startJumpTime, 1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
startJumpTime = float.MinValue;
|
||||
rootTransform.transform.localPosition = new Vector3(startPostion + stepDistance * AnimCount, rootYPos);
|
||||
shadow.transform.localScale = new Vector3(IDOL_SHADOW_SCALE, IDOL_SHADOW_SCALE, 1f);
|
||||
}
|
||||
}
|
||||
shadow.transform.localPosition = new Vector3(rootTransform.transform.localPosition.x, shadow.transform.localPosition.y);
|
||||
}
|
||||
|
||||
public void ClapParticle()
|
||||
{
|
||||
if (clapEffect == null) return;
|
||||
clapEffect.Play();
|
||||
}
|
||||
|
||||
public void WinkParticle()
|
||||
{
|
||||
if (winkEffect == null) return;
|
||||
winkEffect.Play();
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
rootTransform.SetActive(false);
|
||||
shadow.SetActive(false);
|
||||
|
||||
cond = Conductor.instance;
|
||||
anim = GetComponent<Animator>();
|
||||
}
|
||||
|
||||
public void StartEntrance(float beat, float length, bool exit) {
|
||||
gameObject.SetActive(true);
|
||||
rootTransform.SetActive(true);
|
||||
shadow.SetActive(true);
|
||||
|
||||
startStepBeat = beat;
|
||||
stepLength = length;
|
||||
|
||||
exiting = exit;
|
||||
if (exiting)
|
||||
{
|
||||
rootTransform.transform.localPosition = new Vector3(startPostion + stepDistance * AnimCount, rootYPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
rootTransform.transform.localPosition = new Vector3(startPostion, rootYPos);
|
||||
}
|
||||
}
|
||||
|
||||
public void FinishEntrance(bool exit) {
|
||||
exiting = exit;
|
||||
if (exiting)
|
||||
{
|
||||
rootTransform.transform.localPosition = new Vector3(startPostion, rootYPos);
|
||||
gameObject.SetActive(false);
|
||||
rootTransform.SetActive(false);
|
||||
shadow.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
rootTransform.transform.localPosition = new Vector3(startPostion + stepDistance * AnimCount, rootYPos);
|
||||
gameObject.SetActive(true);
|
||||
rootTransform.SetActive(true);
|
||||
shadow.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void ToSpot(bool unspot = true)
|
||||
{
|
||||
if (unspot)
|
||||
coreMat.SetColor("_Color", new Color(1, 1, 1, 1));
|
||||
else
|
||||
coreMat.SetColor("_Color", new Color(117/255f, 177/255f, 209/255f, 1));
|
||||
}
|
||||
|
||||
public void DoIdolJump(float beat)
|
||||
{
|
||||
if (startStepBeat != float.MaxValue) return;
|
||||
if (!gameObject.activeInHierarchy) return;
|
||||
startJumpTime = beat;
|
||||
|
||||
//play anim
|
||||
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
// new BeatAction.Action(beat, delegate { anim.Play("Jump", -1, 0); }),
|
||||
new BeatAction.Action(beat + 1f, delegate { anim.Play("Land", -1, 0); }),
|
||||
});
|
||||
}
|
||||
|
||||
public void PlayAnim(float beat, float length, int type)
|
||||
{
|
||||
if (startStepBeat != float.MaxValue) return;
|
||||
if (!gameObject.activeInHierarchy) return;
|
||||
startJumpTime = float.MinValue;
|
||||
// DisableResponse(beat, length + 0.5f);
|
||||
// DisableBop(beat, length + 0.5f);
|
||||
// DisableCall(beat, length + 0.5f);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case (int) IdolAnimations.Bop:
|
||||
anim.Play("Beat", -1, 0);
|
||||
break;
|
||||
case (int) IdolAnimations.PeaceVocal:
|
||||
anim.Play("Peace", -1, 0);
|
||||
break;
|
||||
case (int) IdolAnimations.Peace:
|
||||
anim.Play("Peace", -1, 0);
|
||||
break;
|
||||
case (int) IdolAnimations.Clap:
|
||||
anim.Play("Crap", -1, 0);
|
||||
break;
|
||||
case (int) IdolAnimations.Jump:
|
||||
DoIdolJump(beat);
|
||||
break;
|
||||
case (int) IdolAnimations.Squat:
|
||||
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { anim.Play("Squat0", -1, 0); }),
|
||||
new BeatAction.Action(beat + length, delegate { anim.Play("Squat1", -1, 0); }),
|
||||
});
|
||||
break;
|
||||
case (int) IdolAnimations.Wink:
|
||||
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat, delegate { anim.Play("Wink0", -1, 0); }),
|
||||
new BeatAction.Action(beat + length, delegate { anim.Play("Wink1", -1, 0); }),
|
||||
});
|
||||
break;
|
||||
case (int) IdolAnimations.Dab:
|
||||
anim.Play("Dab", -1, 0);
|
||||
break;
|
||||
case (int) IdolAnimations.Call:
|
||||
case (int) IdolAnimations.Response:
|
||||
case (int) IdolAnimations.BigCall:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void PlayAnimState(string state)
|
||||
{
|
||||
if (startStepBeat != float.MaxValue) return;
|
||||
if (!gameObject.activeInHierarchy) return;
|
||||
anim.Play(state, -1, 0);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Games/FanClub/NtrIdolAmie.cs.meta
Normal file
11
Assets/Scripts/Games/FanClub/NtrIdolAmie.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a70ba5b3324088f419aaf7284e75365c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -2,42 +2,45 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class NtrIdolAri : MonoBehaviour
|
||||
namespace HeavenStudio.Games.Scripts_FanClub
|
||||
{
|
||||
[Header("Objects")]
|
||||
public ParticleSystem idolClapEffect;
|
||||
public ParticleSystem idolWinkEffect;
|
||||
public ParticleSystem idolKissEffect;
|
||||
public ParticleSystem idolWinkArrEffect;
|
||||
|
||||
[Header("References")]
|
||||
public Material coreMat;
|
||||
|
||||
public void ClapParticle()
|
||||
public class NtrIdolAri : MonoBehaviour
|
||||
{
|
||||
idolClapEffect.Play();
|
||||
}
|
||||
[Header("Objects")]
|
||||
public ParticleSystem idolClapEffect;
|
||||
public ParticleSystem idolWinkEffect;
|
||||
public ParticleSystem idolKissEffect;
|
||||
public ParticleSystem idolWinkArrEffect;
|
||||
|
||||
public void WinkParticle()
|
||||
{
|
||||
idolWinkEffect.Play();
|
||||
}
|
||||
[Header("References")]
|
||||
public Material coreMat;
|
||||
|
||||
public void KissParticle()
|
||||
{
|
||||
idolKissEffect.Play();
|
||||
}
|
||||
public void ClapParticle()
|
||||
{
|
||||
idolClapEffect.Play();
|
||||
}
|
||||
|
||||
public void WinkArrangeParticle()
|
||||
{
|
||||
idolWinkArrEffect.Play();
|
||||
}
|
||||
public void WinkParticle()
|
||||
{
|
||||
idolWinkEffect.Play();
|
||||
}
|
||||
|
||||
public void ToSpot(bool unspot = true)
|
||||
{
|
||||
if (unspot)
|
||||
coreMat.SetColor("_AddColor", new Color(0, 0, 0, 0));
|
||||
else
|
||||
coreMat.SetColor("_AddColor", new Color(0, 100/255f, 200/255f, 0));
|
||||
public void KissParticle()
|
||||
{
|
||||
idolKissEffect.Play();
|
||||
}
|
||||
|
||||
public void WinkArrangeParticle()
|
||||
{
|
||||
idolWinkArrEffect.Play();
|
||||
}
|
||||
|
||||
public void ToSpot(bool unspot = true)
|
||||
{
|
||||
if (unspot)
|
||||
coreMat.SetColor("_AddColor", new Color(0, 0, 0, 0));
|
||||
else
|
||||
coreMat.SetColor("_AddColor", new Color(0, 100 / 255f, 200 / 255f, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -101,8 +101,15 @@ namespace HeavenStudio.Games.Scripts_FanClub
|
||||
{
|
||||
if (!FanClub.instance.IsExpectingInputNow(InputType.STANDARD_DOWN))
|
||||
{
|
||||
ClapStart(false);
|
||||
FanClub.instance.ScoreMiss();
|
||||
if (FanClub.instance.JudgementPaused)
|
||||
{
|
||||
ClapStart(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ClapStart(false);
|
||||
FanClub.instance.ScoreMiss();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (PlayerInput.Pressing())
|
||||
@ -118,8 +125,15 @@ namespace HeavenStudio.Games.Scripts_FanClub
|
||||
{
|
||||
if (clappingStartTime != Single.MinValue && cond.songPositionInBeats > clappingStartTime + 2f && stopCharge && !FanClub.instance.IsExpectingInputNow(InputType.STANDARD_UP))
|
||||
{
|
||||
JumpStart(false);
|
||||
FanClub.instance.ScoreMiss();
|
||||
if (FanClub.instance.JudgementPaused)
|
||||
{
|
||||
JumpStart(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
JumpStart(false);
|
||||
FanClub.instance.ScoreMiss();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -166,6 +180,11 @@ namespace HeavenStudio.Games.Scripts_FanClub
|
||||
FanClub.instance.AngerOnMiss();
|
||||
}
|
||||
|
||||
if (FanClub.instance.JudgementPaused)
|
||||
{
|
||||
FanClub.instance.JudgementInputPaused = true;
|
||||
}
|
||||
|
||||
var cond = Conductor.instance;
|
||||
hasJumped = false;
|
||||
stopBeat = true;
|
||||
|
@ -12,7 +12,7 @@ namespace HeavenStudio.Games.Loaders
|
||||
public static class NtrPingpongLoader
|
||||
{
|
||||
public static Minigame AddGame(EventCaller eventCaller) {
|
||||
return new Minigame("rhythmRally", "Rhythm Rally", "ffffff", true, false, new List<GameAction>()
|
||||
return new Minigame("rhythmRally", "Rhythm Rally", "ffffff", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("bop", "Bop")
|
||||
{
|
||||
|
@ -10,7 +10,7 @@ namespace HeavenStudio.Games.Loaders
|
||||
{
|
||||
public static Minigame AddGame(EventCaller eventCaller)
|
||||
{
|
||||
return new Minigame("tram&Pauline", "Tram & Pauline \n<color=#eb5454>[INITIALIZATION ONLY]</color>", "adb5e7", false, false, new List<GameAction>()
|
||||
return new Minigame("tram&Pauline", "Tram & Pauline \n<color=#eb5454>[INITIALIZATION ONLY]</color>", "adb5e7", true, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("curtains", "Curtains")
|
||||
{
|
||||
@ -27,7 +27,8 @@ namespace HeavenStudio.Games.Loaders
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -123,6 +123,7 @@ namespace HeavenStudio.Editor
|
||||
|
||||
public void AddIcon(Minigames.Minigame minigame)
|
||||
{
|
||||
if (minigame.hidden) return;
|
||||
GameObject GameIcon_ = Instantiate(GridGameSelector.GetChild(0).gameObject, GridGameSelector);
|
||||
GameIcon_.GetComponent<Image>().sprite = GameIcon(minigame.name);
|
||||
GameIcon_.GetComponent<GridGameSelectorGame>().MaskTex = GameIconMask(minigame.name);
|
||||
|
@ -25,7 +25,7 @@ namespace HeavenStudio
|
||||
public string displayName;
|
||||
public string color;
|
||||
public GameObject holder;
|
||||
public bool threeD;
|
||||
public bool hidden;
|
||||
public bool fxOnly;
|
||||
public List<GameAction> actions = new List<GameAction>();
|
||||
|
||||
@ -57,13 +57,13 @@ namespace HeavenStudio
|
||||
set => soundSequences = value;
|
||||
}
|
||||
|
||||
public Minigame(string name, string displayName, string color, bool threeD, bool fxOnly, List<GameAction> actions, List<string> tags = null, string assetBundle = "", string defaultLocale = "en", List<string> supportedLocales = null, bool inferred = false)
|
||||
public Minigame(string name, string displayName, string color, bool hidden, bool fxOnly, List<GameAction> actions, List<string> tags = null, string assetBundle = "", string defaultLocale = "en", List<string> supportedLocales = null, bool inferred = false)
|
||||
{
|
||||
this.name = name;
|
||||
this.displayName = displayName;
|
||||
this.color = color;
|
||||
this.actions = actions;
|
||||
this.threeD = threeD;
|
||||
this.hidden = hidden;
|
||||
this.fxOnly = fxOnly;
|
||||
|
||||
this.tags = tags ?? new List<string>();
|
||||
|
Reference in New Issue
Block a user