Exemple #1
0
        public static Panel.PANEL Parse(int id)
        {
            Panel.PANEL result = Panel.PANEL.Top;
            switch (id)
            {
            case (int)Panel.PANEL.Top:
                result = Panel.PANEL.Top;
                break;

            case (int)Panel.PANEL.Left:
                result = Panel.PANEL.Left;
                break;

            case (int)Panel.PANEL.Center:
                result = Panel.PANEL.Center;
                break;

            case (int)Panel.PANEL.Right:
                result = Panel.PANEL.Right;
                break;

            case (int)Panel.PANEL.Bottom:
                result = Panel.PANEL.Bottom;
                break;
            }
            return(result);
        }
Exemple #2
0
        public void PanelChange(int pattern, Panel.PANEL panel1, Panel.PANEL panel2)
        {
            var layout = Constants.PanelLayouts[pattern];

            for (int pX = 0; pX < this.panel.GetLength(0); ++pX)
            {
                for (int pY = 0; pY < this.panel.GetLength(1); ++pY)
                {
                    switch (layout[pY, pX])
                    {
                    case 0:
                        this.panel[pX, pY].state = panel1;
                        break;

                    case 1:
                        this.panel[pX, pY].state = panel2;
                        break;

                    case 2:
                        this.panel[pX, pY].state = Panel.PANEL._nomal;
                        break;

                    case 3:
                        this.panel[pX, pY].state = Panel.PANEL._nomal;
                        this.objects.Add(new Rock(this.sound, this, pX, pY, this.panel[pX, pY].color));
                        break;
                    }
                }
            }
        }
Exemple #3
0
        public static Panel GetPanel(Panel.PANEL pn)
        {
            Panel    result   = null;
            Database database = new Database("PSCPortalConnectionString");

            using (DbConnection connection = database.GetConnection())
            {
                DbCommand command = database.GetCommand(connection);
                #region PanelId
                DbParameter prPanelId = database.GetParameter(System.Data.DbType.Int32, "@PanelId", (int)pn);
                command.Parameters.Add(prPanelId);
                #endregion

                command.CommandText = "Panel_GetById";
                command.CommandType = System.Data.CommandType.StoredProcedure;
                connection.Open();
                using (DbDataReader reader = command.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        result = new Panel(reader);
                    }
                }
            }
            return(result);
        }
Exemple #4
0
 private void SeedCanon()
 {
     if (this.seedbomb)
     {
         return;
     }
     this.ShakeStart(5, 30);
     this.sound.PlaySE(SoundEffect.bombmiddle);
     this.parent.effects.Add(new Bomber(this.sound, this.parent, this.position.X, this.position.Y, Bomber.BOMBERTYPE.bomber, 1));
     this.parent.attacks.Add(this.StateCopy(this.StateCopy(new BombAttack(this.sound, this.parent, this.position.X, this.position.Y + 1, this.union, this.power, 1, this.element))));
     this.parent.effects.Add(new Bomber(this.sound, this.parent, this.position.X, this.position.Y + 1, Bomber.BOMBERTYPE.bomber, 1));
     this.parent.effects.Add(new Bomber(this.sound, this.parent, this.position.X, this.position.Y - 1, Bomber.BOMBERTYPE.bomber, 2));
     this.parent.attacks.Add(this.StateCopy(this.StateCopy(new BombAttack(this.sound, this.parent, this.position.X, this.position.Y - 1, this.union, this.power, 1, this.element))));
     foreach (Point poji in new List <Point>()
     {
         this.position,
         new Point(this.position.X, this.position.Y),
         new Point(this.position.X, this.position.Y + 1),
         new Point(this.position.X, this.position.Y - 1)
     })
     {
         if (this.InAreaCheck(poji) && !this.parent.panel[poji.X, poji.Y].Hole)
         {
             if (this.element == ChipBase.ELEMENT.leaf)
             {
                 Panel.PANEL panel = Panel.PANEL._grass;
                 this.parent.panel[poji.X, poji.Y].state = panel;
             }
         }
     }
     this.seedbomb = true;
 }
 public PanelInPage Search(Panel.PANEL panel)
 {
     foreach (PanelInPage item in this)
     {
         if (item.Panel.Id == (int)panel)
         {
             return(item);
         }
     }
     return(null);
 }
Exemple #6
0
 public Battle(
     IAudioEngine s,
     EventManager m,
     EnemyBase.VIRUS enemy1,
     byte lank1,
     int x1,
     int y1,
     EnemyBase.VIRUS enemy2,
     byte lank2,
     int x2,
     int y2,
     EnemyBase.VIRUS enemy3,
     byte lank3,
     int x3,
     int y3,
     Panel.PANEL panel1,
     Panel.PANEL panel2,
     int type,
     bool count,
     bool result,
     bool escape,
     SaveData save)
     : base(s, m, save)
 {
     this.enemy[0]      = enemy1;
     this.enemy[1]      = enemy2;
     this.enemy[2]      = enemy3;
     this.lank[0]       = lank1;
     this.lank[1]       = lank2;
     this.lank[2]       = lank3;
     this.position[0].X = x1;
     this.position[1].X = x2;
     this.position[2].X = x3;
     this.position[0].Y = y1;
     this.position[1].Y = y2;
     this.position[2].Y = y3;
     this.panels[0]     = panel1;
     this.panels[1]     = panel2;
     this.paneltype     = type;
     this.countRend     = count;
     this.resultRend    = result;
     this.canEscape     = escape;
     this.NoTimeNext    = true;
 }
Exemple #7
0
        public Brocla(
            IAudioEngine so,
            SceneBattle p,
            int pX,
            int pY,
            Panel.COLOR u,
            int po,
            Panel.PANEL panel,
            bool stealth,
            ChipBase.ELEMENT ele)
            : base(so, p, pX, pY, u, po, ele)
        {
            if (!this.flag)
            {
                return;
            }
            this.stealth          = stealth;
            this.panel            = panel;
            this.downprint        = true;
            this.invincibility    = true;
            this.speed            = 1;
            this.animationpoint.X = 0;
            this.hitrange         = new Point(0, 0);
            this.hitting          = true;
            this.rebirth          = this.union == Panel.COLOR.blue;
            this.positionre       = this.position;
            if (this.union == Panel.COLOR.red)
            {
                this.positionDirect = new Vector2(this.position.X * 40 + 8, this.position.Y * 24 + 70);
            }
            else
            {
                this.positionDirect = new Vector2((this.position.X + 1) * 40 - 8, this.position.Y * 24 + 70);
            }
            this.frame = 0;

            var existingObject = p.attacks.FirstOrDefault(a => a is Brocla && a.position == this.position);

            if (existingObject != null)
            {
                this.parent.effects.Add(new Smoke(this.sound, this.parent, this.position.X, this.position.Y, ChipBase.ELEMENT.normal));
                existingObject.flag = false;
            }
        }
Exemple #8
0
        public void Break()
        {
            switch (this.state)
            {
            case Panel.PANEL._break:
                break;

            case Panel.PANEL._none:
            case Panel.PANEL._un:
                break;

            default:
                if (!this.OnCharaCheck())
                {
                    this.state = Panel.PANEL._break;
                    break;
                }
                this.state = Panel.PANEL._crack;
                break;
            }
        }
Exemple #9
0
 public yuyuMine(
     IAudioEngine so,
     SceneBattle p,
     int pX,
     int pY,
     Panel.COLOR u,
     int po,
     Panel.PANEL panel,
     bool stealth,
     ChipBase.ELEMENT ele)
     : base(so, p, pX, pY, u, po, ele)
 {
     if (!this.flag)
     {
         return;
     }
     this.stealth          = stealth;
     this.panel            = panel;
     this.downprint        = true;
     this.invincibility    = true;
     this.speed            = 1;
     this.animationpoint.X = 0;
     this.hitrange         = new Point(0, 0);
     this.hitting          = true;
     this.rebirth          = this.union == Panel.COLOR.blue;
     this.positionre       = this.position;
     if (this.union == Panel.COLOR.red)
     {
         this.positionDirect = new Vector2(this.position.X * 40 + 8, this.position.Y * 24 + 70);
     }
     else
     {
         this.positionDirect = new Vector2((this.position.X + 1) * 40 - 8, this.position.Y * 24 + 70);
     }
     this.frame = 0;
     this.count = 0;
 }
Exemple #10
0
        public override void Updata()
        {
            if (this.frame % 5 == 0)
            {
                this.bright = !this.bright;
            }
            if (this.bright)
            {
                this.PanelBright();
            }
            if (this.frame == this.time)
            {
                this.hitting = true;
                this.flag    = false;
                if (!this.StandPanel.Hole)
                {
                    List <Point> pointList = new List <Point>();
                    pointList.Add(this.position);
                    if (this.cross)
                    {
                        pointList.Add(new Point(this.position.X + 1, this.position.Y));
                        pointList.Add(new Point(this.position.X, this.position.Y + 1));
                        pointList.Add(new Point(this.position.X - 1, this.position.Y));
                        pointList.Add(new Point(this.position.X, this.position.Y - 1));
                    }
                    foreach (Point point in pointList)
                    {
                        if (this.InAreaCheck(point))
                        {
                            if (!this.parent.panel[point.X, point.Y].Hole)
                            {
                                Panel.PANEL panel = Panel.PANEL._nomal;
                                switch (this.type)
                                {
                                case PoisonShot.TYPE.poison:
                                    panel = Panel.PANEL._poison;
                                    break;

                                case PoisonShot.TYPE.break_:
                                    panel = Panel.PANEL._crack;
                                    break;

                                case PoisonShot.TYPE.ice:
                                    panel = Panel.PANEL._ice;
                                    break;

                                case PoisonShot.TYPE.grass:
                                    panel = Panel.PANEL._grass;
                                    break;

                                case PoisonShot.TYPE.sand:
                                    panel = Panel.PANEL._sand;
                                    break;
                                }
                                this.parent.panel[point.X, point.Y].state = panel;
                            }
                            this.parent.effects.Add(new Elementhit(this.sound, this.parent, this.positionDirect, 2, point, this.element));
                        }
                    }
                }
            }
            else
            {
                this.positionDirect.X -= this.movex;
                this.positionDirect.Y -= this.movey;
                this.plusy            += this.speedy;
                this.speedy           -= this.plusing;
                if (positionDirect.X < 0.0 || positionDirect.X > 240.0)
                {
                    this.flag = false;
                }
            }
            this.FlameControl();
        }
Exemple #11
0
 public Battle(
     IAudioEngine s,
     EventManager m,
     int enemy1,
     byte lank1,
     int x1,
     int y1,
     int chip1_1,
     int chip1_2,
     int chip1_3,
     int hp1,
     string name1,
     int enemy2,
     byte lank2,
     int x2,
     int y2,
     int chip2_1,
     int chip2_2,
     int chip2_3,
     int hp2,
     string name2,
     int enemy3,
     byte lank3,
     int x3,
     int y3,
     int chip3_1,
     int chip3_2,
     int chip3_3,
     int hp3,
     string name3,
     Panel.PANEL panel1,
     Panel.PANEL panel2,
     int type,
     bool count,
     bool result,
     bool escape,
     bool gameover,
     string bgm,
     int back,
     SaveData save)
     : base(s, m, save)
 {
     this.enemy[0]      = (EnemyBase.VIRUS)enemy1;
     this.enemy[1]      = (EnemyBase.VIRUS)enemy2;
     this.enemy[2]      = (EnemyBase.VIRUS)enemy3;
     this.lank[0]       = lank1;
     this.lank[1]       = lank2;
     this.lank[2]       = lank3;
     this.position[0].X = x1;
     this.position[1].X = x2;
     this.position[2].X = x3;
     this.position[0].Y = y1;
     this.position[1].Y = y2;
     this.position[2].Y = y3;
     this.chip1[0]      = chip1_1;
     this.chip1[1]      = chip2_1;
     this.chip1[2]      = chip3_1;
     this.chip2[0]      = chip1_2;
     this.chip2[1]      = chip2_2;
     this.chip2[2]      = chip3_2;
     this.chip3[0]      = chip1_3;
     this.chip3[1]      = chip2_3;
     this.chip3[2]      = chip3_3;
     this.hp[0]         = hp1;
     this.hp[1]         = hp2;
     this.hp[2]         = hp3;
     this.name[0]       = name1;
     this.name[1]       = name2;
     this.name[2]       = name3;
     this.panels[0]     = panel1;
     this.panels[1]     = panel2;
     this.paneltype     = type;
     this.countRend     = count;
     this.resultRend    = result;
     this.canEscape     = escape;
     this.gameover      = gameover;
     this.bgm           = bgm;
     this.back          = back;
     this.NoTimeNext    = true;
 }
Exemple #12
0
 public void EnemySet(
     EnemyBase enemy1,
     EnemyBase enemy2,
     EnemyBase enemy3,
     int pattern,
     Panel.PANEL panel1,
     Panel.PANEL panel2)
 {
     if (enemy1 != null)
     {
         if (enemy1.Parent == null)
         {
             enemy1.Parent = this;
         }
         if (enemy1.Sound == null)
         {
             enemy1.Sound = this.sound;
         }
         this.enemys.Add(enemy1);
         if (enemy1.race == EnemyBase.ENEMY.navi && !(enemy1 is NormalNavi))
         {
             this.bossFlag = true;
         }
         enemy1.Init();
         enemy1.enemyCount = true;
     }
     if (enemy2 != null)
     {
         if (enemy2.Parent == null)
         {
             enemy2.Parent = this;
         }
         if (enemy2.Sound == null)
         {
             enemy2.Sound = this.sound;
         }
         this.enemys.Add(enemy2);
         if (enemy2.race == EnemyBase.ENEMY.navi && !(enemy2 is NormalNavi))
         {
             this.bossFlag = true;
         }
         enemy2.Init();
         enemy2.enemyCount = true;
     }
     if (enemy3 != null)
     {
         if (enemy3.Parent == null)
         {
             enemy3.Parent = this;
         }
         if (enemy3.Sound == null)
         {
             enemy3.Sound = this.sound;
         }
         this.enemys.Add(enemy3);
         if (enemy3.race == EnemyBase.ENEMY.navi && !(enemy3 is NormalNavi))
         {
             this.bossFlag = true;
         }
         enemy3.Init();
         enemy3.enemyCount = true;
     }
     this.PanelChange(pattern, panel1, panel2);
     this.manyenemys = this.enemys.Count;
     if (this.player.style == Player.STYLE.gaia)
     {
         this.GaiaPanelChange(this.player.Element, false);
     }
     if (this.bossFlag)
     {
         this.mind.MindNow = MindWindow.MIND.normal;
     }
     this.player.AddOn();
     if (this.panel[1, 1].state == Panel.PANEL._none && !this.player.addonSkill[58])
     {
         this.player.positionX = 0;
     }
     if (!this.player.Canmove(this.player.position) && !this.player.addonSkill[58])
     {
         this.player.position.X    = 0;
         this.player.positionre.X  = 0;
         this.player.positionold.X = 0;
         this.player.PositionDirectSet();
     }
     foreach (CharacterBase characterBase in this.AllChara())
     {
         characterBase.InitAfter();
     }
     if (this.player.style != Player.STYLE.gaia)
     {
         return;
     }
     this.GaiaPanelChange(this.player.Element, false);
 }
Exemple #13
0
 public Panel Search(Panel.PANEL pn)
 {
     return(Find(p => p.Id == (int)pn));
 }
Exemple #14
0
        public void Update()
        {
            if (this.flashtime > 0)
            {
                --this.flashtime;
                if (this.flashtime % 8 == 0)
                {
                    this.flashing = !this.flashing;
                }
            }
            else if (this.flashing)
            {
                this.flashing = false;
            }
            if (this.bashed && (this.parent.bashtime <= 0 && this.color != this.colordefault))
            {
                bool flag = false;
                if (this.colordefault == Panel.COLOR.blue && this.parent.redRight < this.position.X)
                {
                    flag = true;
                }
                else if (this.colordefault == Panel.COLOR.red && this.parent.blueLeft > this.position.X)
                {
                    flag = true;
                }
                if (flag)
                {
                    this.flashtime     = 180;
                    this.color         = this.colordefault;
                    this.inviolability = false;
                    this.bashed        = false;
                }
            }
            if (this.state != this.stateold)
            {
                this.stateold = this.state;
                this.StateInit();
            }
            switch (this.state)
            {
            case Panel.PANEL._poison:
                ++this.frame;
                if (this.frame == 10)
                {
                    this.frame = 0;
                    if (this.anime <= 0 && this.rebirth)
                    {
                        this.rebirth = false;
                    }
                    if (this.anime >= 2 && !this.rebirth)
                    {
                        this.rebirth = true;
                    }
                    this.anime += this.rebirth ? -1 : 1;
                    break;
                }
                break;

            case Panel.PANEL._burner:
            case Panel.PANEL._thunder:
                if (!this.parent.blackOut)
                {
                    if (this.animationON)
                    {
                        ++this.frame;
                        if (this.frame >= 3)
                        {
                            this.frame   = 0;
                            this.anime  += this.rebirth ? -1 : 1;
                            this.rebirth = !this.rebirth;
                            if (!this.rebirth)
                            {
                                ++this.counter;
                                if (this.counter >= 9)
                                {
                                    this.counter = 0;
                                    if (this.animechange)
                                    {
                                        if (this.state == Panel.PANEL._burner)
                                        {
                                            this.parent.attacks.Add(new FootFire(this.sound, this.parent, this.position.X, this.position.Y, this.color == Panel.COLOR.blue ? Panel.COLOR.red : Panel.COLOR.blue, 10, FootFire.MOTION.init));
                                        }
                                        else
                                        {
                                            this.parent.attacks.Add(new ParaizeThunder(this.sound, this.parent, this.position.X, this.position.Y, this.color == Panel.COLOR.blue ? Panel.COLOR.red : Panel.COLOR.blue, 0, ParaizeThunder.MOTION.init));
                                        }
                                        this.animechange = false;
                                        this.animationON = false;
                                        this.anime       = 0;
                                        if (this.state == Panel.PANEL._thunder)
                                        {
                                            this.thundercount = this.Random.Next(50);
                                        }
                                    }
                                    else
                                    {
                                        ++this.anime;
                                        this.animechange = true;
                                    }
                                }
                            }

                            if (this.anime < 0)
                            {
                                this.anime = 0;
                            }
                            else if (this.anime > 2)
                            {
                                this.anime = 1;
                            }
                        }
                    }
                    else if (this.state == Panel.PANEL._thunder)
                    {
                        ++this.thundercount;
                        if (this.thundercount <= 10)
                        {
                            this.thundercount = this.Random.Next(50);
                        }
                        if (this.thundercount >= 100)
                        {
                            this.thundercount = 0;
                            this.animationON  = true;
                        }
                    }
                    break;
                }
                break;

            default:
                this.anime = 0;
                break;
            }
            if (this.breaktime > 0)
            {
                if (this.state == Panel.PANEL._break)
                {
                    if (!this.parent.blackOut)
                    {
                        --this.breaktime;
                        if (this.breaktime < 180 && this.breaktime % 3 == 0)
                        {
                            this.breaktoggle = !this.breaktoggle;
                        }
                        if (this.breaktime > 0)
                        {
                            return;
                        }
                        this.state = Panel.PANEL._nomal;
                    }
                }
                else
                {
                    this.breaktime = 0;
                }
            }
            else
            {
                if (this.state != Panel.PANEL._break)
                {
                    return;
                }
                this.breaktime   = 600;
                this.breaktoggle = false;
            }
        }