Exemplo n.º 1
0
 public override void Action(CharacterBase character, SceneBattle battle)
 {
     if (character.waittime <= 1)
     {
         character.animationpoint = new Point(0, 1);
     }
     else if (character.waittime <= 7)
     {
         character.animationpoint = new Point((character.waittime - 1) / 2, 1);
     }
     else if (character.waittime < 15)
     {
         character.animationpoint = new Point(3, 1);
     }
     else if (character.waittime == 15)
     {
         if (!character.Canmove(character.positionold))
         {
             return;
         }
         this.sound.PlaySE(SoundEffect.enterenemy);
         battle.enemys.Add(new Kedamar(this.sound, battle, character.positionold.X, character.positionold.Y, (byte)battle.enemys.Count, Panel.COLOR.red, 2));
     }
     else
     {
         if (character.waittime < 31)
         {
             return;
         }
         base.Action(character, battle);
     }
 }
Exemplo n.º 2
0
        public override void Action(CharacterBase character, SceneBattle battle)
        {
            if (SaveData.HAVEVirus[this.id] == null)
            {
                if (character.waittime == 3)
                {
                    this.sound.PlaySE(SoundEffect.throwbomb);
                }
                character.animationpoint = CharacterAnimation.BombAnimation(character.waittime);
                if (character.waittime == 6)
                {
                    int   num = this.power + this.pluspower;
                    int   t   = 40;
                    Point end = new Point(character.position.X + 3 * this.UnionRebirth(character.union), character.position.Y);
                    battle.attacks.Add(this.Paralyze(new VirusBall(this.sound, character.parent, character.position.X, character.position.Y, character.union, this.Power(character), 1, new Vector2(character.positionDirect.X, character.positionDirect.Y - 16f), end, t, this.id)));
                }
                if (character.waittime != 25)
                {
                    return;
                }
                base.Action(character, battle);
            }
            else if (character.waittime <= 3)
            {
                character.animationpoint = new Point(0, 1);
            }
            else if (character.waittime <= 12)
            {
                character.animationpoint = new Point((character.waittime - 3) / 3, 1);
            }
            else if (character.waittime < 24)
            {
                character.animationpoint = new Point(3, 1);
            }
            else if (character.waittime == 24)
            {
                if (character.Canmove(character.positionold))
                {
                    this.sound.PlaySE(SoundEffect.enterenemy);
                    Virus     haveViru;
                    EnemyBase e;
                    haveViru = SaveData.HAVEVirus[this.id];

                    var newVirus = new Virus
                    {
                        type      = haveViru.type,
                        eatBug    = haveViru.eatBug,
                        eatError  = haveViru.eatError,
                        eatFreeze = haveViru.eatFreeze,
                    };
                    if ((character as Player)?.addonSkill[73] == true)
                    {
                        var enemies      = battle.AllChara().Where(c => character.UnionEnemy == c.union);
                        var maxEnemyRank = enemies.Max(c => (c as EnemyBase)?.version ?? 0);

                        if (enemies.Any(c => c is NaviBase))
                        {
                            maxEnemyRank++;
                        }

                        var rankUpgrades = Math.Max(0, maxEnemyRank - haveViru.rank - (3 - haveViru.rank));
                        newVirus.eatBug += 20 * rankUpgrades;
                        newVirus.ReturnVirus(newVirus.type);
                    }
                    e = new EnemyBase(this.sound, battle, character.positionold.X, character.positionold.Y, 0, character.union, newVirus.rank);
                    EnemyBase enemyBase = EnemyBase.EnemyMake(newVirus.type, e, false);
                    enemyBase.number = battle.enemys.Count;
                    if (this.randomSeed != null)
                    {
                        enemyBase.randomSeed = this.randomSeed;
                    }
                    enemyBase.HPset(newVirus.HP);
                    enemyBase.power = newVirus.Power;
                    if (enemyBase.Canmove(enemyBase.position))
                    {
                        battle.enemys.Add(enemyBase);
                        enemyBase.Init();
                        enemyBase.InitAfter();
                    }
                    else
                    {
                        battle.effects.Add(new MoveEnemy(this.sound, battle, character.positionold.X, character.positionold.Y));
                    }
                }
            }
            else if (character.waittime >= 48)
            {
                base.Action(character, battle);
            }
        }