Exemple #1
0
        public CrazyStorm Createnew(string id, Hashtable barragec)
        {
            CrazyStorm crazyStorm = ((CrazyStorm)barragec[(object)id]).Clone(true);

            this.csc.Add(crazyStorm);
            return(crazyStorm);
        }
Exemple #2
0
        public CrazyStorm Clone(bool add)
        {
            CrazyStorm crazyStorm = new CrazyStorm(csm)
            {
                id     = id,
                tex    = tex,
                bgset  = bgset,
                center =
                {
                    x         = center.x,
                    y         = center.y,
                    speed     = center.speed,
                    speedd    = center.speedd,
                    aspeed    = center.aspeed,
                    aspeedd   = center.aspeedd,
                    Available = center.Available,
                    events    = center.events
                },
                layerm = (LayerManager)layerm.Clone()
            };

            crazyStorm.time       = new Time(csm, this, crazyStorm.layerm);
            crazyStorm.time.total = time.total;
            crazyStorm.add        = add;
            foreach (GlobalEvent globalEvent in time.GE)
            {
                crazyStorm.time.GE.Add(globalEvent);
            }
            foreach (int num in time.GEcount)
            {
                crazyStorm.time.GEcount.Add(num);
            }
            return(crazyStorm);
        }
Exemple #3
0
        public CrazyStorm Createnew(bool add, string id, Hashtable barragec)
        {
            CrazyStorm crazyStorm = ((CrazyStorm)barragec[(object)id]).Clone(add);

            this.esc.Add(crazyStorm);
            return(crazyStorm);
        }
Exemple #4
0
        public CrazyStorm Createnew(int stage, int barrageid, Hashtable barragec)
        {
            if (stage == 0)
            {
                stage = 1;
            }
            CrazyStorm crazyStorm = Main.SpecialMode == Modes.SPELLCARD ? ((CrazyStorm)barragec[(object)barrageid.ToString()]).Clone(true) : ((CrazyStorm)barragec[(object)(stage.ToString() + barrageid.ToString())]).Clone(true);

            this.csc.Add(crazyStorm);
            return(crazyStorm);
        }
Exemple #5
0
 public Enemy(
     List <float[]> enemyset_l,
     EnemyManager e,
     CSManager csm,
     Hashtable barragec,
     int type_i,
     Vector2 pos,
     float speed_f,
     float speedf_f,
     int life_i,
     int hp_i,
     int stage,
     int barrageid_i,
     int id_i)
 {
     this.enemyset = enemyset_l;
     this.type     = type_i;
     this.InitType(this.type);
     this.Position       = pos;
     this.speed          = speed_f;
     this.speedf         = speedf_f;
     this.life           = life_i;
     this.hp             = hp_i;
     this.ohp            = this.hp;
     this.barrageid      = barrageid_i;
     this.id             = id_i;
     this.tex            = e.tex;
     this.copy           = new Enemy();
     this.copy.type      = this.type;
     this.copy.Position  = new Vector2(this.Position.X, this.Position.Y);
     this.copy.speed     = this.speed;
     this.copy.speedf    = this.speedf;
     this.copy.life      = this.life;
     this.copy.hp        = this.hp;
     this.copy.barrageid = this.barrageid;
     this.copy.id        = this.id;
     this.EventArray     = new List <EnemyEvent>();
     this.se             = SpriteEffects.None;
     if (this.barrageid != -1)
     {
         this.barrage = csm.Createnew(stage, this.barrageid, barragec);
     }
     this.praticle        = new Praticle(false, true, new Rectangle(49, 48, 14, 13), new Vector4(pos.X - 10f, pos.Y - 10f, 20f, 20f), new Vector2(7f, 7f), 1, 5, 30, 3f, -0.1f, new Vector2(0.0f, 360f), 10f);
     this.praticle.scale  = new Vector4(1.2f, 0.5f, 0.0f, 0.0f);
     this.praticle.calpha = 1f;
     this.praticle.stop   = true;
     e.EnemyArray.Add(this);
 }
Exemple #6
0
        public void Update(Boss boss)
        {
            if (!this.particleinited)
            {
                if (this.stage == 7)
                {
                    this.particle = Program.game.game.PlayEffect(true, "bg", new Vector2(315f, 240f));
                    this.particle.BanSound(true);
                    this.particle.effect = true;
                }
                else if (this.particle != null)
                {
                    this.particle.Close();
                }
                this.particleinited = true;
            }
            if (this.text != "" && !this.text.Contains("End"))
            {
                string str1 = this.text.Split(']')[1];
                string str2 = this.text.Split('[')[1].Split(']')[0];
                if (this.time == int.Parse(str2.Split(':')[0]) * 3600 + int.Parse(str2.Split(':')[1]) * 60 + int.Parse(str2.Split(':')[2]))
                {
                    if (str1.Contains("SetModel"))
                    {
                        string str3   = str1.Split('(')[1].Split(')')[0];
                        ModelM modelM = new ModelM((Model)this.modelc[(object)str3.Split(',')[0]], new Vector3(float.Parse(str3.Split(',')[1]), float.Parse(str3.Split(',')[2]), (float)((double)float.Parse(str3.Split(',')[3]) + (double)this.stepc.Z)), (BlendTypes)int.Parse(str3.Split(',')[6]));
                        if (str3.Split(',').Length == 8)
                        {
                            modelM.ats.Z -= this.stepc.Z;
                        }
                        modelM.label = str3.Split(',')[4];
                        modelM.IsC   = (bool.Parse(str3.Split(',')[5]) ? 1 : 0) != 0;
                        modelM.light = this.light;
                        this.ModelCollection.Add(modelM);
                    }
                    else if (str1.Contains("DelModel"))
                    {
                        string str3 = str1.Split('(')[1].Split(')')[0];
                        for (int index = 0; index < this.ModelCollection.Count; ++index)
                        {
                            if (this.ModelCollection[index].label == str3.Split(',')[0])
                            {
                                this.ModelCollection.RemoveAt(index);
                            }
                        }
                    }
                    else if (str1.Contains("SetRunningStepX"))
                    {
                        string str3 = str1.Split('(')[1].Split(')')[0];
                        this.stepxtarget = float.Parse(str3.Split(',')[0]);
                        this.stepxtime   = (float)int.Parse(str3.Split(',')[1]);
                    }
                    else if (str1.Contains("SetRunningStepY"))
                    {
                        string str3 = str1.Split('(')[1].Split(')')[0];
                        this.stepytarget = float.Parse(str3.Split(',')[0]);
                        this.stepytime   = (float)int.Parse(str3.Split(',')[1]);
                    }
                    else if (str1.Contains("SetRunningStep"))
                    {
                        string str3 = str1.Split('(')[1].Split(')')[0];
                        this.steptarget = float.Parse(str3.Split(',')[0]);
                        this.steptime   = (float)int.Parse(str3.Split(',')[1]);
                    }
                    else if (str1.Contains("ClearRunningStep"))
                    {
                        this.steps    = 0.0f;
                        this.stepc    = new Vector3(0.0f, 0.0f, 0.0f);
                        this.thisloop = false;
                    }
                    else if (str1.Contains("SetPraticleLauncher"))
                    {
                        string   str3     = str1.Split('(')[1].Split(')')[0];
                        Launcher launcher = new Launcher(new ModelM((Model)this.modelc[(object)str3.Split(',')[0]], (BlendTypes)int.Parse(str3.Split(',')[19])), this._3dpraticle)
                        {
                            rectvta = new Vector3(float.Parse(str3.Split(',')[1]), float.Parse(str3.Split(',')[2]), float.Parse(str3.Split(',')[3])),
                            rectvtb = new Vector3(float.Parse(str3.Split(',')[4]), float.Parse(str3.Split(',')[5]), float.Parse(str3.Split(',')[6])),
                            rotater = new Vector3(float.Parse(str3.Split(',')[7]), float.Parse(str3.Split(',')[8]), float.Parse(str3.Split(',')[9])),
                            speedr  = new Vector3(float.Parse(str3.Split(',')[10]), float.Parse(str3.Split(',')[11]), float.Parse(str3.Split(',')[12])),
                            attach  = (bool.Parse(str3.Split(',')[13]) ? 1 : 0) != 0,
                            fade    = (bool.Parse(str3.Split(',')[14]) ? 1 : 0) != 0,
                            quan    = int.Parse(str3.Split(',')[15]),
                            times   = int.Parse(str3.Split(',')[16]),
                            life    = int.Parse(str3.Split(',')[17]),
                            id      = int.Parse(str3.Split(',')[18])
                        };
                    }
                    else if (str1.Contains("SetPraticle"))
                    {
                        string str3  = str1.Split('(')[1].Split(')')[0];
                        int    index = this._3dpraticle.GetIndex(int.Parse(str3.Split(',')[0]));
                        this._3dpraticle.LauncherCollection[index].setting.scale = new Vector3(float.Parse(str3.Split(',')[1]), float.Parse(str3.Split(',')[2]), float.Parse(str3.Split(',')[3]));
                        this._3dpraticle.LauncherCollection[index].setting.life  = int.Parse(str3.Split(',')[4]);
                        this._3dpraticle.LauncherCollection[index].setting.speed = new Vector3(float.Parse(str3.Split(',')[5]), float.Parse(str3.Split(',')[6]), float.Parse(str3.Split(',')[7]));
                        if (str3.Split(',').Length > 9)
                        {
                            this._3dpraticle.LauncherCollection[index].setting.acced    = new Vector3(float.Parse(str3.Split(',')[8]), float.Parse(str3.Split(',')[9]), float.Parse(str3.Split(',')[10]));
                            this._3dpraticle.LauncherCollection[index].setting.rotate   = new Vector3(float.Parse(str3.Split(',')[11]), float.Parse(str3.Split(',')[12]), float.Parse(str3.Split(',')[13]));
                            this._3dpraticle.LauncherCollection[index].setting.rotates  = new Vector3(float.Parse(str3.Split(',')[14]), float.Parse(str3.Split(',')[15]), float.Parse(str3.Split(',')[16]));
                            this._3dpraticle.LauncherCollection[index].setting.fadetime = int.Parse(str3.Split(',')[17]);
                        }
                        else
                        {
                            this._3dpraticle.LauncherCollection[index].setting.fadetime = int.Parse(str3.Split(',')[8]);
                        }
                    }
                    else if (str1.Contains("SetColor"))
                    {
                        string str3 = str1.Split('(')[1].Split(')')[0];
                        if (this.GetModelid(str3.Split(',')[4]) != -1)
                        {
                            this.ModelCollection[this.GetModelid(str3.Split(',')[4])].ChangeColorX(float.Parse(str3.Split(',')[0]), int.Parse(str3.Split(',')[3]));
                            this.ModelCollection[this.GetModelid(str3.Split(',')[4])].ChangeColorY(float.Parse(str3.Split(',')[1]), int.Parse(str3.Split(',')[3]));
                            this.ModelCollection[this.GetModelid(str3.Split(',')[4])].ChangeColorZ(float.Parse(str3.Split(',')[2]), int.Parse(str3.Split(',')[3]));
                        }
                    }
                    else if (str1.Contains("SetAlpha"))
                    {
                        string str3 = str1.Split('(')[1].Split(')')[0];
                        if (this.GetModelid(str3.Split(',')[2]) != -1)
                        {
                            this.ModelCollection[this.GetModelid(str3.Split(',')[2])].ChangeAlpha(float.Parse(str3.Split(',')[0]), int.Parse(str3.Split(',')[1]));
                        }
                    }
                    else if (str1.Contains("ChangeView"))
                    {
                        string str3 = str1.Split('(')[1].Split(')')[0];
                        if ((double)float.Parse(str3.Split(',')[0]) != 0.0)
                        {
                            this.ChangeX(float.Parse(str3.Split(',')[0]), int.Parse(str3.Split(',')[3]));
                        }
                        if ((double)float.Parse(str3.Split(',')[1]) != 0.0)
                        {
                            this.ChangeY(float.Parse(str3.Split(',')[1]), int.Parse(str3.Split(',')[3]));
                        }
                        if ((double)float.Parse(str3.Split(',')[2]) != 0.0)
                        {
                            this.ChangeZ(float.Parse(str3.Split(',')[2]), int.Parse(str3.Split(',')[3]));
                        }
                    }
                    else if (str1.Contains("ChangeTarget"))
                    {
                        string str3 = str1.Split('(')[1].Split(')')[0];
                        if ((double)float.Parse(str3.Split(',')[0]) != 0.0)
                        {
                            this.ChangeTX(float.Parse(str3.Split(',')[0]), int.Parse(str3.Split(',')[3]));
                        }
                        if ((double)float.Parse(str3.Split(',')[1]) != 0.0)
                        {
                            this.ChangeTY(float.Parse(str3.Split(',')[1]), int.Parse(str3.Split(',')[3]));
                        }
                        if ((double)float.Parse(str3.Split(',')[2]) != 0.0)
                        {
                            this.ChangeTZ(float.Parse(str3.Split(',')[2]), int.Parse(str3.Split(',')[3]));
                        }
                    }
                    else if (str1.Contains("ChangeField"))
                    {
                        this.cameraProjectionMatrix = Matrix.CreatePerspectiveFieldOfView(0.7853982f, this.g.GraphicsDevice.Viewport.AspectRatio, 20f, float.Parse(str1.Split('(')[1].Split(')')[0].Split(',')[0]));
                    }
                    else if (str1.Contains("Shake"))
                    {
                        string str3 = str1.Split('(')[1].Split(')')[0];
                        this.shakemax   = (float)int.Parse(str3.Split(',')[0]);
                        this.shakespeed = float.Parse(str3.Split(',')[1]);
                    }
                    else if (str1.Contains("LightSetting"))
                    {
                        this.light = int.Parse(str1.Split('(')[1].Split(')')[0].Split(',')[0]);
                    }
                    else if (str1.Contains("Open"))
                    {
                        this.fadetime = 1;
                    }
                    else if (str1.Contains("Fadein"))
                    {
                        this.fadetime = 3;
                    }
                    else if (str1.Contains("Fadeout"))
                    {
                        this.fadetime = 2;
                    }
                    else if (str1.Contains("End"))
                    {
                        goto label_66;
                    }
                    this.text = this.rd.ReadLine();
label_66:
                    --this.time;
                }
            }
            if (this.fadetime == 1)
            {
                Program.game.game.bgcolor.a -= 0.0084f;
                if ((double)Program.game.game.bgcolor.a <= 0.0)
                {
                    this.fadetime = 0;
                    Program.game.game.bgcolor.a = 0.0f;
                }
            }
            else if (this.fadetime == 2)
            {
                Program.game.game.bgcolor.a += 0.04f;
                if ((double)Program.game.game.bgcolor.a >= 1.0)
                {
                    this.fadetime = 0;
                    Program.game.game.bgcolor.a = 1f;
                }
            }
            else if (this.fadetime == 3)
            {
                Program.game.game.bgcolor.a -= 0.04f;
                if ((double)Program.game.game.bgcolor.a <= 0.0)
                {
                    this.fadetime = 0;
                    Program.game.game.bgcolor.a = 0.0f;
                }
            }
            if ((double)this.shakemax != 0.0)
            {
                float num = (float)Math.Sin((double)MathHelper.ToRadians(this.shaketime)) * MathHelper.ToRadians(this.shakemax);
                this.vup.X      = (float)Math.Sin((double)num);
                this.vup.Y      = (float)Math.Cos((double)num);
                this.shaketime += this.shakespeed;
                if ((double)this.shaketime > 360.0)
                {
                    this.shaketime -= 360f;
                }
            }
            if ((double)this.steptime != 0.0)
            {
                this.step += (this.steptarget - this.step) / this.steptime;
            }
            if ((double)this.stepxtime != 0.0)
            {
                this.stepx += (this.stepxtarget - this.stepx) / this.stepxtime;
            }
            if ((double)this.stepytime != 0.0)
            {
                this.stepy += (this.stepytarget - this.stepy) / this.stepytime;
            }
            if (this._3dpraticle != null)
            {
                this._3dpraticle.Update(this.step);
            }
            this.stepc += new Vector3(this.stepx, this.stepy, this.step);
            this.steps += this.step;
            if (this.GetModelid("1001") != -1 && this.GetModelid("1002") != -1)
            {
                if ((double)this.vtp.Z + (double)this.stepc.Z > 1.0 && (double)this.steps >= 642.0 && !this.thisloop)
                {
                    this.ModelCollection[this.GetModelid("1001")].ats.Z = this.ModelCollection[this.GetModelid("1002")].ats.Z + 642.759f;
                    this.thisloop = true;
                }
                if ((double)this.vtp.Z + (double)this.stepc.Z > 1.0 && (double)this.steps >= 1284.0 && this.thisloop)
                {
                    this.ModelCollection[this.GetModelid("1002")].ats.Z = this.ModelCollection[this.GetModelid("1001")].ats.Z + 642.759f;
                    this.thisloop = false;
                    this.steps    = 0.0f;
                }
            }
            if (this.GetModelid("1003") != -1)
            {
                this.ModelCollection[this.GetModelid("1003")].ats.Z += this.step;
            }
            this.cameraViewMatrix = Matrix.CreateLookAt(this.vp + this.stepc, this.vtp + this.stepc, this.vup);
            if (boss == null)
            {
                ++this.time;
            }
            foreach (ModelM model in this.ModelCollection)
            {
                model.ChangeUpdate();
            }
            this.ChangeUpdate();
            this.ChangeTUpdate();
        }
Exemple #7
0
        public void Update(int t, Vector2 pos, BossBackground bg, int colortype)
        {
            this.numflash -= 0.02f;
            if ((double)this.numflash <= 0.0)
            {
                this.numflash = 0.0f;
            }
            if (this.timecard)
            {
                this.boss.timecard = true;
                this.timecard      = false;
                this.boss.nothide  = this.nothide;
            }
            if (this.time == 40 && !this.boss.start)
            {
                this.boss.start = true;
                CrazyStorm crazyStorm = Program.game.game.PlayEffect(true, "24", new Vector2(this.boss.Position.X + 93f, this.boss.Position.Y - 13f));
                crazyStorm.BanSound(true);
                crazyStorm.effect = true;
                Program.game.game.PlaySound("ch02", true, this.boss.Position.X);
            }
            if (this.time == 80 && this.transform)
            {
                CrazyStorm crazyStorm = Program.game.game.PlayEffect(true, "24", new Vector2(this.boss.Position.X + 93f, this.boss.Position.Y - 13f));
                crazyStorm.BanSound(true);
                crazyStorm.effect = true;
                Program.game.game.PlaySound("ch02", true, this.boss.Position.X);
            }
            if (this.barrages[0] != null)
            {
                this.barrages[0].cs.SetPos(new Vector2(pos.X + 93f, pos.Y - 13f), false);
            }
            if ((double)Time.Stop != 0.0)
            {
                ++this.time;
            }
            if (this.cf && this.time == 1)
            {
                this.mcscale = 1f;
                this.cscale  = this.mcscale;
                this.cx      = 45f;
            }
            if (this.time <= 60)
            {
                Time.Init();
            }
            if (this.time == 120)
            {
                this.Player.dead    = false;
                this.Player.shot    = false;
                this.Player.bombed  = false;
                this.Player.shifted = false;
            }
            if (this.time > 60 && this.time <= 120)
            {
                this.numalpha += 0.01666667f;
            }
            if (this.time <= 120)
            {
                this.boss.Return();
            }
            int num1 = 0;

            if (this.transform)
            {
                num1 = 100;
            }
            if (!this.cf && this.time <= 120)
            {
                if (t == this.type)
                {
                    if (t == 0)
                    {
                        this.mfscale += 0.01085816f;
                        this.fscale   = this.mfscale;
                        this.fx       = 45f;
                    }
                    else
                    {
                        this.mcscale += 0.03584337f;
                        this.cscale   = this.mcscale;
                        this.cx       = 45f;
                    }
                }
                else if (t == 0)
                {
                    this.mcscale += 0.03584337f;
                    this.cscale   = this.mcscale;
                    this.cx       = 45f;
                }
                else
                {
                    this.fdie = true;
                    if (this.time <= 30)
                    {
                        this.mcscale += 0.03333334f;
                        this.cscale   = this.mcscale;
                    }
                    this.cx = 45f;
                    if (this.time > 30)
                    {
                        this.mfscale += 0.01111111f;
                        this.fscale   = this.mfscale;
                    }
                    this.fx = 128f;
                }
            }
            else if (this.time > 120 + num1)
            {
                Program.game.achivmanager.Check(AchievementType.Challenge, 12, new Hashtable()
                {
                    [(object)"bomb"] = (object)this.Player.bombed,
                    [(object)"shot"] = (object)this.Player.shot
                });
                Program.game.achivmanager.Check(AchievementType.Challenge, 13, new Hashtable()
                {
                    [(object)"bomb"] = (object)this.Player.bombed
                });
                Program.game.achivmanager.Check(AchievementType.Hidden, 2, new Hashtable()
                {
                    [(object)"position"] = (object)this.Player.body.position,
                    [(object)"type"]     = (object)this.type
                });
                if (this.boss.timecard && !this.boss.nothide)
                {
                    this.boss.Hide();
                }
                if (this.time == 121 + num1)
                {
                    this.barrages[0].cs.Start();
                }
                if (this.type == 0)
                {
                    this.fscale = (float)this.hp / (float)this.maxhp * this.mfscale;
                }
                if (t == this.type || t != 1)
                {
                    this.cscale = (float)this.hp / (float)this.maxhp * this.mcscale;
                }
                ++this.frame;
                if ((this.time - (120 + num1)) % 60 == 0 && this.realtime > 0)
                {
                    --this.realtime;
                    if (this.realtime <= 9)
                    {
                        Hashtable data = new Hashtable();
                        if (this.cd != null)
                        {
                            data[(object)"name"] = (object)this.cd.CardName;
                        }
                        else
                        {
                            data[(object)"name"] = (object)"";
                        }
                        data[(object)"level"] = (object)(int)(Main.Level - 1);
                        Program.game.achivmanager.Check(AchievementType.Challenge, 0, data);
                        Program.game.achivmanager.Check(AchievementType.Challenge, 3, new Hashtable()
                        {
                            [(object)"barrageid"] = (object)this.barrageid,
                            [(object)"time"]      = (object)this.realtime
                        });
                        Program.game.game.PlaySound("timeout", true, this.boss.Position.X);
                        this.numflash = 1f;
                    }
                }
                if (this.barrages.Count >= 2 && (this.realtime <= this.barrages[1].time || this.hp <= this.barrages[1].hp))
                {
                    Program.game.game.PlaySound("tan", true, this.boss.Position.X);
                    this.barrages[0].cs.Breakanditem();
                    Time.Init();
                    this.barrages.RemoveAt(0);
                    this.barrages[0].cs.Start();
                    this.barrages[0].cs.SetPos(new Vector2(pos.X + 93f, pos.Y - 13f), false);
                }
                if (this.realtime == 0 && this.hp != 0)
                {
                    Hashtable data = new Hashtable();
                    if (this.cd != null)
                    {
                        data[(object)"name"] = (object)this.cd.CardName;
                    }
                    else
                    {
                        data[(object)"name"] = (object)"";
                    }
                    data[(object)"level"] = (object)(int)(Main.Level - 1);
                    data[(object)"shoot"] = (object)this.Player.shot;
                    data[(object)"bomb"]  = (object)this.Player.bombed;
                    data[(object)"dead"]  = (object)this.Player.dead;
                    Program.game.achivmanager.Check(AchievementType.Challenge, 1, data);
                    Program.game.achivmanager.Check(AchievementType.Challenge, 5, data);
                    Program.game.achivmanager.Check(AchievementType.Challenge, 11, data);
                    this.hp = 0;
                    if (!Bonus.IsBonused())
                    {
                        if (this.Player.dead || this.Player.bombed)
                        {
                            Bonus bonus1 = new Bonus(Bonus.GetScore(this.type, (float)this.frame, true), this.type, this.frame, true);
                        }
                        else
                        {
                            this.AddClearRecord(this.stage, this.barrageid);
                            if (!this.boss.timecard)
                            {
                                Bonus bonus2 = new Bonus(Bonus.GetScore(this.type, (float)this.frame, false), this.type, this.frame);
                            }
                            else
                            {
                                Bonus bonus3 = new Bonus(Bonus.GetScore(this.type, 0.0f, false), this.type, this.frame);
                            }
                        }
                    }
                    if (this.itemm != null)
                    {
                        this.itemm.Shoot(pos, 70f, this.Player, this.boss);
                        this.itemm.shot = false;
                    }
                    if (this.cd != null)
                    {
                        Program.game.game.Drawevents2 -= new Game.DrawDelegate3(this.cd.Draw);
                    }
                    this.cd = (CardDisplay)null;
                    this.barrages[0].cs.Breakanditem();
                    this.boss.timecard = false;
                    Time.Init();
                    Program.game.game.FindEffect("e" + (25 + colortype).ToString())?.Break();
                    this.die = true;
                }
            }
            if (this.type != 1)
            {
                return;
            }
            if (!this.first && this.time <= 120)
            {
                if (this.time == 30)
                {
                    bg.Switch(true);
                    this.boss.Image();
                    Program.game.game.PlaySound("cat", true, this.boss.Position.X);
                    CrazyStorm crazyStorm = Program.game.game.PlayEffect(true, (25 + colortype).ToString(), new Vector2(this.boss.Position.X + 93f, this.boss.Position.Y - 13f));
                    crazyStorm.BanSound(true);
                    crazyStorm.effect = true;
                    crazyStorm.SetOPos(new Vector2(this.boss.Position.X + 93f, this.boss.Position.Y - 13f));
                    Program.game.game.Quake(49, 4);
                    this.AddSCRecord(this.stage, this.barrageid);
                    this.cd = new CardDisplay(this.tex, this.boss.Spellcard, this.stage, this.barrageid);
                    Program.game.game.Drawevents2 += new Game.DrawDelegate3(this.cd.Draw);
                }
                if (this.time == 90)
                {
                    Program.game.game.PlaySound("ch02", true, this.boss.Position.X);
                }
            }
            else if (this.first && this.time > 120 && this.time == 121)
            {
                bg.Switch(true);
                Program.game.game.PlaySound("cat", true, this.boss.Position.X);
                CrazyStorm crazyStorm = Program.game.game.PlayEffect(true, (25 + colortype).ToString(), new Vector2(this.boss.Position.X + 93f, this.boss.Position.Y - 13f));
                crazyStorm.BanSound(true);
                crazyStorm.effect = true;
                crazyStorm.SetOPos(new Vector2(this.boss.Position.X + 93f, this.boss.Position.Y - 13f));
                Program.game.game.Quake(49, 4);
                this.AddSCRecord(this.stage, this.barrageid);
                this.cd = new CardDisplay(this.tex, this.boss.Spellcard, this.stage, this.barrageid);
                Program.game.game.Drawevents2 += new Game.DrawDelegate3(this.cd.Draw);
            }
            Program.game.game.FindEffect("e" + (25 + colortype).ToString())?.SetPos(new Vector2(this.boss.Position.X + 93f, this.boss.Position.Y - 13f), true);
            int num2 = this.Player.dead || this.Player.bombed ? Bonus.GetScore(this.type, 0.0f, true) : (this.boss.timecard ? Bonus.GetScore(this.type, 0.0f, false) : Bonus.GetScore(this.type, (float)this.frame, false));

            if (this.cd == null)
            {
                return;
            }
            this.cd.Update((float)num2);
        }
Exemple #8
0
        public void Update(CSManager csm, EnemyManager e, Boss b)
        {
            praticle.posrect = new Vector4(body.position.X, body.position.Y, 0.0f, 0.0f);
            equip.Update(b, e, type, mattribute.CHILDREN, eqlevel, body.position, Dis | Ban | BanShoot);
            SelfBarrageManager.Update(e, b, this);
            ++f;
            if (f % 3 == 0)
            {
                if (flash <= 40)
                {
                    ++flash;
                }
                if (flash % 2 == 0)
                {
                    body.color.r = 0.0f;
                    body.color.g = 0.0f;
                }
                else
                {
                    body.color.r = 1f;
                    body.color.g = 1f;
                }
            }
            if (f == 6)
            {
                f = 0;
                ++ani;
                if (ani == 7)
                {
                    ani = 0;
                }
            }
            eqlevel  = Program.game.game.Point / 50;
            runtime += Time.Stop;
            if (body.position.X >= rangex.X && body.position.X <= rangex.Y && (body.position.Y >= rangey.X && body.position.Y <= rangey.Y))
            {
                int num1 = -1;
                if (!Dis)
                {
                    if (Main.IsKeyDown(Keys.Up) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Up))
                    {
                        num1   = -90;
                        change = false;
                    }
                    if (Main.IsKeyDown(Keys.Down) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Down))
                    {
                        num1   = 90;
                        change = false;
                    }
                    if (Main.IsKeyDown(Keys.Left) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Left))
                    {
                        num1 = 180;
                        if (Main.IsKeyDown(Keys.Up) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Up))
                        {
                            num1 = 225;
                        }
                        if (Main.IsKeyDown(Keys.Down) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Down))
                        {
                            num1 = 135;
                        }
                    }
                    if (Main.IsKeyDown(Keys.Right) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Right))
                    {
                        num1 = 0;
                        if (Main.IsKeyDown(Keys.Up) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Up))
                        {
                            num1 = -45;
                        }
                        if (Main.IsKeyDown(Keys.Down) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Down))
                        {
                            num1 = 45;
                        }
                    }
                }
                if (num1 != -1)
                {
                    if (runtime - runtimebf >= 1.0)
                    {
                        if (num1 == 225 || num1 == 135 || (num1 == 180 || num1 == 0) || (num1 == -45 || num1 == 45))
                        {
                            ansave = num1;
                            change = true;
                            f3     = 1;
                            ++f2;
                            if (f2 == 3)
                            {
                                switch (num1)
                                {
                                case -45:
                                case 0:
                                case 45:
                                    body.rect = new Rectangle(660, (int)(type - 1) * 60, 60, 60);
                                    break;

                                case 135:
                                case 180:
                                case 225:
                                    body.rect = new Rectangle(420, (int)(type - 1) * 60, 60, 60);
                                    break;
                                }
                            }
                            else if (f2 == 7)
                            {
                                ++ani2;
                                if (ani2 >= 4)
                                {
                                    ani2 = 1;
                                }
                                switch (num1)
                                {
                                case -45:
                                case 0:
                                case 45:
                                    body.rect = new Rectangle((11 + ani2) * 60, (int)(type - 1) * 60, 60, 60);
                                    break;

                                case 135:
                                case 180:
                                case 225:
                                    body.rect = new Rectangle((7 + ani2) * 60, (int)(type - 1) * 60, 60, 60);
                                    break;
                                }
                                f2 = 4;
                            }
                        }
                        else
                        {
                            change = false;
                        }
                    }
                    float num2;
                    if (Main.IsKeyDown(Keys.LeftShift) || Main.IsKeyDown(Keys.RightShift) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Slow))
                    {
                        num2    = Characters.attribute[(int)(type - 1 + 4)].MOVE * 0.5f * speedadd.X;
                        shifted = true;
                    }
                    else
                    {
                        num2 = (float)(1.0 + Characters.attribute[(int)(type - 1)].MOVE * 0.5 * speedadd.Y);
                    }
                    body.position.X = MathHelper.Clamp(body.position.X + num2 * (float)Math.Cos(num1 * Math.PI / 180.0) * Time.Stop, rangex.X, rangex.Y);
                    body.position.Y = MathHelper.Clamp(body.position.Y + num2 * (float)Math.Sin(num1 * Math.PI / 180.0) * Time.Stop, rangey.X, rangey.Y);
                }
                else
                {
                    change = false;
                    f2     = 0;
                    ani2   = 0;
                }
                if (runtime - runtimebf >= 1.0)
                {
                    if (!change && f3 == 0)
                    {
                        body.rect = new Rectangle(ani * 60, (int)(type - 1) * 60, 60, 60);
                    }
                    else if (!change && f3 >= 1)
                    {
                        if (ansave == 225 || ansave == 135 || ansave == 180)
                        {
                            body.rect = new Rectangle(420, (int)(type - 1) * 60, 60, 60);
                        }
                        else if (ansave == 0 || ansave == -45 || ansave == 45)
                        {
                            body.rect = new Rectangle(660, (int)(type - 1) * 60, 60, 60);
                        }
                        ++f3;
                        if (f3 == 4)
                        {
                            f3 = 0;
                        }
                    }
                    runtimebf = runtime;
                }
                Program.game.achivmanager.Check(AchievementType.Hidden, 3, new Hashtable()
                {
                    ["itemline"] = Main.gn.Itemline[(int)(Main.Character - 1)],
                    ["y"]        = body.position.Y
                });
            }
            if ((Dis || free) && Time.Stop == 1.0)
            {
                ++time;
                if (time > 30 && time <= 100)
                {
                    for (int index = 0; index < e.EnemyArray.Count; ++index)
                    {
                        if (!e.EnemyArray[index].IsInWudi() && !e.EnemyArray[index].die && (e.EnemyArray[index].hp > 0 && !Main.IsOut(e.EnemyArray[index].Position)) && Math.Sqrt((e.EnemyArray[index].Position.X - body.position.X) * (e.EnemyArray[index].Position.X - body.position.X) + (e.EnemyArray[index].Position.Y - body.position.Y) * (e.EnemyArray[index].Position.Y - body.position.Y)) < Math.Abs((time - 10) * 10))
                        {
                            e.EnemyArray[index].deadkill = true;
                            e.EnemyArray[index].hp      -= 2;
                        }
                    }
                }
                if (time == 1)
                {
                    Program.game.achivmanager.Check(AchievementType.Challenge, 9, new Hashtable()
                    {
                        ["missorjust"] = true
                    });
                    CrazyStorm crazyStorm = Program.game.game.PlayEffect(true, "14", new Vector2(body.position.X + 93f, body.position.Y - 13f));
                    crazyStorm.BanSound(true);
                    crazyStorm.effect = true;
                    Program.game.game.PlaySound("pldead00", true, body.position.X);
                    body.color.a = 0.0f;
                }
                else if (time == 30)
                {
                    if (Program.game.game.Point >= 50)
                    {
                        Program.game.game.DeathItem();
                    }
                    Program.game.game.SpecialSystemReset();
                    dead     = true;
                    havedead = true;
                    Program.game.game.Life -= 5;
                    if (Program.game.game.Bomb < 10)
                    {
                        Program.game.game.Bomb = 10 + Program.game.game.Bomb % 5;
                    }
                    if (Program.game.game.Life == 0)
                    {
                        Program.game.game.Life = 0;
                        if (!makeup)
                        {
                            Program.game.game.Point = 150;
                        }
                        makeup = true;
                    }
                    else if (Program.game.game.Life < 0)
                    {
                        alreadycal = true;
                        Program.game.game.PlaySound("pldead01", true, body.position.X);
                        Program.game.game.Life     = -5;
                        Program.game.game.Bomb     = 0;
                        Program.game.game.BanPause = true;
                        makeup = false;
                    }
                }
                else if (time > 30)
                {
                    if (time == 31)
                    {
                        body.position.X = 224f;
                        body.position.Y = 510f;
                    }
                    else if (Program.game.game.Life >= 0 && body.position.Y > 420.0 && !free)
                    {
                        body.position.Y -= 2f;
                        if (body.position.Y <= 420.0)
                        {
                            body.position.Y = 420f;
                        }
                    }
                    if (Program.game.game.Life >= 0)
                    {
                        if (time % 6 < 3)
                        {
                            body.color.r = 0.0f;
                            body.color.g = 0.0f;
                        }
                        else
                        {
                            body.color.r = 1f;
                            body.color.g = 1f;
                        }
                    }
                    body.color.a = 1f;
                }
                if (time == 95)
                {
                    if (!alreadycal)
                    {
                        Program.game.game.AddStgData(1, 0, 0);
                    }
                    else
                    {
                        alreadycal = false;
                    }
                    Dis  = false;
                    free = true;
                    if (Program.game.game.Life == -5)
                    {
                        free = false;
                        Dis  = true;
                        time = 50;
                        Program.game.game.DeathProcess();
                    }
                }
                if (time > 280)
                {
                    free = false;
                    time = 0;
                }
            }
            if (!Ban && !Dis && !BanShoot | type == Cname.PATCHOULI && (Main.IsKeyDown(Keys.Z) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Confirm)))
            {
                BEquipShoot(selfb, type, mattribute.BODY, body.position);
                shot = true;
            }
            if (bomb != null && !bomb.Die)
            {
                bomb.Update(this, csm, e, b);
            }
            else if (bomb != null)
            {
                bomb = null;
                Wudi = false;
                Auto = false;
            }
            int num = type != Cname.SANAE || Main.Mode != Modes.SINGLE || (Main.IsKeyDown(Keys.LeftShift) || Main.IsKeyDown(Keys.RightShift)) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Slow) ? 5 : 3;

            if (!Ban && (jue <= 10 || free) && (Program.game.game.Bomb >= num && bomb == null) && ((Main.IsKeyPressed(Keys.X) || !Main.Replay && PadState.IsKeyPressed(JOYKEYS.Special, Main.prepadstat)) && Time.Stop != 0.0))
            {
                bombed     = true;
                BanShoot   = true;
                body.color = new Colors(1f, 1f, 1f, 1f);
                if (b != null)
                {
                    Program.game.game.AddStgData(0, 1, 0);
                }
                Program.game.game.Bomb -= num;
                if (Program.game.game.Bomb <= 0)
                {
                    Program.game.game.Bomb = 0;
                }
                if (!free)
                {
                    Dis  = false;
                    time = 0;
                    Program.game.achivmanager.Check(AchievementType.Challenge, 9, new Hashtable()
                    {
                        ["missorjust"] = false
                    });
                }
                Program.game.game.PlaySound("slash", true, body.position.X);
                bomb = new SingleBomb(type, body.position + new Vector2(93f, -13f));
                Wudi = true;
                Auto = true;
            }
            if (Dis || free)
            {
                ++jue;
            }
            else
            {
                jue = 0;
            }
            if (itemm == null)
            {
                return;
            }
            foreach (ItemManager itemManager in itemm)
            {
                if (!Dis)
                {
                    itemManager.Ban(false);
                }
                else
                {
                    itemManager.Ban(true);
                }
                itemManager.Transpos(body.position.X, body.position.Y);
            }
        }
Exemple #9
0
 private void SpecialUpdate()
 {
     if (this.type != 8)
     {
         return;
     }
     if (this.passedCards >= 2)
     {
         this.originsize          = this.fscenter["OriginSize"];
         this.fsrect["Throne"]    = new Rectangle(0, 1812, 137, 180);
         this.sppraticle.posrect  = new Vector4(this.Position.X - 40f, this.Position.Y, 45f, 45f);
         this.sppraticle2.posrect = new Vector4(this.Position.X - 10f, this.Position.Y, 45f, 45f);
         if (this.passedCards == 2 && this.CardArray[0].CurrentTime < 120)
         {
             this.spposition = this.position;
         }
         else
         {
             this.spposition.Y += (float)((-200.0 - (double)this.spposition.Y) / 120.0);
         }
     }
     else
     {
         this.originsize          = new Vector2(0.0f, 0.0f);
         this.spposition          = this.position;
         this.sppraticle.posrect  = new Vector4(this.spposition.X - 105f, this.spposition.Y, 45f, 45f);
         this.sppraticle2.posrect = new Vector4(this.spposition.X + 65f, this.spposition.Y, 45f, 45f);
     }
     this.floatimage               = (float)(5.0 + 5.0 * Math.Abs(Math.Sin((double)this.time / Math.PI / 10.0)));
     this.fsposition["Throne"]     = new Vector2(this.spposition.X, this.spposition.Y - 30f);
     this.fsposition["BackBone"]   = new Vector2(this.spposition.X + 6f, this.spposition.Y - 10f);
     this.fsposition["Skull"]      = new Vector2(this.spposition.X, this.spposition.Y + 50f);
     this.fsposition["LeftWing1"]  = new Vector2(this.spposition.X - 40f, this.spposition.Y + 60f);
     this.fsposition["RightWing1"] = new Vector2(this.spposition.X + 40f, this.spposition.Y + 60f);
     this.fsposition["LeftWing2"]  = new Vector2(this.spposition.X - 50f, this.spposition.Y + 50f);
     this.fsposition["RightWing2"] = new Vector2(this.spposition.X + 50f, this.spposition.Y + 50f);
     this.fsposition["LeftWing3"]  = new Vector2(this.spposition.X - 80f, this.spposition.Y + 40f);
     this.fsposition["RightWing3"] = new Vector2(this.spposition.X + 80f, this.spposition.Y + 40f);
     this.fsposition["LeftFlag1"]  = new Vector2(this.spposition.X - 65f, this.spposition.Y + 60f);
     this.fsposition["RightFlag1"] = new Vector2(this.spposition.X + 65f, this.spposition.Y + 60f);
     this.fsposition["LeftFlag2"]  = new Vector2(this.spposition.X - 100f, this.spposition.Y + 40f);
     this.fsposition["RightFlag2"] = new Vector2(this.spposition.X + 100f, this.spposition.Y + 40f);
     if (this.time % 7 == 0)
     {
         Dictionary <string, int> fsframe;
         (fsframe = this.fsframe)["Flag"] = fsframe["Flag"] + 1;
         if (this.fsframe["Flag"] >= 9)
         {
             this.fsframe["Flag"] = 0;
         }
         if (this.CardArray.Count >= 8)
         {
             this.fsrect["Flag"]     = new Rectangle(417 + this.fsframe["Flag"] * 50, this.fsrect["Flag"].Y, this.fsrect["Flag"].Width, this.fsrect["Flag"].Height);
             this.fsrect["BackFlag"] = new Rectangle(417 + this.fsframe["Flag"] * 50, this.fsrect["BackFlag"].Y, this.fsrect["BackFlag"].Width, this.fsrect["BackFlag"].Height);
         }
         else
         {
             this.fsrect["Flag"]     = new Rectangle(417 + this.fsframe["Flag"] * 50, 1627, this.fsrect["Flag"].Width, this.fsrect["Flag"].Height);
             this.fsrect["BackFlag"] = new Rectangle(417 + this.fsframe["Flag"] * 50, 1847, this.fsrect["BackFlag"].Width, this.fsrect["BackFlag"].Height);
         }
     }
     if (this.CardArray.Count < 6)
     {
         if (!this.level1)
         {
             CrazyStorm crazyStorm1 = Program.game.game.PlayEffect(true, "8", new Vector2(this.Position.X + 93f, (float)((double)this.Position.Y + 50.0 - 13.0)));
             crazyStorm1.BanSound(true);
             crazyStorm1.effect = true;
             CrazyStorm crazyStorm2 = Program.game.game.PlayEffect(true, "8", new Vector2((float)((double)this.Position.X - 50.0 + 93.0), (float)((double)this.Position.Y + 50.0 - 13.0)));
             crazyStorm2.BanSound(true);
             crazyStorm2.effect = true;
             CrazyStorm crazyStorm3 = Program.game.game.PlayEffect(true, "8", new Vector2((float)((double)this.Position.X + 50.0 + 93.0), (float)((double)this.Position.Y + 50.0 - 13.0)));
             crazyStorm3.BanSound(true);
             crazyStorm3.effect = true;
             this.level1        = true;
         }
         this.fsrect["Skull"] = new Rectangle(524, 1300, 178, 164);
     }
     if (this.CardArray.Count >= 2)
     {
         this.sppraticle.Update();
         this.sppraticle2.Update();
         this.sppraticle.stop  = false;
         this.sppraticle2.stop = false;
         this.praticle2.stop   = true;
     }
     else
     {
         this.praticle2.stop   = false;
         this.sppraticle.stop  = true;
         this.sppraticle2.stop = true;
     }
     if (this.CardArray.Count < 6 && this.CardArray.Count >= 4)
     {
         this.fsrect["Wing"] = new Rectangle(104, 1617, 104, 169);
     }
     else
     {
         if (this.CardArray.Count >= 4 || this.CardArray.Count < 2)
         {
             return;
         }
         if (!this.level2)
         {
             CrazyStorm crazyStorm1 = Program.game.game.PlayEffect(true, "8", new Vector2((float)((double)this.Position.X - 40.0 + 93.0), (float)((double)this.Position.Y + 60.0 - 13.0)));
             crazyStorm1.BanSound(true);
             crazyStorm1.effect = true;
             CrazyStorm crazyStorm2 = Program.game.game.PlayEffect(true, "8", new Vector2((float)((double)this.Position.X + 40.0 + 93.0), (float)((double)this.Position.Y + 60.0 - 13.0)));
             crazyStorm2.BanSound(true);
             crazyStorm2.effect = true;
             this.level2        = true;
         }
         this.fsrect["Wing"] = new Rectangle(312, 1617, 104, 169);
     }
 }
Exemple #10
0
        public void Update(
            LayerManager layerm,
            CrazyStorm cs,
            Time Times,
            Center Centers,
            Vector2 Player)
        {
            if (!(Times.now >= this.begin & Times.now <= this.begin + this.life - 1))
            {
                return;
            }
            int now = Times.now;

            this.speedx += this.aspeedx;
            this.speedy += this.aspeedy;
            this.x      += this.speedx;
            this.y      += this.speedy;
            float x1    = this.x - 4f;
            float y1    = this.y + 16f;
            float x2    = (float)((double)this.x - 4.0 + (double)this.longs * Math.Cos((double)MathHelper.ToRadians(this.angle)));
            float y2    = (float)((double)this.y + 16.0 + (double)this.longs * Math.Sin((double)MathHelper.ToRadians(this.angle)));
            Line  line1 = new Line(new PointF(x1, y1), new PointF(x2, y2));

            foreach (Barrage barrage in layerm.LayerArray[this.parentid].Barrages)
            {
                if (barrage.Rebound && (barrage.time > 15 || !barrage.Mist) && !barrage.Dis)
                {
                    float speedx = barrage.speedx;
                    float speedy = barrage.speedy;
                    float num1   = speedx + barrage.aspeedx;
                    float num2   = speedy + barrage.aspeedy;
                    float x3     = barrage.x;
                    float y3     = barrage.y;
                    float num3   = x3 + (num1 - this.speedx);
                    float num4   = y3 + (num2 - this.speedy);
                    float x4     = num3;
                    float y4     = num4;
                    float x5     = barrage.x;
                    float y5     = barrage.y;
                    Line  line2  = new Line(new PointF(x4, y4), new PointF(x5, y5));
                    if (((Main.CheckTwoLineCrose(line1, line2) ? 1 : 0) & (barrage.reboundtime < this.time ? 1 : (this.time == 0 ? 1 : 0))) != 0)
                    {
                        float num5 = (float)(((double)y2 - (double)y1) * ((double)x5 - (double)x4) - ((double)y5 - (double)y4) * ((double)x2 - (double)x1));
                        float num6 = (float)(((double)x2 - (double)x1) * ((double)x5 - (double)x4) * ((double)y4 - (double)y1) + ((double)y2 - (double)y1) * ((double)x5 - (double)x4) * (double)x1 - ((double)y5 - (double)y4) * ((double)x2 - (double)x1) * (double)x4) / num5;
                        float num7 = (float)((((double)y2 - (double)y1) * ((double)y5 - (double)y4) * ((double)x4 - (double)x1) + ((double)x2 - (double)x1) * ((double)y5 - (double)y4) * (double)y1 - ((double)x5 - (double)x4) * ((double)y2 - (double)y1) * (double)y4) / -(double)num5);
                        barrage.speedd = 2f * this.angle - barrage.speedd;
                        float num8 = (float)(((double)num6 - (double)x4) * ((double)num6 - (double)x4) + ((double)num7 - (double)y4) * ((double)num7 - (double)y4));
                        barrage.x      = num6 + barrage.xscale * (float)(Math.Sqrt((double)num8) * Math.Cos((double)MathHelper.ToRadians(barrage.speedd)));
                        barrage.y      = num7 + barrage.yscale * (float)(Math.Sqrt((double)num8) * Math.Sin((double)MathHelper.ToRadians(barrage.speedd)));
                        barrage.speedx = barrage.xscale * barrage.speed * (float)Math.Cos((double)MathHelper.ToRadians(barrage.speedd));
                        barrage.speedy = barrage.yscale * barrage.speed * (float)Math.Sin((double)MathHelper.ToRadians(barrage.speedd));
                        ++barrage.reboundtime;
                        foreach (Event parentevent in this.Parentevents)
                        {
                            string str  = "";
                            string s    = "";
                            int    num9 = 0;
                            string tag  = parentevent.tag;
                            if (parentevent.tag.Contains("变化到"))
                            {
                                str  = tag.Split("变化到".ToCharArray())[0];
                                s    = tag.Split("变化到".ToCharArray())[3].Split('+')[0];
                                num9 = 1;
                            }
                            if (parentevent.tag.Contains("增加"))
                            {
                                str  = tag.Split("增".ToCharArray())[0];
                                s    = tag.Split("增".ToCharArray())[1].Replace("加", "").Split('+')[0];
                                num9 = 2;
                            }
                            if (parentevent.tag.Contains("减少"))
                            {
                                str  = tag.Split("减少".ToCharArray())[0];
                                s    = tag.Split("减少".ToCharArray())[2].Split('+')[0];
                                num9 = 3;
                            }
                            if (parentevent.tag.Contains("+"))
                            {
                                float num10 = float.Parse(parentevent.tag.Split('+')[1]);
                                s = (float.Parse(s) + MathHelper.Lerp(-num10, num10, (float)this.Rand(cs.effect && !cs.bomb, cs.bomb))).ToString();
                            }
                            if (str == "生命")
                            {
                                switch (num9)
                                {
                                case 1:
                                    barrage.life = (int)float.Parse(s);
                                    break;

                                case 2:
                                    barrage.life += (int)float.Parse(s);
                                    break;

                                case 3:
                                    barrage.life -= (int)float.Parse(s);
                                    break;
                                }
                            }
                            if (str == "类型")
                            {
                                switch (num9)
                                {
                                case 1:
                                    barrage.type = (int)float.Parse(s);
                                    break;

                                case 2:
                                    barrage.type += (int)float.Parse(s);
                                    break;

                                case 3:
                                    barrage.type -= (int)float.Parse(s);
                                    break;
                                }
                            }
                            if (str == "宽比")
                            {
                                switch (num9)
                                {
                                case 1:
                                    barrage.wscale = float.Parse(s);
                                    break;

                                case 2:
                                    barrage.wscale += float.Parse(s);
                                    break;

                                case 3:
                                    barrage.wscale -= float.Parse(s);
                                    break;
                                }
                            }
                            if (str == "高比")
                            {
                                switch (num9)
                                {
                                case 1:
                                    barrage.hscale = float.Parse(s);
                                    break;

                                case 2:
                                    barrage.hscale += float.Parse(s);
                                    break;

                                case 3:
                                    barrage.hscale -= float.Parse(s);
                                    break;
                                }
                            }
                            if (str == "R")
                            {
                                switch (num9)
                                {
                                case 1:
                                    barrage.R = float.Parse(s);
                                    break;

                                case 2:
                                    barrage.R += float.Parse(s);
                                    break;

                                case 3:
                                    barrage.R -= float.Parse(s);
                                    break;
                                }
                            }
                            if (str == "G")
                            {
                                switch (num9)
                                {
                                case 1:
                                    barrage.G = float.Parse(s);
                                    break;

                                case 2:
                                    barrage.G += float.Parse(s);
                                    break;

                                case 3:
                                    barrage.G -= float.Parse(s);
                                    break;
                                }
                            }
                            if (str == "B")
                            {
                                switch (num9)
                                {
                                case 1:
                                    barrage.B = float.Parse(s);
                                    break;

                                case 2:
                                    barrage.B += float.Parse(s);
                                    break;

                                case 3:
                                    barrage.B -= float.Parse(s);
                                    break;
                                }
                            }
                            if (str == "不透明度")
                            {
                                switch (num9)
                                {
                                case 1:
                                    barrage.alpha = float.Parse(s);
                                    break;

                                case 2:
                                    barrage.alpha += float.Parse(s);
                                    break;

                                case 3:
                                    barrage.alpha -= float.Parse(s);
                                    break;
                                }
                            }
                            if (str == "朝向")
                            {
                                switch (num9)
                                {
                                case 1:
                                    barrage.head = float.Parse(s);
                                    break;

                                case 2:
                                    barrage.head += float.Parse(s);
                                    break;

                                case 3:
                                    barrage.head -= float.Parse(s);
                                    break;
                                }
                            }
                            if (str == "子弹速度")
                            {
                                switch (num9)
                                {
                                case 1:
                                    barrage.speed = float.Parse(s);
                                    break;

                                case 2:
                                    barrage.speed += float.Parse(s);
                                    break;

                                case 3:
                                    barrage.speed -= float.Parse(s);
                                    break;
                                }
                                barrage.speedx = barrage.xscale * barrage.speed * (float)Math.Cos((double)MathHelper.ToRadians(barrage.speedd));
                                barrage.speedy = barrage.yscale * barrage.speed * (float)Math.Sin((double)MathHelper.ToRadians(barrage.speedd));
                            }
                            if (str == "子弹速度方向")
                            {
                                if (s.Contains("自机"))
                                {
                                    barrage.speedd = MathHelper.ToDegrees(Main.Twopointangle(Player.X, Player.Y, barrage.x, barrage.y));
                                }
                                else
                                {
                                    switch (num9)
                                    {
                                    case 1:
                                        barrage.speedd = float.Parse(s);
                                        break;

                                    case 2:
                                        barrage.speedd += float.Parse(s);
                                        break;

                                    case 3:
                                        barrage.speedd -= float.Parse(s);
                                        break;
                                    }
                                }
                                barrage.speedx = barrage.xscale * barrage.speed * (float)Math.Cos((double)MathHelper.ToRadians(barrage.speedd));
                                barrage.speedy = barrage.yscale * barrage.speed * (float)Math.Sin((double)MathHelper.ToRadians(barrage.speedd));
                            }
                            if (str == "子弹加速度")
                            {
                                switch (num9)
                                {
                                case 1:
                                    barrage.aspeed = float.Parse(s);
                                    break;

                                case 2:
                                    barrage.aspeed += float.Parse(s);
                                    break;

                                case 3:
                                    barrage.aspeed -= float.Parse(s);
                                    break;
                                }
                                barrage.aspeedx = barrage.xscale * barrage.aspeed * (float)Math.Cos((double)MathHelper.ToRadians(barrage.aspeedd));
                                barrage.aspeedy = barrage.yscale * barrage.aspeed * (float)Math.Sin((double)MathHelper.ToRadians(barrage.aspeedd));
                            }
                            if (str == "子弹加速度方向")
                            {
                                if (s.Contains("自机"))
                                {
                                    barrage.aspeedd = MathHelper.ToDegrees(Main.Twopointangle(Player.X, Player.Y, barrage.x, barrage.y));
                                }
                                else
                                {
                                    switch (num9)
                                    {
                                    case 1:
                                        barrage.aspeedd = float.Parse(s);
                                        break;

                                    case 2:
                                        barrage.aspeedd += float.Parse(s);
                                        break;

                                    case 3:
                                        barrage.aspeedd -= float.Parse(s);
                                        break;
                                    }
                                }
                                barrage.aspeedx = barrage.xscale * barrage.aspeed * (float)Math.Cos((double)MathHelper.ToRadians(barrage.aspeedd));
                                barrage.aspeedy = barrage.yscale * barrage.aspeed * (float)Math.Sin((double)MathHelper.ToRadians(barrage.aspeedd));
                            }
                            if (str == "横比")
                            {
                                switch (num9)
                                {
                                case 1:
                                    barrage.xscale = float.Parse(s);
                                    break;

                                case 2:
                                    barrage.xscale += float.Parse(s);
                                    break;

                                case 3:
                                    barrage.xscale -= float.Parse(s);
                                    break;
                                }
                            }
                            if (str == "纵比")
                            {
                                switch (num9)
                                {
                                case 1:
                                    barrage.yscale = float.Parse(s);
                                    break;

                                case 2:
                                    barrage.yscale += float.Parse(s);
                                    break;

                                case 3:
                                    barrage.yscale -= float.Parse(s);
                                    break;
                                }
                            }
                            if (str == "雾化效果")
                            {
                                barrage.Mist = (int)float.Parse(s) > 0;
                            }
                            if (str == "消除效果")
                            {
                                barrage.Dispel = (int)float.Parse(s) > 0;
                            }
                            if (str == "高光效果")
                            {
                                barrage.Blend = (int)float.Parse(s) > 0;
                            }
                            if (str == "拖影效果")
                            {
                                barrage.Afterimage = (int)float.Parse(s) > 0;
                            }
                            if (str == "出屏即消")
                            {
                                barrage.Outdispel = (int)float.Parse(s) > 0;
                            }
                            if (str == "无敌状态")
                            {
                                barrage.Invincible = (int)float.Parse(s) > 0;
                            }
                        }
                    }
                }
            }
        }
Exemple #11
0
        private void S_BOMB(int l, Vector2 p, bool Ban)
        {
            if (!this.inited)
            {
                this.inited = true;
                for (int index = 0; index < l; ++index)
                {
                    this.sprites.Add(new Sprite(this.tex, new Rectangle(103, 61, 41, 41)));
                    this.sprites[this.sprites.Count - 1].origin  = new Vector2(20f, 21f);
                    this.sprites[this.sprites.Count - 1].scale   = Vector2.Zero;
                    this.sprites[this.sprites.Count - 1].color.a = 1f;
                }
                switch (l)
                {
                case 1:
                    this.sprites[0].position = new Vector2(0.0f, -30f);
                    break;

                case 2:
                    this.sprites[0].position = new Vector2(-30f, 0.0f);
                    this.sprites[1].position = new Vector2(30f, 0.0f);
                    break;

                case 3:
                    this.sprites[0].position = new Vector2(0.0f, -30f);
                    this.sprites[1].position = new Vector2(-30f, 0.0f);
                    this.sprites[2].position = new Vector2(30f, 0.0f);
                    break;

                case 4:
                    this.sprites[0].position = new Vector2(-22f, 10f);
                    this.sprites[1].position = new Vector2(22f, 10f);
                    this.sprites[2].position = new Vector2(-40f, 0.0f);
                    this.sprites[3].position = new Vector2(40f, 0.0f);
                    break;
                }
            }
            for (int index = 0; index < this.sprites.Count; ++index)
            {
                this.sprites[index].scale += new Vector2(0.06f, 0.06f);
                if ((double)this.sprites[index].scale.X >= 0.800000011920929)
                {
                    this.sprites[index].scale = new Vector2(0.8f, 0.8f);
                }
                this.sprites[index].rotation += 10f * Time.Stop;
            }
            if ((double)Time.Stop == 1.0)
            {
                if (!Ban && (Main.IsKeyDown(Keys.LeftShift) || Main.IsKeyDown(Keys.RightShift) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Slow)))
                {
                    switch (l)
                    {
                    case 1:
                        this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0);
                        this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0);
                        break;

                    case 2:
                        this.sprites[0].position.X += (float)((-17.0 - (double)this.sprites[0].position.X) / 5.0);
                        this.sprites[0].position.Y += (float)((-11.0 - (double)this.sprites[0].position.Y) / 5.0);
                        this.sprites[1].position.X += (float)((17.0 - (double)this.sprites[1].position.X) / 5.0);
                        this.sprites[1].position.Y += (float)((-11.0 - (double)this.sprites[1].position.Y) / 5.0);
                        break;

                    case 3:
                        this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0);
                        this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0);
                        this.sprites[1].position.X += (float)((-20.0 - (double)this.sprites[1].position.X) / 5.0);
                        this.sprites[1].position.Y += (float)((-10.0 - (double)this.sprites[1].position.Y) / 5.0);
                        this.sprites[2].position.X += (float)((20.0 - (double)this.sprites[2].position.X) / 5.0);
                        this.sprites[2].position.Y += (float)((-10.0 - (double)this.sprites[2].position.Y) / 5.0);
                        break;

                    case 4:
                        this.sprites[0].position.X += (float)((-12.0 - (double)this.sprites[0].position.X) / 5.0);
                        this.sprites[0].position.Y += (float)((-25.0 - (double)this.sprites[0].position.Y) / 5.0);
                        this.sprites[1].position.X += (float)((12.0 - (double)this.sprites[1].position.X) / 5.0);
                        this.sprites[1].position.Y += (float)((-25.0 - (double)this.sprites[1].position.Y) / 5.0);
                        this.sprites[2].position.X += (float)((-26.0 - (double)this.sprites[2].position.X) / 5.0);
                        this.sprites[2].position.Y += (float)((-5.0 - (double)this.sprites[2].position.Y) / 5.0);
                        this.sprites[3].position.X += (float)((26.0 - (double)this.sprites[3].position.X) / 5.0);
                        this.sprites[3].position.Y += (float)((-5.0 - (double)this.sprites[3].position.Y) / 5.0);
                        break;
                    }
                }
                else
                {
                    switch (l)
                    {
                    case 1:
                        this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0);
                        this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0);
                        break;

                    case 2:
                        this.sprites[0].position.X += (float)((-30.0 - (double)this.sprites[0].position.X) / 5.0);
                        this.sprites[0].position.Y += (float)((0.0 - (double)this.sprites[0].position.Y) / 5.0);
                        this.sprites[1].position.X += (float)((30.0 - (double)this.sprites[1].position.X) / 5.0);
                        this.sprites[1].position.Y += (float)((0.0 - (double)this.sprites[1].position.Y) / 5.0);
                        break;

                    case 3:
                        this.sprites[0].position.X += (float)((0.0 - (double)this.sprites[0].position.X) / 5.0);
                        this.sprites[0].position.Y += (float)((-30.0 - (double)this.sprites[0].position.Y) / 5.0);
                        this.sprites[1].position.X += (float)((-30.0 - (double)this.sprites[1].position.X) / 5.0);
                        this.sprites[1].position.Y += (float)((0.0 - (double)this.sprites[1].position.Y) / 5.0);
                        this.sprites[2].position.X += (float)((30.0 - (double)this.sprites[2].position.X) / 5.0);
                        this.sprites[2].position.Y += (float)((0.0 - (double)this.sprites[2].position.Y) / 5.0);
                        break;

                    case 4:
                        this.sprites[0].position.X += (float)((-22.0 - (double)this.sprites[0].position.X) / 5.0);
                        this.sprites[0].position.Y += (float)((10.0 - (double)this.sprites[0].position.Y) / 5.0);
                        this.sprites[1].position.X += (float)((22.0 - (double)this.sprites[1].position.X) / 5.0);
                        this.sprites[1].position.Y += (float)((10.0 - (double)this.sprites[1].position.Y) / 5.0);
                        this.sprites[2].position.X += (float)((-40.0 - (double)this.sprites[2].position.X) / 5.0);
                        this.sprites[2].position.Y += (float)((0.0 - (double)this.sprites[2].position.Y) / 5.0);
                        this.sprites[3].position.X += (float)((40.0 - (double)this.sprites[3].position.X) / 5.0);
                        this.sprites[3].position.Y += (float)((0.0 - (double)this.sprites[3].position.Y) / 5.0);
                        break;
                    }
                }
            }
            foreach (SelfBarrage sb in SelfBarrageManager.SBArray)
            {
                if (sb.label == 1 && ((double)sb.time >= 60.0 || sb.Judged))
                {
                    Program.game.game.PlaySound("explo", true, sb.Position.X);
                    CrazyStorm crazyStorm = Program.game.game.PlayEffect(true, "1", new Vector2(sb.Position.X + 93f, sb.Position.Y - 13f));
                    crazyStorm.isforshoot = true;
                    crazyStorm.BanSound(true);
                    crazyStorm.shoot.AddRange((IEnumerable <byte>) new List <byte>()
                    {
                        (byte)0,
                        (byte)1
                    });
                    crazyStorm.effect = true;
                    crazyStorm.allpan = true;
                    crazyStorm.bomb   = true;
                    sb.Judged         = true;
                    sb.label          = 0;
                }
            }
        }
Exemple #12
0
        public void Update(Character Player, CSManager csm, EnemyManager em, Boss boss)
        {
            Character Player1 = Player;

            ++this.time;
            if (this.time <= 40)
            {
                Program.game.game.bgcolor.a += 0.015f;
                if ((double)Program.game.game.bgcolor.a >= 1.0)
                {
                    Program.game.game.bgcolor.a = 1f;
                }
            }
            if (this.time % 6 < 2)
            {
                Player.body.color.r = 0.0f;
                Player.body.color.g = 0.0f;
            }
            else
            {
                Player.body.color.r = 1f;
                Player.body.color.g = 1f;
            }
            if (this.cs != null)
            {
                switch (this.type)
                {
                case Cname.REIMU:
                    Player.BanShoot = false;
                    Vector2 vector2_1;
                    Vector2 vector2_2;
                    if (Main.Mode == Modes.SINGLE)
                    {
                        vector2_1 = new Vector2(42f, 406f);
                        vector2_2 = new Vector2(43f, 453f);
                    }
                    else
                    {
                        vector2_1 = new Vector2(10f, 630f);
                        vector2_2 = new Vector2(20f, 465f);
                    }
                    this.target.body.position.X = 224f;
                    this.target.body.position.Y = 144f;
                    foreach (Enemy enemy in em.EnemyArray)
                    {
                        if (!enemy.die && (double)enemy.Position.X >= (double)vector2_1.X && ((double)enemy.Position.X <= (double)vector2_1.Y && (double)enemy.Position.Y >= (double)vector2_2.X) && (double)enemy.Position.Y <= (double)vector2_2.Y)
                        {
                            this.target.body.position = enemy.Position;
                            break;
                        }
                    }
                    if (boss != null && !boss.leave)
                    {
                        this.target.body.position = boss.Position;
                    }
                    Player1 = this.target;
                    if (this.time == 199)
                    {
                        Program.game.game.Quake(30, 3);
                        break;
                    }
                    if (this.time == 229)
                    {
                        Program.game.game.Quake(30, 3);
                        break;
                    }
                    if (this.time == 259)
                    {
                        Program.game.game.Quake(30, 3);
                        break;
                    }
                    break;

                case Cname.MARISA:
                    this.cs.SetPos(new Vector2(Player.body.position.X + 93f, Player.body.position.Y - 13f), true);
                    Player.speedadd = new Vector2(0.15f, 0.02f);
                    break;

                case Cname.SANAE:
                    if (this.cs.Id == "e19")
                    {
                        Player.BanShoot = false;
                        this.cs.SetPos(Player.body.position + new Vector2(93f, -13f), true);
                        using (List <CrazyStorm> .Enumerator enumerator = csm.csc.GetEnumerator())
                        {
                            while (enumerator.MoveNext())
                            {
                                foreach (Layer layer in enumerator.Current.layerm.LayerArray)
                                {
                                    foreach (Barrage barrage in layer.Barrages)
                                    {
                                        if (!barrage.Invincible && barrage.time > 15 | !barrage.Mist && (!barrage.NeedDelete && Math.Sqrt(((double)barrage.x - (double)Player.body.position.X - 93.0) * ((double)barrage.x - (double)Player.body.position.X - 93.0) + ((double)barrage.y - (double)Player.body.position.Y + 13.0) * ((double)barrage.y - (double)Player.body.position.Y + 13.0)) <= 100.0))
                                        {
                                            barrage.life  = 0;
                                            barrage.Dis   = true;
                                            barrage.Blend = true;
                                        }
                                    }
                                }
                            }
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }

                case Cname.PATCHOULI:
                    foreach (CrazyStorm crazyStorm in csm.csc)
                    {
                        foreach (Layer layer in crazyStorm.layerm.LayerArray)
                        {
                            foreach (Barrage barrage in layer.Barrages)
                            {
                                if (!barrage.Invincible && barrage.time > 15 | !barrage.Mist && (!barrage.NeedDelete && Math.Sqrt(((double)barrage.x - (double)Player.body.position.X - 93.0) * ((double)barrage.x - (double)Player.body.position.X - 93.0) + ((double)barrage.y - (double)Player.body.position.Y + 13.0) * ((double)barrage.y - (double)Player.body.position.Y + 13.0)) <= 168.0))
                                {
                                    barrage.life  = 0;
                                    barrage.Dis   = true;
                                    barrage.Blend = true;
                                }
                            }
                        }
                    }
                    foreach (Enemy enemy in em.EnemyArray)
                    {
                        if (!enemy.IsInWudi() && Math.Sqrt(((double)enemy.Position.X - (double)Player.body.position.X) * ((double)enemy.Position.X - (double)Player.body.position.X) + ((double)enemy.Position.Y - (double)Player.body.position.Y) * ((double)enemy.Position.Y - (double)Player.body.position.Y)) <= 168.0)
                        {
                            enemy.hp -= 24;
                            Program.game.game.Score += 10L;
                        }
                    }
                    if (boss != null && Math.Sqrt(((double)boss.Position.X - (double)Player.body.position.X) * ((double)boss.Position.X - (double)Player.body.position.X) + ((double)boss.Position.Y - (double)Player.body.position.Y) * ((double)boss.Position.Y - (double)Player.body.position.Y)) <= 168.0)
                    {
                        Program.game.game.Score += 10L;
                        if (boss.CardArray.Count >= 1)
                        {
                            boss.CardArray[0].DeHp(24, this.cs.isforshoot);
                        }
                    }
                    if (this.cs.time.total - this.cs.time.now <= 20)
                    {
                        using (List <Layer> .Enumerator enumerator = this.cs.layerm.LayerArray.GetEnumerator())
                        {
                            while (enumerator.MoveNext())
                            {
                                foreach (Barrage barrage in enumerator.Current.Barrages)
                                {
                                    barrage.alpha = (float)((this.cs.time.total - this.cs.time.now) * 5);
                                }
                            }
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }
            if (this.cs == null)
            {
                if (this.wait == 0)
                {
                    if (this.type == Cname.MARISA)
                    {
                        Player.speedadd = new Vector2(1f, 1f);
                    }
                    Player.BanShoot = false;
                }
                ++this.wait;
                Program.game.game.bgcolor.a -= 0.015f;
                if ((double)Program.game.game.bgcolor.a <= 0.0)
                {
                    Program.game.game.bgcolor.a = 0.0f;
                }
                if (this.wait != 40)
                {
                    return;
                }
                Player.body.color.r = 1f;
                Player.body.color.g = 1f;
                this.wait           = 0;
                this.die            = true;
            }
            else if (this.cs.IsClosing())
            {
                this.cs.EndStart();
                this.cs.Break();
                this.cs = (CrazyStorm)null;
            }
            else
            {
                if (!this.cs.Run())
                {
                    return;
                }
                this.cs.Update(Player1, em, boss);
            }
        }
Exemple #13
0
        public void Update(
            LayerManager lm,
            CrazyStorm cs,
            CSManager csm,
            Time Times,
            Center Centers,
            Character Player,
            EnemyManager em,
            Boss b,
            bool bs,
            bool allpan,
            Vector2 ppos,
            bool isforshoot,
            bool usekira,
            bool bansound)
        {
            if (!cs.IsClosing() && this.Visible)
            {
                for (int index = 0; index < this.ForceArray.Count; ++index)
                {
                    this.ForceArray[index].id       = index;
                    this.ForceArray[index].parentid = this.sort;
                    this.ForceArray[index].copys.Update(lm, Times, Centers, Player);
                }
                for (int index = 0; index < this.ReboundArray.Count; ++index)
                {
                    this.ReboundArray[index].id       = index;
                    this.ReboundArray[index].parentid = this.sort;
                    this.ReboundArray[index].copys.Update(lm, cs, Times, Centers, Player.body.position + new Vector2(93f, -13f));
                }
                for (int index = 0; index < this.CoverArray.Count; ++index)
                {
                    this.CoverArray[index].id       = index;
                    this.CoverArray[index].parentid = this.sort;
                    this.CoverArray[index].copys.Update(lm, cs, Times, Centers, Player.body.position + new Vector2(93f, -13f));
                }
                for (int index = 0; index < this.LaseArray.Count; ++index)
                {
                    this.LaseArray[index].id       = index;
                    this.LaseArray[index].parentid = this.sort;
                    this.LaseArray[index].copys.Update(lm, cs, Times, Centers, Player.body.position + new Vector2(93f, -13f));
                }
                for (int index = 0; index < this.BatchArray.Count; ++index)
                {
                    this.BatchArray[index].id       = index;
                    this.BatchArray[index].parentid = this.sort;
                    this.BatchArray[index].copys.Update(lm, cs, Times, Centers, Player.body.position + new Vector2(93f, -13f));
                }
            }
            bool flag = false;

            for (int index = 0; index < this.Barrages.Count; ++index)
            {
                this.Barrages[index].id = index;
                this.Barrages[index].Update(csm, cs, Times, Centers, Player, em, b, bs, allpan, ppos, isforshoot, usekira, bansound);
                this.Barrages[index].LUpdate(csm, cs, Times, Centers, Player, bs);
                if (cs.IsBreaking())
                {
                    if (!this.Barrages[index].Dis && cs.IsItem())
                    {
                        Program.game.game.SmallItem(new Vector2(this.Barrages[index].x - 93f, this.Barrages[index].y + 13f));
                        flag = true;
                    }
                    this.Barrages[index].life  = 0;
                    this.Barrages[index].Dis   = true;
                    this.Barrages[index].Blend = true;
                    this.Barrages[index].randf = 6.283185f * (float)Main.rand.NextDouble();
                }
            }
            if (!flag)
            {
                return;
            }
            cs.itemed = true;
        }
Exemple #14
0
 public void Update(Character Player)
 {
     this.praticle.posrect = new Vector4(this.Position.X - 10f, this.Position.Y - 10f, 20f, 20f);
     if (this.barrage != null)
     {
         this.barrage.SetPos(new Vector2(this.Position.X + 93f, this.Position.Y - 13f), false);
     }
     for (int index = 0; index < this.EventArray.Count; ++index)
     {
         if (!this.EventArray[index].stop)
         {
             this.EventArray[index].Update(this);
         }
         else if (this.EventArray[index].stop && this.EventArray[index].Independent)
         {
             this.EventArray.RemoveAt(index);
             --index;
         }
     }
     this.presx       = this.Position.X;
     this.Position.X += this.speed * (float)Math.Cos((double)MathHelper.ToRadians(this.speedf));
     this.Position.Y += this.speed * (float)Math.Sin((double)MathHelper.ToRadians(this.speedf));
     this.sx          = this.Position.X;
     ++this.time;
     this.UpdateSpecial();
     if (!Player.Dis && !Player.free && !Player.Wudi)
     {
         this.Judge(Player);
     }
     if (this.barrage != null && !this.barrage.IsStarted() && this.time >= this.ftime)
     {
         this.barrage.Start();
     }
     if (this.step != Vector2.Zero)
     {
         this.se = (double)this.sx >= (double)this.presx ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
         if ((double)this.presx != (double)this.sx && !this.turned)
         {
             this.ns = (int)this.step.X;
         }
         if ((double)this.presx == (double)this.sx && this.turned)
         {
             if (this.prese == SpriteEffects.FlipHorizontally)
             {
                 this.se = this.prese;
             }
             this.ns = (int)this.step.X;
         }
         if (this.time % 7 == 0)
         {
             if ((double)this.presx == (double)this.sx)
             {
                 this.turned = false;
                 ++this.ns;
                 if ((double)this.ns >= (double)this.step.X)
                 {
                     this.ns = 0;
                 }
             }
             else
             {
                 this.turned = true;
                 ++this.ns;
                 if (this.typeid != 4)
                 {
                     if ((double)this.ns >= (double)this.step.X + (double)this.step.Y)
                     {
                         this.ns = (int)this.step.X + 1;
                     }
                 }
                 else if ((double)this.ns >= (double)this.step.X + (double)this.step.Y)
                 {
                     this.ns = (int)((double)this.step.X + (double)this.step.Y) - 1;
                 }
             }
         }
     }
     if (this.time >= this.life)
     {
         this.die = true;
         this.praticle.Delete();
         if (this.epraticle != null)
         {
             this.epraticle.Delete();
         }
         if (this.barrage != null)
         {
             this.barrage.Close();
         }
     }
     this.prese = this.se;
     if (this.hp > 0)
     {
         return;
     }
     this.hp = 0;
     if (!this.die)
     {
         CrazyStorm crazyStorm = Program.game.game.PlayEffect(true, (this.color + 7).ToString(), new Vector2(this.Position.X + 93f, this.Position.Y - 13f));
         crazyStorm.BanSound(true);
         crazyStorm.effect = true;
     }
     this.die = true;
     this.praticle.Delete();
     if (this.epraticle != null)
     {
         this.epraticle.Delete();
     }
     if (this.barrage != null)
     {
         this.barrage.Close();
     }
     if (this.items == null || this.mana)
     {
         return;
     }
     if (this.pdie != null)
     {
         this.pdie();
     }
     Program.game.game.PlaySound("enep00", true, this.Position.X);
     if (!this.deadkill)
     {
         Program.game.game.AddStgData(0, 0, 1);
     }
     Program.game.game.Score += 20000L;
     this.items.Shoot(this.Position, Math.Max(this.originsize.X, this.originsize.Y), Player, (Boss)null);
 }
Exemple #15
0
        private void EM_BLAST(Boss b, EnemyManager em, int l, Vector2 p, bool Ban)
        {
            if (this.ps != null && !this.ps.allpan && (double)this.ptime <= 30.0)
            {
                ++this.ptime;
                int num1  = int.Parse(this.ps.Id.Split('e')[1]) - 19;
                int power = 30 + num1 * 12;
                int num2  = 15 + (num1 - 1) * 5;
                foreach (Enemy enemy in em.EnemyArray)
                {
                    if (!enemy.IsInWudi() && (double)Math.Abs(enemy.Position.X - p.X) <= (double)num2 && ((double)enemy.Position.Y >= 0.0 && (double)enemy.Position.Y <= (double)p.Y))
                    {
                        enemy.hp -= power;
                        Program.game.game.Score += 10L;
                    }
                }
                if (b != null && (double)Math.Abs(b.Position.X - p.X) <= (double)num2 && ((double)b.Position.Y >= 0.0 && (double)b.Position.Y <= (double)p.Y))
                {
                    Program.game.game.Score += 10L;
                    if (b.CardArray.Count >= 1)
                    {
                        b.CardArray[0].DeHp(power, this.ps.isforshoot);
                    }
                }
            }
            else if (this.ps != null && this.ps.allpan && (double)this.ptime <= 10.0)
            {
                ++this.ptime;
                if ((double)this.ptime == 10.0)
                {
                    this.ps.shoot.AddRange((IEnumerable <byte>) new List <byte>()
                    {
                        (byte)0,
                        (byte)37
                    });
                }
            }
            CrazyStorm effect = Program.game.game.FindEffect("e2");

            if (effect != null)
            {
                this.time2 += Time.Stop;
                effect.SetPos(new Vector2(p.X + 93f, p.Y - 13f), true);
                if (Main.IsKeyUp(Keys.Z) && (Main.Replay || PadState.IsKeyUp(JOYKEYS.Confirm)))
                {
                    Program.game.game.StopSound("ch");
                    if ((double)this.time2 >= 90.0 && l >= 1)
                    {
                        if (Main.IsKeyDown(Keys.LeftShift) || Main.IsKeyDown(Keys.RightShift) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Slow))
                        {
                            this.ps        = Program.game.game.PlayEffect(true, (2 + l).ToString(), new Vector2(p.X + 93f, p.Y - 13f));
                            this.ps.allpan = true;
                        }
                        else
                        {
                            this.ps = Program.game.game.PlayEffect(true, (19 + l).ToString(), new Vector2(p.X + 93f, p.Y - 13f));
                        }
                        this.ptime         = 0.0f;
                        this.ps.isforshoot = true;
                        this.ps.BanSound(true);
                        this.ps.effect = true;
                        this.ps.bomb   = true;
                        Program.game.game.PlaySound("slash", true, p.X);
                        this.time2 = 0.0f;
                    }
                    effect.Break();
                }
                if (Ban)
                {
                    effect.Break();
                }
            }
            else if (!Ban && l >= 1 && (Main.IsKeyDown(Keys.Z) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Confirm)) && effect == null)
            {
                this.time2 = 0.0f;
                CrazyStorm crazyStorm = Program.game.game.PlayEffect(true, "2", new Vector2(p.X + 93f, p.Y - 13f));
                crazyStorm.isforshoot = true;
                crazyStorm.BanSound(true);
                crazyStorm.effect         = true;
                crazyStorm.specialnotkill = true;
                crazyStorm.SetOPos(new Vector2(p.X + 93f, p.Y - 13f));
                Program.game.game.PlaySound("ch", true, p.X);
            }
            if (!this.inited)
            {
                this.inited = true;
                for (int index = 0; index < l; ++index)
                {
                    this.sprites.Add(new Sprite(this.tex, new Rectangle(59, 61, 41, 41)));
                    this.sprites[this.sprites.Count - 1].origin  = new Vector2(21f, 21f);
                    this.sprites[this.sprites.Count - 1].scale   = Vector2.Zero;
                    this.sprites[this.sprites.Count - 1].color.a = 1f;
                }
                switch (l)
                {
                case 1:
                    this.sprites[0].position = new Vector2(0.0f, -30f);
                    break;

                case 2:
                    this.sprites[0].position = new Vector2(-30f, 0.0f);
                    this.sprites[1].position = new Vector2(30f, 0.0f);
                    break;

                case 3:
                    this.sprites[0].position = new Vector2(0.0f, -30f);
                    this.sprites[1].position = new Vector2(-30f, 0.0f);
                    this.sprites[2].position = new Vector2(30f, 0.0f);
                    break;

                case 4:
                    this.sprites[0].position = new Vector2(0.0f, -30f);
                    this.sprites[1].position = new Vector2(0.0f, 30f);
                    this.sprites[2].position = new Vector2(-30f, 0.0f);
                    this.sprites[3].position = new Vector2(30f, 0.0f);
                    break;
                }
            }
            for (int index = 0; index < this.sprites.Count; ++index)
            {
                this.sprites[index].scale += new Vector2(0.06f, 0.06f);
                if ((double)this.sprites[index].scale.X >= 0.800000011920929)
                {
                    this.sprites[index].scale = new Vector2(0.8f, 0.8f);
                }
                this.sprites[index].rotation = 10f * (float)Math.Sin((double)this.time / 40.0 * Math.PI);
            }
        }
Exemple #16
0
        public SingleBomb(Cname type_C, Vector2 pos)
        {
            this.type = type_C;
            if (this.type != Cname.SANAE)
            {
                Program.game.game.PlaySound("nep00", true, pos.X);
                this.cs = Program.game.game.PlayEffect(false, ((int)(14 + this.type)).ToString(), new Vector2(pos.X, pos.Y));
                this.cs.BanSound(true);
                this.cs.effect = true;
                this.cs.clearb = true;
                this.cs.bomb   = true;
            }
            switch (this.type)
            {
            case Cname.REIMU:
                this.tex    = new Sprite();
                this.target = new Character(this.tex);
                this.cs.shoot.AddRange((IEnumerable <byte>) new List <byte>()
                {
                    (byte)0,
                    (byte)1,
                    (byte)2,
                    (byte)3,
                    (byte)10,
                    (byte)11,
                    (byte)17,
                    (byte)17,
                    (byte)17,
                    (byte)17,
                    (byte)17,
                    (byte)17
                });
                break;

            case Cname.MARISA:
                Program.game.game.Quake((int)((double)this.cs.time.total * 0.949999988079071), 2);
                this.cs.SetOPos(new Vector2(pos.X, pos.Y));
                this.cs.shoot.AddRange((IEnumerable <byte>) new List <byte>()
                {
                    (byte)2,
                    (byte)30
                });
                break;

            case Cname.SANAE:
                if (Main.IsKeyDown(Keys.LeftShift) || Main.IsKeyDown(Keys.RightShift) || !Main.Replay && PadState.IsKeyDown(JOYKEYS.Slow))
                {
                    this.cs = Program.game.game.PlayEffect(false, "19", new Vector2(pos.X, pos.Y));
                    this.cs.SetOPos(pos);
                }
                else
                {
                    Program.game.game.PlaySound("nep00", true, pos.X);
                    Program.game.game.Quake(250, 2);
                    this.cs = Program.game.game.PlayEffect(false, ((int)(14 + this.type)).ToString(), new Vector2(pos.X, pos.Y));
                    this.cs.shoot.AddRange((IEnumerable <byte>) new List <byte>()
                    {
                        (byte)0,
                        (byte)125
                    });
                    this.cs.clearb = true;
                }
                this.cs.BanSound(true);
                this.cs.effect = true;
                this.cs.bomb   = true;
                break;

            case Cname.PATCHOULI:
                Program.game.game.Quake((int)((double)this.cs.time.total * 0.949999988079071), 2);
                this.cs.shoot.AddRange((IEnumerable <byte>) new List <byte>()
                {
                    (byte)2,
                    (byte)3,
                    (byte)9,
                    (byte)9
                });
                break;
            }
            this.time = 0;
        }
Exemple #17
0
        public void Update(CSManager csm, CrazyStorm cs, Time t, Character Player, Boss boss)
        {
            if (!this.Available)
            {
                return;
            }
            this.speedx += this.aspeedx;
            this.speedy += this.aspeedy;
            this.ox     += this.speedx;
            this.ox     += this.speedy;
            boss?.Setpos(boss.Position.X + this.speedx, boss.Position.Y + this.speedy);
            Hashtable hashtable1 = new Hashtable();
            Hashtable hashtable2 = new Hashtable();

            hashtable1.Add((object)"当前帧", (object)t.now);
            hashtable2.Add((object)"速度", (object)this.ospeed);
            hashtable2.Add((object)"速度方向", (object)this.ospeedd);
            hashtable2.Add((object)"加速度", (object)this.oaspeed);
            hashtable2.Add((object)"加速度方向", (object)this.oaspeedd);
            foreach (string str1 in this.events)
            {
                if (str1.Contains("PlayMusic"))
                {
                    int num = int.Parse(str1.Split('=')[1].Split(':')[0]);
                    if (t.now == num || num > t.total && t.times > 0 && t.now == num - t.total)
                    {
                        Program.game.game.PlaySound(str1.Split('(')[1].Split(')')[0], true, this.x);
                    }
                }
                else if (str1.Contains("UseKira"))
                {
                    cs.usekira = true;
                }
                else if (str1.Contains("BanSound"))
                {
                    cs.bansoundbg = true;
                }
                else
                {
                    string s    = str1.Split(':')[0];
                    string str2 = "";
                    string str3 = "";
                    string str4 = str1.Split(':')[1];
                    int    num1 = 0;
                    string str5 = "";
                    int    num2 = 0;
                    string str6 = "";
                    float  num3 = 0.0f;
                    int    num4 = 0;
                    if (s.Contains("="))
                    {
                        str2 = s.Split('=')[0];
                        str3 = "=";
                        s    = s.Split('=')[1];
                    }
                    if (str3 == "=" && (double)float.Parse(hashtable1[(object)str2].ToString()) == (double)float.Parse(s))
                    {
                        if (str1.Contains("变化到"))
                        {
                            num1 = 0;
                            string[] strArray = str4.Split("变化到".ToCharArray())[3].Split(",".ToCharArray());
                            num2 = (int)csm.results3[(object)str4.Split("变化到".ToCharArray())[0]];
                            str6 = str4.Split("变化到".ToCharArray())[0];
                            if (strArray[0].Contains <char>('+'))
                            {
                                num3 = (float)((double)float.Parse(strArray[0].Split('+')[0]) + (double)MathHelper.Lerp((float)-(double)float.Parse(strArray[0].Split('+')[1]), float.Parse(strArray[0].Split('+')[1]), (float)this.Rand(cs.effect && !cs.bomb, cs.bomb)));
                            }
                            else
                            {
                                num3 = num2 == 1 || num2 == 3 ? (!strArray[0].Contains("自机") ? float.Parse(strArray[0]) : MathHelper.ToDegrees(Main.Twopointangle(Player.body.position.X + 93f, Player.body.position.Y - 13f, this.ox, this.oy))) : float.Parse(strArray[0]);
                            }
                            str5 = strArray[1];
                            num4 = int.Parse(strArray[2].Split("帧".ToCharArray())[0]);
                        }
                        else if (str1.Contains("增加"))
                        {
                            num1 = 1;
                            string[] strArray = str4.Split("增".ToCharArray())[1].Split(",".ToCharArray());
                            strArray[0] = strArray[0].Replace("加", "");
                            num2        = (int)csm.results3[(object)str4.Split("增".ToCharArray())[0]];
                            str6        = str4.Split("增".ToCharArray())[0];
                            if (strArray[0].Contains <char>('+'))
                            {
                                num3 = (float)((double)float.Parse(strArray[0].Split('+')[0]) + (double)MathHelper.Lerp((float)-(double)float.Parse(strArray[0].Split('+')[1]), float.Parse(strArray[0].Split('+')[1]), (float)this.Rand(cs.effect && !cs.bomb, cs.bomb)));
                            }
                            else
                            {
                                num3 = num2 == 1 || num2 == 3 ? (!strArray[0].Contains("自机") ? float.Parse(strArray[0]) : MathHelper.ToDegrees(Main.Twopointangle(Player.body.position.X + 93f, Player.body.position.Y - 13f, this.ox, this.oy))) : float.Parse(strArray[0]);
                            }
                            str5 = strArray[1];
                            num4 = int.Parse(strArray[2].Split("帧".ToCharArray())[0]);
                        }
                        else if (str1.Contains("减少"))
                        {
                            num1 = 2;
                            string[] strArray = str4.Split("减少".ToCharArray())[2].Split(",".ToCharArray());
                            num2 = (int)csm.results3[(object)str4.Split("减少".ToCharArray())[0]];
                            str6 = str4.Split("减少".ToCharArray())[0];
                            if (strArray[0].Contains <char>('+'))
                            {
                                num3 = (float)((double)float.Parse(strArray[0].Split('+')[0]) + (double)MathHelper.Lerp((float)-(double)float.Parse(strArray[0].Split('+')[1]), float.Parse(strArray[0].Split('+')[1]), (float)this.Rand(cs.effect && !cs.bomb, cs.bomb)));
                            }
                            else
                            {
                                num3 = num2 == 1 || num2 == 3 ? (!strArray[0].Contains("自机") ? float.Parse(strArray[0]) : MathHelper.ToDegrees(Main.Twopointangle(Player.body.position.X + 93f, Player.body.position.Y - 13f, this.ox, this.oy))) : float.Parse(strArray[0]);
                            }
                            str5 = strArray[1];
                            num4 = int.Parse(strArray[2].Split("帧".ToCharArray())[0]);
                        }
                        if (str1.Contains("跟随自机"))
                        {
                            this.Eventsexe.Add(new CExecution()
                            {
                                changetype = 3,
                                ctime      = 60
                            });
                        }
                        else if (str1.Contains("范围移动"))
                        {
                            this.Eventsexe.Add(new CExecution()
                            {
                                changetype = 4,
                                ctime      = 60,
                                value      = MathHelper.Lerp(float.Parse(str1.Split(',')[1]), float.Parse(str1.Split(',')[2]), (float)this.Rand(cs.effect && !cs.bomb, cs.bomb)),
                                value2     = MathHelper.Lerp(float.Parse(str1.Split(',')[3]), float.Parse(str1.Split(',')[4]), (float)this.Rand(cs.effect && !cs.bomb, cs.bomb))
                            });
                        }
                        else
                        {
                            CExecution cexecution = new CExecution()
                            {
                                change      = num1,
                                changetype  = (int)csm.type[(object)str5],
                                changevalue = num2,
                                value       = num3,
                                region      = hashtable2[(object)str6].ToString(),
                                time        = num4
                            };
                            cexecution.ctime = cexecution.time;
                            this.Eventsexe.Add(cexecution);
                        }
                    }
                }
            }
            for (int index = 0; index < this.Eventsexe.Count; ++index)
            {
                if (!this.Eventsexe[index].NeedDelete)
                {
                    this.Eventsexe[index].Update(this, Player, boss);
                }
                else
                {
                    this.Eventsexe.RemoveAt(index);
                    --index;
                }
            }
        }