예제 #1
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);
 }
예제 #2
0
        public override void UpdateStatus(FightStatus fightStatus)
        {
            if (fightStatus.TryGetEntity(concernedEntity, out PlayerStatus entityStatus))
            {
                bool flag  = fightStatus == FightStatus.local;
                int  count = moves.Count;
                for (int i = 0; i < count; i++)
                {
                    SpellMovement spellMovement = moves[i];
                    if (flag)
                    {
                        FightCastManager.CheckSpellPlayed(spellMovement.Spell.SpellInstanceId);
                    }
                    switch (spellMovement.To)
                    {
                    case Ankama.Cube.Protocols.FightCommonProtocol.SpellMovementZone.Nowhere:
                    case Ankama.Cube.Protocols.FightCommonProtocol.SpellMovementZone.Deck:
                        if (spellMovement.From == Ankama.Cube.Protocols.FightCommonProtocol.SpellMovementZone.Hand)
                        {
                            int spellInstanceId = spellMovement.Spell.SpellInstanceId;
                            entityStatus.RemoveSpell(spellInstanceId);
                            AbstractPlayerUIRework view2 = entityStatus.view;
                            if (null != view2)
                            {
                                view2.RemoveSpellStatus(spellInstanceId, i);
                            }
                        }
                        break;

                    case Ankama.Cube.Protocols.FightCommonProtocol.SpellMovementZone.Hand:
                    {
                        SpellInfo   spell       = spellMovement.Spell;
                        SpellStatus spellStatus = SpellStatus.TryCreate(spell, entityStatus);
                        if (spellStatus != null)
                        {
                            entityStatus.AddSpell(spellStatus);
                            AbstractPlayerUIRework view = entityStatus.view;
                            if (null != view)
                            {
                                view.AddSpellStatus(spell, i);
                            }
                        }
                        break;
                    }

                    default:
                        throw new ArgumentOutOfRangeException($"Spell moved to unknown zone: {spellMovement.To}");
                    }
                }
            }
            else
            {
                Log.Error(FightEventErrors.PlayerNotFound(concernedEntity), 75, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\SpellsMovedEvent.cs");
            }
            FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.SpellsMoved);
        }
 public override void UpdateStatus(FightStatus fightStatus)
 {
     if (fightStatus.TryGetEntity(concernedEntity, out IEntity entityStatus))
     {
         entityStatus.SetCarac(CaracId.MagicalDamageModifier, valueAfter);
     }
     else
     {
         Log.Error(FightEventErrors.EntityNotFound <IEntity>(concernedEntity), 18, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\MagicalDamageModifierChangedEvent.cs");
     }
     FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.DamageModifierChanged);
 }
 public override void UpdateStatus(FightStatus fightStatus)
 {
     if (fightStatus.TryGetEntity(concernedEntity, out IEntityWithLife entityStatus))
     {
         entityStatus.SetCarac(CaracId.LifeMax, maxLifeAfter);
     }
     else
     {
         Log.Error(FightEventErrors.EntityNotFound <IEntityWithLife>(concernedEntity), 21, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\MaxLifeChangedEvent.cs");
     }
     FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.LifeArmorChanged);
 }
예제 #5
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);
 }
        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);
 }
예제 #9
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);
 }
예제 #11
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);
 }
 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);
 }
 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);
 }
예제 #14
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);
 }
        public override void UpdateStatus(FightStatus fightStatus)
        {
            PropertyId propertyId = (PropertyId)this.propertyId;

            if (fightStatus.TryGetEntity(concernedEntity, out EntityStatus entityStatus))
            {
                if (propertyReplaced.HasValue)
                {
                    PropertyId value = (PropertyId)propertyReplaced.Value;
                    if (value != propertyId)
                    {
                        entityStatus.RemoveProperty(value);
                        PropertyStatusChanged(fightStatus, value);
                        entityStatus.AddProperty(propertyId);
                        PropertyStatusChanged(fightStatus, propertyId);
                    }
                }
                else
                {
                    if (active)
                    {
                        entityStatus.AddProperty(propertyId);
                    }
                    else
                    {
                        entityStatus.RemoveProperty(propertyId);
                    }
                    PropertyStatusChanged(fightStatus, propertyId);
                }
            }
            else
            {
                Log.Error(FightEventErrors.EntityNotFound <EntityStatus>(concernedEntity), 49, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\PropertyChangedEvent.cs");
            }
            FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.PropertyChanged);
        }
예제 #16
0
 public override void UpdateStatus(FightStatus fightStatus)
 {
     fightStatus.RemoveEntity(concernedEntity);
     FightLogicExecutor.FireUpdateStatus(fightStatus.fightId, EventCategory.EntityAddedOrRemoved);
 }