Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void DestroyMonster(GameObject card)
- {
- int i;
- int bullet = card.GetComponent<MonsterCardAttributes>().tempid;
- bool cleared = false;
- for (i = 0; i < MatchControl.mcontrol.TurnBuffs.Count; i++)
- {
- if (MatchControl.mcontrol.TurnBuffs[i].SemiTempCardID == bullet)
- {
- BuffGrande.BuffStruct BuffLambda = new BuffGrande.BuffStruct(-1, -1, -1, () => { });
- MatchControl.mcontrol.TurnBuffs[i] = BuffLambda;
- }
- }
- if (card.GetComponent<MonsterCardAttributes>().priop2 == -3)
- {
- for (i = 0; i < 10; i++)
- {
- if (MatchControl.mcontrol.monsterslots1[i] != null)
- {
- if (MatchControl.mcontrol.monsterslots1[i].GetComponent<MonsterCardAttributes>() != null)
- {
- if (MatchControl.mcontrol.monsterslots1[i].GetComponent<MonsterCardAttributes>().tempid == bullet)
- {
- MatchControl.mcontrol.monsterslots1[i] = null;
- cleared = true;
- break;
- }
- }
- }
- }
- if (cleared == false)
- {
- int cardinhand = -1;
- for (i = 0; i < 10; i++)
- {
- if (MatchControl.mcontrol.player1cards[i] != null)
- {
- if (MatchControl.mcontrol.player1cards[i].GetComponent<MonsterCardAttributes>() != null)
- {
- if (MatchControl.mcontrol.player1cards[i].GetComponent<MonsterCardAttributes>().tempid == bullet)
- {
- cardinhand = i;
- break;
- }
- }
- }
- }
- if (cardinhand != -1)
- {
- MatchControl.mcontrol.player1cards[cardinhand] = null;
- for (i = cardinhand; i < 19 && MatchControl.mcontrol.player1cards[i + 1] != null; i++)
- {
- MatchControl.mcontrol.player1cards[i] = MatchControl.mcontrol.player1cards[i + 1];
- }
- MatchControl.mcontrol.player1cards[19] = null;
- MatchControl.mcontrol.player1handamount--;
- }
- else
- {
- int cardinrdeck = -1;
- for (i = 0; i < 40; i++)
- {
- if (MatchControl.mcontrol.rdeck1[i] != null)
- {
- if (MatchControl.mcontrol.rdeck1[i].GetComponent<MonsterCardAttributes>() != null)
- {
- if (MatchControl.mcontrol.rdeck1[i].GetComponent<MonsterCardAttributes>().tempid == bullet)
- {
- cardinrdeck = i;
- break;
- }
- }
- }
- }
- MatchControl.mcontrol.rdeck1[cardinrdeck] = null;
- for (i = cardinhand; i < 39 && MatchControl.mcontrol.rdeck1[i + 1] != null; i++)
- {
- MatchControl.mcontrol.rdeck1[i] = MatchControl.mcontrol.rdeck1[i + 1];
- }
- MatchControl.mcontrol.rdeck1[39] = null;
- }
- }
- MatchControl.mcontrol.graveyard1.Add(card);
- card.SetActive(false);
- }
- else
- {
- for (i = 0; i < 10; i++)
- {
- if (MatchControl.mcontrol.monsterslots2[i] != null)
- {
- if (MatchControl.mcontrol.monsterslots2[i].GetComponent<MonsterCardAttributes>() != null)
- {
- if (MatchControl.mcontrol.monsterslots2[i].GetComponent<MonsterCardAttributes>().tempid == bullet)
- {
- MatchControl.mcontrol.monsterslots2[i] = null;
- cleared = true;
- break;
- }
- }
- }
- }
- if (cleared == false)
- {
- int cardinhand = -1;
- for (i = 0; i < 10; i++)
- {
- if (MatchControl.mcontrol.player2cards[i] != null)
- {
- if (MatchControl.mcontrol.player2cards[i].GetComponent<MonsterCardAttributes>() != null)
- {
- if (MatchControl.mcontrol.player2cards[i].GetComponent<MonsterCardAttributes>() != null)
- if (MatchControl.mcontrol.player2cards[i].GetComponent<MonsterCardAttributes>().tempid == bullet)
- {
- cardinhand = i;
- break;
- }
- }
- }
- }
- if (cardinhand != -1)
- {
- MatchControl.mcontrol.player2cards[cardinhand] = null;
- for (i = cardinhand; i < 19 && MatchControl.mcontrol.player2cards[i + 1] != null; i++)
- {
- MatchControl.mcontrol.player2cards[i] = MatchControl.mcontrol.player2cards[i + 1];
- }
- MatchControl.mcontrol.player2cards[19] = null;
- MatchControl.mcontrol.player2handamount--;
- //cleared = true;
- }
- else//in decks,check left first
- {
- int cardinrdeck = -1;
- for (i = 0; i < 40; i++)
- {
- if (MatchControl.mcontrol.rdeck2[i] != null)
- {
- if (MatchControl.mcontrol.rdeck2[i].GetComponent<MonsterCardAttributes>() != null)
- {
- if (MatchControl.mcontrol.rdeck2[i].GetComponent<MonsterCardAttributes>().tempid == bullet)
- {
- cardinrdeck = i;
- break;
- }
- }
- }
- }
- MatchControl.mcontrol.rdeck2[cardinrdeck] = null;
- for (i = cardinhand; i < 39 && MatchControl.mcontrol.rdeck2[i + 1] != null; i++)
- {
- MatchControl.mcontrol.rdeck2[i] = MatchControl.mcontrol.rdeck2[i + 1];
- }
- MatchControl.mcontrol.rdeck2[39] = null;
- }
- }
- MatchControl.mcontrol.graveyard2.Add(card);
- card.SetActive(false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement