示例#1
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);
            }
        }
        public override void UpdateStatus(FightStatus fightStatus)
        {
            fightStatus.RemoveEntity(concernedEntity);
            if (fightStatus.TryGetEntity(ownerId, out PlayerStatus entityStatus))
            {
                EntityType   newEntityType = (EntityType)this.newEntityType;
                EntityStatus entityStatus2;
                switch (newEntityType)
                {
                case EntityType.Hero:
                    throw new Exception("[TransformationEvent] Heroes cannot be transformed.");

                case EntityType.Companion:
                    entityStatus2 = CompanionAddedEvent.CreateCompanionStatus(newEntityId, entityDefId, level, entityStatus, refCoord);
                    break;

                case EntityType.Summoning:
                    entityStatus2 = SummoningAddedEvent.CreateSummoningStatus(newEntityId, entityDefId, level, entityStatus, refCoord);
                    break;

                case EntityType.FloorMechanism:
                    entityStatus2 = FloorMechanismAddedEvent.CreateFloorMechanismStatus(newEntityId, entityDefId, level, entityStatus, refCoord);
                    break;

                case EntityType.ObjectMechanism:
                    entityStatus2 = ObjectMechanismAddedEvent.CreateObjectMechanismStatus(newEntityId, entityDefId, level, entityStatus, refCoord);
                    break;

                case EntityType.Global:
                case EntityType.Player:
                case EntityType.Team:
                    Log.Error($"Transformation not handled for type {newEntityType}.", 48, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\TransformationEvent.cs");
                    return;

                default:
                    throw new ArgumentOutOfRangeException();
                }
                IEntityWithAction entityWithAction;
                if (copyActionUsed && fightStatus.TryGetEntity(concernedEntity, out IEntityWithAction entityStatus3) && (entityWithAction = (entityStatus2 as IEntityWithAction)) != null)
                {
                    entityWithAction.actionUsed = entityStatus3.actionUsed;
                    fightStatus.NotifyEntityPlayableStateChanged();
                }
                fightStatus.AddEntity(entityStatus2);
            }
            else
            {
                Log.Error(FightEventErrors.PlayerNotFound(ownerId), 72, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\TransformationEvent.cs");
            }
            FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.EntityAddedOrRemoved);
        }
        public override void UpdateStatus(FightStatus fightStatus)
        {
            if (!fightStatus.TryGetEntity(ownerId, out PlayerStatus entityStatus))
            {
                Log.Error(string.Format("Could not find a {0} entity with id {1}.", "PlayerStatus", ownerId), 17, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\SummoningAddedEvent.cs");
                return;
            }
            SummoningStatus summoningStatus = CreateSummoningStatus(concernedEntity, entityDefId, level, entityStatus, refCoord);

            if (summoningStatus != null)
            {
                fightStatus.AddEntity(summoningStatus);
                FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.EntityAddedOrRemoved);
            }
        }
 public override void UpdateStatus(FightStatus fightStatus)
 {
     if (fightStatus.TryGetEntity(ownerId, out PlayerStatus entityStatus))
     {
         FloorMechanismStatus floorMechanismStatus = CreateFloorMechanismStatus(concernedEntity, entityDefId, level, entityStatus, refCoord);
         if (floorMechanismStatus != null)
         {
             fightStatus.AddEntity(floorMechanismStatus);
         }
     }
     else
     {
         Log.Error(FightEventErrors.PlayerNotFound(ownerId), 25, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\FloorMechanismAddedEvent.cs");
     }
     FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.EntityAddedOrRemoved);
 }
示例#5
0
 public override void UpdateStatus(FightStatus fightStatus)
 {
     if (fightStatus.TryGetEntity(ownerId, out PlayerStatus entityStatus))
     {
         CompanionStatus companionStatus = CreateCompanionStatus(concernedEntity, entityDefId, level, entityStatus, refCoord);
         if (companionStatus != null)
         {
             fightStatus.AddEntity(companionStatus);
         }
         if (entityStatus.isLocalPlayer)
         {
             FightCastManager.CheckCompanionInvoked(entityDefId);
         }
     }
     else
     {
         Log.Error(FightEventErrors.PlayerNotFound(ownerId), 32, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\CompanionAddedEvent.cs");
     }
     FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.EntityAddedOrRemoved);
 }
示例#6
0
 public override void UpdateStatus(FightStatus fightStatus)
 {
     //IL_0046: Unknown result type (might be due to invalid IL or missing references)
     if (fightStatus.TryGetEntity(ownerId, out PlayerStatus entityStatus))
     {
         Gender gender = (Gender)this.gender;
         if (RuntimeData.weaponDefinitions.TryGetValue(entityDefId, out WeaponDefinition value))
         {
             HeroStatus heroStatus = HeroStatus.Create(concernedEntity, value, level, gender, entityStatus, (Vector2Int)refCoord);
             fightStatus.AddEntity(heroStatus);
             entityStatus.heroStatus = heroStatus;
             AbstractPlayerUIRework view = entityStatus.view;
             if (null != view)
             {
                 view.SetHeroIllustration(value, gender);
                 view.SetHeroStartLifePoints(heroStatus.baseLife, entityStatus.playerType);
                 if (RuntimeData.reserveDefinitions.TryGetValue(value.god, out ReserveDefinition value2))
                 {
                     view.SetupReserve(heroStatus, value2);
                 }
                 else
                 {
                     Log.Error(FightEventErrors.DefinitionNotFound <ReserveDefinition>((int)value.god), 45, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\HeroAddedEvent.cs");
                 }
             }
         }
         else
         {
             Log.Error(FightEventErrors.EntityCreationFailed <HeroStatus, WeaponDefinition>(concernedEntity, entityDefId), 51, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\HeroAddedEvent.cs");
         }
     }
     else
     {
         Log.Error(FightEventErrors.PlayerNotFound(ownerId), 56, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\HeroAddedEvent.cs");
     }
     FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.EntityAddedOrRemoved);
 }