Commit 8d29331c authored by SherryChaos's avatar SherryChaos

more strict summon material check

parent b8e83af3
......@@ -1092,7 +1092,10 @@ namespace MDPro3
&& Config.Get("ReplaySummon", "1") == "0")
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.list.Hide();
......
......@@ -136,14 +136,15 @@ namespace MDPro3
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());
else if ((reason & (uint)CardReason.Synchro) > 0)
else if ((reason & (uint)CardReason.Synchro) > 0 && (type & (uint)CardType.Synchro) > 0)
StartCoroutine(SummonSynchro());
else if ((reason & (uint)CardReason.Link) > 0)
StartCoroutine(SummonLink());
else if ((reason & (uint)CardReason.Xyz) > 0)
else if ((reason & (uint)CardReason.Xyz) > 0 && (type & (uint)CardType.Xyz) > 0)
StartCoroutine(SummonXyz());
else if ((reason & (uint)CardReason.Link) > 0 && (type & (uint)CardType.Link) > 0)
StartCoroutine(SummonLink());
else
{
CameraManager.BlackIn(0f, 0.3f);
......
......@@ -1219,11 +1219,11 @@ namespace MDPro3
private string ES_turnString = "";
public bool duelEnded;
int summonedMonsterController;
int spSummonedMonsterController;
//For single duel end
//Program.I().room.duelEnded: For match End;
bool needDamageResponseInstant;
public void CoreReset()
{
if (cards.Count > 0)
......@@ -1252,6 +1252,7 @@ namespace MDPro3
surrended = false;
deckReserved = false;
cantCheckGrave = false;
needDamageResponseInstant = false;
if (condition == Condition.Replay)
{
replayButtons.SetActive(true);
......@@ -1447,7 +1448,10 @@ namespace MDPro3
case GameMessage.ChainDisabled:
return true;
case GameMessage.Damage:
return false;
if (needDamageResponseInstant)
return false;
else
return true;
case GameMessage.Hint:
int type = r.ReadChar();
if (type == 8) return true;
......@@ -2719,7 +2723,8 @@ namespace MDPro3
break;
case GameMessage.Battle:
attackLine.SetActive(false);
Destroy(duelFinalBlow, 0.5f);
Destroy(duelFinalBlow);
needDamageResponseInstant = true;
var gpsAttacker = r.ReadShortGPS();
r.ReadByte();
......@@ -2951,6 +2956,10 @@ namespace MDPro3
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(attackTransform.DORotate(attackAngle, 0.3f).SetEase(Ease.InQuad));
quence.OnComplete(() =>
{
needDamageResponseInstant = false;
});
Sleep(125);
}
AudioManager.PlaySE(sound1);
......@@ -4793,6 +4802,22 @@ namespace MDPro3
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)
{
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