public bool attemptToPlayCard() { if (isCardPlayable()) { character.actions--; character.energy -= getEnergyPlayCost(); character.focus -= getFocusPlayCost(); character.hand.removeFromHand(cardBase); character.refreshUI(); cardBase.transform.parent = PlayArea.Instance().transform; cardBase.startLerp(PlayArea.Instance().getNextStackPosition()); StackController.Instance().addToStack(cardBase); cardBase.transform.localEulerAngles = new Vector3(0, 0, 0); cardBase.hovered = false; cardBase.hoverLerping = false; cardBase.beingPlayedLerping = true; character.refreshUI(); character.hand.checkHandGlow(); cardBase.setGlow(false); PlayerCardProgress.Instance().cardExpGain(this); return(true); } return(false); }
public override void organizeCards() { float halfPoint = (((float)cards.Count) + 1.0f) / 2.0f; for (int i = 0; i < cards.Count; i++) { BaseCard card = cards[i]; float diff = (i + 1.0f) - halfPoint; card.handPosition = transform.position + new Vector3(handDisplacement.x * diff , handDisplacement.y * Mathf.Abs(diff) , handDisplacement.z * -Mathf.Abs(diff)); card.startLerp(card.handPosition); card.transform.localEulerAngles = new Vector3(0, 0, rotationVariation * diff); } }