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); }
private void BuildTaskList(List <Network.PowerHistory> powerList, ref int index, PowerTaskList taskList) { while (index < powerList.Count) { Network.PowerHistory netPower = powerList[index]; Network.PowerType type = netPower.Type; if (type == Network.PowerType.ACTION_START) { if (!taskList.IsEmpty()) { this.EnqueueTaskList(taskList); } PowerTaskList item = new PowerTaskList(); item.SetSourceAction((Network.HistActionStart)netPower); PowerTaskList origin = taskList.GetOrigin(); if (origin.IsSourceActionOrigin()) { item.SetParent(origin); } this.m_previousStack.Push(item); index++; this.BuildTaskList(powerList, ref index, item); return; } if (type == Network.PowerType.ACTION_END) { taskList.SetEndAction((Network.HistActionEnd)netPower); if (this.m_previousStack.Count > 0) { this.m_previousStack.Pop(); this.EnqueueTaskList(taskList); return; } break; } taskList.CreateTask(netPower).DoRealTimeTask(powerList, index); index++; } if (!taskList.IsEmpty()) { this.EnqueueTaskList(taskList); } }
private void NotifyWillProcessTaskList(PowerTaskList taskList) { if (ThinkEmoteManager.Get() != null) { ThinkEmoteManager.Get().NotifyOfActivity(); } if (taskList.IsSourceActionOrigin()) { Network.HistActionStart sourceAction = taskList.GetSourceAction(); if (sourceAction.BlockType == HistoryBlock.Type.PLAY) { Entity entity = GameState.Get().GetEntity(sourceAction.Entity); if (entity.GetController().IsOpposingSide()) { string cardId = entity.GetCardId(); if (string.IsNullOrEmpty(cardId)) { cardId = this.FindRevealedCardId(taskList); } GameState.Get().GetGameEntity().NotifyOfOpponentWillPlayCard(cardId); } } } }