public override void Play(AbstractCharacter source, AbstractCharacter target) { base.Play(source, target); List <AbstractCard> improve = CombatManager.Instance.SelectCardsFromList(source.GetHand(), 1, true); improve[0].COST += increaseCost; }
public override void NotifyOfEvent(AbstractEvent eventData) { AbstractCharacter char1 = TurnManager.Instance.GetPlayer(); AbstractCharacter char2 = TurnManager.Instance.GetEnemy(); if (char1.GetDiscardPile().ToList().Contains(this) && char1.GetHand().Count < 10) { char1.GetHand().Add(this); char1.GetDiscardPile().ToList().Remove(this); } if (char2.GetDiscardPile().ToList().Contains(this) && char2.GetHand().Count < 10) { char2.GetHand().Add(this); char2.GetDiscardPile().ToList().Remove(this); } }
public override void PlayCardsSelected(List <AbstractCard> selectedCards) { for (int i = 0; i < selectedCards.Count; i++) { AbstractCard card = selectedCards[i]; temp.GetHand().Add(card); temp.GetDiscardPile().RemoveCard(card); } }
// post-negotiation cleanup helper function public void Cleanup(AbstractCharacter character) { actionQueue.Clear(); character.coreArgument.poise = 0; character.GetHand().Clear(); character.GetSupportArguments().Clear(); character.GetDrawPile().Clear(); character.GetDiscardPile().Clear(); character.GetScourPile().Clear(); }
public override void Play(AbstractCharacter source, AbstractCharacter target) { base.Play(source, target); // Calculating the bonus AFTER base.Play() means that playing Weighted Hammer will not include itself in cost calculations. int bonus = 0; List <AbstractCard> hand = source.GetHand(); foreach (AbstractCard card in hand) { bonus += card.COST; } CombatManager.Instance.AddAction(new DamageTargetAction(source, target, damage + bonus)); }
// TODO: Currently *extremely* inefficient for testing purposes. Rewrite this. public void DisplayHand() { foreach (Transform child in this.transform) { GameObject.Destroy(child.gameObject); // Remove all old gameobjects. } AbstractCharacter character = TurnManager.Instance.GetCurrentCharacter(); List <AbstractCard> hand = character.GetHand(); for (int i = 0; i < hand.Count; i++) { GameObject obj = Instantiate(cardTemplate, new Vector3((transform.position.x / 2) + 200.0f * i, 0, 0), Quaternion.identity); obj.transform.SetParent(gameObject.transform); obj.GetComponent <CardTemplate>().LoadData(hand[i]); } }
public int renderCardHorizontalDistance; // set in inspector public void RenderHand() { // get rid of the old hand to render a new one. maybe excessive - could we just rerender the hand? foreach (Transform child in handZone.transform) { GameObject.Destroy(child.gameObject); } List <AbstractCard> playerHand = player.GetHand(); int cardsInHand = playerHand.Count; int startXPos = (-renderCardHorizontalDistance / 2) * (cardsInHand - 1); int startAng = 5 * (cardsInHand - 1); for (int i = 0; i < cardsInHand; i++) { GameObject cardDisplay = Instantiate(cardTemplatePrefab, handZone.transform.position + new Vector3(startXPos + (i * renderCardHorizontalDistance), 0, 0), Quaternion.identity); cardDisplay.transform.Rotate(0, 0, startAng - (10 * i)); cardDisplay.transform.SetParent(handZone.transform); cardDisplay.GetComponent <DisplayCard>().reference = playerHand[i]; cardDisplay.GetComponent <DisplayCard>().Render(); // cardDisplay.SetActive(true); // calls OnEnable() for the card template prefab } }
public override void Play(AbstractCharacter source, AbstractArgument target) { base.Play(source, target); NegotiationManager.Instance.SelectCardsFromList(source.GetHand(), 1, true, this); }