コード例 #1
0
 public Quaternion GetOrientation(Vector2Int origin, [NotNull] CastTargetContext castTargetContext)
 {
     //IL_0023: Unknown result type (might be due to invalid IL or missing references)
     //IL_0028: Unknown result type (might be due to invalid IL or missing references)
     //IL_0029: Unknown result type (might be due to invalid IL or missing references)
     //IL_002a: Unknown result type (might be due to invalid IL or missing references)
     //IL_0030: Unknown result type (might be due to invalid IL or missing references)
     //IL_005c: Unknown result type (might be due to invalid IL or missing references)
     //IL_0061: Unknown result type (might be due to invalid IL or missing references)
     //IL_0063: Unknown result type (might be due to invalid IL or missing references)
     //IL_0064: Unknown result type (might be due to invalid IL or missing references)
     //IL_006b: Unknown result type (might be due to invalid IL or missing references)
     //IL_0092: Unknown result type (might be due to invalid IL or missing references)
     if (m_orientation != null)
     {
         ISingleCoordSelector singleCoordSelector = m_orientation as ISingleCoordSelector;
         if (singleCoordSelector != null && singleCoordSelector.TryGetCoord(castTargetContext, out Coord coord))
         {
             Vector2Int to = (Vector2Int)coord;
             return(origin.GetDirectionTo(to).GetRotation());
         }
         ISingleEntitySelector singleEntitySelector = m_orientation as ISingleEntitySelector;
         if (singleEntitySelector != null && singleEntitySelector.TryGetEntity(castTargetContext, out IEntityWithBoardPresence entity))
         {
             Vector2Int coords = entity.view.cellObject.coords;
             return(origin.GetDirectionTo(coords).GetRotation());
         }
     }
     else
     {
         Log.Warning($"Requested orientation but not orientation target is set (spell definition id: {castTargetContext.spellDefinitionId}).", 78, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Spells\\SpellEffectInstantiationData.cs");
     }
     return(Quaternion.get_identity());
 }
コード例 #2
0
        public bool TryGetCoord(DynamicValueContext context, out Coord coord)
        {
            CastTargetContext castTargetContext = context as CastTargetContext;

            if (castTargetContext != null)
            {
                Target target = castTargetContext.GetTarget(1);
                if (target.type == Target.Type.Coord)
                {
                    coord = target.coord;
                    return(true);
                }
            }
            coord = default(Coord);
            return(false);
        }
コード例 #3
0
        public override void UpdateModifications(ref GaugesModification modifications, PlayerStatus player, DynamicValueContext context)
        {
            this.value.GetValue(context, out int value);
            CastTargetContext castTargetContext = context as CastTargetContext;

            if (castTargetContext != null)
            {
                if (!RuntimeData.spellDefinitions.TryGetValue(castTargetContext.spellDefinitionId, out SpellDefinition value2))
                {
                    Log.Error($"Could not find spell definition with id {castTargetContext.spellDefinitionId}.", 69, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Costs\\ActionPointsCost.cs");
                    return;
                }
                value = SpellCostModification.ApplyCostModification(player.spellCostModifiers, value, value2, castTargetContext);
            }
            modifications.Increment(CaracId.ActionPoints, -value);
        }
コード例 #4
0
        public bool TryGetEntity <T>(DynamicValueContext context, out T entity) where T : class, IEntity
        {
            CastTargetContext castTargetContext = context as CastTargetContext;

            if (castTargetContext != null)
            {
                Target target = castTargetContext.GetTarget(1);
                if (target.type == Target.Type.Entity)
                {
                    T val = target.entity as T;
                    if (val != null)
                    {
                        entity = val;
                        return(true);
                    }
                }
            }
            entity = null;
            return(false);
        }
コード例 #5
0
        public bool TryGetEntity <T>(DynamicValueContext context, out T entity) where T : class, IEntity
        {
            CastTargetContext castTargetContext = context as CastTargetContext;

            if (castTargetContext != null)
            {
                Target target = castTargetContext.GetTarget(0);
                if (target.type == Target.Type.Entity)
                {
                    IEntity entity2 = target.entity;
                    if (entity2 is T)
                    {
                        entity = (T)entity2;
                        return(true);
                    }
                }
            }
            entity = null;
            return(false);
        }
コード例 #6
0
        private static CastValidity CheckForSpell(PlayerStatus playerStatus, DynamicValueContext context, int baseCost)
        {
            CastTargetContext castTargetContext = context as CastTargetContext;

            if (castTargetContext == null)
            {
                return(CastValidity.DATA_ERROR);
            }
            if (!RuntimeData.spellDefinitions.TryGetValue(castTargetContext.spellDefinitionId, out SpellDefinition value))
            {
                Log.Error($"Could not find spell definition with id {castTargetContext.spellDefinitionId}.", 44, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Costs\\ActionPointsCost.cs");
                return(CastValidity.DATA_ERROR);
            }
            int num = SpellCostModification.ApplyCostModification(playerStatus.spellCostModifiers, baseCost, value, castTargetContext);

            if (playerStatus.actionPoints < num)
            {
                return(CastValidity.NOT_ENOUGH_ACTION_POINTS);
            }
            return(CastValidity.SUCCESS);
        }
コード例 #7
0
        public IEnumerable <IEntity> Filter(IEnumerable <IEntity> entities, DynamicValueContext context)
        {
            CastTargetContext castTargetContext = context as CastTargetContext;

            if (castTargetContext != null)
            {
                Target target = castTargetContext.GetTarget(m_castTargetIndex);
                if (target.type == Target.Type.Entity)
                {
                    IEntity entity = target.entity;
                    foreach (IEntity entity2 in entities)
                    {
                        if (entity == entity2)
                        {
                            yield return(entity);

                            yield break;
                        }
                    }
                }
            }
        }
コード例 #8
0
 public IEnumerable <Target> EnumerateTargets(CastTargetContext castTargetContext)
 {
     return(((castTargetContext.selectedTargetCount == 0) ? m_selector1 : m_selector2).EnumerateTargets(castTargetContext));
 }
コード例 #9
0
 public IEnumerable <Target> EnumerateTargets(CastTargetContext castTargetContext)
 {
     return(m_selector.EnumerateTargets(castTargetContext));
 }
コード例 #10
0
 public IEnumerable <Target> EnumerateTargets(CastTargetContext castTargetContext)
 {
     return(m_selectors[castTargetContext.selectedTargetCount].EnumerateTargets(castTargetContext));
 }