Ejemplo n.º 1
0
        public SandHoleAttack(
            IAudioEngine so,
            SceneBattle p,
            int pX,
            int pY,
            Panel.COLOR u,
            int po,
            int t,
            int c,
            SandHoleAttack.MOTION m,
            ChipBase.ELEMENT ele,
            bool warnPanel = false)
            : base(so, p, pX, pY, u, po, ele)
        {
            if (!this.flag)
            {
                return;
            }
            this.downprint        = true;
            this.time             = t;
            this.speed            = 5;
            this.animationpoint.X = 0;
            this.hitrange         = new Point(0, 0);
            this.hitting          = false;
            this.rebirth          = this.union == Panel.COLOR.blue;
            this.positionre       = this.position;
            this.positionDirect   = new Vector2(this.position.X * 40 + 20, this.position.Y * 24 + 82);
            this.animationpoint.Y = c;
            this.motion           = m;
            switch (this.motion)
            {
            case SandHoleAttack.MOTION.init:
                if (this.element == ChipBase.ELEMENT.leaf)
                {
                    this.sound.PlaySE(SoundEffect.sand);
                    this.parent.panel[this.position.X, this.position.Y].state = Panel.PANEL._grass;
                    break;
                }
                this.parent.panel[this.position.X, this.position.Y].state = Panel.PANEL._sand;
                this.sound.PlaySE(SoundEffect.sand);
                this.element = ChipBase.ELEMENT.earth;
                break;

            case SandHoleAttack.MOTION.set:
                this.hitting = true;
                break;
            }
            if (warnPanel)
            {
                this.parent.attacks.Add(new Dummy(so, p, pX, pY, u, Point.Empty, 4 * this.speed, true));
            }
            this.frame = 0;
        }
Ejemplo n.º 2
0
        public override void Updata()
        {
            if (this.over)
            {
                return;
            }
            if (this.moveflame)
            {
                switch (this.motion)
                {
                case SandHoleAttack.MOTION.init:
                    this.animationpoint.X = this.frame;
                    if (this.frame >= 4)
                    {
                        this.hitting = true;
                        this.motion  = SandHoleAttack.MOTION.set;
                        break;
                    }
                    break;

                case SandHoleAttack.MOTION.set:
                    this.animationpoint.X = this.frame % 4 + 4;
                    if (this.frame >= this.time)
                    {
                        this.hitting = false;
                        this.frame   = 0;
                        this.motion  = SandHoleAttack.MOTION.end;
                        break;
                    }
                    break;

                case SandHoleAttack.MOTION.end:
                    this.animationpoint.X = 5 - this.frame;
                    if (this.frame >= 4)
                    {
                        this.flag = false;
                        break;
                    }
                    break;
                }
            }
            this.FlameControl();
        }