Example #1
0
 public ClampEmitter(ClampEmitter other)
 {
     Anim1       = new AnimData(other.Anim1);
     Anim2       = new AnimData(other.Anim2);
     Offset      = other.Offset;
     LocHeight   = other.LocHeight;
     HalfOffset  = other.HalfOffset;
     HalfHeight  = other.HalfHeight;
     LingerStart = other.LingerStart;
     MoveTime    = other.MoveTime;
     LingerEnd   = other.LingerEnd;
 }
 public MoveToEmitter(MoveToEmitter other)
 {
     Anim        = new AnimData(other.Anim);
     OffsetStart = other.OffsetStart;
     HeightStart = other.HeightStart;
     OffsetEnd   = other.OffsetEnd;
     HeightEnd   = other.HeightEnd;
     LingerStart = other.LingerStart;
     MoveTime    = other.MoveTime;
     LingerEnd   = other.LingerEnd;
     ResultAnim  = other.ResultAnim.CloneIEmittable();
     ResultLayer = other.ResultLayer;
 }
Example #3
0
        public HelixAnim(AnimData anim, int totalTime, Loc origin, int radius, int degreesStart, int cycleSpeed, int locHeight, int heightSpeed)
            : base(anim, totalTime)
        {
            Origin       = origin;
            Radius       = radius;
            DegreesStart = degreesStart;
            CycleSpeed   = cycleSpeed;
            StartHeight  = locHeight;
            HeightSpeed  = heightSpeed;

            locHeight   = StartHeight;
            this.mapLoc = Origin + GetCycle(Radius, Radius / 2, DegreesStart);
            Direction   = GetCycle(Radius, Radius / 2, DegreesStart + 90 * (CycleSpeed < 0 ? -1 : 1)).ApproximateDir8();
        }
Example #4
0
        public MoveToAnim(AnimData anim, int moveTime, Loc startLoc, Loc newEndPos, int startHeight, int endHeight, int lingerStart, int lingerEnd, Dir8 dir)
            : base(anim, moveTime + lingerStart + lingerEnd)
        {
            MovingTime  = moveTime;
            StartLoc    = startLoc;
            EndLoc      = newEndPos;
            StartHeight = startHeight;
            EndHeight   = endHeight;
            Direction   = dir;
            LingerStart = lingerStart;
            LingerEnd   = lingerEnd;

            locHeight = StartHeight;
            mapLoc    = StartLoc;
        }
Example #5
0
        public override void Update(BaseScene scene, FrameTick elapsedTime)
        {
            CurrentBurstTime += elapsedTime;
            while (CurrentBurstTime >= Math.Max(1, BurstTime))
            {
                CurrentBurstTime -= Math.Max(1, BurstTime);
                for (int ii = 0; ii < ParticlesPerBurst; ii++)
                {
                    if (Anims.Count > 0)
                    {
                        List <int> openDirs  = getOpenDirs();
                        int        openIndex = openDirs[MathUtils.Rand.Next(openDirs.Count)];
                        Coverages[openIndex] = true;

                        double angle = (openIndex + MathUtils.Rand.NextDouble()) * Math.PI / 4;

                        int dist       = StartDistance + MathUtils.Rand.Next(StartVariance + 1);
                        Loc startDelta = new Loc((int)Math.Round(Math.Cos(angle) * dist), (int)Math.Round(Math.Sin(angle) * dist));

                        double endAngle = MathUtils.Rand.NextDouble() * Math.PI * 2;
                        int    endDist  = MathUtils.Rand.Next(EndDistance + 1);
                        Loc    endDelta = new Loc((int)Math.Round(Math.Cos(endAngle) * endDist), (int)Math.Round(Math.Sin(endAngle) * endDist));

                        Loc particleSpeed = ((UseDest ? Destination : Origin) + endDelta - (Origin + startDelta)) * GraphicsManager.MAX_FPS / TravelTime;

                        Loc startLoc = Origin + startDelta;
                        {
                            AnimData animData   = Anims[MathUtils.Rand.Next(Anims.Count)];
                            AnimData scaledAnim = new AnimData(animData);
                            DirSheet fxSheet    = GraphicsManager.GetAttackSheet(animData.AnimIndex);
                            scaledAnim.FrameTime = (int)Math.Round((float)TravelTime / scaledAnim.GetTotalFrames(fxSheet.TotalFrames) / Math.Max(1, Cycles));
                            scaledAnim.FrameTime = Math.Max(1, scaledAnim.FrameTime);
                            ParticleAnim anim = new ParticleAnim(scaledAnim, 0, TravelTime);
                            anim.SetupEmitted(startLoc, particleSpeed, Loc.Zero, 0, 0, 0, particleSpeed.ApproximateDir8());
                            scene.Anims[(int)Layer].Add(anim);
                        }
                    }
                }
                CurrentBursts++;

                if (CurrentBursts >= Math.Max(1, Bursts))
                {
                    break;
                }
            }
        }
Example #6
0
        public MoveToAnim(AnimData anim, IEmittable emittable, DrawLayer layer, int moveTime, Loc startLoc, Loc newEndPos, int startHeight, int endHeight, int lingerStart, int lingerEnd, Dir8 dir)
            : base(anim, moveTime + lingerStart + lingerEnd)
        {
            MovingTime  = moveTime;
            StartLoc    = startLoc;
            EndLoc      = newEndPos;
            StartHeight = startHeight;
            EndHeight   = endHeight;
            Direction   = dir;
            LingerStart = lingerStart;
            LingerEnd   = lingerEnd;

            locHeight = StartHeight;
            mapLoc    = StartLoc;

            ResultAnim = emittable;
            Layer      = layer;
        }
Example #7
0
 public SingleEmitter(AnimData anim, int cycles)
 {
     Anim  = new StaticAnim(anim, cycles, 0);
     Layer = DrawLayer.Normal;
 }
Example #8
0
 public SingleEmitter(AnimData anim)
 {
     Anim  = new StaticAnim(anim);
     Layer = DrawLayer.Normal;
 }
Example #9
0
 public LoopingAnim(AnimData anim, int totalTime, int cycles)
 {
     Anim      = anim;
     TotalTime = totalTime;
     Cycles    = cycles;
 }
Example #10
0
 public LoopingAnim(AnimData anim, int totalTime)
 {
     Anim      = anim;
     TotalTime = totalTime;
 }
Example #11
0
 public MoveToEmitter()
 {
     Anim        = new AnimData();
     ResultAnim  = new EmptyFiniteEmitter();
     ResultLayer = DrawLayer.Normal;
 }
Example #12
0
 public StaticAnim(AnimData anim, int cycles, int totalTime)
     : base(anim, totalTime, cycles)
 {
 }
Example #13
0
 public StaticAnim(AnimData anim) : this(anim, 1, 0)
 {
 }
 public WrappedRainAnim(AnimData anim, int totalTime) : base(anim, 0, totalTime)
 {
     ResultAnim = new AnimData();
 }
Example #15
0
 public ParticleAnim(AnimData anim, int cycles, int totalTime) : base(anim, cycles, totalTime)
 {
 }
Example #16
0
 public ClampEmitter()
 {
     Anim1 = new AnimData();
     Anim2 = new AnimData();
 }
Example #17
0
 public BetweenEmitter(AnimData animBack, AnimData animFront)
 {
     AnimBack  = new StaticAnim(animBack);
     AnimFront = new StaticAnim(animFront);
 }
Example #18
0
 public Emote(AnimData anim, int height, int cycles)
 {
     Anim      = anim;
     locHeight = height;
     TotalTime = anim.FrameTime * anim.GetTotalFrames(GraphicsManager.GetAttackSheet(anim.AnimIndex).TotalFrames) * cycles;
 }
Example #19
0
 public MoveToEmitter()
 {
     Anim = new AnimData();
 }
 public SwingSwitchEmitter()
 {
     Anim = new AnimData();
     Layer = DrawLayer.Normal;
 }
Example #21
0
 public ParticleAnim(AnimData anim, int cycles) : base(anim, cycles)
 {
 }
Example #22
0
 public AnimData(AnimData other)
     : base(other)
 {
 }
Example #23
0
 public StaticAnim(AnimData anim, int cycles) : this(anim, cycles, 0)
 {
 }
Example #24
0
 public ParticleAnim(AnimData anim) : base(anim)
 {
 }
 public WrappedRainAnim(AnimData anim, AnimData resultAnim, DrawLayer layer, int totalTime)
     : base(anim, 0, totalTime)
 {
     Layer      = layer;
     ResultAnim = resultAnim;
 }
Example #26
0
 public RepeatEmitter(AnimData anim)
 {
     Anim  = new StaticAnim(anim);
     Layer = DrawLayer.Normal;
 }
 public SwingSwitchEmitter(AnimData anim)
 {
     Anim = anim;
     Layer = DrawLayer.Normal;
 }
Example #28
0
 public LoopingAnim()
 {
     Anim = new AnimData();
 }
 public ScreenRainEmitter(AnimData anim) : this()
 {
     Anim = anim;
 }
Example #30
0
 public LoopingAnim(AnimData anim)
 {
     Anim = anim;
 }