Наследование: TimedObjects
Пример #1
0
        public ISpell GenerateAttack()
        {
            if (isBlizzardNext)
            {
                var blizzard = new Blizzard(this.Unit.AttackPoints * 2);

                Validator.HasEnoughEnergy(this.Unit, blizzard);

                isBlizzardNext = false;
                Unit.EnergyPoints -= blizzard.EnergyCost;

                return blizzard;
            }
            else
            {
                var fireBreath = new FireBreath(this.Unit.AttackPoints);

                Validator.HasEnoughEnergy(this.Unit, fireBreath);

                isBlizzardNext = true;
                Unit.EnergyPoints -= fireBreath.EnergyCost;

                return fireBreath;
            }
        }
        public override ISpell GenerateAttack()
        {
            ISpell currentSpell;
            if (this.firstAttack)
            {
                currentSpell = new FireBreath(this.Unit.AttackPoints);
            }
            else
            {
                currentSpell = new Blizzard(this.Unit.AttackPoints * 2);
            }

            if (this.Unit.EnergyPoints < currentSpell.EnergyCost)
            {
                throw new NotEnoughEnergyException(
                    string.Format(
                        GlobalMessages.NotEnoughEnergy,
                        this.Unit.Name,
                        currentSpell.GetType().Name));
            }

            this.firstAttack = !this.firstAttack;
            this.Unit.EnergyPoints -= currentSpell.EnergyCost;

            return currentSpell;
        }
Пример #3
0
        public override ISpell GenerateAttack()
        {
            ISpell attack;

            if (this.spellCount % 2 == 0)
            {
                attack = new FireBreath(this.Unit.AttackPoints);
            }
            else
            {
                attack = new Blizzard(this.Unit.AttackPoints * 2);
            }

            if (this.Unit.EnergyPoints < attack.EnergyCost)
            {
                throw new NotEnoughEnergyException(string.Format(
                    GlobalMessages.NotEnoughEnergy,
                    this.Unit.Name, attack.GetType().Name));
            }

            this.spellCount++;

            this.Unit.EnergyPoints -= attack.EnergyCost;

            return attack;
        }
Пример #4
0
        public ISpell GenerateAttack()
        {
            if (isBlizzardNext)
            {
                var blizzard = new Blizzard(this.Unit.AttackPoints * 2);

                Validator.HasEnoughEnergy(this.Unit, blizzard);

                isBlizzardNext     = false;
                Unit.EnergyPoints -= blizzard.EnergyCost;

                return(blizzard);
            }
            else
            {
                var fireBreath = new FireBreath(this.Unit.AttackPoints);

                Validator.HasEnoughEnergy(this.Unit, fireBreath);

                isBlizzardNext     = true;
                Unit.EnergyPoints -= fireBreath.EnergyCost;

                return(fireBreath);
            }
        }
        public override ISpell GenerateAttack()
        {
            ISpell currentSpell;

            if (this.firstAttack)
            {
                currentSpell = new FireBreath(this.Unit.AttackPoints);
            }
            else
            {
                currentSpell = new Blizzard(this.Unit.AttackPoints * 2);
            }

            if (this.Unit.EnergyPoints < currentSpell.EnergyCost)
            {
                throw new NotEnoughEnergyException(
                          string.Format(
                              GlobalMessages.NotEnoughEnergy,
                              this.Unit.Name,
                              currentSpell.GetType().Name));
            }

            this.firstAttack        = !this.firstAttack;
            this.Unit.EnergyPoints -= currentSpell.EnergyCost;

            return(currentSpell);
        }
Пример #6
0
    private IEnumerator fireBreath(float duration, float fireRate, float delay)
    {
        float timer           = duration;
        float currentFireRate = 0;

        while (timer > 0)
        {
            if (delay > 0)
            {
                delay -= Time.deltaTime;
            }
            else
            {
                fireParticle.SpAttackSate(true);
                timer -= Time.deltaTime;
                if (currentFireRate > 0)
                {
                    currentFireRate -= Time.deltaTime;
                }
                else
                {
                    GameObject fireBreath_GO  = (GameObject)Instantiate(falsolProjectile, breathCenter.position, transform.rotation);
                    FireBreath fireBreathComp = fireBreath_GO.GetComponent <FireBreath>();
                    fireBreathComp.damage          = specialDamage;
                    fireBreathComp.direction       = transform.forward;
                    fireBreathComp.attackingPlayer = GetComponent <TamPlayerScore>().getPlayerNumber();
                    NetworkServer.Spawn(fireBreath_GO);
                    currentFireRate = fireRate;
                }
            }
            yield return(null);
        }
        fireParticle.SpAttackSate(false);
    }
Пример #7
0
        public override ISpell GenerateAttack()
        {
            ISpell attack;

            if (this.spellCount % 2 == 0)
            {
                attack = new FireBreath(this.Unit.AttackPoints);
            }
            else
            {
                attack = new Blizzard(this.Unit.AttackPoints * 2);
            }

            if (this.Unit.EnergyPoints < attack.EnergyCost)
            {
                throw new NotEnoughEnergyException(string.Format(
                                                       GlobalMessages.NotEnoughEnergy,
                                                       this.Unit.Name, attack.GetType().Name));
            }

            this.spellCount++;

            this.Unit.EnergyPoints -= attack.EnergyCost;

            return(attack);
        }
Пример #8
0
        public override ISpell GenerateAttack()
        {
            if (lastSuccessfulAttack == "FireBreath")
            {
                int energyCost = new Blizzard(0).EnergyCost;
                if (this.Unit.EnergyPoints >= energyCost)
                {
                    lastSuccessfulAttack = "Blizzard";
                    this.Unit.EnergyPoints -= energyCost;
                    return new Blizzard(this.Unit.AttackPoints * 2);
                }
            }
            else if (lastSuccessfulAttack == "Blizzard")
            {
                int energyCost = new FireBreath(0).EnergyCost;
                if (this.Unit.EnergyPoints >= energyCost)
                {
                    lastSuccessfulAttack = "FireBreath";
                    this.Unit.EnergyPoints -= energyCost;
                    return new FireBreath(this.Unit.AttackPoints);
                }
            }

            throw new NotEnoughEnergyException(string.Format(GlobalMessages.NotEnoughEnergy, this.Unit.Name, lastSuccessfulAttack == "Blizzard" ? "FireBreath" : "Blizzard"));
        }
        public override ISpell GenerateAttack()
        {
            Spell attack;

            if (this.previousSpell == null)
            {
                attack             = new FireBreath();
                this.previousSpell = attack;

                if (this.Unit.EnergyPoints >= attack.EnergyCost)
                {
                    attack.Damage = this.Unit.AttackPoints;

                    this.Unit.EnergyPoints -= attack.EnergyCost;

                    return(attack);
                }
            }
            else
            {
                if (this.previousSpell is FireBreath)
                {
                    attack = new Blizzard();

                    if (this.Unit.EnergyPoints >= attack.EnergyCost)
                    {
                        attack.Damage = this.Unit.AttackPoints * 2;

                        this.Unit.EnergyPoints -= attack.EnergyCost;
                        this.previousSpell      = attack;

                        return(attack);
                    }
                }
                else
                {
                    attack = new FireBreath();

                    if (this.Unit.EnergyPoints >= attack.EnergyCost)
                    {
                        attack.Damage = this.Unit.AttackPoints;

                        this.Unit.EnergyPoints -= attack.EnergyCost;
                        this.previousSpell      = attack;

                        return(attack);
                    }
                }
            }

            throw new NotEnoughEnergyException(
                      string.Format(GlobalMessages.NotEnoughEnergy, this.Unit.Name, attack.GetType().Name));
        }
Пример #10
0
    protected override void Start()
    {
        if (!isServer)
        {
            dragonSkillsMenu.SetActive(false);
        }

        m_RemoveAddRoom   = GetComponent <RemoveAddRoom>();
        m_PlaceTrap       = GetComponent <PlaceTrap>();
        m_PlaceDragonling = GetComponent <PlaceDragonling>();
        m_FireBreath      = GetComponent <FireBreath>();
        m_Entomb          = GetComponent <Entomb>();

        base.Start();
    }
        public ISpell FireBreath()
        {
            int    damage = this.Unit.AttackPoints;
            ISpell spell  = new FireBreath(damage);

            if (this.Unit.EnergyPoints < spell.EnergyCost)
            {
                throw new NotEnoughEnergyException(this.Unit.Name + " does not have enough energy to cast FireBreath");
            }
            else
            {
                this.Unit.EnergyPoints -= spell.EnergyCost;
                this._flag              = 1;
                return(spell);
            }
        }
        public override ISpell GenerateAttack()
        {
            ISpell spell;
            if (this.attackCount % 2 == 0)
            {
                spell = new FireBreath(this.Unit.AttackPoints);
            }
            else
            {
                spell = new Blizzard(this.Unit.AttackPoints * 2);
            }

            this.ValidateEnergyPoints(this.Unit, spell);
            this.attackCount++;
            this.Unit.EnergyPoints -= spell.EnergyCost;
            return spell;
        }
Пример #13
0
        public override ISpell GenerateAttack()
        {
            if (!fireBreathCasted)
            {
                var fireBreath = new FireBreath(this.Unit.AttackPoints);

                if (this.Unit.EnergyPoints >= fireBreath.EnergyCost)
                {
                    this.fireBreathCasted = true;

                    this.Unit.EnergyPoints -= fireBreath.EnergyCost;

                    return fireBreath;
                }
                else
                {
                    throw new NotEnoughEnergyException(string.Format(
                        GlobalMessages.NotEnoughEnergy,
                        this.Unit.Name,
                        fireBreath.GetType().Name
                    ));
                }
            }
            else
            {
                var blizzard = new Blizzard(this.Unit.AttackPoints * 2);

                if (this.Unit.EnergyPoints >= blizzard.EnergyCost)
                {
                    fireBreathCasted = false;

                    this.Unit.EnergyPoints -= blizzard.EnergyCost;

                    return blizzard;
                }
                else
                {
                    throw new NotEnoughEnergyException(string.Format(
                        GlobalMessages.NotEnoughEnergy,
                        this.Unit.Name,
                        blizzard.GetType().Name
                    ));
                }
            }
        }
        public override ISpell GenerateAttack()
        {
            ISpell spell;

            if (this.attackCount % 2 == 0)
            {
                spell = new FireBreath(this.Unit.AttackPoints);
            }
            else
            {
                spell = new Blizzard(this.Unit.AttackPoints * 2);
            }

            this.ValidateEnergyPoints(this.Unit, spell);
            this.attackCount++;
            this.Unit.EnergyPoints -= spell.EnergyCost;
            return(spell);
        }
Пример #15
0
        public override ISpell GenerateAttack()
        {
            ISpell spell = null;

            if (this.prevSpell.GetType() == typeof(FireBreath))
            {
                spell = new Blizzard(2 * base.Unit.AttackPoints);
            }
            else
            {
                spell = new FireBreath(base.Unit.AttackPoints);
            }

            base.TakeEnergy(spell);

            prevSpell = spell;

            return(spell);
        }
Пример #16
0
        public override ISpell GenerateAttack()
        {
            ISpell spell = null;

            if (this.lastSuccessfullSpell == null || this.lastSuccessfullSpell is Blizzard)
            {
                spell = new FireBreath(this.Unit.AttackPoints);
            }
            else
            {
                spell = new Blizzard(this.Unit.AttackPoints * 2);
            }
            if (this.Unit.EnergyPoints >= spell.EnergyCost)
            {
                this.lastSuccessfullSpell = spell;
                this.Unit.EnergyPoints   -= spell.EnergyCost;
                return(spell);
            }
            throw new NotEnoughEnergyException(string.Format(Messages.NotEnoughEnergyException, this.Unit.Name, spell.GetType().Name));
        }
        public override ISpell GenerateAttack()
        {
            /////. Casts Fire Breath and Blizzard, alternating each time he successfully casts a spell
            /////(i.e. first Fire Breath, next time Blizzard, then Fire Breath again, etc.).
            ///// Fire Breath damage: Equals the mage's attack points.
            ///// Blizzard damage: Equals the mage's attack points * 2
            ISpell spell;

            if (this.attackCount % 2 == 0)
            {
                spell = new FireBreath(this.Unit.AttackPoints);
            }
            else
            {
                spell = new Blizzard(this.Unit.AttackPoints * 2);
            }

            this.ValidateEnergyPoints(this.Unit, spell);
            this.attackCount++;
            this.Unit.EnergyPoints -= spell.EnergyCost;
            return(spell);
        }
Пример #18
0
    protected override void Start()
    {
        if (!isServer)
        {
            dragonSkillsMenu.SetActive(false);
        }

        m_RemoveAddRoom = GetComponent<RemoveAddRoom>();
        m_PlaceTrap = GetComponent<PlaceTrap>();
        m_PlaceDragonling = GetComponent<PlaceDragonling>();
        m_FireBreath = GetComponent<FireBreath>();
        m_Entomb = GetComponent<Entomb>();

        base.Start();
    }
Пример #19
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.animationpoint = this.AnimeNeutral(this.waittime);
                    if (this.waittime >= (this.beast ? 2 : 8 - Math.Min(6, (int)this.version)))
                    {
                        this.waittime = 0;
                        ++this.roopneutral;
                        if (this.roopneutral >= 1 && this.parent.nowscene != SceneBattle.BATTLESCENE.end)
                        {
                            this.roopneutral = 0;
                            if (this.roopmove > this.moveroop && !this.badstatus[4])
                            {
                                this.roopmove = 0;
                                this.roopmove = this.version > 3 ? this.Random.Next(-1, this.moveroop + 1) : 0;
                                ++this.atackroop;
                                if (!this.atack)
                                {
                                    int index = this.Random.Next(4);
                                    this.attack    = (HakutakuMan.ATTACK)index;
                                    this.powerPlus = this.powers[index];
                                }
                                this.waittime      = 0;
                                this.attackFlag    = true;
                                this.Motion        = NaviBase.MOTION.move;
                                this.counterTiming = true;
                            }
                            else
                            {
                                this.waittime = 0;
                                this.Motion   = NaviBase.MOTION.move;
                            }
                        }
                    }
                    break;
                }
                break;

            case NaviBase.MOTION.attack:
                if (this.moveflame)
                {
                    ++this.waittime;
                    if (this.moveflame)
                    {
                        switch (this.attack)
                        {
                        case HakutakuMan.ATTACK.WideCrow:
                            if (!this.beast)
                            {
                                this.animationpoint = this.AnimeWide(this.waittime);
                                switch (this.waittime)
                                {
                                case 6:
                                    this.counterTiming = false;
                                    this.sound.PlaySE(SoundEffect.shotwave);
                                    this.parent.attacks.Add(new SwordAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 3, this.element, false, false));
                                    break;

                                case 10:
                                    this.motion      = NaviBase.MOTION.move;
                                    this.frame       = 0;
                                    this.speed       = this.nspeed;
                                    this.roopneutral = 0;
                                    this.waittime    = 0;
                                    break;
                                }
                            }
                            else
                            {
                                if (this.attackCombo == 0)
                                {
                                    this.animationpoint = this.AnimeWideBO(this.waittime);
                                    switch (this.waittime)
                                    {
                                    case 6:
                                        this.counterTiming = false;
                                        this.sound.PlaySE(SoundEffect.shotwave);
                                        AttackBase attackBase = new SwordAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 3, this.element, false, false);
                                        attackBase.invincibility = false;
                                        this.parent.attacks.Add(attackBase);
                                        break;

                                    case 8:
                                        ++this.attackCombo;
                                        this.frame       = 0;
                                        this.speed       = this.nspeed;
                                        this.roopneutral = 0;
                                        this.waittime    = 0;
                                        break;
                                    }
                                }
                                else
                                {
                                    this.animationpoint = this.AnimeLongBO(this.waittime);
                                    switch (this.waittime)
                                    {
                                    case 6:
                                        this.counterTiming = false;
                                        this.sound.PlaySE(SoundEffect.shotwave);
                                        this.parent.attacks.Add(new LanceAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 3, this.element, true));
                                        break;

                                    case 10:
                                        this.attackCombo = 0;
                                        this.motion      = NaviBase.MOTION.move;
                                        this.frame       = 0;
                                        this.speed       = this.nspeed;
                                        this.roopneutral = 0;
                                        this.waittime    = 0;
                                        break;
                                    }
                                }
                                break;
                            }
                            break;

                        case HakutakuMan.ATTACK.LongCrow:
                            if (!this.beast)
                            {
                                this.animationpoint = this.AnimeLong(this.waittime);
                                switch (this.waittime)
                                {
                                case 6:
                                    this.counterTiming = false;
                                    this.sound.PlaySE(SoundEffect.shotwave);
                                    this.parent.attacks.Add(new LanceAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 3, this.element, true));
                                    break;

                                case 10:
                                    this.motion      = NaviBase.MOTION.move;
                                    this.frame       = 0;
                                    this.speed       = this.nspeed;
                                    this.roopneutral = 0;
                                    this.waittime    = 0;
                                    break;
                                }
                            }
                            else
                            {
                                if (this.attackCombo == 0)
                                {
                                    this.animationpoint = this.AnimeLongBO(this.waittime);
                                    switch (this.waittime)
                                    {
                                    case 6:
                                        this.counterTiming = false;
                                        this.sound.PlaySE(SoundEffect.shotwave);
                                        AttackBase attackBase = new LanceAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 3, this.element, true);
                                        attackBase.invincibility = false;
                                        this.parent.attacks.Add(attackBase);
                                        break;

                                    case 8:
                                        ++this.attackCombo;
                                        this.frame       = 0;
                                        this.speed       = this.nspeed;
                                        this.roopneutral = 0;
                                        this.waittime    = 0;
                                        break;
                                    }
                                }
                                else
                                {
                                    this.animationpoint = this.AnimeWideBO(this.waittime);
                                    switch (this.waittime)
                                    {
                                    case 6:
                                        this.counterTiming = false;
                                        this.sound.PlaySE(SoundEffect.shotwave);
                                        this.parent.attacks.Add(new SwordAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 3, this.element, false, false));
                                        break;

                                    case 10:
                                        this.attackCombo = 0;
                                        this.motion      = NaviBase.MOTION.move;
                                        this.frame       = 0;
                                        this.speed       = this.nspeed;
                                        this.roopneutral = 0;
                                        this.waittime    = 0;
                                        break;
                                    }
                                }
                                break;
                            }
                            break;

                        case HakutakuMan.ATTACK.Miss:
                            if (!this.beast)
                            {
                                this.animationpoint = this.AnimeMiss(this.waittime);
                                switch (this.waittime)
                                {
                                case 7:
                                case 9:
                                    this.counterTiming = false;
                                    this.sound.PlaySE(SoundEffect.lance);
                                    break;

                                case 13:
                                    this.sound.PlaySE(SoundEffect.canon);
                                    this.sound.PlaySE(SoundEffect.damageenemy);
                                    this.whitetime = 4;
                                    this.hp       -= 20 * version;
                                    break;

                                case 20:
                                    this.motion      = NaviBase.MOTION.move;
                                    this.frame       = 0;
                                    this.roopneutral = 0;
                                    this.waittime    = 0;
                                    this.speed       = this.nspeed;
                                    break;
                                }
                            }
                            else
                            {
                                this.animationpoint = this.AnimeCrossBO(this.waittime);
                                switch (this.waittime)
                                {
                                case 6:
                                    this.sound.PlaySE(SoundEffect.shotwave);
                                    this.parent.attacks.Add(new SwordCloss(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 3, this.element, false));
                                    break;

                                case 10:
                                    this.motion      = NaviBase.MOTION.move;
                                    this.frame       = 0;
                                    this.speed       = this.nspeed;
                                    this.roopneutral = 0;
                                    this.waittime    = 0;
                                    break;
                                }
                                break;
                            }
                            break;

                        case HakutakuMan.ATTACK.Hadouken:
                            if (!this.beast)
                            {
                                this.animationpoint = this.AnimeHadou(this.waittime);
                                switch (this.waittime)
                                {
                                case 8:
                                    this.counterTiming = false;
                                    int        x          = this.RandomTarget().X;
                                    int        num1       = 1;
                                    int        num2       = 8;
                                    AttackBase attackBase = new FireBreath(this.sound, this.parent, this.position.X + num1 * this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 2, this.element, x);
                                    attackBase.positionDirect.Y += num2;
                                    this.parent.attacks.Add(attackBase);
                                    break;

                                case 16:
                                    this.motion      = NaviBase.MOTION.move;
                                    this.frame       = 0;
                                    this.speed       = this.nspeed;
                                    this.roopneutral = 0;
                                    this.waittime    = 0;
                                    break;
                                }
                            }
                            else
                            {
                                switch (this.attackCombo)
                                {
                                case 0:
                                    this.animationpoint = this.AnimeSpin1BO(this.waittime);
                                    if (this.waittime == 4)
                                    {
                                        this.counterTiming = false;
                                        this.guard         = CharacterBase.GUARD.guard;
                                        switch (this.position.Y)
                                        {
                                        case 0:
                                            this.spinUP = false;
                                            this.spinGo = true;
                                            break;

                                        case 2:
                                            this.spinUP = true;
                                            this.spinGo = true;
                                            break;

                                        default:
                                            this.spinGo = false;
                                            break;
                                        }
                                        this.PositionDirectSet();
                                        this.HitFlagReset();
                                        this.sound.PlaySE(SoundEffect.knife);
                                        this.effecting = true;
                                        ++this.attackCombo;
                                        this.frame       = 0;
                                        this.speed       = this.nspeed;
                                        this.roopneutral = 0;
                                        this.waittime    = 0;
                                        this.DammySet();
                                        break;
                                    }
                                    break;

                                case 1:
                                    this.animationpoint = this.AnimeSpin2BO(this.waittime % 4);
                                    if (this.spinGo)
                                    {
                                        if (this.SlideMove(movespeed, 0))
                                        {
                                            this.SlideMoveEnd();
                                            this.PositionDirectSet();
                                            this.spinGo = false;
                                            break;
                                        }
                                        break;
                                    }
                                    if (this.spinUP)
                                    {
                                        if (this.SlideMove(movespeed, 2))
                                        {
                                            this.SlideMoveEnd();
                                            Point position = this.position;
                                            --position.Y;
                                            if (!this.InAreaCheck(position))
                                            {
                                                this.spinUP = !this.spinUP;
                                                position    = this.position;
                                                position.X += this.UnionRebirth(this.union);
                                                if (!this.InAreaCheck(position))
                                                {
                                                    ++this.attackCombo;
                                                    this.frame       = 0;
                                                    this.speed       = this.nspeed;
                                                    this.roopneutral = 0;
                                                    this.waittime    = 0;
                                                }
                                                this.PositionDirectSet();
                                                this.spinGo = true;
                                            }
                                        }
                                    }
                                    else if (this.SlideMove(movespeed, 3))
                                    {
                                        this.SlideMoveEnd();
                                        Point position = this.position;
                                        ++position.Y;
                                        if (!this.InAreaCheck(position))
                                        {
                                            this.spinUP = !this.spinUP;
                                            position    = this.position;
                                            position.X += this.UnionRebirth(this.union);
                                            if (!this.InAreaCheck(position))
                                            {
                                                this.HitFlagReset();
                                                ++this.attackCombo;
                                                this.frame       = 0;
                                                this.speed       = this.nspeed;
                                                this.roopneutral = 0;
                                                this.waittime    = 0;
                                            }
                                            this.PositionDirectSet();
                                            this.spinGo = true;
                                        }
                                    }
                                    break;

                                case 2:
                                    this.animationpoint = this.AnimeSpin2BO(this.waittime % 3);
                                    if (this.SlideMove(movespeed, 1))
                                    {
                                        Point position = this.position;
                                        position.X -= this.UnionRebirth(this.union);
                                        if (!this.InAreaCheck(position))
                                        {
                                            this.guard     = CharacterBase.GUARD.none;
                                            this.effecting = false;
                                            ++this.attackCombo;
                                            this.frame       = 0;
                                            this.speed       = this.nspeed;
                                            this.roopneutral = 0;
                                            this.waittime    = 0;
                                        }
                                        break;
                                    }
                                    break;

                                default:
                                    this.animationpoint = this.AnimeSpin3BO(this.waittime);
                                    if (this.waittime == 4)
                                    {
                                        this.effecting   = false;
                                        this.attackCombo = 0;
                                        this.motion      = NaviBase.MOTION.move;
                                        this.frame       = 0;
                                        this.speed       = this.nspeed;
                                        this.roopneutral = 0;
                                        this.waittime    = 0;
                                        break;
                                    }
                                    break;
                                }
                                break;
                            }
                            break;
                        }
                    }
                    break;
                }
                break;

            case NaviBase.MOTION.move:
                this.animationpoint = this.AnimeMove(this.waittime);
                if (this.moveflame)
                {
                    switch (this.waittime)
                    {
                    case 0:
                        if (!this.attackFlag || this.attack == HakutakuMan.ATTACK.Hadouken)
                        {
                            this.MoveRandom(false, false);
                        }
                        else
                        {
                            Point point = this.RandomTarget();
                            if (this.Canmove(new Point(point.X - this.UnionRebirth(this.union), point.Y), this.number, this.union == Panel.COLOR.blue ? Panel.COLOR.red : Panel.COLOR.blue) && !this.HeviSand)
                            {
                                this.positionre = new Point(point.X - this.UnionRebirth(this.union), point.Y);
                            }
                            else
                            {
                                this.MoveRandom(true, false);
                            }
                        }
                        if (this.position == this.positionre)
                        {
                            if (this.attackFlag)
                            {
                                this.Motion = NaviBase.MOTION.attack;
                                if (this.beast)
                                {
                                    this.speed *= 2;
                                }
                                this.attackFlag = false;
                                switch (this.attack)
                                {
                                case HakutakuMan.ATTACK.WideCrow:
                                    this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y - 1, this.union, new Point(0, 2), 60, true));
                                    break;

                                case HakutakuMan.ATTACK.LongCrow:
                                    this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, new Point(1, 0), 60, true));
                                    break;
                                }
                            }
                            else
                            {
                                this.dammy.flag = false;
                                this.Motion     = NaviBase.MOTION.neutral;
                            }
                            this.frame       = 0;
                            this.roopneutral = 0;
                            ++this.roopmove;
                            break;
                        }
                        break;

                    case 4:
                        var originalPosition = this.position;
                        this.position         = this.positionre;
                        this.positionReserved = null;
                        if (this.attackFlag)
                        {
                            this.positionReserved = originalPosition;
                            switch (this.attack)
                            {
                            case HakutakuMan.ATTACK.WideCrow:
                                this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y - 1, this.union, new Point(0, 2), 60, true));
                                break;

                            case HakutakuMan.ATTACK.LongCrow:
                                this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, new Point(1, 0), 60, true));
                                break;

                            case HakutakuMan.ATTACK.Miss:
                                if (this.beast)
                                {
                                    this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, new Point(0, 0), 60, true));
                                    this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X + 2 * this.UnionRebirth(this.union), this.position.Y - 1, this.union, new Point(0, 0), 60, true));
                                    this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X, this.position.Y - 1, this.union, new Point(0, 0), 60, true));
                                    this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X + 2 * this.UnionRebirth(this.union), this.position.Y + 1, this.union, new Point(0, 0), 60, true));
                                    this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X, this.position.Y + 1, this.union, new Point(0, 0), 60, true));
                                    break;
                                }
                                break;
                            }
                        }
                        this.PositionDirectSet();
                        break;

                    case 7:
                        if (this.attackFlag)
                        {
                            this.Motion     = NaviBase.MOTION.attack;
                            this.attackFlag = false;
                            this.speed     *= 2;
                        }
                        else
                        {
                            this.dammy.flag = false;
                            this.Motion     = NaviBase.MOTION.neutral;
                        }
                        this.frame       = 0;
                        this.roopneutral = 0;
                        ++this.roopmove;
                        break;
                    }
                    ++this.waittime;
                    break;
                }
                break;

            case NaviBase.MOTION.knockback:
                switch (this.waittime)
                {
                case 2:
                    this.NockMotion();
                    this.attackCombo   = 0;
                    this.speed         = this.nspeed;
                    this.guard         = CharacterBase.GUARD.none;
                    this.counterTiming = false;
                    this.effecting     = false;
                    this.attackFlag    = false;
                    this.PositionDirectSet();
                    break;

                case 3:
                    this.NockMotion();
                    break;

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

                case 21:
                    this.animationpoint = new Point(0, 0);
                    this.waittime       = 0;
                    this.dammy.flag     = false;
                    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);
            }
            this.FlameControl();
            this.MoveAftar();
        }
Пример #20
0
        protected override void Moving()
        {
            if (!this.dammyInit)
            {
                this.dammyInit     = true;
                this.dammyEnemy[0] = new DammyEnemy(this.sound, this.parent, this.UnionRebirth, 0, this, true);
                this.dammyEnemy[1] = new DammyEnemy(this.sound, this.parent, -1 * this.UnionRebirth, 0, this, false);
                this.parent.enemys.Add(this.dammyEnemy[0]);
                this.parent.enemys.Add(this.dammyEnemy[1]);
                this.dammyEnemy[0].nohit  = true;
                this.dammyEnemy[0].noslip = true;
                this.dammyEnemy[1].noslip = true;
            }
            this.neutlal = this.motion == Juraigon.MOTION.neutral;
            if (this.moveflame)
            {
                this.positionre = this.position;
                switch (this.motion)
                {
                case Juraigon.MOTION.neutral:
                    this.animationpoint = this.AnimeNeutral(this.frame);
                    if (this.frame >= 7)
                    {
                        this.frame = 0;
                        ++this.roopneutral;
                        if (this.roopneutral >= 2 && !this.badstatus[4] && this.parent.nowscene != SceneBattle.BATTLESCENE.end)
                        {
                            this.frame         = 0;
                            this.counterTiming = true;
                            if (this.version > 0)
                            {
                                this.motion = Juraigon.MOTION.attack;
                            }
                            else
                            {
                                int num = this.Random.Next(3);
                                this.speed = 3;
                                switch (num)
                                {
                                case 0:
                                    this.motion = Juraigon.MOTION.attack;
                                    break;

                                case 1:
                                    this.breathMode = true;
                                    this.sound.PlaySE(SoundEffect.dragonVoice);
                                    this.motion = Juraigon.MOTION.attack3;
                                    break;

                                case 2:
                                    this.motion = Juraigon.MOTION.attack4;
                                    break;
                                }
                            }
                        }
                        else
                        {
                            ++this.roop;
                        }
                        this.frame = 0;
                        break;
                    }
                    break;

                case Juraigon.MOTION.move:
                    this.animationpoint = this.AnimeNeutral(this.frame);
                    this.MoveRandom(false, this.breathMode);
                    if (this.position == this.positionre)
                    {
                        this.frame       = 0;
                        this.roopneutral = 0;
                    }
                    else
                    {
                        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;
                    }
                    this.motion = !this.breathMode ? Juraigon.MOTION.neutral : Juraigon.MOTION.attack3;
                    break;

                case Juraigon.MOTION.attack:
                    this.animationpoint.X = this.AnimeAttack1(this.frame).X;
                    if (this.frame == 4)
                    {
                        this.frame         = 0;
                        this.speed         = 4;
                        this.guard         = CharacterBase.GUARD.none;
                        this.counterTiming = false;
                        this.motion        = Juraigon.MOTION.attack2;
                        break;
                    }
                    break;

                case Juraigon.MOTION.attack2:
                    this.animationpoint.X = this.AnimeAttack2(this.frame % 2).X;
                    int num1 = 8;
                    this.wideBreathTicks++;
                    switch (this.wideBreathTicks)
                    {
                    case 1:
                        this.counterTiming           = false;
                        this.dammyEnemy[0].nohit     = false;
                        this.dammyEnemy[0].effecting = false;
                        break;

                    case 8:
                        this.sound.PlaySE(SoundEffect.quake);
                        var attackBase1 = new ElementFire(this.sound, this.parent, this.position.X + 2 * this.UnionRebirth, this.position.Y, this.union, this.Power, 18, this.element, false, 1);
                        attackBase1.positionDirect.Y += num1;
                        this.parent.attacks.Add(attackBase1);
                        this.fireBreath.Add(attackBase1);
                        break;

                    case 11:
                        this.sound.PlaySE(SoundEffect.quake);
                        int num2        = 3;
                        var attackBase2 = new ElementFire(this.sound, this.parent, this.position.X + num2 * this.UnionRebirth, this.position.Y - 1, this.union, this.Power, 18, this.element, false, 1);

                        attackBase2.positionDirect.Y += num1;
                        this.parent.attacks.Add(attackBase2);
                        var attackBase3 = new ElementFire(this.sound, this.parent, this.position.X + num2 * this.UnionRebirth, this.position.Y, this.union, this.Power, 18, this.element, false, 1);
                        attackBase3.positionDirect.Y += num1;
                        this.parent.attacks.Add(attackBase3);
                        var attackBase4 = new ElementFire(this.sound, this.parent, this.position.X + num2 * this.UnionRebirth, this.position.Y + 1, this.union, this.Power, 18, this.element, false, 1);
                        attackBase4.positionDirect.Y += num1;
                        this.parent.attacks.Add(attackBase4);
                        this.fireBreath.Add(attackBase2);
                        this.fireBreath.Add(attackBase3);
                        this.fireBreath.Add(attackBase4);
                        break;

                    case 14:
                        this.sound.PlaySE(SoundEffect.quake);
                        int num3        = 4;
                        var attackBase5 = new ElementFire(this.sound, this.parent, this.position.X + num3 * this.UnionRebirth, this.position.Y - 1, this.union, this.Power, 18, this.element, false, 1);
                        attackBase5.positionDirect.Y += num1;
                        this.parent.attacks.Add(attackBase5);
                        var attackBase6 = new ElementFire(this.sound, this.parent, this.position.X + num3 * this.UnionRebirth, this.position.Y, this.union, this.Power, 18, this.element, false, 1);
                        attackBase6.positionDirect.Y += num1;
                        this.parent.attacks.Add(attackBase6);
                        var attackBase7 = new ElementFire(this.sound, this.parent, this.position.X + num3 * this.UnionRebirth, this.position.Y + 1, this.union, this.Power, 18, this.element, false, 1);
                        attackBase7.positionDirect.Y += num1;
                        this.parent.attacks.Add(attackBase7);
                        this.fireBreath.Add(attackBase5);
                        this.fireBreath.Add(attackBase6);
                        this.fireBreath.Add(attackBase7);
                        break;
                    }
                    if (this.frame >= 60)
                    {
                        this.wideBreathTicks         = 0;
                        this.frame                   = 0;
                        this.dammyEnemy[0].nohit     = true;
                        this.dammyEnemy[0].effecting = true;
                        this.motion                  = Juraigon.MOTION.move;
                        this.speed                   = this.nspeed;
                        this.fireBreath.Clear();
                        this.waittime = 0;
                    }
                    break;

                case Juraigon.MOTION.attack3:
                    Point point1;
                    if (this.frame < 6)
                    {
                        ref Point local = ref this.animationpoint;
                        point1 = this.AnimeAttack3(this.frame);
                        int x = point1.X;
                        local.X = x;
                    }
                    else
                    {
                        this.animationpoint.X = this.AnimeAttack2(this.frame % 2).X;
                    }
                    switch (this.frame)
                    {
                    case 4:
                        this.counterTiming           = false;
                        this.dammyEnemy[0].nohit     = false;
                        this.dammyEnemy[0].effecting = false;
                        break;

                    case 12:
                        point1 = this.RandomTarget();
                        int        x1          = point1.X;
                        int        num4        = 2;
                        int        num5        = 8;
                        AttackBase attackBase8 = new FireBreath(this.sound, this.parent, this.position.X + num4 * this.UnionRebirth, this.position.Y, this.union, this.Power, 2, this.element, x1);
                        attackBase8.positionDirect.Y += num5;
                        this.parent.attacks.Add(attackBase8);
                        break;

                    case 16:
                        if (this.breathCount < 3)
                        {
                            this.frame = 0;
                            this.dammyEnemy[0].nohit     = true;
                            this.dammyEnemy[0].effecting = true;
                            ++this.breathCount;
                            this.motion = Juraigon.MOTION.move;
                            break;
                        }
                        break;

                    case 40:
                        this.motion = Juraigon.MOTION.move;
                        this.frame  = 0;
                        this.dammyEnemy[0].nohit     = true;
                        this.dammyEnemy[0].effecting = true;
                        this.breathCount             = 0;
                        this.breathMode = false;
                        break;
                    }
                    break;
Пример #21
0
 new void Awake()
 {
     base.Awake();
     fireBreath = GetComponentInChildren<FireBreath>();
     GetComponentInChildren<AttackSubjectImpl>().damageCalculator = original => original * 0.2f;
 }
Пример #22
0
 new void Awake()
 {
     base.Awake();
     fireBreath = GetComponentInChildren <FireBreath>();
     GetComponentInChildren <AttackSubjectImpl>().damageCalculator = original => original * 0.1f;
 }