Example #1
0
 public void DrawInfoMessage(FightInfoMessage message, params string[] parameters)
 {
     if (m_messageRibbonRoot != null)
     {
         m_messageRibbonRoot.BuildAndDrawInfoMessage(message, parameters);
     }
 }
Example #2
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");
            }
        }
Example #3
0
 public void DrawScore(FightInfoMessage message, string playerOrigin)
 {
     if (m_messageRibbonRoot != null)
     {
         m_messageRibbonRoot.BuildAndDrawScoreMessage(message, playerOrigin);
     }
 }
Example #4
0
 public void SetScore(FightScore score, string playerOrigin, TeamsScoreModificationReason reason)
 {
     if (m_teamPointCounter != null)
     {
         m_teamPointCounter.OnScoreChange(score);
     }
     if (reason != TeamsScoreModificationReason.HeroLifeModified)
     {
         FightInfoMessage message = FightInfoMessage.Score(score, reason);
         DrawScore(message, playerOrigin);
     }
 }
Example #5
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;
 }
Example #6
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);
                }
            }
        }
Example #7
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);
        }