Exemplo n.º 1
0
    public void playCard()

    /* Check that there is enough ium to play this Card, perform this Card's Action, then discard it
     *  and unset the selected Card.
     */
    {
        bool isAbleToPlay = getIsAbleToPlay();

        if (!isAbleToPlay)
        {
            return;
        }

        int  costToPlay      = getCostToPlay();
        bool canAffordToPlay = TrialLogic.currentIum >= costToPlay;

        if (!canAffordToPlay)
        {
            return;
        }

        TrialLogic.gainIum(-costToPlay);
        cardAction();
        TrialLogic.discardCard(cardId);
        TrialLogic.selectedCardId = null;
    }
Exemplo n.º 2
0
    /* PUBLIC API */

    public void produce()
    /* Depending on the blockType, perform any production effects. */
    {
        if (blockType == BlockType.BLUE)
        {
            TrialLogic.gainIum(1);
        }
        else if (blockType == BlockType.YELLOW)
        {
            TrialLogic.drawCard();
        }

        EventLog.LogEvent($"Produced for blockType {blockType} at {gridIndices}.");
    }
Exemplo n.º 3
0
    public void onBlockDestroy(Block block)

    /* Run this destroy function if any block in this combo gets destroyed.
     *
     * :param Block block: Block that was destroyed to trigger this block combo action.
     */
    {
        if (blockComboType == BlockComboType.CHECKER_BLUE_RED)
        {
            TrialLogic.gainIum(1);
            block.destroyNeighboringMass();
        }
        else if (blockComboType == BlockComboType.CHECKER_YELLOW_RED)
        {
            TrialLogic.drawCard();
            block.destroyNeighboringMass();
        }
    }
Exemplo n.º 4
0
 public override void cardAction()
 /* See cardAction on base class Card. */
 {
     TrialLogic.gainIum(3);
 }