示例#1
0
        public override bool Equals(object obj)
        {
            SequenceSource sequenceSource = obj as SequenceSource;

            if ((object)sequenceSource == null)
            {
                return(false);
            }
            return((int)RootID == (int)sequenceSource.RootID);
        }
示例#2
0
        public static bool DidSequenceHit(SequenceSource src, Vector3 position)
        {
            if (s_idsToSrcs.ContainsKey(src.RootID))
            {
                List <SequenceSource> idsToSrc = s_idsToSrcs[src.RootID];
                for (int index = 0; index < idsToSrc.Count; ++index)
                {
                    if (idsToSrc[index].m_hitPositions.Contains(position))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
示例#3
0
//        public void OnSequenceHit(
//            Sequence seq,
//            ActorData target,
//            ActorModelData.ImpulseInfo impulseInfo,
//            ActorModelData.RagdollActivation ragdollActivation = ActorModelData.RagdollActivation.HealthBased,
//            bool tryHitReactIfAlreadyHit = true)
//        {
//            AbilityPriority currentAbilityPhase = ServerClientUtils.GetCurrentAbilityPhase();
//            if (m_hitTurn != GameFlowData.Get().CurrentTurn || m_hitPhase != currentAbilityPhase)
//            {
//                m_hitTurn = GameFlowData.Get().CurrentTurn;
//                m_hitPhase = currentAbilityPhase;
//                m_hitPositions.Clear();
//                m_hitActors.Clear();
//            }
//
//            bool flag = false;
//            if (!m_hitActors.Contains(target))
//            {
//                if (m_onHitActor != null)
//                    m_onHitActor(target);
//            }
//            else
//                flag = true;
//
//            m_hitActors.Add(target);
//            if ((Object) seq != null && (tryHitReactIfAlreadyHit || !flag))
//                TheatricsManager.Get().OnSequenceHit(seq, target, impulseInfo, ragdollActivation);
//            if (!SequenceManager.SequenceDebugTraceOn)
//                return;
//            Debug.LogWarning((object) ("<color=yellow>Sequence Actor Hit: </color><<color=lightblue>" +
//                                       seq.gameObject.name + " | " + (object) seq.GetType() + "</color>> \nhit on: " +
//                                       target.\u0012("white") + " @time= " + (object) Time.time));
//        }
//
//        public void OnSequenceHit(
//            Sequence seq,
//            Vector3 position,
//            ActorModelData.ImpulseInfo impulseInfo = null)
//        {
//            AbilityPriority currentAbilityPhase = ServerClientUtils.GetCurrentAbilityPhase();
//            if (m_hitTurn != GameFlowData.Get().CurrentTurn || m_hitPhase != currentAbilityPhase)
//            {
//                m_hitTurn = GameFlowData.Get().CurrentTurn;
//                m_hitPhase = currentAbilityPhase;
//                m_hitPositions.Clear();
//                m_hitActors.Clear();
//            }
//
//            if (!m_hitPositions.Contains(position))
//            {
//                m_hitPositions.Add(position);
//                if (m_onHitPosition != null)
//                    m_onHitPosition(position);
//            }
//
//            if (!SequenceManager.SequenceDebugTraceOn)
//                return;
//            Debug.LogWarning((object) ("<color=yellow>Sequence Position Hit: </color><<color=lightblue>" +
//                                       seq.gameObject.name + " | " + (object) seq.GetType() + "</color>> \nhit at: " +
//                                       position + " @time= " + (object) Time.time));
//        }

        public static bool DidSequenceHit(SequenceSource src, ActorData target)
        {
            if (s_idsToSrcs.ContainsKey(src.RootID))
            {
                List <SequenceSource> idsToSrc = s_idsToSrcs[src.RootID];
                for (int index = 0; index < idsToSrc.Count; ++index)
                {
                    if (idsToSrc[index].m_hitActors.Contains(target))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
示例#4
0
 public SequenceSource(
     ActorDelegate onHitActor,
     Vector3Delegate onHitPosition,
     bool removeAtEndOfTurn      = true,
     SequenceSource parentSource = null,
     IBitStream stream           = null)
 {
     m_onHitActor        = onHitActor;
     m_onHitPosition     = onHitPosition;
     RemoveAtEndOfTurn   = removeAtEndOfTurn;
     WaitForClientEnable = false;
     if (stream == null)
     {
         RootID = !(parentSource == null)
             ? parentSource.RootID
             : AllocateID();
     }
     else
     {
         OnSerializeHelper(stream);
     }
 }
示例#5
0
 public bool Equals(SequenceSource p)
 {
     return((int)RootID == (int)p.RootID);
 }
示例#6
0
        internal void u000Du000E(IBitStream _param1)
        {
            sbyte num1 = (sbyte)u000E;
            sbyte num2 = (sbyte)_actionType;
            float x    = u0012.X;
            float z    = u0012.Z;
            sbyte num3 = ActorData != null
                ? (sbyte)ActorData.ActorIndex
                : (sbyte)ActorData.s_invalidActorIndex;
            bool    flag1  = u0008;
            sbyte   num4   = (sbyte)u0016;
            bool    flag2  = u0013;
            bool    flag3  = u0018;
            bool    flag4  = u0009;
            bool    flag5  = u0015;
            sbyte   num5   = u000A;
            sbyte   num6   = u0006;
            Vector3 center = u0020.center;
            Vector3 size   = u0020.size;
            byte    count  = checked ((byte)u000C.Count);

            _param1.Serialize(ref num1);
            _param1.Serialize(ref num2);
            _param1.Serialize(ref x);
            _param1.Serialize(ref z);
            _param1.Serialize(ref num3);
            _param1.Serialize(ref flag1);
            _param1.Serialize(ref num4);
            _param1.Serialize(ref flag2);
            _param1.Serialize(ref flag3);
            _param1.Serialize(ref flag4);
            _param1.Serialize(ref flag5);
            _param1.Serialize(ref num5);
            _param1.Serialize(ref num6);
            short num7 = (short)Mathf.RoundToInt(center.X);
            short num8 = (short)Mathf.RoundToInt(center.Z);

            _param1.Serialize(ref num7);
            _param1.Serialize(ref num8);
            if (_param1.isReading)
            {
                center.X = num7;
                center.Y = 1.5f; //+ (float) Board.u000E().BaselineHeight; // TODO
                center.Z = num8;
            }

            short num9  = (short)Mathf.CeilToInt(size.X + 0.5f);
            short num10 = (short)Mathf.CeilToInt(size.Z + 0.5f);

            _param1.Serialize(ref num9);
            _param1.Serialize(ref num10);
            if (_param1.isReading)
            {
                size.X = num9;
                size.Y = 3f;
                size.Z = num10;
            }

            _param1.Serialize(ref count);
            if (_param1.isReading)
            {
                for (int index = 0; index < (int)count; ++index)
                {
                    byte num11 = 0;
                    byte num12 = 0;
                    _param1.Serialize(ref num11);
                    _param1.Serialize(ref num12);
                    u000C.Add(num11);
                    u0014.Add(num12);
                }
            }
            else
            {
                for (int index = 0; index < (int)count; ++index)
                {
                    byte num11 = u000C[index];
                    byte num12 = u0014[index];
                    _param1.Serialize(ref num11);
                    _param1.Serialize(ref num12);
                }
            }

            u000E = num1;
//            if (_param1.isReading) // TODO
//                u0012 = new Vector3(x, (float) Board.u000E().BaselineHeight, z);
            ActorIndex  = num3;
            u0008       = flag1;
            u0016       = num4;
            u0013       = flag2;
            u0018       = flag3;
            u0009       = flag4;
            u0015       = flag5;
            u000A       = num5;
            u0006       = num6;
            u0020       = new Bounds(center, size);
            _actionType = (AbilityData.ActionType)num2;
//            u000B = this.ActorData != null // TODO
//                ? this.ActorData.u000E().GetAbilityOfActionType(_actionType)
//                : (Ability) null;
            if (SeqSource == null)
            {
                SeqSource = new SequenceSource();
            }
            SeqSource.OnSerializeHelper(_param1);
            if (_param1.isWriting)
            {
                bool flag6 = ParentAbilitySeqSource != null;
                _param1.Serialize(ref flag6);
                if (flag6)
                {
                    ParentAbilitySeqSource.OnSerializeHelper(_param1);
                }
            }

            if (_param1.isReading)
            {
                bool flag6 = false;
                _param1.Serialize(ref flag6);
                if (flag6)
                {
                    if (ParentAbilitySeqSource == null)
                    {
                        ParentAbilitySeqSource = new SequenceSource();
                    }
                    ParentAbilitySeqSource.OnSerializeHelper(_param1);
                }
                else
                {
                    ParentAbilitySeqSource = null;
                }
            }

            sbyte num13 = HitActorsToDeltaHP != null ? checked ((sbyte)HitActorsToDeltaHP.Count) : (sbyte)0;

            _param1.Serialize(ref num13);
            if (num13 > 0 && HitActorsToDeltaHP == null)
            {
                HitActorsToDeltaHP = new Dictionary <ActorData, int>();
            }
            if (_param1.isWriting && num13 > 0)
            {
                foreach (KeyValuePair <ActorData, int> keyValuePair in HitActorsToDeltaHP)
                {
                    sbyte num11 = !(keyValuePair.Key == null)
                        ? (sbyte)keyValuePair.Key.ActorIndex
                        : (sbyte)ActorData.s_invalidActorIndex;
                    if (num11 != ActorData.s_invalidActorIndex)
                    {
                        sbyte num12 = 0;
                        if (keyValuePair.Value > 0)
                        {
                            num12 = 1;
                        }
                        else if (keyValuePair.Value < 0)
                        {
                            num12 = -1;
                        }
                        _param1.Serialize(ref num11);
                        _param1.Serialize(ref num12);
                    }
                }
            }
            else if (_param1.isReading)
            {
                if (HitActorsToDeltaHP != null)
                {
                    HitActorsToDeltaHP.Clear();
                }
                for (int index = 0; index < (int)num13; ++index)
                {
                    sbyte invalidActorIndex = (sbyte)ActorData.s_invalidActorIndex;
                    sbyte num11             = 0;
                    _param1.Serialize(ref invalidActorIndex);
                    _param1.Serialize(ref num11);
                    // TODO
//                    ActorData actorByActorIndex = GameFlowData.Get().FindActorByActorIndex((int) invalidActorIndex);
//                    if (actorByActorIndex != null)
//                        HitActorsToDeltaHP[actorByActorIndex] = num11;
                }
            }

//            this.u0008u000E();
        }