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