Esempio n. 1
0
 public void ClearFloatingCounterEffect()
 {
     if (null != m_currentFloatingCounterFeedback)
     {
         FightSpellEffectFactory.DestroyFloatingCounterFeedback(m_currentFloatingCounterFeedback);
         m_currentFloatingCounterFeedback = null;
     }
 }
Esempio n. 2
0
        public IEnumerator InitializeFloatingCounterEffect(FloatingCounterEffect floatingCounterEffect, int value)
        {
            if (null != m_currentFloatingCounterFeedback)
            {
                Log.Warning("InitializeFloatingCounterEffect called on " + base.GetType().Name + " named " + this.get_name() + " but a floating counter feedback is already attached.", 662, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\CharacterObject.cs");
            }
            FloatingCounterFeedback floatingCounterFeedback = FightSpellEffectFactory.InstantiateFloatingCounterFeedback(m_attachableEffectsContainer);

            if (!(null == floatingCounterFeedback))
            {
                m_currentFloatingCounterFeedback = floatingCounterFeedback;
                yield return(floatingCounterFeedback.Launch(this, floatingCounterEffect, value));
            }
        }
Esempio n. 3
0
 public override IEnumerator UpdateView(FightStatus fightStatus)
 {
     if (fightStatus.TryGetEntity(concernedEntity, out IEntityWithBoardPresence entityStatus))
     {
         IObjectWithCounterEffects objectWithCounterEffects;
         IObjectWithCounterEffects isoObject = objectWithCounterEffects = (entityStatus.view as IObjectWithCounterEffects);
         if (objectWithCounterEffects != null)
         {
             if (counterReplaced.HasValue)
             {
                 yield return(isoObject.RemoveFloatingCounterEffect());
             }
             CaracId floatingCounterType = (CaracId)this.floatingCounterType;
             if (!FightSpellEffectFactory.TryGetFloatingCounterEffect(floatingCounterType, (PropertyId?)sightProperty, out FloatingCounterEffect effect))
             {
                 yield break;
             }
             if (null != effect)
             {
                 if (valueBefore == 0 || counterReplaced.HasValue)
                 {
                     yield return(isoObject.InitializeFloatingCounterEffect(effect, valueAfter));
                 }
                 else
                 {
                     FloatingCounterFeedback currentFloatingCounterFeedback = isoObject.GetCurrentFloatingCounterFeedback();
                     currentFloatingCounterFeedback.ChangeVisual(effect);
                     yield return(currentFloatingCounterFeedback.SetCount(valueAfter));
                 }
                 if (parentEventId.HasValue)
                 {
                     FightSpellEffectFactory.SetupSpellEffectOverrides(effect, fightStatus.fightId, parentEventId.Value);
                 }
             }
             else
             {
                 Log.Error(string.Format("No prefab defined for {0} {1}.", "FloatingCounterEffect", floatingCounterType), 68, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\FloatingCounterValueChangedEvent.cs");
             }
         }
         else
         {
             Log.Error(FightEventErrors.EntityHasIncompatibleView <IObjectWithCounterEffects>(entityStatus), 74, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\FloatingCounterValueChangedEvent.cs");
         }
     }
     else
     {
         Log.Error(FightEventErrors.EntityNotFound <IEntityWithBoardPresence>(concernedEntity), 79, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\FloatingCounterValueChangedEvent.cs");
     }
 }
 public static void DestroyFloatingCounterFeedback([NotNull] FloatingCounterFeedback instance)
 {
     instance.Clear();
     s_floatingCounterFeedbackPool.Release(instance.get_gameObject());
 }