コード例 #1
0
 public ParticleEffect(int apiVersion, EventHandler handler, ISection section)
     : base(apiVersion, handler, section)
 {
     mParticleParameters   = new ParticleParams(apiVersion, handler, true);
     mRateCurve            = new DataList <FloatValue>(handler);
     mSizeCurve            = new DataList <FloatValue>(handler);
     mAspectCurve          = new DataList <FloatValue>(handler);
     mRotationCurve        = new DataList <FloatValue>(handler);
     mAlphaCurve           = new DataList <FloatValue>(handler);
     mColorCurve           = new DataList <ColorValue>(handler);
     mColorVary            = new ColorValue(apiVersion, handler);
     mDrawInfo             = new ResourceReference(apiVersion, handler, section);
     mDirectionalForcesSum = new Vector3ValueLE(apiVersion, handler);
     mRadialForceLocation  = new Vector3ValueLE(apiVersion, handler);
     mWiggles           = new DataList <Wiggle>(handler);
     mLoopBoxColorCurve = new DataList <ColorValue>(handler);
     mLoopBoxAlphaCurve = new DataList <FloatValue>(handler);
     mSurfaces          = new DataList <Surface>(handler);
     mAltitudeRange     = new Vector2ValueLE(apiVersion, handler, -10000.0f, 10000.0f);
     mRandomWalk        = new RandomWalk(apiVersion, handler);
     mAttractorOrigin   = new Vector3ValueLE(apiVersion, handler);
     mAttractor         = new Attractor(apiVersion, handler);
     mPathPoints        = new DataList <PathPoint>(handler);
     mVector01          = new Vector3ValueLE(apiVersion, handler);
     mVector3List01     = new DataList <Vector3ValueLE>(handler);
     mVector02          = new Vector3ValueLE(apiVersion, handler);
     mUnknown140        = new Vector2ValueLE(apiVersion, handler);
     mUnknown150        = new Vector2ValueLE(apiVersion, handler);
     mUnknown180        = new Vector3ValueLE(apiVersion, handler);
     mUnknown190        = new Vector2ValueLE(apiVersion, handler);
     mUnknown1A0        = new Vector2ValueLE(apiVersion, handler);
 }
コード例 #2
0
 public MetaparticleEffect(int apiVersion, EventHandler handler, ISection section)
     : base(apiVersion, handler, section)
 {
     mParticleParameters   = new ParticleParams(apiVersion, handler, true);
     mRateCurve            = new DataList <FloatValue>(handler);
     mSizeCurve            = new DataList <FloatValue>(handler);
     mPitchCurve           = new DataList <FloatValue>(handler);
     mRollCurve            = new DataList <FloatValue>(handler);
     mHeadingCurve         = new DataList <FloatValue>(handler);
     mRollOffset           = -1000000000.0f;
     mHeadingOffset        = 0f;
     mColorCurve           = new DataList <ColorValue>(handler);
     mColorVary            = new ColorValue(apiVersion, handler);
     mAlphaCurve           = new DataList <FloatValue>(handler);
     mDirectionalForcesSum = new Vector3ValueLE(apiVersion, handler);
     mGlobalForcesSum      = new Vector3ValueLE(apiVersion, handler);
     mRadialForceLocation  = new Vector3ValueLE(apiVersion, handler);
     mWiggles                      = new DataList <Wiggle>(handler);
     mLoopBoxColorCurve            = new DataList <ColorValue>(handler);
     mLoopBoxAlphaCurve            = new DataList <FloatValue>(handler);
     mSurfaces                     = new DataList <Surface>(handler);
     mAltitudeRange                = new Vector2ValueLE(apiVersion, handler, -10000.0f, 10000.0f);
     mRandomWalk1                  = new RandomWalk(apiVersion, handler);
     mRandomWalk2                  = new RandomWalk(apiVersion, handler);
     mRandomWalkPreferredDirection = new Vector3ValueLE(apiVersion, handler);
     mAttractorOrigin              = new Vector3ValueLE(apiVersion, handler);
     mAttractor                    = new Attractor(apiVersion, handler);
     mPathPoints                   = new DataList <PathPoint>(handler);
 }
コード例 #3
0
 public FastParticleEffect(int apiVersion, EventHandler handler, ISection section)
     : base(apiVersion, handler, section)
 {
     mParticleParameters   = new ParticleParams(apiVersion, handler, false);
     mRateCurve            = new DataList <FloatValue>(handler);
     mSizeCurve            = new DataList <FloatValue>(handler);
     mColorCurve           = new DataList <ColorValue>(handler);
     mAlphaCurve           = new DataList <FloatValue>(handler);
     mDrawInfo             = new ResourceReference(apiVersion, handler, section);
     mDirectionalForcesSum = new Vector3ValueLE(apiVersion, handler);
     mRadialForceLocation  = new Vector3ValueLE(apiVersion, handler);
 }
コード例 #4
0
        protected void CreateSubParams()
        {
            SubParams.Clear();
            var health = MainElement.GetChildElement("health");

            if (health != null)
            {
                Health = new HealthParams(health, this);
                SubParams.Add(Health);
            }
            // TODO: support for multiple ai elements?
            var ai = MainElement.GetChildElement("ai");

            if (ai != null)
            {
                AI = new AIParams(ai, this);
                SubParams.Add(AI);
            }
            foreach (var element in MainElement.GetChildElements("bloodemitter"))
            {
                var emitter = new ParticleParams(element, this);
                BloodEmitters.Add(emitter);
                SubParams.Add(emitter);
            }
            foreach (var element in MainElement.GetChildElements("gibemitter"))
            {
                var emitter = new ParticleParams(element, this);
                GibEmitters.Add(emitter);
                SubParams.Add(emitter);
            }
            foreach (var element in MainElement.GetChildElements("damageemitter"))
            {
                var emitter = new ParticleParams(element, this);
                GibEmitters.Add(emitter);
                SubParams.Add(emitter);
            }
            foreach (var soundElement in MainElement.GetChildElements("sound"))
            {
                var sound = new SoundParams(soundElement, this);
                Sounds.Add(sound);
                SubParams.Add(sound);
            }
            foreach (var inventoryElement in MainElement.GetChildElements("inventory"))
            {
                var inventory = new InventoryParams(inventoryElement, this);
                Inventories.Add(inventory);
                SubParams.Add(inventory);
            }
        }
コード例 #5
0
        protected override void Parse(Stream stream)
        {
            var s = new BinaryStreamWrapper(stream, ByteOrder.BigEndian);

            s.Read(out mFlags);
            //mFlags &= 0x1FFF;

            mParticleParameters = new ParticleParams(requestedApiVersion, handler, false, stream);
            mRateCurve          = new DataList <FloatValue>(handler, stream);
            s.Read(out mRateCurveTime);
            s.Read(out mRateCurveCycles);
            s.Read(out mRateSpeedScale);
            mSizeCurve  = new DataList <FloatValue>(handler, stream);
            mColorCurve = new DataList <ColorValue>(handler, stream);
            mAlphaCurve = new DataList <FloatValue>(handler, stream);
            mDrawInfo   = new ResourceReference(requestedApiVersion, handler, mSection, stream);
            s.Read(out mAlignMode);
            mDirectionalForcesSum = new Vector3ValueLE(requestedApiVersion, handler, stream);
            s.Read(out mWindStrength);
            s.Read(out mGravityStrength);
            s.Read(out mRadialForce);
            mRadialForceLocation = new Vector3ValueLE(requestedApiVersion, handler, stream);
            s.Read(out mDrag);
        }
コード例 #6
0
 public bool RemoveDamageEmitter(ParticleParams emitter) => RemoveSubParam(emitter, DamageEmitters);
コード例 #7
0
 public bool RemoveGibEmitter(ParticleParams emitter) => RemoveSubParam(emitter, GibEmitters);
コード例 #8
0
 public bool RemoveBloodEmitter(ParticleParams emitter) => RemoveSubParam(emitter, BloodEmitters);
コード例 #9
0
        protected override void Parse(Stream stream)
        {
            var s = new BinaryStreamWrapper(stream, ByteOrder.BigEndian);

            s.Read(out mFlags);
            // no flag mask

            ParticleParameters = new ParticleParams(requestedApiVersion, handler, true, stream);
            mRateCurve         = new DataList <FloatValue>(handler, stream);
            s.Read(out mRateCurveTime);
            s.Read(out mRateCurveCycles);
            s.Read(out mRateSpeedScale);
            mSizeCurve = new DataList <FloatValue>(handler, stream);
            s.Read(out mSizeVary);
            mAspectCurve = new DataList <FloatValue>(handler, stream);
            s.Read(out mAspectVary);
            s.Read(out mRotationVary);
            s.Read(out mRotationOffset);
            mRotationCurve = new DataList <FloatValue>(handler, stream);
            mAlphaCurve    = new DataList <FloatValue>(handler, stream);
            s.Read(out mAlphaVary);
            mColorCurve = new DataList <ColorValue>(handler, stream);
            mColorVary  = new ColorValue(requestedApiVersion, handler, stream);
            mDrawInfo   = new ResourceReference(0, handler, mSection, stream);

            s.Read(out mPhysicsType);
            s.Read(out mOverrideSet);
            s.Read(out mTileCountU);
            s.Read(out mTileCountV);
            s.Read(out mAlignMode);
            s.Read(out mFrameSpeed);
            s.Read(out mFrameStart);
            s.Read(out mFrameCount);
            s.Read(out mFrameRandom);

            mDirectionalForcesSum = new Vector3ValueLE(requestedApiVersion, handler, stream);

            s.Read(out mWindStrength);
            s.Read(out mGravityStrength);
            s.Read(out mRadialForce);

            mRadialForceLocation = new Vector3ValueLE(requestedApiVersion, handler, stream);

            s.Read(out mDrag);
            s.Read(out mVelocityStretch);
            s.Read(out mScrewRate);

            mWiggles = new DataList <Wiggle>(handler, stream);
            s.Read(out mScreenBloomAlphaRate);
            s.Read(out mScreenBloomAlphaBase);
            s.Read(out mScreenBloomSizeRate);
            s.Read(out mScreenBloomSizeBase);
            mLoopBoxColorCurve = new DataList <ColorValue>(handler, stream);
            mLoopBoxAlphaCurve = new DataList <FloatValue>(handler, stream);
            mSurfaces          = new DataList <Surface>(handler, stream);
            s.Read(out mMapBounce);
            s.Read(out mMapRepulseHeight);
            s.Read(out mMapRepulseStrength);
            s.Read(out mMapRepulseScoutDistance);
            s.Read(out mMapRepulseVertical);

            s.Read(out mMapRepulseKillHeight);                                         //-1000000000.0f
            s.Read(out mProbabilityDeath);                                             //0f
            mAltitudeRange = new Vector2ValueLE(requestedApiVersion, handler, stream); // (-10000.0f, 10000.0f)

            s.Read(out mForceMapId);
            s.Read(out mEmitRateMapId);
            s.Read(out mEmitColorMapId);
            mRandomWalk = new RandomWalk(requestedApiVersion, handler, stream);

            mAttractorOrigin = new Vector3ValueLE(requestedApiVersion, handler, stream);

            mAttractor = new Attractor(requestedApiVersion, handler, stream);

            mPathPoints = new DataList <PathPoint>(handler, stream);

            //Version 2+
            if (mSection.Version >= 0x0002 && stream.Position < stream.Length)
            {
                mVector01      = new Vector3ValueLE(requestedApiVersion, handler, stream);
                mVector3List01 = new DataList <Vector3ValueLE>(handler, stream);
            }

            //Version 3+
            if (mSection.Version >= 0x0003 && stream.Position < stream.Length)
            {
                s.Read(out mByte01);
            }

            //Version 4+
            if (mSection.Version >= 0x0004 && stream.Position < stream.Length)
            {
                s.Read(out mFloat01);
            }

            //Version 5+
            if (mSection.Version >= 0x0005 && stream.Position < stream.Length)
            {
                if (isTheSims4)
                {
                    mVector02 = new Vector3ValueLE(requestedApiVersion, handler, stream);
                    s.Read(out mUnknown170);
                }
                else
                {
                    float value;
                    s.Read(out value);
                    mVector02 = new Vector3ValueLE(requestedApiVersion, handler, value, value, value);
                }
            }

            if (isTheSims4)
            {
                //Version 6+
                if (mSection.Version >= 0x0006 && stream.Position < stream.Length)
                {
                    mUnknown140 = new Vector2ValueLE(requestedApiVersion, handler, stream);
                }
                else
                {
                    float value;
                    s.Read(out value);
                    mUnknown140 = new Vector2ValueLE(requestedApiVersion, handler, value, value);
                }

                //Version 7+
                if (mSection.Version >= 0x0007 && stream.Position < stream.Length)
                {
                    mUnknown150 = new Vector2ValueLE(requestedApiVersion, handler, stream);
                }

                s.Read(out mUnknown160);
                s.Read(out mUnknown164);

                s.Read(out mUnknown1C1);
                if (mUnknown1C1 != 0 && stream.Position < stream.Length)
                {
                    mUnknown180 = new Vector3ValueLE(requestedApiVersion, handler, stream);
                    s.Read(out mUnknown1C0);

                    if (mSection.Version >= 0x0006 && stream.Position < stream.Length)
                    {
                        mUnknown190 = new Vector2ValueLE(requestedApiVersion, handler, stream);
                    }
                    else
                    {
                        float value;
                        s.Read(out value);
                        mUnknown190 = new Vector2ValueLE(requestedApiVersion, handler, value, value);
                    }

                    if (mSection.Version >= 0x0007 && stream.Position < stream.Length)
                    {
                        mUnknown1A0 = new Vector2ValueLE(requestedApiVersion, handler, stream);
                    }

                    s.Read(out mUnknown1B0);
                    s.Read(out mUnknown1B4);
                }

                if (mSection.Version >= 0x0006 && stream.Position < stream.Length)
                {
                    s.Read(out mUnknown208);
                    if (mUnknown208 != 0)
                    {
                        s.Read(out mUnknown20C);
                        s.Read(out mUnknown209);
                        s.Read(out mUnknown20A);
                        s.Read(out mUnknown20B);
                    }
                }
            }
        }
コード例 #10
0
ファイル: Effect.cs プロジェクト: Nofasar/s3pi-wrappers
 public ParticleParams(int apiVersion, EventHandler handler, bool hasTorus, ParticleParams basis)
     : base(apiVersion, handler)
 {
     bHasTorus         = hasTorus;
     mParticleLifetime = new Vector2ValueLE(apiVersion, handler, basis.mParticleLifetime);
     mPrerollTime      = basis.mPrerollTime;
     mEmitDelay        = new Vector2ValueLE(apiVersion, handler, basis.mEmitDelay);
     mEmitRetrigger    = new Vector2ValueLE(apiVersion, handler, basis.mEmitRetrigger);
     mEmitDirection    = new BoundingBoxValue(apiVersion, handler, basis.mEmitDirection);
     mEmitSpeed        = new Vector2ValueLE(apiVersion, handler, basis.mEmitSpeed);
     mEmitVolume       = new BoundingBoxValue(apiVersion, handler, basis.mEmitVolume);
     mEmitTorusWidth   = basis.mEmitTorusWidth;
 }
コード例 #11
0
        protected override void Parse(Stream stream)
        {
            var s = new BinaryStreamWrapper(stream, ByteOrder.BigEndian);

            s.Read(out mFlags);
            // no flag mask

            mParticleParameters = new ParticleParams(requestedApiVersion, handler, true, stream);
            mRateCurve          = new DataList <FloatValue>(handler, stream);
            s.Read(out mRateCurveTime);
            s.Read(out mRateCurveCycles);
            mSizeCurve = new DataList <FloatValue>(handler, stream);
            s.Read(out mSizeVary);
            mPitchCurve   = new DataList <FloatValue>(handler, stream);
            mRollCurve    = new DataList <FloatValue>(handler, stream);
            mHeadingCurve = new DataList <FloatValue>(handler, stream);
            s.Read(out mPitchVary);
            s.Read(out mRollVary);
            s.Read(out mHeadingVary);
            s.Read(out mPitchOffset);
            s.Read(out mRollOffset);
            s.Read(out mHeadingOffset);
            mColorCurve = new DataList <ColorValue>(handler, stream);
            mColorVary  = new ColorValue(requestedApiVersion, handler, stream);
            mAlphaCurve = new DataList <FloatValue>(handler, stream);
            s.Read(out mAlphaVary);
            s.Read(out mComponentName, StringType.ZeroDelimited);
            s.Read(out mComponentType, StringType.ZeroDelimited);
            s.Read(out mAlignMode);
            mDirectionalForcesSum = new Vector3ValueLE(requestedApiVersion, handler, stream);
            mGlobalForcesSum      = new Vector3ValueLE(requestedApiVersion, handler, stream);

            s.Read(out mWindStrength);
            s.Read(out mGravityStrength);
            s.Read(out mRadialForce);

            mRadialForceLocation = new Vector3ValueLE(requestedApiVersion, handler, stream);

            s.Read(out mDrag);
            s.Read(out mScrewRate);
            mWiggles = new DataList <Wiggle>(handler, stream);
            s.Read(out mScreenBloomAlphaRate);
            s.Read(out mScreenBloomAlphaBase);
            s.Read(out mScreenBloomSizeRate);
            s.Read(out mScreenBloomSizeBase);
            mLoopBoxColorCurve = new DataList <ColorValue>(handler, stream);
            mLoopBoxAlphaCurve = new DataList <FloatValue>(handler, stream);
            mSurfaces          = new DataList <Surface>(handler, stream);
            s.Read(out mMapBounce);
            s.Read(out mMapRepulseHeight);
            s.Read(out mMapRepulseStrength);
            s.Read(out mMapRepulseScoutDistance);
            s.Read(out mMapRepulseVertical);
            s.Read(out mMapRepulseKillHeight);
            s.Read(out mProbabilityDeath);

            mAltitudeRange = new Vector2ValueLE(requestedApiVersion, handler, stream);

            s.Read(out mForceMapId);
            s.Read(out mEmitRateMapId);
            s.Read(out mEmitColorMapId);

            mRandomWalk1 = new RandomWalk(0, handler, stream);
            mRandomWalk2 = new RandomWalk(0, handler, stream);

            mRandomWalkPreferredDirection = new Vector3ValueLE(requestedApiVersion, handler, stream);

            s.Read(out mAlignDamping);
            s.Read(out mBankAmount);
            s.Read(out mBankRestore);

            mAttractorOrigin = new Vector3ValueLE(requestedApiVersion, handler, stream);
            mAttractor       = new Attractor(requestedApiVersion, handler, stream);

            mPathPoints = new DataList <PathPoint>(handler, stream);
            s.Read(out mTractorResetSpeed);
        }