예제 #1
0
    public override void ApplyToTarget(Targettable target, PlayerController player, Targettable source)
    {
        PlayerController targetPlayer = target as PlayerController;

        if (targetPlayer)
        {
            GameSession gameSession = GameUtils.GetGameSession();

            CardGenerationFlags flags = CardGenerationFlags.NONE;
            if (cardQualifier != null)
            {
                switch (cardQualifier.qualifierType)
                {
                case QualifierType.CARD_TYPE:
                {
                    CardTypeQualifierDescription cardTypeQualifier = cardQualifier as CardTypeQualifierDescription;
                    flags |= EffectConstants.GetGenerationFlags(cardTypeQualifier.cardType);
                }
                break;

                case QualifierType.CREATURE_TYPE:
                {
                    CreatureTypeQualifierDescription creatureTypeQualifier = cardQualifier as CreatureTypeQualifierDescription;
                    flags |= EffectConstants.GetGenerationFlags(creatureTypeQualifier.creatureType);
                }
                break;
                }
            }

            for (int i = 0; i < amount; i++)
            {
                switch (drawModifier)
                {
                case DrawModifier.RANDOM:
                    gameSession.ServerPlayerDrawCard(targetPlayer, targetPlayer, flags, true);
                    break;

                case DrawModifier.SELF:
                    gameSession.ServerPlayerDrawCard(targetPlayer, targetPlayer, flags);
                    break;

                case DrawModifier.OPPONENT_RANDOM:
                    gameSession.ServerPlayerDrawCard(targetPlayer, GameUtils.GetGameSession().GetOpponents(targetPlayer)[0], flags, true);
                    break;

                case DrawModifier.OPPONENT:
                    gameSession.ServerPlayerDrawCard(targetPlayer, GameUtils.GetGameSession().GetOpponents(targetPlayer)[0], flags);
                    break;
                }
            }
        }
    }
예제 #2
0
    void OnMouseDown()
    {
        if (GameState.CurrentActionState != ActionState.Playing)
        {
            return;
        }

        if (isInEffect)
        {
            return;
        }

        isInEffect = true;
        Soundboard.PlayCastSpell();
        triggeredLight.color = EffectConstants.GetEffectColor(GameState.CurrentLightPower);
        AffectedPower        = GameState.CurrentLightPower;
        tmpPrefab            = ParticlePrefabs[Random.Range(0, ParticlePrefabs.Length)];
        Instantiate(tmpPrefab, particleSource.position, particleSource.rotation * tmpPrefab.rotation);
        counter = CounterBar.InstantiateFromPool(particleSource, TimerBarOffset, Quaternion.identity, EffectConstants.GetEffectColor(GameState.CurrentLightPower), EffectTimerMax, EffectTimerMax);
        StartCoroutine("DoEffect");
    }