joe prepare animation

- bg effect preview (buggy)
- adjusted path of hit items
- adjusted particle limits and spawning
- rain is now affected by wind
- cont. work on joe expressions

- animation helper sync scale now plays thru events properly
- adjusted timing windows
This commit is contained in:
minenice55
2022-08-07 19:40:06 -04:00
parent bd0d05772a
commit 3f7af6a0eb
9 changed files with 278 additions and 145 deletions

View File

@ -13,7 +13,10 @@ namespace HeavenStudio.Games.Loaders
public static Minigame AddGame(EventCaller eventCaller) {
return new Minigame("karateman", "Karate Man [INDEV REWORK]", "70A8D8", false, false, new List<GameAction>()
{
new GameAction("bop", delegate { }, 0.5f, true),
new GameAction("bop", delegate { KarateMan.instance.ToggleBop(eventCaller.currentEntity.toggle); }, 0.5f, true, new List<Param>()
{
new Param("toggle", true, "Bop", "Whether to bop to the beat or not")
}),
new GameAction("hit", delegate { var e = eventCaller.currentEntity; KarateMan.instance.CreateItem(e.beat, e.type); }, 2, false,
new List<Param>()
{
@ -32,7 +35,7 @@ namespace HeavenStudio.Games.Loaders
{
new Param("type", KarateMan.HitThree.HitThree, "Type", "The warning text to show")
}),
new GameAction("prepare", delegate { }, 1f, true),
new GameAction("prepare", delegate { var e = eventCaller.currentEntity; KarateMan.instance.Prepare(e.beat, e.length);}, 1f, true),
new GameAction("set background effects", delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetBgAndShadowCol(e.beat, e.length, e.type, e.type2, e.colorA, e.colorB, e.type3); }, 0.5f, true, new List<Param>()
{
new Param("type", KarateMan.BackgroundType.Yellow, "Background Type", "The preset background type"),
@ -56,8 +59,8 @@ namespace HeavenStudio.Games.Loaders
new GameAction("particle effects", delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetParticleEffect(e.beat, e.type, e.valA, e.valB); }, 0.5f, false, new List<Param>()
{
new Param("type", KarateMan.ParticleType.None, "Particle Type", "The type of particle effect to spawn. Using \"None\" will stop all effects"),
new Param("valA", new EntityTypes.Float(0f, 64f, 1f), "Wind Strength", "The strength of the particle wind. (Does not work on the Rain particle.)"),
new Param("valB", new EntityTypes.Float(1f, 12f, 1f), "Particle Intensity", "The intensity of the particle effect")
new Param("valA", new EntityTypes.Float(0f, 64f, 1f), "Wind Strength", "The strength of the particle wind"),
new Param("valB", new EntityTypes.Float(1f, 16f, 1f), "Particle Intensity", "The intensity of the particle effect")
}),
new GameAction("force facial expression", delegate { KarateMan.instance.SetFaceExpression(eventCaller.currentEntity.type); }, 0.5f, false, new List<Param>()
{
@ -280,6 +283,9 @@ namespace HeavenStudio.Games
private void Update()
{
var cond = Conductor.instance;
if (!cond.isPlaying)
SetBgEffectsToLast(cond.songPositionInBeats);
switch (currentBgEffect)
{
case BackgroundFXType.Sunburst:
@ -365,68 +371,80 @@ namespace HeavenStudio.Games
cameraReturnLength = Mathf.Min(2f, length*0.5f);
}
public void DoWord(float beat, int type)
public void DoWord(float beat, int type, bool doSound = true)
{
String word = "NoPose";
float clear = 0f;
switch (type)
{
case (int) HitThree.HitTwo:
Word.Play("Word02");
wordClearTime = beat + 4f;
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
new MultiSound.Sound("karateman/two", beat + 1f),
}, forcePlay: true);
word = "Word02";
clear = beat + 4f;
if (doSound)
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
new MultiSound.Sound("karateman/two", beat + 1f),
}, forcePlay: true);
break;
case (int) HitThree.HitThree:
Word.Play("Word03");
wordClearTime = beat + 4f;
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
new MultiSound.Sound("karateman/three", beat + 1f),
}, forcePlay: true);
word = "Word03";
clear = beat + 4f;
if (doSound)
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
new MultiSound.Sound("karateman/three", beat + 1f),
}, forcePlay: true);
break;
case (int) HitThree.HitThreeAlt:
Word.Play("Word03");
wordClearTime = beat + 4f;
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/hitAlt", beat + 0.5f, offset: hitVoiceOffset),
new MultiSound.Sound("karateman/threeAlt", beat + 1f),
}, forcePlay: true);
word = "Word03";
clear = beat + 4f;
if (doSound)
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/hitAlt", beat + 0.5f, offset: hitVoiceOffset),
new MultiSound.Sound("karateman/threeAlt", beat + 1f),
}, forcePlay: true);
break;
case (int) HitThree.HitFour:
Word.Play("Word04");
wordClearTime = beat + 4f;
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
new MultiSound.Sound("karateman/four", beat + 1f),
}, forcePlay: true);
word = "Word04";
clear = beat + 4f;
if (doSound)
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
new MultiSound.Sound("karateman/four", beat + 1f),
}, forcePlay: true);
break;
case (int) HitThree.Grr:
Word.Play("Word01");
wordClearTime = beat + 1f;
word = "Word01";
clear = beat + 1f;
break;
case (int) HitThree.Warning:
Word.Play("Word05");
wordClearTime = beat + 1f;
word = "Word05";
clear = beat + 1f;
break;
case (int) HitThree.Combo:
Word.Play("Word00");
wordClearTime = beat + 3f;
word = "Word00";
clear = beat + 3f;
break;
case (int) HitThree.HitOne: //really?
Word.Play("Word06");
wordClearTime = beat + 4f;
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
new MultiSound.Sound("karateman/one", beat + 1f),
}, forcePlay: true);
word = "Word06";
clear = beat + 4f;
if (doSound)
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("karateman/hit", beat + 0.5f, offset: hitVoiceOffset),
new MultiSound.Sound("karateman/one", beat + 1f),
}, forcePlay: true);
break;
}
if (Conductor.instance.songPositionInBeats <= clear && Conductor.instance.songPositionInBeats >= beat)
{
Word.Play(word);
wordClearTime = clear;
}
}
public void CreateItem(float beat, int type)
@ -545,6 +563,37 @@ namespace HeavenStudio.Games
return mobj;
}
void SetBgEffectsToLast(float beat)
{
var bgfx = GameManager.instance.Beatmap.entities.FindAll(en => en.datamodel == "karateman/set background effects");
for (int i = 0; i < bgfx.Count; i++)
{
var e = bgfx[i];
if (e.beat > beat)
break;
SetBgAndShadowCol(e.beat, e.length, e.type, e.type2, e.colorA, e.colorB, e.type3);
}
var bgtex = GameManager.instance.Beatmap.entities.FindAll(en => en.datamodel == "karateman/set background texture");
for (int i = 0; i < bgtex.Count; i++)
{
var e = bgtex[i];
if (e.beat > beat)
break;
SetBgTexture(e.type, e.type2, e.colorA, e.colorB);
}
// has issues when creating a new hitx entity so this is deactivated for now
// var hitx = GameManager.instance.Beatmap.entities.FindAll(en => en.datamodel == "karateman/hitX");
// for (int i = 0; i < hitx.Count; i++)
// {
// var e = hitx[i];
// if (e.beat > beat)
// break;
// Debug.Log("hitx");
// DoWord(e.beat, e.type, false);
// }
}
public void SetBgAndShadowCol(float beat, float length, int bgType, int shadowType, Color a, Color b, int fx)
{
SetBgFx(fx, beat, length);
@ -629,7 +678,6 @@ namespace HeavenStudio.Games
float fadeProg = Conductor.instance.GetPositionFromBeat(bgFadeTime, bgFadeDuration);
if (fadeProg <= 1f && fadeProg >= 0)
{
Debug.Log(fadeProg);
return Color.LerpUnclamped(lastCol, nextCol, fadeProg);
}
return next ? nextCol : lastCol;
@ -651,20 +699,20 @@ namespace HeavenStudio.Games
public void SetParticleEffect(float beat, int type, float windStrength, float particleStrength)
{
ParticleSystem.EmissionModule emm = SnowEffect.emission;
ParticleSystem.EmissionModule emm;
switch (type)
{
case (int) ParticleType.Snow:
SnowEffectGO.SetActive(true);
SnowEffect.Play();
emm = SnowEffect.emission;
emm.rateOverTime = particleStrength * 16f;
emm.rateOverTime = particleStrength * 6f;
break;
case (int) ParticleType.Fire:
FireEffectGO.SetActive(true);
FireEffect.Play();
emm = FireEffect.emission;
emm.rateOverTime = particleStrength * 8f;
emm.rateOverTime = particleStrength * 6f;
break;
case (int) ParticleType.Rain:
RainEffectGO.SetActive(true);
@ -681,6 +729,19 @@ namespace HeavenStudio.Games
Wind.windMain = windStrength;
}
public void ToggleBop(bool toggle)
{
if (toggle)
Joe.bop.length = Single.MaxValue;
else
Joe.bop.length = 0;
}
public void Prepare(float beat, float length)
{
Joe.Prepare(beat, length);
}
public void SetFaceExpression(int face)
{
Joe.SetFaceExpression(face);

View File

@ -30,9 +30,11 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public bool wantKick = false;
public bool inKick = false;
float lastChargeTime = Single.MinValue;
float unPrepareTime = Single.MinValue;
bool canEmote = false;
public int wantFace = 0;
bool inSpecial { get { return inCombo || Conductor.instance.GetPositionFromBeat(lastChargeTime, 2.75f) <= 0.25f; } }
bool inSpecial { get { return inCombo || lockedInCombo || Conductor.instance.GetPositionFromBeat(lastChargeTime, 2.75f) <= 0.25f; } }
private void Awake()
{
@ -42,7 +44,15 @@ namespace HeavenStudio.Games.Scripts_KarateMan
private void Update()
{
var cond = Conductor.instance;
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1, false) && cond.songPositionInBeats > bop.startBeat && !inCombo)
if (unPrepareTime != Single.MinValue && cond.songPositionInBeats >= unPrepareTime)
{
unPrepareTime = Single.MinValue;
anim.speed = 1f;
anim.Play("Beat", -1, 0);
}
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1, false) && cond.songPositionInBeats > bop.startBeat && cond.songPositionInBeats >= unPrepareTime && !inCombo)
{
anim.speed = 1f;
anim.Play("Beat", -1, 0);
@ -127,6 +137,12 @@ namespace HeavenStudio.Games.Scripts_KarateMan
}
UpdateShadowColour();
if (canEmote && wantFace >= 0)
{
SetFaceExpressionForced(wantFace);
if (wantFace == (int) KarateMan.KarateManFaces.Surprise) wantFace = -1;
}
}
public bool Punch(int forceHand = 0)
@ -136,6 +152,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
bool straight = false;
anim.speed = 1f;
unPrepareTime = Single.MinValue;
lastChargeTime = Single.MinValue;
inKick = false;
@ -171,6 +188,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
if (GameManager.instance.currentGame != "karateman") return;
var cond = Conductor.instance;
bop.startBeat = cond.songPositionInBeats + 1f;
unPrepareTime = Single.MinValue;
switch (seq)
{
case 0:
@ -201,6 +219,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan
var cond = Conductor.instance;
lastComboMissTime = beat;
bop.startBeat = beat + 3f;
unPrepareTime = Single.MinValue;
anim.DoNormalizedAnimation("LowKickMiss");
}
public void ForceFailCombo(float beat)
@ -226,6 +246,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public void StartKickCharge(float beat)
{
wantKick = true;
unPrepareTime = Single.MinValue;
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate {
@ -245,7 +266,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan
if (!inKick) return;
//play the kick animation and reset stance
anim.speed = 1f;
bop.startBeat = beat + 2.5f;
bop.startBeat = beat + 1f;
unPrepareTime = Single.MinValue;
lastChargeTime = Single.MinValue;
inKick = false;
@ -270,13 +292,22 @@ namespace HeavenStudio.Games.Scripts_KarateMan
}
}
public void Prepare(float beat, float length)
{
anim.speed = 0f;
anim.Play("Beat", -1, 0);
unPrepareTime = beat + length;
}
public void SetFaceExpressionForced(int face)
{
wantFace = -2;
FaceAnim.DoScaledAnimationAsync("Face" + face.ToString("D2"));
}
public void SetFaceExpression(int face, bool ignoreCheck = false)
{
wantFace = face;
if (canEmote || ignoreCheck)
FaceAnim.DoScaledAnimationAsync("Face" + face.ToString("D2"));
}

View File

@ -239,7 +239,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
if (prog <= 1f)
{
transform.position = CurrentCurve.GetPoint(prog);
transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (-180f * Time.deltaTime * (1/cond.pitchedSecPerBeat)));
transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (-270f * Time.deltaTime * (1/cond.pitchedSecPerBeat)));
}
else
{
@ -298,7 +298,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
{
case ItemType.Bulb:
CurrentCurve = ItemCurves[straight ? 1 : 0];
curveTargetBeat = 2f;
curveTargetBeat = straight ? 1f : 1.5f;;
Jukebox.PlayOneShotGame("karateman/lightbulbHit", forcePlay: true);
p = Instantiate(HitParticles[5], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
@ -322,21 +322,21 @@ namespace HeavenStudio.Games.Scripts_KarateMan
break;
case ItemType.Rock:
CurrentCurve = ItemCurves[1];
curveTargetBeat = 2f;
curveTargetBeat = 1f;
Jukebox.PlayOneShotGame("karateman/rockHit", forcePlay: true);
p = Instantiate(HitParticles[4], HitPosition[1].position, Quaternion.identity, KarateMan.instance.ItemHolder);
p.Play();
break;
case ItemType.Ball:
CurrentCurve = ItemCurves[1];
curveTargetBeat = 2f;
curveTargetBeat = 1f;
Jukebox.PlayOneShotGame("karateman/soccerHit", forcePlay: true);
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
p.Play();
break;
case ItemType.Cooking:
CurrentCurve = ItemCurves[1];
curveTargetBeat = 2f;
curveTargetBeat = 1f;
Jukebox.PlayOneShotGame("karateman/cookingPot", forcePlay: true);
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
p.Play();
@ -345,14 +345,14 @@ namespace HeavenStudio.Games.Scripts_KarateMan
break;
case ItemType.Alien:
CurrentCurve = ItemCurves[1];
curveTargetBeat = 2f;
curveTargetBeat = 1f;
Jukebox.PlayOneShotGame("karateman/alienHit", forcePlay: true);
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
p.Play();
break;
case ItemType.TacoBell:
CurrentCurve = ItemCurves[1];
curveTargetBeat = 2f;
curveTargetBeat = 1f;
Jukebox.PlayOneShotGame("karateman/rockHit", forcePlay: true);
Jukebox.PlayOneShotGame("karateman/tacobell", forcePlay: true);
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
@ -360,14 +360,14 @@ namespace HeavenStudio.Games.Scripts_KarateMan
break;
case ItemType.ComboPot1:
CurrentCurve = ItemCurves[straight ? 1 : 0];
curveTargetBeat = 2f;
curveTargetBeat = 1.5f;
Jukebox.PlayOneShotGame("karateman/comboHit1", forcePlay: true);
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
p.Play();
break;
case ItemType.ComboPot2:
CurrentCurve = ItemCurves[0];
curveTargetBeat = 2f;
curveTargetBeat = 1.5f;
Jukebox.PlayOneShotGame("karateman/comboHit1", forcePlay: true);
p = Instantiate(HitParticles[1], HitPosition[1].position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0f, 360f)), KarateMan.instance.ItemHolder);
p.Play();
@ -415,7 +415,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
break;
default:
CurrentCurve = ItemCurves[straight ? 1 : 0];
curveTargetBeat = 2f;
curveTargetBeat = straight ? 1f : 1.5f;
Jukebox.PlayOneShotGame("karateman/potHit", forcePlay: true);
p = Instantiate(HitParticles[3], HitPosition[1].position, Quaternion.identity, KarateMan.instance.ItemHolder);
p.Play();
@ -505,7 +505,14 @@ namespace HeavenStudio.Games.Scripts_KarateMan
curveTargetBeat = 1f;
Jukebox.PlayOneShot("miss");
status = FlyStatus.NG;
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Sad);
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 2f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Normal);
}),
});
}
else {
ItemHitEffect(straight);
@ -532,6 +539,16 @@ namespace HeavenStudio.Games.Scripts_KarateMan
else {
ItemHitEffect();
}
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 4f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Sad);
}),
new BeatAction.Action(startBeat + 6f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Normal);
}),
});
}
}
@ -539,15 +556,20 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public void ItemThrough(PlayerActionEvent caller)
{
var joe = KarateMan.instance.Joe;
if (GameManager.instance.currentGame != "karateman") return;
if (status != FlyStatus.Fly || gameObject == null) return;
BeatAction.New(KarateMan.instance.Joe.gameObject, new List<BeatAction.Action>()
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 2f, delegate {
//TODO: play miss sound
//deduct flow if applicable
KarateMan.instance.Joe.SetFaceExpression((int) KarateMan.KarateManFaces.Surprise);
})
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Surprise);
}),
new BeatAction.Action(startBeat + 6f, delegate {
if (joe.wantFace == -1)
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Normal);
}),
});
}
@ -576,15 +598,20 @@ namespace HeavenStudio.Games.Scripts_KarateMan
public void ComboStartOut(PlayerActionEvent caller) {}
public void ComboStartThrough(PlayerActionEvent caller)
{
var joe = KarateMan.instance.Joe;
if (GameManager.instance.currentGame != "karateman") return;
if (status != FlyStatus.Fly || gameObject == null) return;
BeatAction.New(KarateMan.instance.Joe.gameObject, new List<BeatAction.Action>()
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 2f, delegate {
//TODO: play miss sound
//deduct flow if applicable
KarateMan.instance.Joe.SetFaceExpression((int) KarateMan.KarateManFaces.Surprise);
})
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Surprise);
}),
new BeatAction.Action(startBeat + 6f, delegate {
if (joe.wantFace == -1)
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Normal);
}),
});
}
@ -629,7 +656,10 @@ namespace HeavenStudio.Games.Scripts_KarateMan
{
new BeatAction.Action(startBeat + 2f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Sad);
})
}),
new BeatAction.Action(startBeat + 6f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Normal);
}),
});
}
else {
@ -661,11 +691,16 @@ namespace HeavenStudio.Games.Scripts_KarateMan
//TODO: play miss sound
//deduct flow if applicable
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Surprise);
})
}),
new BeatAction.Action(startBeat + 6f, delegate {
if (joe.wantFace == -1)
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Normal);
}),
});
}
else
{
joe.SetFaceExpression((int) KarateMan.KarateManFaces.VerySad);
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 1.5f, delegate {
@ -674,8 +709,11 @@ namespace HeavenStudio.Games.Scripts_KarateMan
joe.SetShouldComboId(-1);
joe.ComboSequence(4);
}),
new BeatAction.Action(startBeat + 2.5f, delegate {
new BeatAction.Action(startBeat + 2f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.VerySad);
}),
new BeatAction.Action(startBeat + 5f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Normal);
})
});
}
@ -704,8 +742,15 @@ namespace HeavenStudio.Games.Scripts_KarateMan
CurrentCurve = ItemCurves[6];
curveTargetBeat = 1f;
Jukebox.PlayOneShot("miss");
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Sad);
status = FlyStatus.NG;
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Sad);
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 2f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Normal);
}),
});
}
else {
joe.StartKickCharge(startBeat + 1.25f);
@ -728,7 +773,11 @@ namespace HeavenStudio.Games.Scripts_KarateMan
//TODO: play miss sound
//deduct flow if applicable
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Surprise);
})
}),
new BeatAction.Action(startBeat + 6f, delegate {
if (joe.wantFace == -1)
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Normal);
}),
});
}
@ -743,8 +792,17 @@ namespace HeavenStudio.Games.Scripts_KarateMan
CurrentCurve = ItemCurves[8];
curveTargetBeat = 1f;
Jukebox.PlayOneShot("miss");
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Sad);
status = FlyStatus.NG;
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 1.25f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Sad);
}),
new BeatAction.Action(startBeat + 4.25f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Normal);
}),
});
}
else {
ItemHitEffect();
@ -753,12 +811,13 @@ namespace HeavenStudio.Games.Scripts_KarateMan
startBeat = Conductor.instance.songPositionInBeats;
curveTargetBeat = 3f;
BeatAction.New(joe.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(startBeat + 1.25f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Smirk);
}),
new BeatAction.Action(startBeat + 3.25f, delegate {
new BeatAction.Action(startBeat + 4.25f, delegate {
joe.SetFaceExpression((int) KarateMan.KarateManFaces.Normal);
})
});

View File

@ -6,7 +6,7 @@ namespace HeavenStudio.Games
{
public class Minigame : MonoBehaviour
{
public static float earlyTime = 0.1f, perfectTime = 0.06f, lateTime = 0.06f, endTime = 0.1f;
public static float earlyTime = 0.1f, perfectTime = 0.08f, aceEarlyTime = 0.02f, aceLateTime = 0.02f, lateTime = 0.08f, endTime = 0.1f;
public List<Minigame.Eligible> EligibleHits = new List<Minigame.Eligible>();
[System.Serializable]

View File

@ -24,7 +24,7 @@ namespace HeavenStudio.Util
{
float pos = Conductor.instance.GetPositionFromBeat(startTime, length) * timeScale;
anim.Play(animName, animLayer, pos);
anim.speed = 0;
anim.speed = 1f; //not 0 so these can still play their script events
}
/// <summary>
@ -37,7 +37,7 @@ namespace HeavenStudio.Util
public static void DoNormalizedAnimation(this Animator anim, string animName, float pos = 0f, int animLayer = -1)
{
anim.Play(animName, animLayer, pos);
anim.speed = 0;
anim.speed = 1f;
}
/// <summary>