// private PlayerInputAction controls;
    // private Vector2 move;

    // void  Awake()
    // {
    //     controls = new PlayerInputAction();

    //     controls.GamePlay.Move.performed += ctx => move = ctx.ReadValue<Vector2>();
    //     controls.GamePlay.Move.canceled += ctx => move = Vector2.zero;

    //     controls.GamePlay.Jump.started += ctx => Jump();
    // }

    // void OnEnable()
    // {
    //     controls.GamePlay.Enable();
    // }

    // void OnDisable()
    // {
    //     controls.GamePlay.Disable();
    // }

    // Start is called before the first frame update
    void Start()
    {
        myRigidbody = GetComponent <Rigidbody2D>();
        myAnim      = GetComponent <Animator>();
        myFeet      = GetComponent <BoxCollider2D>();
        da          = GetComponent <DrillAttack>();
    }
示例#2
0
 public override void Action(CharacterBase character, SceneBattle battle)
 {
     if (character.waittime == 17)
     {
         this.sound.PlaySE(SoundEffect.drill2);
         this.drillAnime = 2;
     }
     if (character.waittime < 5)
     {
         character.animationpoint = new Point(0, 3);
     }
     else if (character.waittime < 17)
     {
         character.animationpoint = new Point((character.waittime - 5) / 3, 3);
     }
     else if (character.waittime < 44)
     {
         if ((character.waittime - 5) % 3 != 0)
         {
             return;
         }
         ++this.drillAnime;
         if (this.drillAnime >= 3)
         {
             DrillAttack drillAttack = new DrillAttack(this.sound, character.parent, character.position.X + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 2, this.element);
             this.drillAnime = 0;
             ++this.hitcount;
             if (this.hitcount < 3)
             {
                 drillAttack.panelChange = false;
             }
             else
             {
                 drillAttack.hitted = true;
             }
             character.parent.attacks.Add(this.Paralyze(drillAttack));
         }
     }
     else if (character.waittime < 53)
     {
         character.animationpoint = new Point(4, 0);
     }
     else
     {
         base.Action(character, battle);
     }
 }
示例#3
0
        public override void Action(CharacterBase character, SceneBattle battle)
        {
            if (this.moveflame)
            {
                character.animationpoint.X = this.motionX[this.waittime];
                character.animationpoint.Y = 3;
                switch (this.waittime)
                {
                case 2:
                    this.sound.PlaySE(SoundEffect.Zblade);
                    IAudioEngine sound  = this.sound;
                    SceneBattle  parent = character.parent;
                    int          x      = character.position.X;
                    this.UnionRebirth(character.union);
                    int        pX      = x + 0;
                    int        y       = character.position.Y;
                    int        union   = (int)character.union;
                    int        po      = this.Power(character);
                    int        element = (int)this.element;
                    AttackBase a1      = new DrillAttack(sound, parent, pX, y, (Panel.COLOR)union, po, 2, (ChipBase.ELEMENT)element);
                    a1.invincibility = false;
                    character.parent.attacks.Add(this.Paralyze(a1));
                    break;

                case 4:
                    this.sound.PlaySE(SoundEffect.Zblade);
                    AttackBase a2 = new DrillAttack(this.sound, character.parent, character.position.X + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 2, this.element);
                    a2.invincibility = false;
                    character.parent.attacks.Add(this.Paralyze(a2));
                    break;

                case 6:
                    this.sound.PlaySE(SoundEffect.Zblade);
                    AttackBase a3 = new DrillAttack(this.sound, character.parent, character.position.X + 2 * this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 2, this.element);
                    a3.invincibility = false;
                    character.parent.attacks.Add(this.Paralyze(a3));
                    break;

                case 7:
                    base.Action(character, battle);
                    break;
                }
                ++this.waittime;
            }
            this.FlameControl(4);
        }
示例#4
0
        protected override void Moving()
        {
            this.neutlal = this.Motion == NaviBase.MOTION.neutral;
            switch (this.Motion)
            {
            case NaviBase.MOTION.neutral:
                if (this.moveflame)
                {
                    ++this.waittime;
                }
                ++this.movetime;
                if (!this.HeviSand && this.SlideMove(1f / movespeed, this.UpDown ? 2 : 3))
                {
                    int   num      = this.UpDown ? -1 : 1;
                    Point position = this.position;
                    position.Y += num;
                    ++this.roopmove;
                    if (!this.Canmove(position, this.number))
                    {
                        this.UpDown = !this.UpDown;
                    }
                    if (this.roopmove == this.moveroop && (this.ballShot || this.Hp >= this.HpMax / 2))
                    {
                        this.powerPlus = this.powers[5] * version;
                        this.sound.PlaySE(SoundEffect.eriasteal2);
                        this.parent.attacks.Add(new SlowThunder(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, ChipBase.ELEMENT.eleki, 1, 1, true));
                    }
                }
                if (this.moveflame)
                {
                    this.animationpoint = this.AnimeNeutral(this.waittime);
                }
                if (this.waittime >= 4 || this.atack)
                {
                    this.waittime = 0;
                }
                if (this.parent.nowscene != SceneBattle.BATTLESCENE.end && ((this.roopmove > this.moveroop || this.HeviSand) && !this.badstatus[4]))
                {
                    ++this.atackroop;
                    this.roopneutral = 0;
                    this.roopmove    = 0;
                    this.speed       = Math.Max(2, 4 - version / 2);
                    if (!this.atack)
                    {
                        int index = this.Random.Next(this.Hp >= this.HpMax / 2 ? 2 : 8);
                        if (index >= 2)
                        {
                            index = 3;
                        }
                        if (index == 3)
                        {
                            this.speed = Math.Max(2, 3);
                        }
                        this.frame     = 0;
                        this.attack    = (Iku.ATTACK)index;
                        this.powerPlus = this.powers[index];
                    }
                    this.waittime   = 0;
                    this.positionre = this.position;
                    this.PositionDirectSet();
                    this.Motion        = NaviBase.MOTION.attack;
                    this.counterTiming = true;
                    break;
                }
                break;

            case NaviBase.MOTION.attack:
                if (this.moveflame)
                {
                    ++this.waittime;
                }
                if (this.moveflame)
                {
                    switch (this.attack)
                    {
                    case Iku.ATTACK.lineThunder:
                        this.animationpoint = this.AnimeFever(this.waittime);
                        switch (this.waittime)
                        {
                        case 1:
                            this.target   = this.RandomTarget();
                            this.target.Y = 0;
                            this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.target.X, 0, this.union, new Point(), 13, true));
                            this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.target.X, 1, this.union, new Point(), 16, true));
                            this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.target.X, 2, this.union, new Point(), 19, true));
                            break;

                        case 6:
                            this.counterTiming = false;
                            if (7 - (version - 1) * 3 <= 0)
                            {
                                break;
                            }
                            break;

                        case 13:
                            this.target.Y = 0;
                            this.parent.attacks.Add(new CrackThunder(this.sound, this.parent, this.target.X, this.target.Y, this.union, this.Power, false));
                            break;

                        case 16:
                            this.target.Y = 1;
                            this.parent.attacks.Add(new CrackThunder(this.sound, this.parent, this.target.X, this.target.Y, this.union, this.Power, false));
                            break;

                        case 19:
                            this.target.Y = 2;
                            this.parent.attacks.Add(new CrackThunder(this.sound, this.parent, this.target.X, this.target.Y, this.union, this.Power, false));
                            break;

                        case 20:
                            this.roopneutral = 0;
                            this.DorillChange();
                            break;
                        }
                        break;

                    case Iku.ATTACK.searchThunder:
                        this.animationpoint = this.AnimeThunder(this.waittime);
                        switch (this.waittime)
                        {
                        case 1:
                            this.attackCount = 0;
                            break;

                        case 6:
                            this.counterTiming = false;
                            break;
                        }
                        if (this.waittime >= 5 && this.waittime % 5 == 0)
                        {
                            if (this.attackCount > 0)
                            {
                                this.parent.attacks.Add(new CrackThunder(this.sound, this.parent, this.target.X, this.target.Y, this.union, this.Power, false));
                            }
                            if (this.attackCount < Math.Min(version + 2, 5))
                            {
                                this.target = this.RandomTarget();
                                this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.target.X, this.target.Y, this.union, new Point(), 13, true));
                            }
                            else
                            {
                                this.roopneutral = 0;
                                this.parent.attacks.Add(new CrackThunder(this.sound, this.parent, this.target.X, this.target.Y, this.union, this.Power, false));
                                this.DorillChange();
                            }
                            ++this.attackCount;
                            break;
                        }
                        break;

                    case Iku.ATTACK.drillArm:
                        this.animationpoint = this.AnimeThunder(this.waittime);
                        switch (this.waittime)
                        {
                        case 7:
                            DrillAttack drillAttack1 = new DrillAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 1, ChipBase.ELEMENT.eleki)
                            {
                                invincibility = false,
                                breaking      = true
                            };
                            this.parent.attacks.Add(drillAttack1);
                            this.sound.PlaySE(SoundEffect.drill2);
                            break;

                        case 10:
                            DrillAttack drillAttack2 = new DrillAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 1, ChipBase.ELEMENT.eleki)
                            {
                                invincibility = false,
                                breaking      = true
                            };
                            this.parent.attacks.Add(drillAttack2);
                            break;

                        case 13:
                            DrillAttack drillAttack3 = new DrillAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 1, ChipBase.ELEMENT.eleki)
                            {
                                invincibility = false,
                                breaking      = true
                            };
                            this.parent.attacks.Add(drillAttack3);
                            break;

                        case 16:
                            this.waittime = 0;
                            this.speed    = 8;
                            this.motion   = NaviBase.MOTION.move;
                            break;
                        }
                        break;

                    case Iku.ATTACK.drillBreak:
                        this.animationpoint.X = 7;
                        int speed = 5;
                        if (this.version >= 3)
                        {
                            speed      = 10;
                            this.speed = 3;
                        }
                        else
                        {
                            this.speed = 6;
                        }
                        switch (this.frame)
                        {
                        case 1:
                            this.Noslip   = true;
                            this.drilinvi = true;
                            this.nohit    = true;
                            this.parent.effects.Add(new MoveEnemy(this.sound, this.parent, this.position.X, this.position.Y));
                            switch (this.position.Y)
                            {
                            case 0:
                                this.drillY[0] = 1;
                                this.drillY[1] = 2;
                                break;

                            case 1:
                                this.drillY[0] = 2;
                                this.drillY[1] = 0;
                                break;

                            case 2:
                                this.drillY[0] = 1;
                                this.drillY[1] = 0;
                                break;
                            }
                            this.sound.PlaySE(SoundEffect.drill1);
                            this.parent.objects.Add(new MetalDorill(this.sound, this.parent, this.position.X, this.drillY[0], this.Power, this.version <= 3, speed, this.union));
                            break;

                        case 6:
                            this.sound.PlaySE(SoundEffect.drill1);
                            this.parent.objects.Add(new MetalDorill(this.sound, this.parent, this.position.X, this.drillY[1], this.Power, this.version <= 3, speed, this.union));
                            break;

                        case 11:
                            this.drilinvi = false;
                            this.nohit    = false;
                            this.sound.PlaySE(SoundEffect.drill1);
                            this.drillBreak = new MetalDorill(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.Power, this.version <= 3, speed, this.union);
                            this.drillBreak.positionDirect.X -= 16 * this.UnionRebirth(this.union);
                            this.drillBreak.positionDirect.Y -= 8f;
                            this.parent.objects.Add(drillBreak);
                            this.speed         = 8;
                            this.effecting     = true;
                            this.counterTiming = false;
                            break;
                        }
                        break;
                    }
                    break;
                }
                break;

            case NaviBase.MOTION.move:
                if (this.moveflame)
                {
                    ++this.waittime;
                }
                ++this.roopmove;
                this.Motion     = NaviBase.MOTION.neutral;
                this.positionre = this.position;
                if (this.position.X != (this.union == Panel.COLOR.blue ? 5 : 0))
                {
                    this.positionre.X = this.union == Panel.COLOR.blue ? 5 : 0;
                    if (this.Canmove(this.positionre))
                    {
                        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;
                    }
                    else
                    {
                        this.positionre.Y = 0;
                        if (this.Canmove(this.positionre, this.number))
                        {
                            this.parent.effects.Add(new MoveEnemy(this.sound, this.parent, this.position.X, this.position.Y));
                            this.position = this.positionre;
                            this.PositionDirectSet();
                        }
                        else
                        {
                            this.positionre.Y = 1;
                            if (this.Canmove(this.positionre, this.number))
                            {
                                this.parent.effects.Add(new MoveEnemy(this.sound, this.parent, this.position.X, this.position.Y));
                                this.position = this.positionre;
                                this.PositionDirectSet();
                            }
                            else
                            {
                                this.positionre.Y = 2;
                                if (this.Canmove(this.positionre, this.number))
                                {
                                    this.parent.effects.Add(new MoveEnemy(this.sound, this.parent, this.position.X, this.position.Y));
                                    this.position = this.positionre;
                                    this.PositionDirectSet();
                                }
                                else
                                {
                                    this.Motion = NaviBase.MOTION.neutral;
                                    this.PositionDirectSet();
                                }
                            }
                        }
                    }
                    this.frame       = 0;
                    this.roopneutral = 0;
                    this.roopmove    = 0;
                }
                if (this.position.Y == 0)
                {
                    this.UpDown = false;
                    break;
                }
                if (this.position.Y == 2)
                {
                    this.UpDown = true;
                    break;
                }
                break;

            case NaviBase.MOTION.knockback:
                switch (this.waittime)
                {
                case 1:
                    if (this.drillBreak != null)
                    {
                        this.drillBreak.flag = false;
                        break;
                    }
                    break;

                case 2:
                    this.movelong       = 24;
                    this.effecting      = false;
                    this.animationpoint = new Point(3, 0);
                    this.counterTiming  = false;
                    this.effecting      = false;
                    this.PositionDirectSet();
                    this.Noslip = false;
                    break;

                case 3:
                    this.animationpoint = new Point(3, 0);
                    break;

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

                case 21:
                    this.animationpoint = new Point(0, 0);
                    this.waittime       = 0;
                    if (!this.atack)
                    {
                        this.speed = 8;
                    }
                    this.Motion = NaviBase.MOTION.move;
                    break;
                }
                if (this.waittime >= 2 && this.waittime <= 6)
                {
                    this.positionDirect.X -= this.UnionRebirth(this.union);
                }
                ++this.waittime;
                break;
            }
            if (this.effecting && !this.nohit)
            {
                this.AttackMake(this.Power, 0, 0);
            }
            if (this.motion == NaviBase.MOTION.attack && this.attack == Iku.ATTACK.drillBreak && this.frame >= 11 && this.drillBreak != null)
            {
                if (!this.drillBreak.flag && this.drillBreak.speednow == 0)
                {
                    this.drillBreak.speednow = 3;
                }
                if (this.drillBreak.flag)
                {
                    this.positionDirect.X = this.drillBreak.positionDirect.X - 24 * this.UnionRebirth(this.union);
                }
                else
                {
                    this.positionDirect.X += this.drillBreak.speednow * this.UnionRebirth(this.union);
                }
                this.position.X = this.Calcposition(this.positionDirect, 72, false).X;
                if (this.union == Panel.COLOR.blue && this.position.X <= 0 && !this.drillBreak.flag || this.union == Panel.COLOR.red && this.position.X >= 6 && !this.drillBreak.flag)
                {
                    this.Noslip    = false;
                    this.speed     = 8;
                    this.motion    = NaviBase.MOTION.move;
                    this.effecting = false;
                }
            }
            this.FlameControl();
            this.MoveAftar();
        }