Пример #1
0
Файл: Boss.cs Проект: THSJF/sjf
        private void Leave(BossBackground bg)
        {
            switch (this.letype)
            {
            case 0:
                if (Main.Mode != Modes.SINGLE)
                {
                    break;
                }
                this.position.X += (float)((224.0 - (double)this.Position.X) / 30.0);
                this.position.Y += (float)((-150.0 - (double)this.Position.Y) / 30.0);
                break;

            case 1:
                if (Main.Mode != Modes.SINGLE)
                {
                    break;
                }
                bg.Switch(false);
                this.position.X += (float)((-150.0 - (double)this.Position.X) / 30.0);
                this.position.Y += (float)((50.0 - (double)this.Position.Y) / 30.0);
                break;

            case 2:
                if (Main.Mode != Modes.SINGLE)
                {
                    break;
                }
                this.position.X += (float)((566.0 - (double)this.Position.X) / 30.0);
                this.position.Y += (float)((50.0 - (double)this.Position.Y) / 30.0);
                break;

            case 3:
                if (this.lastone)
                {
                    Time.Slowdown(0.33f);
                }
                if (!this.lastone && this.ltime % 10 == 0 || this.lastone && this.ltime % 5 == 0)
                {
                    this.praticle2.stop     = true;
                    this.praticle3.quantity = this.lastone ? 70 : 80;
                    if (this.ltime == 130)
                    {
                        this.praticle3.quantity = 90;
                    }
                    this.praticle3.stop = false;
                    Program.game.game.PlaySound("tan00", true, this.Position.X);
                    break;
                }
                if (this.ltime != 139)
                {
                    break;
                }
                bg.Switch(false);
                Program.game.game.Quake(60, 5);
                Program.game.game.PlaySound("enep01", true, this.Position.X);
                break;
            }
        }
Пример #2
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);
        }
Пример #3
0
Файл: Boss.cs Проект: THSJF/sjf
 public void Update(
     EnemyManager e,
     CSManager csm,
     Character Player,
     BossBackground bg,
     Texture2D bgmt,
     int stage)
 {
     this.praticle.posrect  = new Vector4(this.Position.X - 15f, this.Position.Y - 15f, 30f, 30f);
     this.praticle2.posrect = new Vector4(this.Position.X - 20f, this.Position.Y - 15f, 45f, 45f);
     this.praticle3.posrect = new Vector4(this.Position.X - 5f, this.Position.Y - 5f, 10f, 10f);
     this.praticle2.Update();
     if (this.dialogm != null)
     {
         if (this.time >= 160)
         {
             this.dialogm.Update(bgmt, stage);
         }
         if (this.dialogm.ok)
         {
             this.wait = false;
             Program.game.game.BanShoot(false);
         }
     }
     if (bg != null && bg.Start)
     {
         Effects.SetforceParameters(this.force, this.time, (float)(((double)this.Position.X - 2.0) / 640.0), this.Position.Y / 480f);
     }
     else
     {
         Effects.SetforceParameters(this.force, this.time, (float)(((double)this.Position.X + 91.0) / 640.0), this.Position.Y / 480f);
     }
     if (this.time <= 120)
     {
         if (csm != null)
         {
             foreach (CrazyStorm crazyStorm in csm.csc)
             {
                 foreach (Layer layer in crazyStorm.layerm.LayerArray)
                 {
                     foreach (Barrage barrage in layer.Barrages)
                     {
                         if (!barrage.Dis && barrage.time > 15 | !barrage.Mist && (!barrage.NeedDelete && !barrage.Invincible) && Math.Sqrt(((double)barrage.x - (double)this.Position.X) * ((double)barrage.x - (double)this.Position.X) + ((double)barrage.y - (double)this.Position.Y) * ((double)barrage.y - (double)this.Position.Y)) < (double)Math.Abs(this.time * 6))
                         {
                             barrage.time  = 1 + barrage.add + barrage.life;
                             barrage.Dis   = true;
                             barrage.Blend = true;
                             barrage.randf = 10f * (float)Main.rand.NextDouble();
                         }
                     }
                 }
             }
         }
         if (e != null)
         {
             for (int index = 0; index < e.EnemyArray.Count; ++index)
             {
                 if (!e.EnemyArray[index].die && e.EnemyArray[index].hp > 0 && (!Main.IsOut(e.EnemyArray[index].Position) && Math.Sqrt(((double)e.EnemyArray[index].Position.X - (double)this.Position.X) * ((double)e.EnemyArray[index].Position.X - (double)this.Position.X) + ((double)e.EnemyArray[index].Position.Y - (double)this.Position.Y) * ((double)e.EnemyArray[index].Position.Y - (double)this.Position.Y)) < (double)Math.Abs(this.time * 6)))
                 {
                     e.EnemyArray[index].mana = true;
                     e.EnemyArray[index].hp   = 0;
                 }
             }
         }
         this.position.X += (float)((224.0 - (double)this.Position.X) / 30.0);
         this.position.Y += (float)((170.0 - (double)this.Position.Y) / 30.0);
         if (Player != null)
         {
             Player.IAuto = true;
         }
     }
     else if (Player != null)
     {
         Player.IAuto = false;
     }
     ++this.time;
     this.SpecialUpdate();
     this.sx = this.Position.X;
     if ((double)Math.Abs(this.sx - this.presx) >= 0.5 && !this.turned)
     {
         this.ns     = 0;
         this.turned = true;
         this.back   = false;
     }
     else if ((double)Math.Abs(this.sx - this.presx) < 0.5 && this.turned)
     {
         this.ns     = (int)this.step.X - 1;
         this.turned = false;
         this.back   = true;
     }
     if (this.time % 7 == 0)
     {
         if (this.turned)
         {
             this.ny = (double)this.sx <= (double)this.presx ? (int)this.step.Y - 1 : (int)this.step.Y;
             if (this.ny <= 0)
             {
                 this.ny = 0;
             }
         }
         if (!this.back)
         {
             ++this.ns;
             if ((double)Math.Abs(this.sx - this.presx) >= 0.5 && (double)this.ns > (double)this.step.X)
             {
                 this.ns = (int)this.step.X;
             }
             if ((double)Math.Abs(this.sx - this.presx) < 0.5 && (double)this.ns > (double)this.step.X)
             {
                 this.ns = 0;
             }
         }
         else
         {
             --this.ns;
             if (this.ns < 0)
             {
                 this.ns   = 0;
                 this.ny   = 0;
                 this.back = false;
             }
         }
     }
     this.presx      = this.sx;
     this.cirrotate += 7;
     if (this.cirrotate >= 360)
     {
         this.cirrotate -= 360;
     }
     this.cirscale = (float)(1.5 + 0.200000002980232 * Math.Sin((double)this.time / Math.PI / 7.0));
     if (!this.wait)
     {
         ++this.battletime;
         if (this.battletime == 120)
         {
             Hashtable data = new Hashtable();
             data[(object)"reset"] = (object)null;
             Program.game.achivmanager.Check(AchievementType.Challenge, 12, data);
             Program.game.achivmanager.Check(AchievementType.Challenge, 13, data);
         }
         this.numalpha += 0.01666667f;
         if ((double)this.numalpha >= 1.0)
         {
             this.numalpha = 1f;
         }
         if (this.CardArray.Count >= 2)
         {
             this.CardArray[0].Update(this.CardArray[1].type, this.Position, bg, this.colortype);
         }
         else if (this.CardArray.Count >= 1)
         {
             this.CardArray[0].Update(this.CardArray[0].type, this.Position, bg, this.colortype);
         }
         if (this.CardArray.Count >= 1 && this.CardArray[0].die)
         {
             ++this.passedCards;
             if (this.CardArray[0].fdie)
             {
                 this.CardArray.RemoveAt(0);
                 this.CardArray[0].cf = true;
             }
             else
             {
                 this.CardArray.RemoveAt(0);
             }
             if (this.CardArray.Count == 0)
             {
                 if (this.letype != 3)
                 {
                     bg.Switch(false);
                     Program.game.game.Quake(50, 5);
                     this.praticle2.stop = true;
                     this.praticle3.stop = false;
                     Program.game.game.PlaySound("enep01", true, this.Position.X);
                 }
                 else
                 {
                     Program.game.game.PlaySound("tan", true, this.Position.X);
                 }
                 this.leave      = true;
                 this.itemm.shot = true;
                 if (!this.lastone)
                 {
                     Time.Init();
                 }
             }
             else
             {
                 Program.game.game.PlaySound("tan", true, this.Position.X);
                 bg.Switch(false);
             }
         }
         if (this.leave)
         {
             this.numalpha -= 0.05f;
             if ((double)this.numalpha <= 0.0)
             {
                 this.numalpha = 0.0f;
             }
             if (!this.lastone)
             {
                 ++this.ltime;
             }
             else if (this.time % 3 == 0)
             {
                 ++this.ltime;
             }
             if (this.letype == 3)
             {
                 this.cirscale += 0.05f;
             }
             if (this.letype == 3 && this.ltime == 1)
             {
                 this.ltime = 59;
             }
             int num = 0;
             if (this.ltime == 1 && this.dialogm != null && this.dialogm.next)
             {
                 num = 40;
             }
             if (this.ltime == 59 + num)
             {
                 Program.game.game.ClearSth("Enemy");
                 if (this.dialogm != null && this.dialogm.next)
                 {
                     this.dialogm.Continue();
                     this.wait = true;
                 }
             }
             if (this.ltime >= 60 + num && (this.letype != 3 && this.ltime < 100 + num || this.letype == 3 && this.ltime < 140 + num))
             {
                 this.Leave(bg);
             }
             if (this.letype == 3 && this.ltime >= 140 + num || this.letype != 3 && this.ltime >= 100 + num)
             {
                 Hashtable data = new Hashtable();
                 data[(object)"level"] = (object)Main.Level;
                 data[(object)"type"]  = (object)this.dialog;
                 Program.game.achivmanager.Check(AchievementType.Challenge, 12, data);
                 data[(object)"continued"]   = (object)Program.game.game.BanRecord;
                 data[(object)nameof(stage)] = (object)Program.game.game.StmStage;
                 Program.game.achivmanager.Check(AchievementType.Challenge, 13, data);
                 this.die = true;
                 this.praticle.Delete();
                 Time.Init();
             }
             if (this.itemm != null)
             {
                 this.itemm.shot = true;
             }
         }
         else if (!Player.Dis && !Player.free && !Player.Wudi)
         {
             this.Judge(Player);
         }
     }
     else if (this.time >= 60)
     {
         Program.game.game.BanShoot(true);
     }
     if (!this.image)
     {
         return;
     }
     this.ImageUpdate();
 }