コード例 #1
0
        protected override void Moving()
        {
            this.neutlal = this.Motion == NaviBase.MOTION.neutral;
            switch (this.Motion)
            {
            case NaviBase.MOTION.neutral:
                if (this.moveflame)
                {
                    ++this.waittime;
                }
                if (this.moveflame && this.waittime >= 10 / Math.Max(2, Math.Min((int)this.version, 4)) + this.wait)
                {
                    this.wait     = 0;
                    this.waittime = 0;
                    ++this.roopneutral;
                    this.animationpoint = this.AnimeNeutral(this.waittime);
                    if (this.roopneutral >= 1 && this.parent.nowscene != SceneBattle.BATTLESCENE.end)
                    {
                        this.roopneutral = 0;
                        if (this.roopmove > this.moveroop && !this.badstatus[4])
                        {
                            this.roopmove = this.Random.Next(this.moveroop - 2);
                            this.speed    = 1;
                            ++this.attackroop;
                            this.waittime = 0;
                            this.ready    = false;
                            this.attack   = (Ran.ATTACK) this.pattern[this.action];
                            if (this.chen != null && (this.chen.flag && this.attack >= Ran.ATTACK.SpreadCanon))
                            {
                                this.attack = Ran.ATTACK.TaleBit;
                            }
                            this.powerPlus = this.powers[this.pattern[this.action]];
                            ++this.action;
                            if (this.action >= this.pattern.Length)
                            {
                                this.action = 0;
                            }
                            this.attackProcess = 0;
                            this.ready         = false;
                            this.end           = false;
                            this.Motion        = NaviBase.MOTION.attack;
                        }
                        else
                        {
                            this.waittime = 0;
                            ++this.roopmove;
                            this.Motion = NaviBase.MOTION.move;
                        }
                    }
                    break;
                }
                break;

            case NaviBase.MOTION.attack:
                switch (this.attack)
                {
                case Ran.ATTACK.SingleShot:
                    this.animationpoint = this.AnimeSingleShot(this.waittime);
                    switch (this.waittime)
                    {
                    case 4:
                        this.counterTiming = true;
                        break;

                    case 8:
                        this.counterTiming = false;
                        this.sound.PlaySE(SoundEffect.gun);
                        BustorShot bustorShot1 = new BustorShot(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, BustorShot.SHOT.ranShot, this.element, false, 6)
                        {
                            blackOutObject = false
                        };
                        this.parent.attacks.Add(bustorShot1);
                        break;

                    case 16:
                        this.roopneutral = 0;
                        this.Motion      = NaviBase.MOTION.neutral;
                        break;
                    }
                    ++this.waittime;
                    break;

                case Ran.ATTACK.TaleBit:
                    int time = 30;
                    if (!this.ready)
                    {
                        this.animationpoint = this.AnimeTaleBit(this.waittime);
                        switch (this.waittime / this.aspeed)
                        {
                        case 1:
                            if (this.Canmove(new Point(this.union == Panel.COLOR.blue ? 4 : 1, 1), this.number, this.union))
                            {
                                this.parent.effects.Add(new MoveEnemy(this.sound, this.parent, this.position.X, this.position.Y));
                                this.positionre = new Point(this.union == Panel.COLOR.blue ? 4 : 1, 1);
                                this.position   = this.positionre;
                                this.PositionDirectSet();
                                if (this.version > 1)
                                {
                                    this.target[0] = new Point(this.union == Panel.COLOR.blue ? 1 : 4, 1);
                                    this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.target[0].X, this.target[0].Y, this.union, new Point(), time, true));
                                }
                                this.target[1] = new Point(this.position.X + this.UnionRebirth(this.union), this.position.Y);
                                this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.target[1].X, this.target[1].Y, this.union, new Point(), time, true));
                                break;
                            }
                            this.attackroop = 0;
                            this.MoveRandom(false, false);
                            this.roopneutral = 0;
                            this.waittime    = 0;
                            this.Motion      = NaviBase.MOTION.neutral;
                            this.speed       = this.nspeed;
                            break;

                        case 8:
                            this.counterTiming = true;
                            break;

                        case 12:
                            this.counterTiming = false;
                            this.ready         = true;
                            if (this.version > 1)
                            {
                                var newV2Barrier = new RanBarrier(this.sound, this.parent, this.target[0].X, this.target[0].Y, this.Power, 2, this.union, -1, this.version >= 4);
                                this.barriers.Add(newV2Barrier);
                                this.parent.objects.Add(newV2Barrier);
                            }
                            var newBarrier = new RanBarrier(this.sound, this.parent, this.target[1].X, this.target[1].Y, this.Power, 2, this.union, -1, this.version >= 4);
                            this.barriers.Add(newBarrier);
                            this.parent.objects.Add(newBarrier);
                            this.target[2] = new Point(this.union == Panel.COLOR.blue ? 0 : 5, 0);
                            this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.target[2].X, this.target[2].Y, this.union, new Point(), time, true));
                            if (this.version >= 2)
                            {
                                this.target[1] = new Point(this.union == Panel.COLOR.blue ? 0 : 5, 0);
                                this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.target[1].X, this.target[1].Y, this.union, new Point(), time, true));
                            }
                            this.attackProcess = 0;
                            this.waittime      = 0;
                            break;
                        }
                    }
                    else
                    {
                        int num = this.waittime / this.aspeed;
                        if (this.waittime == this.aspeed * 8)
                        {
                            var newBarrier = new RanBarrier(this.sound, this.parent, this.target[2].X, this.target[2].Y, this.Power, 2, this.union, 3, this.version >= 4);
                            this.barriers.Add(newBarrier);
                            this.parent.objects.Add(newBarrier);
                            if (this.version >= 2)
                            {
                                var newV2Barrier = new RanBarrier(this.sound, this.parent, this.target[1].X, this.target[1].Y, this.Power, 2, this.union, 3, this.version >= 4);
                                this.barriers.Add(newV2Barrier);
                                this.parent.objects.Add(newV2Barrier);
                            }
                            switch (this.attackProcess % 8)
                            {
                            case 0:
                                this.target[2] = new Point(this.union == Panel.COLOR.blue ? 0 : 5, 1);
                                if (this.version >= 2)
                                {
                                    this.target[1] = new Point(this.union == Panel.COLOR.blue ? 2 : 3, 1);
                                    break;
                                }
                                break;

                            case 1:
                                this.target[2] = new Point(this.union == Panel.COLOR.blue ? 0 : 5, 2);
                                if (this.version >= 2)
                                {
                                    this.target[1] = new Point(this.union == Panel.COLOR.blue ? 2 : 3, 0);
                                    break;
                                }
                                break;

                            case 2:
                                this.target[2] = new Point(this.union == Panel.COLOR.blue ? 1 : 4, 2);
                                if (this.version >= 2)
                                {
                                    this.target[1] = new Point(this.union == Panel.COLOR.blue ? 1 : 4, 0);
                                    break;
                                }
                                break;

                            case 3:
                                this.target[2] = new Point(this.union == Panel.COLOR.blue ? 2 : 3, 2);
                                if (this.version >= 2)
                                {
                                    this.target[1] = new Point(this.union == Panel.COLOR.blue ? 0 : 5, 0);
                                    break;
                                }
                                break;

                            case 4:
                                this.target[2] = new Point(this.union == Panel.COLOR.blue ? 2 : 3, 1);
                                if (this.version >= 2)
                                {
                                    this.target[1] = new Point(this.union == Panel.COLOR.blue ? 0 : 5, 1);
                                    break;
                                }
                                break;

                            case 5:
                                this.target[2] = new Point(this.union == Panel.COLOR.blue ? 2 : 3, 0);
                                if (this.version >= 2)
                                {
                                    this.target[1] = new Point(this.union == Panel.COLOR.blue ? 0 : 5, 2);
                                    break;
                                }
                                break;

                            case 6:
                                this.target[2] = new Point(this.union == Panel.COLOR.blue ? 1 : 4, 0);
                                if (this.version >= 2)
                                {
                                    this.target[1] = new Point(this.union == Panel.COLOR.blue ? 1 : 4, 2);
                                    break;
                                }
                                break;

                            case 7:
                                this.target[2] = new Point(this.union == Panel.COLOR.blue ? 0 : 5, 0);
                                if (this.version >= 2)
                                {
                                    this.target[1] = new Point(this.union == Panel.COLOR.blue ? 2 : 3, 2);
                                }
                                if (this.attackProcess / 7 >= 2)
                                {
                                    this.roopneutral = 0;
                                    this.waittime    = 0;
                                    this.Motion      = NaviBase.MOTION.neutral;
                                    foreach (var barrier in this.barriers)
                                    {
                                        barrier?.Break();
                                    }
                                    this.barriers.Clear();
                                    break;
                                }
                                break;
                            }
                            ++this.attackProcess;
                            this.waittime = 0;
                            this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.target[2].X, this.target[2].Y, this.union, new Point(), time, true));
                            if (this.version >= 2)
                            {
                                this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.target[1].X, this.target[1].Y, this.union, new Point(), time, true));
                                break;
                            }
                            break;
                        }
                    }
                    ++this.waittime;
                    break;

                case Ran.ATTACK.SpreadCanon:
                    if (!this.ready)
                    {
                        if (this.waittime % this.aspeed == 0)
                        {
                            this.animationpoint = this.AnimeSpread1(this.waittime);
                            switch (this.waittime / this.aspeed)
                            {
                            case 1:
                                this.targetMulti = ((IEnumerable <Point>) this.RandomMultiPanel(Math.Min(5, version + 2), this.UnionEnemy)).ToList <Point>();
                                for (int index = 0; index < this.targetMulti.Count; ++index)
                                {
                                    List <AttackBase> attacks = this.parent.attacks;
                                    IAudioEngine      sound   = this.sound;
                                    SceneBattle       parent  = this.parent;
                                    int   x     = this.targetMulti[index].X;
                                    Point point = this.targetMulti[index];
                                    int   y     = point.Y;
                                    int   union = (int)this.union;
                                    point = new Point();
                                    Point hitrange = point;
                                    Dummy dummy    = new Dummy(sound, parent, x, y, (Panel.COLOR)union, hitrange, 30, true);
                                    attacks.Add(dummy);
                                }
                                break;

                            case 12:
                                this.aspeed        = 3;
                                this.attackProcess = 0;
                                this.waittime      = 0;
                                this.ready         = true;
                                break;
                            }
                        }
                    }
                    else if (this.waittime % this.aspeed == 0)
                    {
                        this.animationpoint = this.AnimeSpread2(this.waittime);
                        switch (this.waittime / this.aspeed)
                        {
                        case 2:
                            this.sound.PlaySE(SoundEffect.gun);
                            for (int index = 0; index < this.targetMulti.Count; ++index)
                            {
                                this.parent.effects.Add(new GunHit(this.sound, this.parent, this.targetMulti[index].X, this.targetMulti[index].Y, this.union));
                                this.parent.attacks.Add(new BombAttack(this.sound, this.parent, this.targetMulti[index].X, this.targetMulti[index].Y, this.union, this.Power, 0, this.element));
                            }
                            if (this.attackProcess < version + 1)
                            {
                                this.targetMulti = ((IEnumerable <Point>) this.RandomMultiPanel(Math.Min(5, version + 2), this.UnionEnemy)).ToList <Point>();
                                for (int index = 0; index < this.targetMulti.Count; ++index)
                                {
                                    List <AttackBase> attacks = this.parent.attacks;
                                    IAudioEngine      sound   = this.sound;
                                    SceneBattle       parent  = this.parent;
                                    int   x     = this.targetMulti[index].X;
                                    Point point = this.targetMulti[index];
                                    int   y     = point.Y;
                                    int   union = (int)this.union;
                                    point = new Point();
                                    Point hitrange = point;
                                    Dummy dummy    = new Dummy(sound, parent, x, y, (Panel.COLOR)union, hitrange, 30, true);
                                    attacks.Add(dummy);
                                }
                                break;
                            }
                            break;

                        case 13:
                            ++this.attackProcess;
                            this.waittime = 0;
                            if (this.attackProcess >= version + 2)
                            {
                                this.roopneutral = 0;
                                this.waittime    = 0;
                                this.Motion      = NaviBase.MOTION.neutral;
                                break;
                            }
                            break;
                        }
                    }
                    ++this.waittime;
                    break;

                case Ran.ATTACK.MachineGunRey:
                    if (!this.ready)
                    {
                        if (this.waittime % this.aspeed == 0)
                        {
                            this.animationpoint.X = 2;
                            switch (this.waittime / this.aspeed)
                            {
                            case 1:
                                if (this.Canmove(new Point(this.union == Panel.COLOR.blue ? 5 : 0, 1), this.number, this.union))
                                {
                                    this.parent.effects.Add(new MoveEnemy(this.sound, this.parent, this.position.X, this.position.Y));
                                    this.positionre = new Point(this.union == Panel.COLOR.blue ? 5 : 0, 1);
                                    this.position   = this.positionre;
                                    this.PositionDirectSet();
                                    this.chargeEffect = new Charge(this.sound, this.parent, this.position.X, this.position.Y);
                                    this.parent.effects.Add(chargeEffect);
                                    break;
                                }
                                this.attackroop = 0;
                                this.MoveRandom(false, false);
                                this.roopneutral = 0;
                                this.waittime    = 0;
                                this.Motion      = NaviBase.MOTION.neutral;
                                this.speed       = this.nspeed;
                                break;

                            case 12:
                                this.chargeEffect.chargeEffect = 2;
                                break;

                            case 20:
                                this.counterTiming = true;
                                break;

                            case 24:
                                this.counterTiming     = false;
                                this.aspeed            = 3;
                                this.chargeEffect.flag = false;
                                this.attackProcess     = 0;
                                this.waittime          = 0;
                                this.ready             = true;
                                break;
                            }
                        }
                    }
                    else if (this.waittime % this.aspeed == 0)
                    {
                        this.animationpoint = this.AnimeMachinegunRay(this.waittime);
                        switch (this.waittime / this.aspeed)
                        {
                        case 2:
                            this.sound.PlaySE(SoundEffect.gun);
                            int num = this.Random.Next(2);
                            if (num == 1)
                            {
                                num = 2;
                            }
                            BustorShot bustorShot2 = new BustorShot(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.Random.Next(100) < 60 ? this.Random.Next(3) : num, this.union, this.Power, BustorShot.SHOT.ranShot, this.element, false, 6)
                            {
                                blackOutObject = false
                            };
                            this.parent.attacks.Add(bustorShot2);
                            break;

                        case 4:
                            ++this.attackProcess;
                            this.waittime = 0;
                            if (this.attackProcess / 8 >= version / 2 + 1)
                            {
                                this.roopneutral = 0;
                                this.waittime    = 0;
                                this.Motion      = NaviBase.MOTION.neutral;
                                break;
                            }
                            break;
                        }
                    }
                    ++this.waittime;
                    break;
                }
                break;

            case NaviBase.MOTION.move:
                if (this.moveflame)
                {
                    ++this.waittime;
                }
                ++this.roopmove;
                this.Motion = NaviBase.MOTION.neutral;
                this.MoveRandom(false, false);
                this.speed = this.nspeed;
                if (this.attackroop > 4)
                {
                    this.attackroop = 0;
                }
                if (this.position == this.positionre)
                {
                    this.frame       = 0;
                    this.roopneutral = 0;
                    break;
                }
                this.parent.effects.Add(new MoveEnemy(this.sound, this.parent, this.position.X, this.position.Y));
                this.position = this.positionre;
                this.PositionDirectSet();
                this.frame       = 0;
                this.roopneutral = 0;
                break;

            case NaviBase.MOTION.knockback:
                switch (this.waittime)
                {
                case 2:
                    this.rebirth = this.union == Panel.COLOR.red;
                    foreach (var barrier in this.barriers)
                    {
                        barrier?.Break();
                    }
                    this.barriers.Clear();
                    if (this.chargeEffect != null)
                    {
                        this.chargeEffect.flag = false;
                    }
                    this.guard       = CharacterBase.GUARD.none;
                    this.ready       = false;
                    this.Noslip      = false;
                    this.attackCount = 0;
                    this.speed       = this.nspeed;
                    this.effecting   = false;
                    this.NockMotion();
                    this.counterTiming = false;
                    this.effecting     = false;
                    this.PositionDirectSet();
                    break;

                case 3:
                    this.NockMotion();
                    break;

                case 15:
                    this.animationpoint = new Point(2, 0);
                    this.PositionDirectSet();
                    break;

                case 21:
                    this.animationpoint = new Point(0, 0);
                    this.waittime       = 0;
                    this.wait           = 0;
                    this.Motion         = NaviBase.MOTION.neutral;
                    break;
                }
                if (this.waittime >= 2 && this.waittime <= 6)
                {
                    this.positionDirect.X -= this.UnionRebirth(this.union);
                }
                ++this.waittime;
                break;
            }
            if (this.effecting)
            {
                this.AttackMake(this.Power, 0, 0);
            }
            this.FlameControl();
            this.MoveAftar();
        }
コード例 #2
0
 private void HitCheck()
 {
     for (int index1 = 0; index1 < this.attacks.Count; ++index1)
     {
         AttackBase attack1 = this.attacks[index1];
         if (attack1.hitting && (!this.blackOut || attack1.blackOutObject) && !attack1.effectMode)
         {
             foreach (Player player in this.players)
             {
                 if (attack1.union != player.union && (!player.nohit && player.printplayer && (!player.invincibility || attack1.breakinvi) && attack1.HitCheck(player.position)))
                 {
                     attack1.HitEvent(player);
                 }
             }
             foreach (EnemyBase enemy in this.enemys)
             {
                 if (!enemy.nohit && (!enemy.invincibility || attack1.breakinvi))
                 {
                     if (attack1.HitCheck(enemy.position, enemy.union))
                     {
                         attack1.HitEvent(enemy);
                     }
                     if (attack1.rehit && attack1.HitCheck(enemy.positionre, enemy.union))
                     {
                         attack1.HitEvent(enemy);
                     }
                 }
             }
             if (attack1.parry)
             {
                 List <BustorShot> bustorShotList = new List <BustorShot>();
                 foreach (AttackBase attack2 in this.attacks)
                 {
                     if (attack2.hitting && (!object.Equals(attack1, attack2) && attack1.HitCheck(attack2.position) && attack1.HitCheck(attack2.position, attack2.union)))
                     {
                         this.sound.PlaySE(SoundEffect.damagezero);
                         this.effects.Add(new Guard(this.sound, this, attack2.position.X, attack2.position.Y, 2));
                         BustorShot bustorShot = new BustorShot(this.sound, this, attack2.position.X, attack2.position.Y, attack1.union, attack1.power, BustorShot.SHOT.reflect, attack1.Element, true, 0)
                         {
                             canCounter         = false,
                             breaking           = false,
                             invincibility      = attack1.invincibility,
                             invincibilitytime  = attack1.invincibilitytime,
                             invincibilitytimeA = attack1.invincibilitytimeA,
                         };
                         bustorShotList.Add(bustorShot);
                         attack2.flag = false;
                     }
                 }
                 foreach (AttackBase attackBase in bustorShotList)
                 {
                     this.attacks.Add(attackBase);
                 }
             }
             for (int index2 = 0; index2 < this.objects.Count; ++index2)
             {
                 if (!this.objects[index2].nohit && (this.objects[index2].unionhit || this.objects[index2].union != attack1.union) && (attack1.HitCheck(this.objects[index2].position) && !this.objects[index2].nohit))
                 {
                     attack1.HitEvent(this.objects[index2]);
                 }
             }
         }
         if (attack1.panelChange && !attack1.flag)
         {
             attack1.PanelChange();
         }
     }
 }