Commit 8d29331c authored by SherryChaos's avatar SherryChaos

more strict summon material check

parent b8e83af3
...@@ -1092,7 +1092,10 @@ namespace MDPro3 ...@@ -1092,7 +1092,10 @@ namespace MDPro3
&& Config.Get("ReplaySummon", "1") == "0") && Config.Get("ReplaySummon", "1") == "0")
summonEffect = false; summonEffect = false;
if (summonEffect && Program.I().ocgcore.materialCards.Count > 0) if (summonEffect
&& Program.I().ocgcore.materialCards.Count > 0
&& (OcgCore.TypeMatchReason(data.Type, (int)Program.I().ocgcore.materialCards[0].p.reason)
|| OcgCore.TypeMatchReason(data.Type, Program.I().ocgcore.materialCards[0].GetData().Reason)))
{ {
Program.I().ocgcore.description.Hide(); Program.I().ocgcore.description.Hide();
Program.I().ocgcore.list.Hide(); Program.I().ocgcore.list.Hide();
......
...@@ -136,14 +136,15 @@ namespace MDPro3 ...@@ -136,14 +136,15 @@ namespace MDPro3
void SyncSummonTimeline() void SyncSummonTimeline()
{ {
if ((reason & (uint)CardReason.Ritual) > 0) var type = CardsManager.Get(summonCard).Type;
if ((reason & (uint)CardReason.Ritual) > 0 && (type & (uint)CardType.Ritual) > 0)
StartCoroutine(SummonRitual()); StartCoroutine(SummonRitual());
else if ((reason & (uint)CardReason.Synchro) > 0) else if ((reason & (uint)CardReason.Synchro) > 0 && (type & (uint)CardType.Synchro) > 0)
StartCoroutine(SummonSynchro()); StartCoroutine(SummonSynchro());
else if ((reason & (uint)CardReason.Link) > 0) else if ((reason & (uint)CardReason.Xyz) > 0 && (type & (uint)CardType.Xyz) > 0)
StartCoroutine(SummonLink());
else if ((reason & (uint)CardReason.Xyz) > 0)
StartCoroutine(SummonXyz()); StartCoroutine(SummonXyz());
else if ((reason & (uint)CardReason.Link) > 0 && (type & (uint)CardType.Link) > 0)
StartCoroutine(SummonLink());
else else
{ {
CameraManager.BlackIn(0f, 0.3f); CameraManager.BlackIn(0f, 0.3f);
......
...@@ -1219,11 +1219,11 @@ namespace MDPro3 ...@@ -1219,11 +1219,11 @@ namespace MDPro3
private string ES_turnString = ""; private string ES_turnString = "";
public bool duelEnded; public bool duelEnded;
int summonedMonsterController;
int spSummonedMonsterController;
//For single duel end //For single duel end
//Program.I().room.duelEnded: For match End; //Program.I().room.duelEnded: For match End;
bool needDamageResponseInstant;
public void CoreReset() public void CoreReset()
{ {
if (cards.Count > 0) if (cards.Count > 0)
...@@ -1252,6 +1252,7 @@ namespace MDPro3 ...@@ -1252,6 +1252,7 @@ namespace MDPro3
surrended = false; surrended = false;
deckReserved = false; deckReserved = false;
cantCheckGrave = false; cantCheckGrave = false;
needDamageResponseInstant = false;
if (condition == Condition.Replay) if (condition == Condition.Replay)
{ {
replayButtons.SetActive(true); replayButtons.SetActive(true);
...@@ -1447,7 +1448,10 @@ namespace MDPro3 ...@@ -1447,7 +1448,10 @@ namespace MDPro3
case GameMessage.ChainDisabled: case GameMessage.ChainDisabled:
return true; return true;
case GameMessage.Damage: case GameMessage.Damage:
return false; if (needDamageResponseInstant)
return false;
else
return true;
case GameMessage.Hint: case GameMessage.Hint:
int type = r.ReadChar(); int type = r.ReadChar();
if (type == 8) return true; if (type == 8) return true;
...@@ -2719,7 +2723,8 @@ namespace MDPro3 ...@@ -2719,7 +2723,8 @@ namespace MDPro3
break; break;
case GameMessage.Battle: case GameMessage.Battle:
attackLine.SetActive(false); attackLine.SetActive(false);
Destroy(duelFinalBlow, 0.5f); Destroy(duelFinalBlow);
needDamageResponseInstant = true;
var gpsAttacker = r.ReadShortGPS(); var gpsAttacker = r.ReadShortGPS();
r.ReadByte(); r.ReadByte();
...@@ -2951,6 +2956,10 @@ namespace MDPro3 ...@@ -2951,6 +2956,10 @@ namespace MDPro3
quence.Append(attackTransform.DOMove(attackPosition, 0.3f).SetEase(Ease.InQuad)); quence.Append(attackTransform.DOMove(attackPosition, 0.3f).SetEase(Ease.InQuad));
quence.Join(Program.I().camera_.cameraMain.transform.DOMove(new Vector3(0, 95, -37), 0.3f)); quence.Join(Program.I().camera_.cameraMain.transform.DOMove(new Vector3(0, 95, -37), 0.3f));
quence.Join(attackTransform.DORotate(attackAngle, 0.3f).SetEase(Ease.InQuad)); quence.Join(attackTransform.DORotate(attackAngle, 0.3f).SetEase(Ease.InQuad));
quence.OnComplete(() =>
{
needDamageResponseInstant = false;
});
Sleep(125); Sleep(125);
} }
AudioManager.PlaySE(sound1); AudioManager.PlaySE(sound1);
...@@ -4793,6 +4802,22 @@ namespace MDPro3 ...@@ -4793,6 +4802,22 @@ namespace MDPro3
return returnValue; return returnValue;
} }
public static bool TypeMatchReason(int type, int reason)
{
bool returnValue = false;
if ((type & (uint)CardType.Ritual) > 0 && (reason & (uint)CardReason.Ritual) > 0)
return true;
if ((type & (uint)CardType.Fusion) > 0 && (reason & (uint)CardReason.Fusion) > 0)
return true;
if ((type & (uint)CardType.Synchro) > 0 && (reason & (uint)CardReason.Synchro) > 0)
return true;
if ((type & (uint)CardType.Xyz) > 0 && (reason & (uint)CardReason.Xyz) > 0)
return true;
if ((type & (uint)CardType.Link) > 0 && (reason & (uint)CardReason.Link) > 0)
return true;
return returnValue;
}
public GameCard GCS_Create(GPS p) public GameCard GCS_Create(GPS p)
{ {
GameCard c = null; GameCard c = null;
......
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