Esempio n. 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;
 }
Esempio n. 2
0
 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;
 }
Esempio n. 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();
        }
Esempio n. 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;
        }
Esempio n. 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;
                }
            }
        }
Esempio n. 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;
        }
Esempio n. 7
0
 public SingleEmitter(AnimData anim, int cycles)
 {
     Anim  = new StaticAnim(anim, cycles, 0);
     Layer = DrawLayer.Normal;
 }
Esempio n. 8
0
 public SingleEmitter(AnimData anim)
 {
     Anim  = new StaticAnim(anim);
     Layer = DrawLayer.Normal;
 }
Esempio n. 9
0
 public LoopingAnim(AnimData anim, int totalTime, int cycles)
 {
     Anim      = anim;
     TotalTime = totalTime;
     Cycles    = cycles;
 }
Esempio n. 10
0
 public LoopingAnim(AnimData anim, int totalTime)
 {
     Anim      = anim;
     TotalTime = totalTime;
 }
Esempio n. 11
0
 public MoveToEmitter()
 {
     Anim        = new AnimData();
     ResultAnim  = new EmptyFiniteEmitter();
     ResultLayer = DrawLayer.Normal;
 }
Esempio n. 12
0
 public StaticAnim(AnimData anim, int cycles, int totalTime)
     : base(anim, totalTime, cycles)
 {
 }
Esempio n. 13
0
 public StaticAnim(AnimData anim) : this(anim, 1, 0)
 {
 }
Esempio n. 14
0
 public WrappedRainAnim(AnimData anim, int totalTime) : base(anim, 0, totalTime)
 {
     ResultAnim = new AnimData();
 }
Esempio n. 15
0
 public ParticleAnim(AnimData anim, int cycles, int totalTime) : base(anim, cycles, totalTime)
 {
 }
Esempio n. 16
0
 public ClampEmitter()
 {
     Anim1 = new AnimData();
     Anim2 = new AnimData();
 }
Esempio n. 17
0
 public BetweenEmitter(AnimData animBack, AnimData animFront)
 {
     AnimBack  = new StaticAnim(animBack);
     AnimFront = new StaticAnim(animFront);
 }
Esempio n. 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;
 }
Esempio n. 19
0
 public MoveToEmitter()
 {
     Anim = new AnimData();
 }
 public SwingSwitchEmitter()
 {
     Anim = new AnimData();
     Layer = DrawLayer.Normal;
 }
Esempio n. 21
0
 public ParticleAnim(AnimData anim, int cycles) : base(anim, cycles)
 {
 }
Esempio n. 22
0
 public AnimData(AnimData other)
     : base(other)
 {
 }
Esempio n. 23
0
 public StaticAnim(AnimData anim, int cycles) : this(anim, cycles, 0)
 {
 }
Esempio n. 24
0
 public ParticleAnim(AnimData anim) : base(anim)
 {
 }
Esempio n. 25
0
 public WrappedRainAnim(AnimData anim, AnimData resultAnim, DrawLayer layer, int totalTime)
     : base(anim, 0, totalTime)
 {
     Layer      = layer;
     ResultAnim = resultAnim;
 }
Esempio n. 26
0
 public RepeatEmitter(AnimData anim)
 {
     Anim  = new StaticAnim(anim);
     Layer = DrawLayer.Normal;
 }
 public SwingSwitchEmitter(AnimData anim)
 {
     Anim = anim;
     Layer = DrawLayer.Normal;
 }
Esempio n. 28
0
 public LoopingAnim()
 {
     Anim = new AnimData();
 }
 public ScreenRainEmitter(AnimData anim) : this()
 {
     Anim = anim;
 }
Esempio n. 30
0
 public LoopingAnim(AnimData anim)
 {
     Anim = anim;
 }