public void AddPowerHistoryInfoOverride(PowerHistoryInfo info) { if (info != null) { for (int i = 0; i < this.m_powerHistoryInfoOverrides.Count; i++) { if (this.m_powerHistoryInfoOverrides[i].GetEffectIndex() == info.GetEffectIndex()) { this.m_powerHistoryInfoOverrides[i] = info; return; } } this.m_powerHistoryInfoOverrides.Add(info); } }
private void PrepareHistoryForCurrentTaskList() { object[] args = new object[] { this.m_currentTaskList.GetId() }; Log.Power.Print("PowerProcessor.PrepareHistoryForCurrentTaskList() - m_currentTaskList={0}", args); Network.HistActionStart sourceAction = this.m_currentTaskList.GetSourceAction(); if (sourceAction != null) { if (sourceAction.BlockType != HistoryBlock.Type.ATTACK) { if (sourceAction.BlockType == HistoryBlock.Type.PLAY) { Entity playedEntity = GameState.Get().GetEntity(sourceAction.Entity); if (playedEntity != null) { if (this.m_currentTaskList.IsSourceActionOrigin()) { Entity targetedEntity = GameState.Get().GetEntity(sourceAction.Target); HistoryManager.Get().CreateCardPlayedTile(playedEntity, targetedEntity); this.m_currentTaskList.SetSpawnedHistoryTile(true); if (playedEntity.IsControlledByFriendlySidePlayer()) { GameState.Get().GetGameEntity().NotifyOfFriendlyPlayedCard(playedEntity); } if (this.ShouldShowPlayedBigCard(playedEntity)) { if (playedEntity.IsControlledByOpposingSidePlayer()) { GameState.Get().GetGameEntity().NotifyOfOpponentPlayedCard(playedEntity); } bool wasCountered = this.m_currentTaskList.WasThePlayedSpellCountered(playedEntity); this.m_historyBlocking = true; this.m_historyBlockingTaskList = this.m_currentTaskList; HistoryManager.Get().CreatePlayedBigCard(playedEntity, new HistoryManager.FinishedCallback(this.OnBigCardFinished), wasCountered); } } this.m_currentTaskList.NotifyHistoryOfAdditionalTargets(); } } else if (sourceAction.BlockType == HistoryBlock.Type.POWER) { this.m_currentTaskList.NotifyHistoryOfAdditionalTargets(); } else if (sourceAction.BlockType == HistoryBlock.Type.JOUST) { this.m_currentTaskList.NotifyHistoryOfAdditionalTargets(); } else if (sourceAction.BlockType == HistoryBlock.Type.TRIGGER) { Entity triggeredEntity = GameState.Get().GetEntity(sourceAction.Entity); if (triggeredEntity != null) { if (triggeredEntity.IsSecret()) { if (this.m_currentTaskList.IsSourceActionOrigin()) { HistoryManager.Get().CreateTriggerTile(triggeredEntity); this.m_currentTaskList.SetSpawnedHistoryTile(true); this.m_historyBlocking = true; this.m_historyBlockingTaskList = this.m_currentTaskList; HistoryManager.Get().CreateSecretBigCard(triggeredEntity, new HistoryManager.FinishedCallback(this.OnBigCardFinished)); } this.m_currentTaskList.NotifyHistoryOfAdditionalTargets(); } else { if (this.m_currentTaskList.IsSourceActionOrigin()) { PowerHistoryInfo powerHistoryInfo = triggeredEntity.GetPowerHistoryInfo(sourceAction.Index); if ((powerHistoryInfo != null) && powerHistoryInfo.ShouldShowInHistory()) { if (triggeredEntity.HasTag(GAME_TAG.HISTORY_PROXY)) { Entity entity6 = GameState.Get().GetEntity(triggeredEntity.GetTag(GAME_TAG.HISTORY_PROXY)); HistoryManager.Get().CreateCardPlayedTile(entity6, null); if ((triggeredEntity.GetController() != GameState.Get().GetFriendlySidePlayer()) || !triggeredEntity.HasTag(GAME_TAG.HISTORY_PROXY_NO_BIG_CARD)) { this.m_historyBlocking = true; this.m_historyBlockingTaskList = this.m_currentTaskList; HistoryManager.Get().CreateTriggeredBigCard(entity6, new HistoryManager.FinishedCallback(this.OnBigCardFinished)); } } else { if (this.ShouldShowTriggeredBigCard(triggeredEntity)) { this.m_historyBlocking = true; this.m_historyBlockingTaskList = this.m_currentTaskList; HistoryManager.Get().CreateTriggeredBigCard(triggeredEntity, new HistoryManager.FinishedCallback(this.OnBigCardFinished)); } HistoryManager.Get().CreateTriggerTile(triggeredEntity); } this.m_currentTaskList.SetSpawnedHistoryTile(true); } } if (this.m_currentTaskList.DidBlockSpawnHistoryTile()) { this.m_currentTaskList.NotifyHistoryOfAdditionalTargets(); } } } } else if (sourceAction.BlockType == HistoryBlock.Type.FATIGUE) { if (this.m_currentTaskList.IsSourceActionOrigin()) { HistoryManager.Get().CreateFatigueTile(); this.m_currentTaskList.SetSpawnedHistoryTile(true); } this.m_currentTaskList.NotifyHistoryOfAdditionalTargets(); } } else { AttackType attackType = this.m_currentTaskList.GetAttackType(); Entity attacker = null; Entity defender = null; switch (attackType) { case AttackType.REGULAR: attacker = this.m_currentTaskList.GetAttacker(); defender = this.m_currentTaskList.GetDefender(); break; case AttackType.CANCELED: attacker = this.m_currentTaskList.GetAttacker(); defender = this.m_currentTaskList.GetProposedDefender(); break; } if ((attacker != null) && (defender != null)) { HistoryManager.Get().CreateAttackTile(attacker, defender, this.m_currentTaskList); this.m_currentTaskList.SetSpawnedHistoryTile(true); this.m_currentTaskList.NotifyHistoryOfAdditionalTargets(); } } } }