Esempio n. 1
0
    protected override bool AddPowerSourceAndTargets(PowerTaskList taskList)
    {
        if (!this.HasSourceCard(taskList))
        {
            return(false);
        }
        this.m_fatigueTagChange = null;
        List <PowerTask> list = base.m_taskList.GetTaskList();

        for (int i = 0; i < list.Count; i++)
        {
            Network.PowerHistory power = list[i].GetPower();
            if (power.Type == Network.PowerType.TAG_CHANGE)
            {
                Network.HistTagChange change = (Network.HistTagChange)power;
                if (change.Tag == 0x16)
                {
                    this.m_fatigueTagChange = change;
                }
            }
        }
        if (this.m_fatigueTagChange == null)
        {
            return(false);
        }
        Card card = taskList.GetSourceEntity().GetCard();

        base.SetSource(card);
        return(true);
    }
    protected virtual bool AddPowerSourceAndTargets(PowerTaskList taskList)
    {
        if (!this.HasSourceCard(taskList))
        {
            return(false);
        }
        if (!SpellUtils.CanAddPowerTargets(taskList))
        {
            return(false);
        }
        Card card = taskList.GetSourceEntity().GetCard();

        this.SetSource(card);
        List <PowerTask> list = this.m_taskList.GetTaskList();

        for (int i = 0; i < list.Count; i++)
        {
            PowerTask task = list[i];
            Card      targetCardFromPowerTask = this.GetTargetCardFromPowerTask(task);
            if (((targetCardFromPowerTask != null) && (card != targetCardFromPowerTask)) && !this.IsTarget(targetCardFromPowerTask))
            {
                this.AddTarget(targetCardFromPowerTask);
            }
        }
        return((card != null) || (this.m_targets.Count > 0));
    }
Esempio n. 3
0
    protected override bool AddPowerSourceAndTargets(PowerTaskList taskList)
    {
        this.Reset();
        if (!this.HasSourceCard(taskList))
        {
            return(false);
        }
        Entity sourceEntity               = taskList.GetSourceEntity();
        Card   card                       = sourceEntity.GetCard();
        Spell  spell                      = this.DetermineTriggerSpell(card);
        bool   spellInitialized           = this.InitTriggerSpell(card, spell);
        List <CardSoundSpell> soundSpells = this.DetermineTriggerSounds(card);

        this.InitTriggerSounds(card, soundSpells);
        if (this.CanPlayActorTriggerSpell(sourceEntity, spell, spellInitialized))
        {
            this.m_actorTriggerSpell = this.GetActorTriggerSpell(sourceEntity);
        }
        if (((this.m_triggerSpell == null) && (this.m_triggerSoundSpells.Count == 0)) && (this.m_actorTriggerSpell == null))
        {
            return(TurnStartManager.Get().IsCardDrawHandled(card));
        }
        base.SetSource(card);
        return(true);
    }
Esempio n. 4
0
    protected override bool AddPowerSourceAndTargets(PowerTaskList taskList)
    {
        if (!this.HasSourceCard(taskList))
        {
            return(false);
        }
        Entity sourceEntity = taskList.GetSourceEntity();
        Card   card         = sourceEntity.GetCard();
        bool   flag         = false;

        if (taskList.IsSourceActionOrigin() && this.InitBannerSpell(sourceEntity))
        {
            flag = true;
        }
        Spell triggerSpell = this.GetTriggerSpell(card);

        if ((triggerSpell != null) && this.InitTriggerSpell(card, triggerSpell))
        {
            flag = true;
        }
        if (!flag)
        {
            return(false);
        }
        base.SetSource(card);
        return(true);
    }
Esempio n. 5
0
    protected override bool AddPowerSourceAndTargets(PowerTaskList taskList)
    {
        if (!this.HasSourceCard(taskList))
        {
            return(false);
        }
        this.m_joustTaskIndex = -1;
        List <PowerTask> list = taskList.GetTaskList();

        for (int i = 0; i < list.Count; i++)
        {
            PowerTask            task  = list[i];
            Network.HistMetaData power = task.GetPower() as Network.HistMetaData;
            if ((power != null) && (power.MetaType == HistoryMeta.Type.JOUST))
            {
                this.m_joustTaskIndex = i;
            }
        }
        if (this.m_joustTaskIndex < 0)
        {
            return(false);
        }
        Card card = taskList.GetSourceEntity().GetCard();

        base.SetSource(card);
        return(true);
    }
Esempio n. 6
0
 protected override bool HasSourceCard(PowerTaskList taskList)
 {
     if (taskList.GetSourceEntity() == null)
     {
         return(false);
     }
     if (this.GetCardWithActorTrigger(taskList) == null)
     {
         return(false);
     }
     return(true);
 }
    protected virtual bool HasSourceCard(PowerTaskList taskList)
    {
        Entity sourceEntity = taskList.GetSourceEntity();

        if (sourceEntity == null)
        {
            return(false);
        }
        if (sourceEntity.GetCard() == null)
        {
            return(false);
        }
        return(true);
    }
Esempio n. 8
0
    private void CancelSpellsForEarlyConcede(PowerTaskList taskList)
    {
        Entity sourceEntity = taskList.GetSourceEntity();

        if (sourceEntity != null)
        {
            Card card = sourceEntity.GetCard();
            if ((card != null) && (taskList.GetSourceAction().BlockType == HistoryBlock.Type.POWER))
            {
                Spell playSpell = card.GetPlaySpell(true);
                if (playSpell != null)
                {
                    SpellStateType activeState = playSpell.GetActiveState();
                    if ((activeState != SpellStateType.NONE) && (activeState != SpellStateType.CANCEL))
                    {
                        playSpell.ActivateState(SpellStateType.CANCEL);
                    }
                }
            }
        }
    }
    protected override bool AddPowerSourceAndTargets(PowerTaskList taskList)
    {
        this.Reset();
        if (!this.HasSourceCard(taskList))
        {
            return(false);
        }
        Entity sourceEntity = taskList.GetSourceEntity();
        Card   card         = sourceEntity.GetCard();
        Spell  spell        = this.DeterminePowerSpell(sourceEntity, card);

        if (sourceEntity.IsMinion())
        {
            if (!this.InitPowerSpell(card, spell))
            {
                if (!SpellUtils.CanAddPowerTargets(taskList))
                {
                    return(false);
                }
                if (this.GetActorBattlecrySpell(card) == null)
                {
                    return(false);
                }
            }
        }
        else
        {
            this.InitPowerSpell(card, spell);
            List <CardSoundSpell> soundSpells = this.DeterminePowerSounds(sourceEntity, card);
            this.InitPowerSounds(card, soundSpells);
            if ((this.m_powerSpell == null) && (this.m_powerSoundSpells.Count == 0))
            {
                return(false);
            }
        }
        base.SetSource(card);
        return(true);
    }
Esempio n. 10
0
    private Card GetCardWithActorTrigger(PowerTaskList taskList)
    {
        Entity sourceEntity = taskList.GetSourceEntity();

        return(this.GetCardWithActorTrigger(sourceEntity));
    }