示例#1
0
            public override IEnumerable <bool> E_Task()
            {
                DDTaskList el = new DDTaskList();
                double     dx = 0.0;
                double     dy = 0.0;
                double     ldx;
                double     ldy;
                double     shadow_a = 0.0;
                double     shadow_x = 0.0;
                double     title_a  = 0.0;
                double     shadow_targ_a;
                double     shadow_targ_x;
                double     title_targ_a;

                for (int frame = 0; ; frame++)
                {
                    ldx = dx;
                    ldy = dy;
                    dx  = Math.Cos(frame / 199.0) * 40.0;
                    dy  = Math.Cos(frame / 211.0) * 30.0;
                    double dxa = dx - ldx;
                    double dya = dy - ldy;

                    DDDraw.DrawBegin(Ground.I.Picture.TitleWall, DDConsts.Screen_W / 2 + dx, DDConsts.Screen_H / 2 + dy);
                    DDDraw.DrawZoom(1.3);
                    DDDraw.DrawEnd();

                    if (1 <= frame && DDUtils.Random.Real() < 0.03 + Math.Sin(frame / 307.0) * 0.02)
                    {
                        el.Add(SCommon.Supplier(this.Effect_0001(dx, dy, dxa, dya)));
                    }
                    el.ExecuteAllTask_Reverse();

                    double titleX = 720.0 + dx * 0.4;
                    double titleY = 270.0 + dy * 0.4;

                    double tba = 0.5 + Math.Sin(frame / 103.0) * 0.185 + Math.Sin(frame / 3.0) * 0.015 * Math.Sin(frame / 107.0);
                    double tfa = 0.3;

                    tba *= title_a;
                    tfa *= title_a;

                    {
                        const int FRAME_MAX = 300;

                        if (frame < FRAME_MAX)
                        {
                            DDDraw.SetBlendAdd(frame * tba / FRAME_MAX);
                            DDDraw.DrawCenter(Ground.I.Picture.Title, titleX, titleY);
                            DDDraw.Reset();
                        }
                        else
                        {
                            DDDraw.SetBlendAdd(tba);
                            DDDraw.DrawCenter(Ground.I.Picture.Title, titleX, titleY);
                            DDDraw.Reset();
                        }
                    }

                    {
                        const int FRAME_MAX = 300;

                        if (frame < FRAME_MAX)
                        {
                            DDDraw.SetBlendAdd(frame * tfa / FRAME_MAX);
                            DDDraw.DrawCenter(Ground.I.Picture.Title, titleX, titleY);
                            DDDraw.Reset();
                        }
                        else
                        {
                            DDDraw.SetBlendAdd(tfa);
                            DDDraw.DrawCenter(Ground.I.Picture.Title, titleX, titleY);
                            DDDraw.Reset();
                        }
                    }

                    if (this.DeepConfigEntered)
                    {
                        shadow_targ_a = 0.3;
                        shadow_targ_x = DDConsts.Screen_W;
                        title_targ_a  = 0.0;
                    }
                    else if (this.TopMenuLeaved)
                    {
                        shadow_targ_a = 0.3;
                        shadow_targ_x = 480.0;
                        title_targ_a  = 1.0;
                    }
                    else
                    {
                        shadow_targ_a = 0.0;
                        shadow_targ_x = 30.0;
                        title_targ_a  = 1.0;
                    }
                    DDUtils.Approach(ref shadow_a, shadow_targ_a, 0.8);
                    DDUtils.Approach(ref shadow_x, shadow_targ_x, 0.8);
                    DDUtils.Approach(ref title_a, title_targ_a, 0.97);

                    DDDraw.SetAlpha(shadow_a);
                    DDDraw.SetBright(0, 0, 0);
                    DDDraw.DrawRect(Ground.I.Picture.WhiteBox, 0, 0, shadow_x, DDConsts.Screen_H);
                    DDDraw.Reset();

                    yield return(true);
                }
            }