Exemplo n.º 1
0
        private void RemoveFightEventListeners(int companionDefinitionId, int fightId, bool status)
        {
            List <EventCategory> list = new List <EventCategory>();
            Dictionary <EventCategory, List <int> > dictionary = status ? m_companionsPerCategoryInvalidatingStatus : m_companionsPerCategoryInvalidatingView;

            foreach (KeyValuePair <EventCategory, List <int> > item in dictionary)
            {
                for (int num = item.Value.Count - 1; num >= 0; num--)
                {
                    if (item.Value[num] == companionDefinitionId)
                    {
                        item.Value.RemoveAt(num);
                        break;
                    }
                }
                if (item.Value.Count == 0)
                {
                    list.Add(item.Key);
                }
            }
            foreach (EventCategory item2 in list)
            {
                if (status)
                {
                    FightLogicExecutor.RemoveListenerUpdateStatus(fightId, OnCastingValidityUpdated, item2);
                }
                else
                {
                    FightLogicExecutor.RemoveListenerUpdateView(fightId, OnCastingValidityViewUpdated, item2);
                }
                dictionary.Remove(item2);
            }
        }
Exemplo n.º 2
0
 public override void UpdateStatus(FightStatus fightStatus)
 {
     //IL_002f: Unknown result type (might be due to invalid IL or missing references)
     //IL_0043: Unknown result type (might be due to invalid IL or missing references)
     //IL_0048: Unknown result type (might be due to invalid IL or missing references)
     //IL_004f: Unknown result type (might be due to invalid IL or missing references)
     if (fightStatus.TryGetEntity(concernedEntity, out IEntityWithBoardPresence entityStatus))
     {
         Area       area         = entityStatus.area;
         int        count        = cells.Count;
         Vector2Int val          = (Vector2Int)cells[0];
         Vector2Int newRefCoords = (Vector2Int)cells[count - 1];
         entityStatus.area.MoveTo(newRefCoords);
         fightStatus.NotifyEntityAreaMoved();
         CharacterStatus characterStatus;
         if (IsMovementAction() && (characterStatus = (entityStatus as CharacterStatus)) != null)
         {
             characterStatus.actionUsed = true;
             fightStatus.NotifyEntityPlayableStateChanged();
         }
     }
     else
     {
         Log.Error(FightEventErrors.EntityNotFound <IEntityWithBoardPresence>(concernedEntity), 46, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\EntityAreaMovedEvent.cs");
     }
     FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.EntityMoved);
 }
Exemplo n.º 3
0
 public override void UpdateStatus(FightStatus fightStatus)
 {
     if (fightStatus.TryGetEntity(concernedEntity, out IEntityWithElementaryState entityStatus))
     {
         entityStatus.ChangeElementaryState((ElementaryStates)elementaryState);
     }
     else
     {
         Log.Error(FightEventErrors.EntityNotFound <IEntityWithElementaryState>(concernedEntity), 19, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\ElementaryChangedEvent.cs");
     }
     FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.ElementaryStateChanged);
 }
Exemplo n.º 4
0
        protected override void Enable()
        {
            //IL_002f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0049: Unknown result type (might be due to invalid IL or missing references)
            m_uiRework.OnQuitRequest       += OnQuitClick;
            m_uiRework.onTurnEndButtonClick = EndTurn;
            SceneManager.SetActiveScene(m_fightMapScene);
            RenderSettings.set_ambientLight(FightMap.current.ambience.lightSettings.ambientColor);
            FightLogicExecutor.Start();
            FightMap current = FightMap.current;

            if (null != current)
            {
                current.Begin();
            }
        }
Exemplo n.º 5
0
 public override void UpdateStatus(FightStatus fightStatus)
 {
     if (fightStatus.TryGetEntity(concernedEntity, out IEntityWithMovement entityStatus))
     {
         if (entityStatus.GetCarac(CaracId.MovementPoints) != valueBefore)
         {
             Log.Warning($"The previous movement points value ({entityStatus.GetCarac(CaracId.MovementPoints)}) for entity with id {concernedEntity} doesn't match the value in the event ({valueBefore}).", 18, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\MovementPointsChangedEvent.cs");
         }
         entityStatus.SetCarac(CaracId.MovementPoints, valueAfter);
     }
     else
     {
         Log.Error(FightEventErrors.EntityNotFound <IEntityWithMovement>(concernedEntity), 25, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\MovementPointsChangedEvent.cs");
     }
     FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.MovementPointsChanged);
 }
 public override void UpdateStatus(FightStatus fightStatus)
 {
     if (fightStatus.TryGetEntity(concernedEntity, out PlayerStatus entityStatus))
     {
         entityStatus.RemoveSpellCostModifier(stoppedModifierId);
         AbstractPlayerUIRework view = entityStatus.view;
         if (null != view)
         {
             view.RefreshAvailableActions(recomputeSpellCosts: true);
         }
     }
     else
     {
         Log.Error(FightEventErrors.PlayerNotFound(concernedEntity), 25, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\SpellCostModifierRemovedEvent.cs");
     }
     FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.SpellCostModification);
 }
Exemplo n.º 7
0
 public override IEnumerator UpdateView(FightStatus fightStatus)
 {
     if (fightStatus.TryGetEntity(concernedEntity, out PlayerStatus entityStatus))
     {
         AbstractPlayerUIRework view = entityStatus.view;
         if (null != view)
         {
             view.ChangeActionPoints(valueAfter);
             yield return(view.UpdateAvailableActions(recomputeSpellCosts: false));
         }
     }
     else
     {
         Log.Error(FightEventErrors.PlayerNotFound(concernedEntity), 50, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\ActionPointsChangedEvent.cs");
     }
     FightLogicExecutor.FireUpdateView(fightStatus.fightId, EventCategory.ActionPointsChanged);
 }
Exemplo n.º 8
0
        protected override void Disable()
        {
            if (frame != null)
            {
                frame.Dispose();
                frame = null;
            }
            m_uiRework.OnQuitRequest       -= OnQuitClick;
            m_uiRework.onTurnEndButtonClick = null;
            FightMap current = FightMap.current;

            if (null != current)
            {
                current.End();
            }
            FightLogicExecutor.Stop();
        }
 public override IEnumerator UpdateView(FightStatus fightStatus)
 {
     if (fightStatus.TryGetEntity(concernedEntity, out PlayerStatus entityStatus))
     {
         AbstractPlayerUIRework view = entityStatus.view;
         if (null != view)
         {
             view.ChangeReservePoints(valueAfter);
         }
     }
     else
     {
         Log.Error(FightEventErrors.PlayerNotFound(concernedEntity), 49, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\ReservePointsChangedEvent.cs");
     }
     FightLogicExecutor.FireUpdateView(fightStatus.fightId, EventCategory.ReserveChanged);
     yield break;
 }
        public override IEnumerator UpdateView(FightStatus fightStatus)
        {
            if (fightStatus.TryGetEntity(concernedEntity, out PlayerStatus entityStatus))
            {
                AbstractPlayerUIRework playerUI = entityStatus.view;
                if (null != playerUI)
                {
                    yield return(playerUI.RemoveSpellCostModifier(stoppedModifierId));

                    yield return(playerUI.UpdateAvailableActions(recomputeSpellCosts: true));
                }
            }
            else
            {
                Log.Error(FightEventErrors.PlayerNotFound(concernedEntity), 45, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\SpellCostModifierRemovedEvent.cs");
            }
            FightLogicExecutor.FireUpdateView(fightStatus.fightId, EventCategory.SpellCostModification);
        }
Exemplo n.º 11
0
        private void AddFightEventListener(ReserveCompanionStatus companionStatus, EventCategory eventCategory, bool status)
        {
            Dictionary <EventCategory, List <int> > dictionary = status ? m_companionsPerCategoryInvalidatingStatus : m_companionsPerCategoryInvalidatingView;

            if (!dictionary.TryGetValue(eventCategory, out List <int> value))
            {
                value = new List <int>();
                dictionary.Add(eventCategory, value);
                if (status)
                {
                    FightLogicExecutor.AddListenerUpdateStatus(companionStatus.ownerPlayer.fightId, OnCastingValidityUpdated, eventCategory);
                }
                else
                {
                    FightLogicExecutor.AddListenerUpdateView(companionStatus.ownerPlayer.fightId, OnCastingValidityViewUpdated, eventCategory);
                }
            }
            value.Add(companionStatus.definition.get_id());
        }
Exemplo n.º 12
0
        public override IEnumerator UpdateView(FightStatus fightStatus)
        {
            int fightId = fightStatus.fightId;

            if (fightStatus.TryGetEntity(concernedEntity, out IEntityWithMovement entityStatus))
            {
                IsoObject isoObject = entityStatus.view;
                if (null != isoObject)
                {
                    IObjectWithMovement objectWithMovement;
                    if ((objectWithMovement = (isoObject as IObjectWithMovement)) != null)
                    {
                        objectWithMovement.SetMovementPoints(valueAfter);
                    }
                    else
                    {
                        Log.Error(FightEventErrors.EntityHasIncompatibleView <IObjectWithMovement>(entityStatus), 46, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\MovementPointsChangedEvent.cs");
                    }
                    if (valueAfter > valueBefore)
                    {
                        yield return(FightSpellEffectFactory.PlayGenericEffect(SpellEffectKey.MovementPointGain, fightId, parentEventId, isoObject, fightStatus.context));

                        ValueChangedFeedback.Launch(valueAfter - valueBefore, ValueChangedFeedback.Type.Movement, isoObject.cellObject.get_transform());
                    }
                    else
                    {
                        yield return(FightSpellEffectFactory.PlayGenericEffect(SpellEffectKey.MovementPointLoss, fightId, parentEventId, isoObject, fightStatus.context));

                        ValueChangedFeedback.Launch(valueAfter - valueBefore, ValueChangedFeedback.Type.Movement, isoObject.cellObject.get_transform());
                    }
                }
                else
                {
                    Log.Error(FightEventErrors.EntityHasNoView(entityStatus), 62, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\MovementPointsChangedEvent.cs");
                }
            }
            else
            {
                Log.Error(FightEventErrors.EntityNotFound <IEntityWithMovement>(concernedEntity), 67, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\MovementPointsChangedEvent.cs");
            }
            FightLogicExecutor.FireUpdateView(fightId, EventCategory.MovementPointsChanged);
        }
 public override void UpdateStatus(FightStatus fightStatus)
 {
     if (fightStatus.TryGetEntity(concernedEntity, out PlayerStatus entityStatus))
     {
         if (entityStatus.reservePoints != valueBefore)
         {
             Log.Warning($"The previous reserve points value ({entityStatus.reservePoints}) for player with id {concernedEntity} doesn't match the value in the event ({valueBefore}).", 17, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\ReservePointsChangedEvent.cs");
         }
         entityStatus.SetCarac(CaracId.ReservePoints, valueAfter);
         AbstractPlayerUIRework view = entityStatus.view;
         if (!(null != view))
         {
         }
     }
     else
     {
         Log.Error(FightEventErrors.PlayerNotFound(concernedEntity), 31, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\ReservePointsChangedEvent.cs");
     }
     FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.ReserveChanged);
 }
Exemplo n.º 14
0
 public override IEnumerator UpdateView(FightStatus fightStatus)
 {
     if (fightStatus.TryGetEntity(concernedEntity, out IEntityWithBoardPresence entityStatus))
     {
         IObjectWithElementaryState objectWithElementaryState;
         if ((objectWithElementaryState = (entityStatus.view as IObjectWithElementaryState)) != null)
         {
             objectWithElementaryState.SetElementaryState((ElementaryStates)elementaryState);
         }
         else
         {
             Log.Error(FightEventErrors.EntityHasIncompatibleView <IObjectWithElementaryState>(entityStatus), 35, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\ElementaryChangedEvent.cs");
         }
     }
     else
     {
         Log.Error(FightEventErrors.EntityNotFound <IEntityWithBoardPresence>(concernedEntity), 40, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\ElementaryChangedEvent.cs");
     }
     FightLogicExecutor.FireUpdateView(fightStatus.fightId, EventCategory.ElementaryStateChanged);
     yield break;
 }
 public override void UpdateStatus(FightStatus fightStatus)
 {
     if (fightStatus.TryGetEntity(concernedEntity, out PlayerStatus entityStatus))
     {
         CaracId element = (CaracId)this.element;
         if (entityStatus.GetCarac(element) != valueBefore)
         {
             Log.Warning($"The previous element points value ({entityStatus.GetCarac(element)}) for player with id {concernedEntity} doesn't match the value in the event ({valueBefore}).", 20, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\ElementPointsChangedEvent.cs");
         }
         entityStatus.SetCarac(element, valueAfter);
         AbstractPlayerUIRework view = entityStatus.view;
         if (null != view)
         {
             view.RefreshAvailableCompanions();
         }
     }
     else
     {
         Log.Error(FightEventErrors.PlayerNotFound(concernedEntity), 33, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\ElementPointsChangedEvent.cs");
     }
     FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.ElementPointsChanged);
 }