void OnDrop() { CardSlot cardSlot = GetCollidedCardSlot(); if (cardSlot != null && cardSlot.CanPlayCardHere(this)) { // reveal this card to both players, then play it to the board gm.actionQueue.AddAction(new RevealCardAction(this.actorID, template.ID.GetID())); gm.actionQueue.AddAction(new PlayCardAction(this.actorID, cardSlot.actorID)); } else { ReturnToMyHand(); } MouseTargetable.SetActiveTargetingGroups(new List <TargetingGroup> { TargetingGroup.CardInMyHandPlayable, TargetingGroup.CardOnBoardChargeable }); }
void OnPickUp() { // make valid card slots targetable TargetingGroup emptyTG = TargetingGroup.NOT_ASSIGNED; if (template.cat == CardCategory.Operative) { emptyTG = TargetingGroup.EmptyMyOperativeSlot; } else if (template.cat == CardCategory.Policy) { emptyTG = TargetingGroup.EmptyPolicySlot; } MouseTargetable.SetActiveTargetingGroups(new List <TargetingGroup> { TargetingGroup.DraggedObject, emptyTG }); sortingLayerManager.SetSortingLayer("DraggedCard"); }
void StartTurn() { if (IsMyTurn()) { MouseTargetable.SetActiveTargetingGroups(new List <TargetingGroup> { TargetingGroup.CardInMyHandPlayable, TargetingGroup.CardOnBoardChargeable }); // make my cards in my hand and the board selectable on my turn } else { MouseTargetable.SetActiveTargetingGroups(new List <TargetingGroup> { }); // make nothing selectable on enemy turn } RefillFunds(); DrawCards(); gm.slotManager.OnStartTurn(IsMyTurn()); gm.myHand.UpdateAllCardsTargetingGroupsForPlayability(); gm.slotManager.UpdateAllCardsTargetingGroupsForChargeability(); }