Commit e6f8b136 authored by J114514's avatar J114514

1.加速状态进入语音播放的时候,会暂时解除加速

parent e8a2cb7a
...@@ -76,13 +76,15 @@ namespace MDPro3.Duel ...@@ -76,13 +76,15 @@ namespace MDPro3.Duel
var clip = await AudioManager.LoadAudioFileUniAsync(paths[i][j], AudioType.OGGVORBIS); var clip = await AudioManager.LoadAudioFileUniAsync(paths[i][j], AudioType.OGGVORBIS);
clips[i].Add(clip); clips[i].Add(clip);
} }
catch (Exception ex) catch (Exception ex)
{ {
Debug.LogException(ex); Debug.LogException(ex);
} }
} }
} }
for (int i = 0; i < clips.Length; i++) for (int i = 0; i < clips.Length; i++)
{ {
for (int j = 0; j < clips[i].Count; j++) for (int j = 0; j < clips[i].Count; j++)
...@@ -130,6 +132,8 @@ namespace MDPro3.Duel ...@@ -130,6 +132,8 @@ namespace MDPro3.Duel
await UniTask.WaitForSeconds(clips[i][j].length); await UniTask.WaitForSeconds(clips[i][j].length);
} }
} }
} }
private bool NeedVoice() private bool NeedVoice()
...@@ -181,10 +185,24 @@ namespace MDPro3.Duel ...@@ -181,10 +185,24 @@ namespace MDPro3.Duel
if (voiceData.Count == 0) if (voiceData.Count == 0)
return; return;
// EDIT VOICE CODE
var needrecacc = false;
if (OcgCore.Accing)
{
Core.GetUI<MDPro3.UI.ServantUI.OcgCoreUI>().OnNor();needrecacc = true;
}
var voiceTask = PlayVoiceAsync(); var voiceTask = PlayVoiceAsync();
var clickTask = UniTask.WaitUntil(() => UserInput.MouseLeftDown); var clickTask = UniTask.WaitUntil(() => UserInput.MouseLeftDown);
await UniTask.WhenAny(voiceTask, clickTask); await UniTask.WhenAny(voiceTask, clickTask);
//Edit Voice code
if(!OcgCore.Accing && needrecacc)
{
Core.GetUI<MDPro3.UI.ServantUI.OcgCoreUI>().OnAcc();
}
} }
protected override UniTask GameMessage_Start(BinaryReader reader) protected override UniTask GameMessage_Start(BinaryReader reader)
...@@ -768,7 +786,7 @@ namespace MDPro3.Duel ...@@ -768,7 +786,7 @@ namespace MDPro3.Duel
var value = attackCard.GetData().Attack; var value = attackCard.GetData().Attack;
var attackedCard = Core.GCS_Get(to); var attackedCard = Core.GCS_Get(to);
if(attackedCard != null) if (attackedCard != null)
{ {
directAttack = false; directAttack = false;
if (attackedCard.p.InPosition(CardPosition.Attack)) if (attackedCard.p.InPosition(CardPosition.Attack))
...@@ -776,10 +794,12 @@ namespace MDPro3.Duel ...@@ -776,10 +794,12 @@ namespace MDPro3.Duel
else else
value = 0; value = 0;
} }
bool finalBlow = value >= (from.InMyControl() ? life1 : life0); bool finalBlow = value >= (from.InMyControl() ? life1 : life0);
var targetData = from.InMyControl() ? heroVoices : rivalVoices; var targetData = from.InMyControl() ? heroVoices : rivalVoices;
var data = new VoiceData(); var data = new VoiceData();
data.name = Tools.GetRandomDictionaryElement(finalBlow ? targetData.BeforeAttackFinish.rawKvp : targetData.BeforeAttackNormal.rawKvp).Value.shortName; data.name = Tools.GetRandomDictionaryElement(finalBlow ? targetData.BeforeAttackFinish.rawKvp : targetData.BeforeAttackNormal.rawKvp).Value.shortName;
data.num = GetVoiceNum(targetData, data.name); data.num = GetVoiceNum(targetData, data.name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment