public unsafe static void ShowFightCharacterTooltip(ITooltipDataProvider dataProvider, Vector3 worldPosition)
        {
            //IL_0011: Unknown result type (might be due to invalid IL or missing references)
            //IL_0012: Unknown result type (might be due to invalid IL or missing references)
            //IL_0023: Unknown result type (might be due to invalid IL or missing references)
            //IL_002a: Unknown result type (might be due to invalid IL or missing references)
            //IL_002f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0034: Unknown result type (might be due to invalid IL or missing references)
            //IL_0039: Unknown result type (might be due to invalid IL or missing references)
            //IL_003f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0046: Unknown result type (might be due to invalid IL or missing references)
            //IL_004b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0050: Unknown result type (might be due to invalid IL or missing references)
            //IL_0055: Unknown result type (might be due to invalid IL or missing references)
            //IL_0059: Unknown result type (might be due to invalid IL or missing references)
            //IL_005a: Unknown result type (might be due to invalid IL or missing references)
            //IL_005f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0062: Unknown result type (might be due to invalid IL or missing references)
            Transform       transform = CameraHandler.current.camera.get_transform();
            TooltipPosition position;

            if (((IntPtr)(void *)transform.InverseTransformPoint(worldPosition)).x < 0f)
            {
                worldPosition += 0.7071f * transform.get_right();
                position       = TooltipPosition.Right;
            }
            else
            {
                worldPosition -= 0.7071f * transform.get_right();
                position       = TooltipPosition.Left;
            }
            Vector3 worldPosition2 = FightUIRework.WorldToUIWorld(worldPosition);

            FightUIRework.ShowTooltip(dataProvider, position, worldPosition2);
        }
Ejemplo n.º 2
0
        public override void UpdateStatus(FightStatus fightStatus)
        {
            PlayerType   playerType   = (PlayerType)(isLocalPlayer ? 13 : (((teamIndex == GameStatus.localPlayerTeamIndex) ? 1 : 2) | ((fightStatus == FightStatus.local) ? 4 : 0)));
            PlayerStatus playerStatus = new PlayerStatus(concernedEntity, fightStatus.fightId, index, teamId, teamIndex, name, playerType);

            fightStatus.AddEntity(playerStatus);
            playerStatus.SetCarac(CaracId.ActionPoints, baseActionPoints);
            if (isLocalPlayer)
            {
                fightStatus.localPlayerId = concernedEntity;
                CameraHandler current = CameraHandler.current;
                if (null != current)
                {
                    DirectionAngle mapRotation = GameStatus.GetMapRotation(playerStatus);
                    current.ChangeRotation(mapRotation);
                }
            }
            FightUIRework instance = FightUIRework.instance;

            if (null != instance)
            {
                AbstractPlayerUIRework abstractPlayerUIRework2 = playerStatus.view = ((!isLocalPlayer) ? ((AbstractPlayerUIRework)instance.AddPlayer(playerStatus)) : ((AbstractPlayerUIRework)instance.GetLocalPlayerUI(playerStatus)));
                abstractPlayerUIRework2.SetPlayerStatus(playerStatus);
                abstractPlayerUIRework2.SetPlayerName(playerStatus.nickname);
                abstractPlayerUIRework2.SetRankIcon(0);
                abstractPlayerUIRework2.SetActionPoints(baseActionPoints);
                abstractPlayerUIRework2.SetReservePoints(0);
                abstractPlayerUIRework2.SetElementaryPoints(0, 0, 0, 0);
            }
        }
Ejemplo n.º 3
0
 public override IEnumerator UpdateView(FightStatus fightStatus)
 {
     if (fightStatus.TryGetEntity(concernedEntity, out CompanionStatus companionStatus))
     {
         if (fightStatus.TryGetEntity(ownerId, out PlayerStatus ownerStatus))
         {
             if (!ownerStatus.isLocalPlayer)
             {
                 FightMap current = FightMap.current;
                 if (null != current)
                 {
                     if (current.TryGetCellObject(refCoord.X, refCoord.Y, out CellObject cellObject))
                     {
                         ReserveCompanionStatus reserveCompanion = new ReserveCompanionStatus(ownerStatus, (CompanionDefinition)companionStatus.definition, level);
                         yield return(FightUIRework.ShowPlayingCompanion(reserveCompanion, cellObject));
                     }
                     else
                     {
                         Log.Error(FightEventErrors.InvalidPosition(refCoord), 59, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\CompanionAddedEvent.cs");
                     }
                 }
             }
             yield return(CreateCompanionCharacterObject(fightStatus, companionStatus, ownerStatus, refCoord.X, refCoord.Y, (Direction)direction));
         }
         else
         {
             Log.Error(FightEventErrors.PlayerNotFound(ownerId), 70, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\CompanionAddedEvent.cs");
         }
     }
     else
     {
         Log.Error(FightEventErrors.EntityNotFound <CompanionStatus>(concernedEntity), 75, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\CompanionAddedEvent.cs");
     }
     FightLogicExecutor.FireUpdateView(fightStatus.fightId, EventCategory.EntityAddedOrRemoved);
 }
Ejemplo n.º 4
0
        public override IEnumerator UpdateView(FightStatus fightStatus)
        {
            if (fightStatus != FightStatus.local)
            {
                yield break;
            }
            FightUIRework instance = FightUIRework.instance;

            if (!(null != instance))
            {
                yield break;
            }
            if (GameStatus.GetFightStatus(fromFightId).TryGetEntity(fromPlayerId, out PlayerStatus entityStatus))
            {
                if (RuntimeData.companionDefinitions.TryGetValue(companionDefId, out CompanionDefinition value))
                {
                    PlayerStatus localPlayer = fightStatus.GetLocalPlayer();
                    if (concernedEntity == localPlayer.id)
                    {
                        FightInfoMessage message = FightInfoMessage.ReceivedCompanion(MessageInfoRibbonGroup.MyID);
                        instance.DrawInfoMessage(message, entityStatus.nickname, RuntimeData.FormattedText(value.i18nNameId));
                    }
                }
                else
                {
                    Log.Error(FightEventErrors.DefinitionNotFound <CompanionDefinition>(companionDefId), 37, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\CompanionReceivedEvent.cs");
                }
            }
            else
            {
                Log.Error(FightEventErrors.PlayerNotFound(fromPlayerId, fromFightId), 42, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\CompanionReceivedEvent.cs");
            }
        }
Ejemplo n.º 5
0
        public override void UpdateStatus(FightStatus fightStatus)
        {
            FightUIRework instance = FightUIRework.instance;

            if (null != instance)
            {
                instance.EndTurn();
            }
        }
Ejemplo n.º 6
0
        public override IEnumerator UpdateView(FightStatus fightStatus)
        {
            FightUIRework instance = FightUIRework.instance;

            if (null != instance)
            {
                instance.ShowEndOfTurn();
            }
            yield break;
        }
Ejemplo n.º 7
0
        public override void UpdateStatus(FightStatus fightStatus)
        {
            GameStatus.hasEnded = true;
            FightUIRework instance = FightUIRework.instance;

            if (null != instance)
            {
                instance.SetResignButtonEnabled(value: false);
            }
        }
Ejemplo n.º 8
0
 public override IEnumerator UpdateView(FightStatus fightStatus)
 {
     if (fightStatus == FightStatus.local)
     {
         FightUIRework instance = FightUIRework.instance;
         if (null != instance)
         {
             int i18nNameId = GameStatus.fightDefinition.i18nNameId;
             yield return(instance.ShowTurnFeedback(TurnFeedbackUI.Type.Boss, i18nNameId));
         }
     }
 }
Ejemplo n.º 9
0
        private void OnRefuseQuit()
        {
            FightStatus local = FightStatus.local;

            if (local != null && !local.isEnded)
            {
                FightUIRework instance = FightUIRework.instance;
                if (null != instance)
                {
                    instance.SetResignButtonEnabled(value: true);
                }
            }
        }
Ejemplo n.º 10
0
 public override void UpdateStatus(FightStatus fightStatus)
 {
     fightStatus.turnIndex = turnIndex;
     if (fightStatus == FightStatus.local)
     {
         FightUIRework instance = FightUIRework.instance;
         if (null != instance)
         {
             bool isLocalPlayerTeam = GameStatus.localPlayerTeamIndex == teamIndex;
             instance.StartTurn(turnIndex, turnDuration, isLocalPlayerTeam);
         }
     }
 }
Ejemplo n.º 11
0
        public override IEnumerator UpdateView(FightStatus fightStatus)
        {
            FightStatus   fightStatus2 = GameStatus.GetFightStatus(relatedFightId);
            string        playerName   = GetPlayerName(fightStatus2);
            FightUIRework instance     = FightUIRework.instance;

            if (null != instance)
            {
                FightScore score = GetScore();
                instance.SetScore(score, playerName, reason);
            }
            yield break;
        }
Ejemplo n.º 12
0
        public override IEnumerator UpdateView(FightStatus fightStatus)
        {
            if (fightStatus != FightStatus.local)
            {
                yield break;
            }
            FightUIRework instance = FightUIRework.instance;

            if (null != instance)
            {
                switch (GameStatus.fightType)
                {
                case FightType.BossFight:
                    if (GameStatus.localPlayerTeamIndex == teamIndex)
                    {
                        TurnFeedbackUI.Type type2 = fightStatus.isEnded ? TurnFeedbackUI.Type.PlayerTeam : TurnFeedbackUI.Type.Player;
                        yield return(instance.ShowTurnFeedback(type2, 61373));
                    }
                    else
                    {
                        yield return(instance.ShowTurnFeedback(TurnFeedbackUI.Type.Boss, 30091));
                    }
                    break;

                case FightType.TeamVersus:
                    if (GameStatus.localPlayerTeamIndex == teamIndex)
                    {
                        TurnFeedbackUI.Type type = fightStatus.isEnded ? TurnFeedbackUI.Type.PlayerTeam : TurnFeedbackUI.Type.Player;
                        yield return(instance.ShowTurnFeedback(type, 61373));
                    }
                    else
                    {
                        yield return(instance.ShowTurnFeedback(TurnFeedbackUI.Type.OpponentTeam, 30091));
                    }
                    break;

                default:
                    throw new ArgumentOutOfRangeException();

                case FightType.Versus:
                    break;
                }
            }
            FightMap current = FightMap.current;

            if (null != current)
            {
                current.SetTurnIndex(turnIndex);
            }
        }
Ejemplo n.º 13
0
        public override void UpdateStatus(FightStatus fightStatus)
        {
            fightStatus.currentTurnPlayerId = 0;
            if (fightStatus != FightStatus.local || fightStatus.localPlayerId != concernedEntity)
            {
                return;
            }
            switch (FightCastManager.currentCastType)
            {
            case FightCastManager.CurrentCastType.Spell:
                FightCastManager.StopCastingSpell(cancelled: true);
                break;

            case FightCastManager.CurrentCastType.Companion:
                FightCastManager.StopInvokingCompanion(cancelled: true);
                break;

            default:
                throw new ArgumentOutOfRangeException();

            case FightCastManager.CurrentCastType.None:
                break;
            }
            FightMap current = FightMap.current;

            if (null != current)
            {
                current.SetNoInteractionPhase();
            }
            FightUIRework instance = FightUIRework.instance;

            if (null != instance)
            {
                instance.EndLocalPlayerTurn();
            }
            if (fightStatus.TryGetEntity(concernedEntity, out PlayerStatus entityStatus))
            {
                AbstractPlayerUIRework view = entityStatus.view;
                if (null != view)
                {
                    view.SetUIInteractable(interactable: false);
                }
            }
            else
            {
                Log.Error(FightEventErrors.PlayerNotFound(concernedEntity), 60, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\TurnEndedEvent.cs");
            }
        }
Ejemplo n.º 14
0
 public override IEnumerator UpdateView(FightStatus fightStatus)
 {
     if (GameStatus.GetFightStatus(sourceFightId).TryGetEntity(sourcePlayerId, out PlayerStatus entityStatus))
     {
         FightUIRework instance = FightUIRework.instance;
         if (null != instance)
         {
             FightInfoMessage message = FightInfoMessage.BossPointEarn(MessageInfoRibbonGroup.MyID, valueBefore - valueAfter);
             instance.DrawScore(message, entityStatus.nickname);
         }
     }
     else
     {
         Log.Error(FightEventErrors.PlayerNotFound(sourcePlayerId, sourceFightId), 29, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\BossLifeModificationEvent.cs");
     }
     yield break;
 }
Ejemplo n.º 15
0
        public override IEnumerator UpdateView(FightStatus fightStatus)
        {
            foreach (CharacterStatus item in fightStatus.EnumerateEntities((CharacterStatus c) => c.ownerId == concernedEntity))
            {
                IObjectWithAction objectWithAction;
                if ((objectWithAction = (item.view as IObjectWithAction)) != null)
                {
                    objectWithAction.SetActionUsed(actionUsed: false, turnEnded: false);
                }
            }
            if (fightStatus != FightStatus.local)
            {
                yield break;
            }
            FightUIRework instance = FightUIRework.instance;

            if (!(null != instance))
            {
                yield break;
            }
            switch (GameStatus.fightType)
            {
            case FightType.BossFight:
            case FightType.TeamVersus:
                break;

            case FightType.Versus:
                if (fightStatus.TryGetEntity(concernedEntity, out PlayerStatus entityStatus))
                {
                    if (entityStatus.isLocalPlayer)
                    {
                        yield return(instance.ShowTurnFeedback(TurnFeedbackUI.Type.Player, 61373));
                    }
                    else
                    {
                        yield return(instance.ShowTurnFeedback(TurnFeedbackUI.Type.Opponent, 30091));
                    }
                }
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Ejemplo n.º 16
0
        public override void UpdateStatus(FightStatus fightStatus)
        {
            fightStatus.endReason = GetEndReason(fightStatus);
            switch (GameStatus.fightType)
            {
            case FightType.TeamVersus:
                foreach (IEntityWithBoardPresence item in fightStatus.EnumerateEntities <IEntityWithBoardPresence>())
                {
                    IEntityWithOwner entityWithOwner;
                    if ((entityWithOwner = (item as IEntityWithOwner)) == null || entityWithOwner.teamId != winningTeamId)
                    {
                        m_removedEntities.Add(item);
                        fightStatus.RemoveEntity(item.id);
                    }
                }
                break;

            case FightType.BossFight:
                foreach (IEntityWithBoardPresence item2 in fightStatus.EnumerateEntities <IEntityWithBoardPresence>())
                {
                    m_removedEntities.Add(item2);
                    fightStatus.RemoveEntity(item2.id);
                }
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            if (fightStatus == FightStatus.local)
            {
                FightMap current3 = FightMap.current;
                if (null != current3)
                {
                    current3.Stop();
                }
                FightUIRework instance = FightUIRework.instance;
                if (null != instance)
                {
                    instance.SetResignButtonEnabled(value: false);
                }
            }
        }
Ejemplo n.º 17
0
        private void TryDrawLowLifeMessage(int lifeAfterValue, PlayerStatus ownerStatus)
        {
            FightType fightType = GameStatus.fightType;

            if ((fightType != FightType.BossFight && fightType != FightType.TeamVersus) || lifeAfterValue <= 0)
            {
                return;
            }
            int num = (int)((float)ownerStatus.heroStatus.baseLife * 0.35f);

            if (lifeAfterValue <= num && (!lifeBefore.HasValue || lifeBefore.Value > num))
            {
                MessageInfoRibbonGroup messageGroup = (GameStatus.localPlayerTeamIndex != ownerStatus.teamIndex) ? MessageInfoRibbonGroup.OtherID : MessageInfoRibbonGroup.MyID;
                FightUIRework          instance     = FightUIRework.instance;
                if (null != instance)
                {
                    FightInfoMessage message = FightInfoMessage.HeroLowLife(messageGroup);
                    instance.DrawInfoMessage(message, ownerStatus.nickname);
                }
            }
        }
Ejemplo n.º 18
0
 public virtual void SetFocus(bool value)
 {
     //IL_002b: Unknown result type (might be due to invalid IL or missing references)
     if (null == this || value == m_isFocused)
     {
         return;
     }
     if (value)
     {
         if (FightUIRework.tooltipsEnabled)
         {
             FocusCharacter();
         }
         TooltipWindowUtility.ShowFightCharacterTooltip(this, this.get_transform().get_position());
     }
     else
     {
         UnFocusCharacter();
         FightUIRework.HideTooltip();
     }
     m_isFocused = value;
 }
Ejemplo n.º 19
0
        public override void UpdateStatus(FightStatus fightStatus)
        {
            fightStatus.currentTurnPlayerId = concernedEntity;
            foreach (CharacterStatus item in fightStatus.EnumerateEntities((CharacterStatus c) => c.ownerId == concernedEntity))
            {
                item.actionUsed = false;
            }
            fightStatus.NotifyEntityPlayableStateChanged();
            if (fightStatus != FightStatus.local || fightStatus.localPlayerId != concernedEntity)
            {
                return;
            }
            FightMap current = FightMap.current;

            if (null != current)
            {
                current.SetMovementPhase();
            }
            FightUIRework instance = FightUIRework.instance;

            if (null != instance)
            {
                instance.StartLocalPlayerTurn();
            }
            if (fightStatus.TryGetEntity(concernedEntity, out PlayerStatus entityStatus))
            {
                AbstractPlayerUIRework view = entityStatus.view;
                if (null != view)
                {
                    view.SetUIInteractable(interactable: true);
                }
            }
            else
            {
                Log.Error(FightEventErrors.PlayerNotFound(concernedEntity), 55, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\TurnStartedEvent.cs");
            }
        }
Ejemplo n.º 20
0
        protected override IEnumerator Load()
        {
            if (m_concurrentFightsCount == 1)
            {
                RuntimeData.currentKeywordContext = KeywordContext.FightSolo;
            }
            else
            {
                RuntimeData.currentKeywordContext = KeywordContext.FightMulti;
            }
            instance = this;
            int fightCount = m_concurrentFightsCount;

            if (!RuntimeData.fightDefinitions.TryGetValue(m_fightDefId, out m_fightDefinition))
            {
                Log.Error(string.Format("Could not find {0} with id {1}.", "FightDefinition", m_fightDefId), 78, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\FightState.cs");
                yield break;
            }
            yield return(RuntimeData.LoadTextCollectionAsync("Fight"));

            yield return(LoadSceneAndBundleRequest("FightMapWrapper", "core/scenes/maps/fight_maps"));

            Scene sceneByName = SceneManager.GetSceneByName("FightMapWrapper");

            if (!sceneByName.get_isLoaded())
            {
                Log.Error("Could not load scene named 'FightMapWrapper' from bundle 'core/scenes/maps/fight_maps'.", 93, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\FightState.cs");
                yield break;
            }
            yield return(LoadFightMap());

            FightMap current = FightMap.current;

            if (null == current)
            {
                Log.Error("Failed to load fight map.", 104, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\States\\FightState.cs");
                yield break;
            }
            FightLogicExecutor.Initialize(fightCount);
            FightMapDefinition definition = current.definition;

            FightStatus[] array = new FightStatus[fightCount];
            for (int i = 0; i < fightCount; i++)
            {
                FightMapStatus mapStatus   = definition.CreateFightMapStatus(i);
                FightStatus    fightStatus = new FightStatus(i, mapStatus);
                if (fightStatus.fightId == m_ownFightId)
                {
                    FightStatus.local = fightStatus;
                }
                FightLogicExecutor.AddFightStatus(fightStatus);
                array[i] = fightStatus;
            }
            GameStatus.Initialize((FightType)m_fightInfo.FightType, m_fightDefinition, array);
            yield return(current.Initialize());

            VisualEffectFactory.Initialize();
            yield return(FightObjectFactory.Load());

            if (!FightObjectFactory.isReady)
            {
                yield break;
            }
            yield return(FightSpellEffectFactory.Load(fightCount));

            if (!FightSpellEffectFactory.isReady)
            {
                yield break;
            }
            yield return(FightUIFactory.Load());

            if (!FightUIFactory.isReady)
            {
                yield break;
            }
            UILoader <FightUIRework> loaderRework = new UILoader <FightUIRework>(this, "FightUIRework", "core/scenes/ui/fight");

            yield return(loaderRework.Load());

            m_uiRework = loaderRework.ui;
            m_uiRework.Init(GameStatus.fightType, m_fightDefinition);
            frame = new FightFrame
            {
                onOtherPlayerLeftFight = OnOtherPlayerLeftFight
            };
            if (m_hardResumed)
            {
                FightSnapshot snapshot = null;
                frame.onFightSnapshot = delegate(FightSnapshot fightSnapshot)
                {
                    snapshot = fightSnapshot;
                };
                frame.SendFightSnapshotRequest();
                while (snapshot == null)
                {
                    yield return(null);
                }
                frame.onFightSnapshot = null;
                yield return(ApplyFightSnapshot(snapshot));
            }
            frame.SendPlayerReady();
            while (!FightLogicExecutor.fightInitialized)
            {
                yield return(null);
            }
            yield return(uiRework.Load());
        }
Ejemplo n.º 21
0
        public override IEnumerator UpdateView(FightStatus fightStatus)
        {
            if (fightStatus.TryGetEntity(concernedEntity, out PlayerStatus playerStatus))
            {
                if (playerStatus.TryGetSpell(spellInstanceId, out SpellStatus spellStatus))
                {
                    SpellDefinition definition = spellStatus.definition;
                    if (!(null != definition))
                    {
                        yield break;
                    }
                    yield return(definition.LoadResources());

                    ICastTargetDefinition castTarget        = definition.castTarget;
                    CastTargetContext     castTargetContext = castTarget.CreateCastTargetContext(fightStatus, concernedEntity, DynamicValueHolderType.Spell, spellDefId, spellLevel, 0);
                    int count = targets.Count;
                    for (int j = 0; j < count; j++)
                    {
                        castTargetContext.SelectTarget(targets[j].ToTarget(fightStatus));
                    }
                    if (count > 0 && !playerStatus.isLocalPlayer)
                    {
                        CellObject targetedCell = GetTargetedCell(fightStatus, targets[0]);
                        yield return(FightUIRework.ShowPlayingSpell(spellStatus, targetedCell));
                    }
                    List <SpellEffectInstantiationData> spellEffectData = (List <SpellEffectInstantiationData>)definition.spellEffectData;
                    int spellEffectCount = spellEffectData.Count;
                    if (spellEffectCount > 0)
                    {
                        List <IEnumerator> routineList = ListPool <IEnumerator> .Get();

                        int num;
                        for (int i = 0; i < spellEffectCount; i = num)
                        {
                            SpellEffect spellEffect = definition.GetSpellEffect(i);
                            if (!(null == spellEffect))
                            {
                                SpellEffectInstantiationData spellEffectInstantiationData = spellEffectData[i];
                                spellEffectInstantiationData.PreComputeDelayOverDistance(castTargetContext);
                                foreach (Vector2Int item3 in spellEffectInstantiationData.EnumerateInstantiationPositions(castTargetContext))
                                {
                                    IEnumerator item = FightSpellEffectFactory.PlaySpellEffect(spellEffect, item3, spellEffectInstantiationData, castTargetContext);
                                    routineList.Add(item);
                                }
                                foreach (IsoObject item4 in spellEffectInstantiationData.EnumerateInstantiationObjectTargets(castTargetContext))
                                {
                                    IEnumerator item2 = FightSpellEffectFactory.PlaySpellEffect(spellEffect, item4, spellEffectInstantiationData, castTargetContext);
                                    routineList.Add(item2);
                                }
                                yield return(EnumeratorUtility.ParallelRecursiveImmediateSafeExecution(routineList.ToArray()));

                                routineList.Clear();
                            }
                            num = i + 1;
                        }
                        ListPool <IEnumerator> .Release(routineList);
                    }
                    FightSpellEffectFactory.SetupSpellEffectOverrides(definition, fightStatus.fightId, eventId);
                }
                else
                {
                    Log.Error($"Could not find spell with instance id {spellInstanceId} for player with id {concernedEntity}.", 128, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\PlaySpellEvent.cs");
                }
            }
            else
            {
                Log.Error(FightEventErrors.PlayerNotFound(concernedEntity), 133, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\PlaySpellEvent.cs");
            }
        }
Ejemplo n.º 22
0
        public override IEnumerator UpdateView(FightStatus fightStatus)
        {
            if (fightStatus.TryGetEntity(concernedEntity, out IEntityWithBoardPresence entityStatus))
            {
                IsoObject view = entityStatus.view;
                if (null != view)
                {
                    switch (reason)
                    {
                    case 2:
                    case 4:
                    case 6:
                    case 8:
                    case 9:
                    {
                        ICharacterObject characterObject2;
                        if ((characterObject2 = (view as ICharacterObject)) != null)
                        {
                            yield return(characterObject2.Die());
                        }
                        HeroStatus heroStatus;
                        if ((heroStatus = (entityStatus as HeroStatus)) == null)
                        {
                            break;
                        }
                        if (fightStatus.TryGetEntity(heroStatus.ownerId, out PlayerStatus entityStatus2))
                        {
                            AbstractPlayerUIRework view2 = entityStatus2.view;
                            if (null != view2)
                            {
                                view2.ChangeHeroLifePoints(0);
                            }
                            if (GameStatus.fightType == FightType.BossFight)
                            {
                                FightUIRework instance = FightUIRework.instance;
                                if (null != instance)
                                {
                                    FightInfoMessage message = FightInfoMessage.HeroDeath(MessageInfoRibbonGroup.MyID);
                                    instance.DrawInfoMessage(message, entityStatus2.nickname);
                                }
                            }
                        }
                        else
                        {
                            Log.Error(FightEventErrors.PlayerNotFound(heroStatus.ownerId), 68, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\EntityRemovedEvent.cs");
                        }
                        break;
                    }

                    case 7:
                    {
                        IObjectWithActivation objectWithActivation;
                        if ((objectWithActivation = (view as IObjectWithActivation)) != null)
                        {
                            yield return(objectWithActivation.WaitForActivationEnd());
                        }
                        else
                        {
                            Log.Error(FightEventErrors.EntityHasIncompatibleView <IObjectWithActivation>(entityStatus), 82, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\EntityRemovedEvent.cs");
                        }
                        break;
                    }

                    case 5:
                    {
                        ICharacterObject characterObject;
                        if ((characterObject = (view as ICharacterObject)) != null)
                        {
                            yield return(characterObject.Die());
                        }
                        else
                        {
                            Log.Error(FightEventErrors.EntityHasIncompatibleView <ICharacterObject>(entityStatus), 95, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\EntityRemovedEvent.cs");
                        }
                        break;
                    }

                    case 3:
                        throw new ArgumentException("Transformations should not trigger an EntityRemovedEvent.");

                    default:
                        throw new ArgumentOutOfRangeException($"EntityRemovedReason not handled: {reason}");

                    case 1:
                        break;
                    }
                    view.DetachFromCell();
                    view.Destroy();
                }
                else
                {
                    Log.Error(FightEventErrors.EntityHasNoView(entityStatus), 112, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\EntityRemovedEvent.cs");
                }
            }
            else
            {
                Log.Error(FightEventErrors.EntityNotFound <IEntityWithBoardPresence>(concernedEntity), 117, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\EntityRemovedEvent.cs");
            }
            FightLogicExecutor.FireUpdateView(fightStatus.fightId, EventCategory.EntityAddedOrRemoved);
        }