mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-15 06:05:10 +00:00
Merge branch 'release_1'
This commit is contained in:
commit
1545495633
2 changed files with 58 additions and 34 deletions
|
@ -159,7 +159,8 @@ namespace HeavenStudio.Games
|
||||||
{
|
{
|
||||||
public int expression;
|
public int expression;
|
||||||
public double beat;
|
public double beat;
|
||||||
public Reaction(int expression, double beat) {
|
public Reaction(int expression, double beat)
|
||||||
|
{
|
||||||
this.expression = expression;
|
this.expression = expression;
|
||||||
this.beat = beat;
|
this.beat = beat;
|
||||||
}
|
}
|
||||||
|
@ -260,7 +261,7 @@ namespace HeavenStudio.Games
|
||||||
float normalizedBeat = cond.GetPositionFromBeat(gearEase.beat, gearEase.length);
|
float normalizedBeat = cond.GetPositionFromBeat(gearEase.beat, gearEase.length);
|
||||||
Util.EasingFunction.Function func = Util.EasingFunction.GetEasingFunction(gearEase.ease);
|
Util.EasingFunction.Function func = Util.EasingFunction.GetEasingFunction(gearEase.ease);
|
||||||
currentGearSpeed = func(oldGearSpeed, newGearSpeed, normalizedBeat);
|
currentGearSpeed = func(oldGearSpeed, newGearSpeed, normalizedBeat);
|
||||||
if (normalizedBeat >= 1) cartEase.length = 0;
|
if (normalizedBeat >= 1) gearEase.length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cartEase.length != 0)
|
if (cartEase.length != 0)
|
||||||
|
@ -268,24 +269,32 @@ namespace HeavenStudio.Games
|
||||||
float normalizedBeat = cond.GetPositionFromBeat(cartEase.beat, cartEase.length);
|
float normalizedBeat = cond.GetPositionFromBeat(cartEase.beat, cartEase.length);
|
||||||
Util.EasingFunction.Function func = Util.EasingFunction.GetEasingFunction(cartEase.ease);
|
Util.EasingFunction.Function func = Util.EasingFunction.GetEasingFunction(cartEase.ease);
|
||||||
float newPos = func(0f, 1f, normalizedBeat);
|
float newPos = func(0f, 1f, normalizedBeat);
|
||||||
|
Debug.Log($"{normalizedBeat}, {newPos}");
|
||||||
CartGuyParentAnim.DoNormalizedAnimation($"Move{cartDir}", newPos);
|
CartGuyParentAnim.DoNormalizedAnimation($"Move{cartDir}", newPos);
|
||||||
if (normalizedBeat >= 1) cartEase.length = 0;
|
if (normalizedBeat >= 1) cartEase.length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CartGuyParentAnim.gameObject.SetActive(cartEase.length != 0);
|
CartGuyParentAnim.gameObject.SetActive(cartEase.length != 0);
|
||||||
|
|
||||||
if (cond.isPlaying && !cond.isPaused) {
|
if (cond.isPlaying && !cond.isPaused)
|
||||||
foreach (Transform gear in Gears) {
|
{
|
||||||
|
foreach (Transform gear in Gears)
|
||||||
|
{
|
||||||
double newZ = Time.deltaTime * currentGearSpeed * 50 * (gear.name == "Big" ? -1 : 1) / cond.pitchedSecPerBeat;
|
double newZ = Time.deltaTime * currentGearSpeed * 50 * (gear.name == "Big" ? -1 : 1) / cond.pitchedSecPerBeat;
|
||||||
gear.Rotate(new Vector3(0, 0, (float)newZ));
|
gear.Rotate(new Vector3(0, 0, (float)newZ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cond.isPlaying) {
|
if (cond.isPlaying)
|
||||||
|
{
|
||||||
MeatSplash.Play();
|
MeatSplash.Play();
|
||||||
} else if (cond.isPaused) {
|
}
|
||||||
|
else if (cond.isPaused)
|
||||||
|
{
|
||||||
MeatSplash.Pause();
|
MeatSplash.Pause();
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
MeatSplash.Stop();
|
MeatSplash.Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -297,11 +306,15 @@ namespace HeavenStudio.Games
|
||||||
BossAnim.DoScaledAnimationAsync(bossAnnoyed ? "BossMiss" : "Bop", 0.5f);
|
BossAnim.DoScaledAnimationAsync(bossAnnoyed ? "BossMiss" : "Bop", 0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CartGuyParentAnim.gameObject.activeSelf) {
|
if (CartGuyParentAnim.gameObject.activeSelf)
|
||||||
|
{
|
||||||
// Debug.Log(cartPhone ? "PhoneBop" : "Bop");
|
// Debug.Log(cartPhone ? "PhoneBop" : "Bop");
|
||||||
if (cartPhone) {
|
if (cartPhone)
|
||||||
|
{
|
||||||
CartGuyAnim.DoScaledAnimationAsync("PhoneBop", 0.5f);
|
CartGuyAnim.DoScaledAnimationAsync("PhoneBop", 0.5f);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
CartGuyAnim.DoScaledAnimationAsync("Bop", 0.5f);
|
CartGuyAnim.DoScaledAnimationAsync("Bop", 0.5f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -326,15 +339,18 @@ namespace HeavenStudio.Games
|
||||||
{
|
{
|
||||||
List<RiqEntity> allEntities = GameManager.instance.Beatmap.Entities.FindAll(c => c.datamodel.Split('/')[0] == "meatGrinder");
|
List<RiqEntity> allEntities = GameManager.instance.Beatmap.Entities.FindAll(c => c.datamodel.Split('/')[0] == "meatGrinder");
|
||||||
RiqEntity cg = allEntities.Find(c => c.datamodel == "meatGrinder/cartGuy");
|
RiqEntity cg = allEntities.Find(c => c.datamodel == "meatGrinder/cartGuy");
|
||||||
if (cg != null) {
|
if (cg != null)
|
||||||
|
{
|
||||||
CartGuy(cg.beat, cg.length, cg["spider"], cg["direction"], cg["ease"]);
|
CartGuy(cg.beat, cg.length, cg["spider"], cg["direction"], cg["ease"]);
|
||||||
}
|
}
|
||||||
RiqEntity gr = allEntities.Find(c => c.datamodel == "meatGrinder/gears");
|
RiqEntity gr = allEntities.Find(c => c.datamodel == "meatGrinder/gears");
|
||||||
if (gr != null) {
|
if (gr != null)
|
||||||
|
{
|
||||||
ChangeGears(gr.beat, gr.length, gr["ease"], gr["speed"]);
|
ChangeGears(gr.beat, gr.length, gr["ease"], gr["speed"]);
|
||||||
}
|
}
|
||||||
List<RiqEntity> meats = allEntities.FindAll(c => c.datamodel == "meatGrinder/MeatToss" && beat > c.beat && beat < c.beat + 1);
|
List<RiqEntity> meats = allEntities.FindAll(c => c.datamodel == "meatGrinder/MeatToss" && beat > c.beat && beat < c.beat + 1);
|
||||||
foreach (var meat in meats) {
|
foreach (var meat in meats)
|
||||||
|
{
|
||||||
MeatToss(meat.beat, meat["bacon"], meat["tackReaction"], meat["tackReactionBeats"], meat["bossReaction"], meat["bossReactionBeats"]);
|
MeatToss(meat.beat, meat["bacon"], meat["tackReaction"], meat["tackReactionBeats"], meat["bossReaction"], meat["bossReactionBeats"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -352,8 +368,10 @@ namespace HeavenStudio.Games
|
||||||
var actions = new List<BeatAction.Action>();
|
var actions = new List<BeatAction.Action>();
|
||||||
for (int i = 0; i < length; i++)
|
for (int i = 0; i < length; i++)
|
||||||
{
|
{
|
||||||
actions.Add(new BeatAction.Action(beat + i, delegate {
|
actions.Add(new BeatAction.Action(beat + i, delegate
|
||||||
if (!BossAnim.IsPlayingAnimationNames("BossCall", "BossSignal")) {
|
{
|
||||||
|
if (!BossAnim.IsPlayingAnimationNames("BossCall", "BossSignal"))
|
||||||
|
{
|
||||||
BossAnim.DoScaledAnimationAsync(bossAnnoyed ? "BossMiss" : "Bop", 0.5f);
|
BossAnim.DoScaledAnimationAsync(bossAnnoyed ? "BossMiss" : "Bop", 0.5f);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
@ -364,11 +382,13 @@ namespace HeavenStudio.Games
|
||||||
|
|
||||||
public void DoExpressions(int tackExpression, int bossExpression = 0)
|
public void DoExpressions(int tackExpression, int bossExpression = 0)
|
||||||
{
|
{
|
||||||
if (tackExpression != (int)TackExpressions.None) {
|
if (tackExpression != (int)TackExpressions.None)
|
||||||
|
{
|
||||||
string tackAnim = ((TackExpressions)tackExpression).ToString();
|
string tackAnim = ((TackExpressions)tackExpression).ToString();
|
||||||
TackAnim.DoScaledAnimationAsync("Tack" + tackAnim, 0.5f);
|
TackAnim.DoScaledAnimationAsync("Tack" + tackAnim, 0.5f);
|
||||||
}
|
}
|
||||||
if (bossExpression != (int)BossExpressions.None) {
|
if (bossExpression != (int)BossExpressions.None)
|
||||||
|
{
|
||||||
string bossAnim = ((BossExpressions)bossExpression).ToString();
|
string bossAnim = ((BossExpressions)bossExpression).ToString();
|
||||||
BossAnim.DoScaledAnimationAsync("Boss" + bossAnim, 0.5f);
|
BossAnim.DoScaledAnimationAsync("Boss" + bossAnim, 0.5f);
|
||||||
}
|
}
|
||||||
|
@ -376,21 +396,24 @@ namespace HeavenStudio.Games
|
||||||
|
|
||||||
public void CartGuy(double beat, float length, bool spider, int direction, int ease)
|
public void CartGuy(double beat, float length, bool spider, int direction, int ease)
|
||||||
{
|
{
|
||||||
cartEase = new() {
|
cartPhone = spider;
|
||||||
|
cartDir = direction == 0 ? "Right" : "Left";
|
||||||
|
if (cartPhone)
|
||||||
|
{
|
||||||
|
CartGuyAnim.Play("Phone", 0, 0);
|
||||||
|
}
|
||||||
|
cartEase = new()
|
||||||
|
{
|
||||||
beat = beat,
|
beat = beat,
|
||||||
length = length,
|
length = length,
|
||||||
ease = (Util.EasingFunction.Ease)ease,
|
ease = (Util.EasingFunction.Ease)ease,
|
||||||
};
|
};
|
||||||
cartPhone = spider;
|
|
||||||
cartDir = direction == 0 ? "Right" : "Left";
|
|
||||||
if (cartPhone) {
|
|
||||||
CartGuyAnim.Play("Phone", 0, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ChangeGears(double beat, float length, int ease, float speed)
|
public void ChangeGears(double beat, float length, int ease, float speed)
|
||||||
{
|
{
|
||||||
gearEase = new() {
|
gearEase = new()
|
||||||
|
{
|
||||||
beat = beat,
|
beat = beat,
|
||||||
length = length,
|
length = length,
|
||||||
ease = (Util.EasingFunction.Ease)ease,
|
ease = (Util.EasingFunction.Ease)ease,
|
||||||
|
@ -487,7 +510,8 @@ namespace HeavenStudio.Games
|
||||||
|
|
||||||
private void PassTurn(double beat, double intervalBeat, float intervalLength, List<RiqEntity> allCallEvents = null)
|
private void PassTurn(double beat, double intervalBeat, float intervalLength, List<RiqEntity> allCallEvents = null)
|
||||||
{
|
{
|
||||||
if (allCallEvents == null) {
|
if (allCallEvents == null)
|
||||||
|
{
|
||||||
allCallEvents = GetRelevantMeatCallsBetweenBeat(intervalBeat, intervalBeat + intervalLength);
|
allCallEvents = GetRelevantMeatCallsBetweenBeat(intervalBeat, intervalBeat + intervalLength);
|
||||||
allCallEvents.Sort((x, y) => x.beat.CompareTo(y.beat));
|
allCallEvents.Sort((x, y) => x.beat.CompareTo(y.beat));
|
||||||
}
|
}
|
||||||
|
|
|
@ -260,13 +260,6 @@ namespace HeavenStudio
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
epilogueFrame.sprite = rank switch
|
|
||||||
{
|
|
||||||
Rank.Ok => epilogueFrmOk,
|
|
||||||
Rank.Hi => epilogueFrmHi,
|
|
||||||
_ => epilogueFrmNg
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
header.text = playedBeatmap != null ? playedBeatmap["resultcaption"] : "Rhythm League Notes";
|
header.text = playedBeatmap != null ? playedBeatmap["resultcaption"] : "Rhythm League Notes";
|
||||||
|
@ -303,6 +296,13 @@ namespace HeavenStudio
|
||||||
imageResource = playedBeatmap != null ? playedBeatmap["epilogue_hi_res"] : null;
|
imageResource = playedBeatmap != null ? playedBeatmap["epilogue_hi_res"] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
epilogueFrame.sprite = rank switch
|
||||||
|
{
|
||||||
|
Rank.Ok => epilogueFrmOk,
|
||||||
|
Rank.Hi => epilogueFrmHi,
|
||||||
|
_ => epilogueFrmNg
|
||||||
|
};
|
||||||
|
|
||||||
if (imageResource != null)
|
if (imageResource != null)
|
||||||
{
|
{
|
||||||
imagePath = imageResource.Value.path;
|
imagePath = imageResource.Value.path;
|
||||||
|
|
Loading…
Reference in a new issue