private void DiscardCard() { HackDeck hackDeck = FindObjectOfType <HackDeck>(); hackDeck.SendTopCardToDiscard(); FindObjectOfType <HackBattleData>().RaiseSecurityLevel(); }
public void SendCardBackToDeck() { Debug.Log("Send card back to deck"); HackDeck hackDeck = FindObjectOfType <HackDeck>(); hackDeck.ReAttachTopCard(); parentCard.GetCurrentSquareHolder().RemoveCardFromSquare(); }
private void Awake() { hackDeck = FindObjectOfType <HackDeck>(); state = "normal"; SetTopCard(); SetTextField(); startPosition = transform.position; }
public void SetupHack(int safeSize, string newSecurityType) { mapGrid.gameObject.SetActive(false); hackDeck = FindObjectOfType <HackDeck>(); hackDiscard = FindObjectOfType <HackDiscard>(); allHackCards = FindObjectOfType <AllHackCards>(); List <int> cardIds = new List <int>(); if (trapType == MapObject.TrapTypes.ParalysisAgent) { // Paralysis Agent Trap: Blocks arm and leg mods List <Item.ItemTypes> blockedItemTypes = new List <Item.ItemTypes> { Item.ItemTypes.Arm, Item.ItemTypes.Leg }; cardIds.AddRange(runner.GetLoadout().GetAllCardIds(blockedItemTypes)); } else if (trapType == MapObject.TrapTypes.ConcussiveBlast) { List <Item.ItemTypes> blockedItemTypes = new List <Item.ItemTypes> { Item.ItemTypes.Head, Item.ItemTypes.Exoskeleton }; cardIds.AddRange(runner.GetLoadout().GetAllCardIds(blockedItemTypes)); } else { cardIds.AddRange(runner.GetLoadout().GetAllCardIds()); } // Block Hacker cards if faraday cage if (trapType != MapObject.TrapTypes.FaradayCage) { cardIds.AddRange(hacker.GetHackerLoadout().GetCardIds()); } cardIds.AddRange(FindObjectOfType <MapData>().GetTemporaryCardIds()); // Create a deck from here, but for now we use nonsense cards LogAllCardIds(cardIds); List <HackCard> cards = GetCardsByIds(cardIds); hackDeck.SetDeckPrefabs(cards); hackDeck.ShuffleDeck(); hackDeck.SetTopCard(); securityType = newSecurityType; hackSecurityUI = FindObjectOfType <HackSecurityUI>(); SetupPointHolders(); this.safeZoneSize = safeSize; SetupSafeSquares(); SetupAbilityButtons(); SetupPassiveAbilities(); }
// HACK ABILITY FUNCTIONALITY private void AddConnectionsToActiveCard(int number, string color) { HackDeck hackDeck = FindObjectOfType <HackDeck>(); if (hackDeck.GetCardCount() > 0) { hackDeck.AddConnectionsToActiveCard(number, color); } }
private void AttachCardToSquare() { HackGridSquare[] allSquares = FindObjectsOfType <HackGridSquare>(); HackDeck hackDeck = FindObjectOfType <HackDeck>(); foreach (HackGridSquare square in allSquares) { if (square.IsActive() && square.IsPlacementAllowed()) { bool wasAttachmentSuccessful = square.AttachCardToSquare(hackDeck.GetTopCard(), hackDeck.GetTemporaryCircuits()); if (wasAttachmentSuccessful) { hackDeck.RemoveTopCardFromDeck(); } return; } } }