Esempio n. 1
0
 private void Angle()
 {
     if (this.motion == GekoHuts.MOTION.up)
     {
         if (this.CanRight)
         {
             this.motion = GekoHuts.MOTION.right;
         }
         else if (this.CanDown)
         {
             this.motion = GekoHuts.MOTION.down;
         }
         else
         {
             if (!this.CanLeft)
             {
                 return;
             }
             this.motion = GekoHuts.MOTION.left;
         }
     }
     else if (this.motion == GekoHuts.MOTION.right)
     {
         if (this.CanDown)
         {
             this.motion = GekoHuts.MOTION.down;
         }
         else if (this.CanLeft)
         {
             this.motion = GekoHuts.MOTION.left;
         }
         else
         {
             if (!this.CanUP)
             {
                 return;
             }
             this.motion = GekoHuts.MOTION.up;
         }
     }
     else if (this.motion == GekoHuts.MOTION.down)
     {
         if (this.CanLeft)
         {
             this.motion = GekoHuts.MOTION.left;
         }
         else if (this.CanUP)
         {
             this.motion = GekoHuts.MOTION.up;
         }
         else
         {
             if (!this.CanRight)
             {
                 return;
             }
             this.motion = GekoHuts.MOTION.right;
         }
     }
     else
     {
         if (this.motion != GekoHuts.MOTION.left)
         {
             return;
         }
         if (this.CanUP)
         {
             this.motion = GekoHuts.MOTION.up;
         }
         else if (this.CanRight)
         {
             this.motion = GekoHuts.MOTION.right;
         }
         else if (this.CanDown)
         {
             this.motion = GekoHuts.MOTION.down;
         }
     }
 }
Esempio n. 2
0
        protected override void Moving()
        {
            if (!this.angry && this.hp <= this.HpMax / 2)
            {
                this.angry             = true;
                this.animationpoint.X += 2;
            }
            this.neutlal = true;
            if (!this.attacknow)
            {
                float speed = 1f;
                switch (this.version)
                {
                case 0:
                    speed = 2f;
                    break;

                case 1:
                    speed = 0.4f;
                    break;

                case 2:
                    speed = 0.8f;
                    break;
                }
                if (this.angry)
                {
                    speed *= 3f;
                }
                int angle = 0;
                switch (this.motion)
                {
                case GekoHuts.MOTION.up:
                    if (!this.CanUP && !this.slideInit)
                    {
                        this.Angle();
                        break;
                    }
                    break;

                case GekoHuts.MOTION.down:
                    if (!this.CanDown && !this.slideInit)
                    {
                        this.Angle();
                        break;
                    }
                    break;

                case GekoHuts.MOTION.left:
                    if (!this.CanLeft && !this.slideInit)
                    {
                        this.Angle();
                        break;
                    }
                    break;

                case GekoHuts.MOTION.right:
                    if (!this.CanRight && !this.slideInit)
                    {
                        this.Angle();
                        break;
                    }
                    break;
                }
                switch (this.motion)
                {
                case GekoHuts.MOTION.up:
                    angle = 2;
                    break;

                case GekoHuts.MOTION.down:
                    angle = 3;
                    break;

                case GekoHuts.MOTION.left:
                    angle = this.union == Panel.COLOR.blue ? 0 : 1;
                    break;

                case GekoHuts.MOTION.right:
                    angle = this.union == Panel.COLOR.blue ? 1 : 0;
                    break;
                }
                if ((this.CanUP || this.CanDown || (this.CanLeft || this.CanRight)) && (this.parent.nowscene != SceneBattle.BATTLESCENE.end && !this.HeviSand) || this.slideInit)
                {
                    if (this.SlideMove(speed, angle))
                    {
                        this.SlideMoveEnd();
                        this.PositionDirectSet();
                        if ((this.CanUP || this.CanDown || (this.CanLeft || this.CanRight)) && this.parent.nowscene != SceneBattle.BATTLESCENE.end && !this.HeviSand)
                        {
                            bool flag = false;
                            this.motion = (GekoHuts.MOTION) this.Random.Next(4);
                            switch (this.motion)
                            {
                            case GekoHuts.MOTION.up:
                                if (!this.CanUP)
                                {
                                    flag = true;
                                    break;
                                }
                                break;

                            case GekoHuts.MOTION.down:
                                if (!this.CanDown)
                                {
                                    flag = true;
                                    break;
                                }
                                break;

                            case GekoHuts.MOTION.left:
                                if (!this.CanLeft)
                                {
                                    flag = true;
                                    break;
                                }
                                break;

                            case GekoHuts.MOTION.right:
                                if (!this.CanRight)
                                {
                                    flag = true;
                                    break;
                                }
                                break;
                            }
                            if (flag)
                            {
                                GekoHuts.MOTION motion = this.motion;
                                this.Angle();
                                if (motion == this.motion)
                                {
                                }
                            }
                            ++this.moving;
                            this.moveend = false;
                            if (this.moving >= this.moveMany)
                            {
                                this.moving    = 0;
                                this.attacknow = true;
                                ++this.animationpoint.X;
                                this.frame = 0;
                            }
                        }
                    }
                    else if (this.moveflame && this.frame >= 12)
                    {
                        this.frame = 0;
                    }
                }
                else
                {
                    this.positionre = this.position;
                    this.PositionDirectSet();
                    this.Angle();
                }
            }
            else if (this.moveflame)
            {
                if (this.frame == 10)
                {
                    this.counterTiming = true;
                    this.sound.PlaySE(SoundEffect.bound);
                    AttackBase attackBase = new Otama(this.sound, this.parent, this.position.X, this.position.Y, this.union, this.Power, 2, this.positionDirect, this.element, 5);
                    if (this.version == 0)
                    {
                        attackBase.breaking = true;
                    }
                    this.parent.attacks.Add(attackBase);
                }
                else if (this.frame > 20)
                {
                    this.counterTiming = false;
                    this.attacknow     = false;
                    --this.animationpoint.X;
                }
            }
            this.FlameControl();
            this.MoveAftar();
        }