Commit 8ae57b1a authored by mercury233's avatar mercury233

prevent "picking up" dying card in deck builder

parent d6f3022d
...@@ -5,6 +5,7 @@ using System; ...@@ -5,6 +5,7 @@ using System;
public class MonoCardInDeckManager : MonoBehaviour { public class MonoCardInDeckManager : MonoBehaviour {
int loadedPicCode = 0; int loadedPicCode = 0;
YGOSharp.Banlist loaded_banlist = null; YGOSharp.Banlist loaded_banlist = null;
public bool dying = false;
bool died = false; bool died = false;
public YGOSharp.Card cardData=new YGOSharp.Card(); public YGOSharp.Card cardData=new YGOSharp.Card();
...@@ -61,6 +62,7 @@ public class MonoCardInDeckManager : MonoBehaviour { ...@@ -61,6 +62,7 @@ public class MonoCardInDeckManager : MonoBehaviour {
} }
else else
{ {
dying = true;
died = true; died = true;
gameObject.SetActive(false); gameObject.SetActive(false);
} }
...@@ -102,6 +104,7 @@ public class MonoCardInDeckManager : MonoBehaviour { ...@@ -102,6 +104,7 @@ public class MonoCardInDeckManager : MonoBehaviour {
Vector3 to_position = getGoodPosition(0); Vector3 to_position = getGoodPosition(0);
Vector3 delta_position = to_position - form_position; Vector3 delta_position = to_position - form_position;
GetComponent<Rigidbody>().AddForce(delta_position * 200); GetComponent<Rigidbody>().AddForce(delta_position * 200);
dying = true;
} }
} }
......
...@@ -1257,7 +1257,8 @@ public class DeckManager : ServantWithCardDescription ...@@ -1257,7 +1257,8 @@ public class DeckManager : ServantWithCardDescription
goLast = gameObject; goLast = gameObject;
timeLastDown = Program.TimePassed(); timeLastDown = Program.TimePassed();
MonoCardInDeckManager MonoCardInDeckManager_ = gameObject.GetComponent<MonoCardInDeckManager>(); MonoCardInDeckManager MonoCardInDeckManager_ = gameObject.GetComponent<MonoCardInDeckManager>();
if (MonoCardInDeckManager_ != null) cardPicLoader cardPicLoader_ = gameObject.GetComponent<cardPicLoader>();
if (MonoCardInDeckManager_ != null && !MonoCardInDeckManager_.dying)
{ {
if (doubleClick && condition == Condition.editDeck && deck.GetCardCount(MonoCardInDeckManager_.cardData.Id) < currentBanlist.GetQuantity(MonoCardInDeckManager_.cardData.Id)) if (doubleClick && condition == Condition.editDeck && deck.GetCardCount(MonoCardInDeckManager_.cardData.Id) < currentBanlist.GetQuantity(MonoCardInDeckManager_.cardData.Id))
{ {
...@@ -1276,11 +1277,9 @@ public class DeckManager : ServantWithCardDescription ...@@ -1276,11 +1277,9 @@ public class DeckManager : ServantWithCardDescription
MonoCardInDeckManager_.beginDrag(); MonoCardInDeckManager_.beginDrag();
} }
} }
else if (cardPicLoader_ != null)
if (condition == Condition.editDeck)
{ {
cardPicLoader cardPicLoader_ = gameObject.GetComponent<cardPicLoader>(); if (condition == Condition.editDeck)
if (cardPicLoader_ != null)
{ {
if (deck.GetCardCount(cardPicLoader_.data.Id) < currentBanlist.GetQuantity(cardPicLoader_.data.Id)) if (deck.GetCardCount(cardPicLoader_.data.Id) < currentBanlist.GetQuantity(cardPicLoader_.data.Id))
{ {
......
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