예제 #1
0
        public bool BarierCheck(CharacterBase c, int damage)
        {
            bool flag = false;

            if (c.shield != CharacterBase.SHIELD.none && !this.breaking)
            {
                this.sound.PlaySE(SoundEffect.damagezero);
                this.parent.effects.Add(new Guard(this.sound, this.parent, new Vector2(c.positionDirect.X + this.Random.Next(-16, 16), c.positionDirect.Y + this.Random.Next(-16, 16)), 2, c.position));
                damage = 0;
                if (!c.shieldUsed)
                {
                    switch (c.shield)
                    {
                    case CharacterBase.SHIELD.Reflect:
                        BustorShot bustorShot1 = new BustorShot(this.sound, this.parent, c.position.X - this.UnionRebirth, c.position.Y, this.UnionEnemy, this.power * 2, BustorShot.SHOT.reflect, ChipBase.ELEMENT.normal, false, 0)
                        {
                            blackOutObject = false
                        };
                        this.parent.attacks.Add(bustorShot1);
                        break;

                    case CharacterBase.SHIELD.ReflectP:
                        BustorShot bustorShot2 = new BustorShot(this.sound, this.parent, c.position.X - this.UnionRebirth, c.position.Y, this.UnionEnemy, c.ReflectP, BustorShot.SHOT.reflect, ChipBase.ELEMENT.normal, false, 0)
                        {
                            blackOutObject = false
                        };
                        this.parent.attacks.Add(bustorShot2);
                        break;

                    case CharacterBase.SHIELD.Repair:
                        this.sound.PlaySE(SoundEffect.repair);
                        c.Hp += this.power;
                        BustorShot bustorShot3 = new BustorShot(this.sound, this.parent, c.position.X - this.UnionRebirth, c.position.Y, this.UnionEnemy, this.power, BustorShot.SHOT.reflect, ChipBase.ELEMENT.normal, false, 0)
                        {
                            blackOutObject = false
                        };
                        this.parent.attacks.Add(bustorShot3);
                        break;
                    }
                    c.shieldUsed = true;
                }
                return(false);
            }
            if (c.guard == CharacterBase.GUARD.guard && !this.breaking)
            {
                c.NoDameged(this);
                this.sound.PlaySE(SoundEffect.damagezero);
                this.parent.effects.Add(new Guard(this.sound, this.parent, new Vector2(c.positionDirect.X + this.Random.Next(-16, 16), c.positionDirect.Y + this.Random.Next(-16, 16)), 2, c.position));
                damage = 0;
                return(false);
            }
            if (c.guard == CharacterBase.GUARD.armar && !this.breaking)
            {
                damage /= 2;
                if (c.armarCount > 0)
                {
                    --c.armarCount;
                }
                this.sound.PlaySE(SoundEffect.damagezero);
            }
            else if (c.guard == CharacterBase.GUARD.armar && this.breaking)
            {
                c.guard      = CharacterBase.GUARD.none;
                c.armarCount = 0;
                this.sound.PlaySE(SoundEffect.breakObject);
            }
            switch (c.barrierType)
            {
            case CharacterBase.BARRIER.Barrier:
            case CharacterBase.BARRIER.HealBarrier:
            case CharacterBase.BARRIER.FloteBarrier:
                if (c.barrierEX)
                {
                    this.sound.PlaySE(SoundEffect.damageenemy);
                }
                else
                {
                    this.sound.PlaySE(SoundEffect.damagezero);
                }
                c.barierPower -= damage;
                if (c.barierPower <= 0)
                {
                    c.DeleteBarier();
                }
                damage = 0;
                break;

            case CharacterBase.BARRIER.PowerAura:
                this.sound.PlaySE(SoundEffect.damagezero);
                if (damage >= c.barierPower)
                {
                    c.DeleteBarier();
                }
                damage = 0;
                break;

            case CharacterBase.BARRIER.ElementsAura:
                this.sound.PlaySE(SoundEffect.damagezero);
                if ((uint)this.Element > 0U)
                {
                    c.DeleteBarier();
                }
                damage = 0;
                break;

            case CharacterBase.BARRIER.MetalAura:
                this.sound.PlaySE(SoundEffect.damagezero);
                if (this.breaking)
                {
                    c.DeleteBarier();
                }
                damage = 0;
                break;

            default:
                flag = true;
                break;
            }
            return(flag);
        }