Пример #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)
     {
         foreach (CharacterBase chara in battle.AllHitter())
         {
             if (!chara.nohit && (chara.union == character.UnionEnemy || chara is ObjectBase))
             {
                 battle.attacks.Add(new Plant(this.sound, battle, chara.position.X, chara.position.Y, character.union, this.Power(character), this.element, chara));
             }
         }
     }
     else
     {
         if (character.waittime < 31)
         {
             return;
         }
         base.Action(character, battle);
     }
 }
Пример #2
0
        protected int TargetX(CharacterBase character, SceneBattle battle)
        {
            List <CharacterBase> characterBaseList = new List <CharacterBase>();

            foreach (CharacterBase characterBase in battle.AllHitter())
            {
                if (characterBase is EnemyBase)
                {
                    if (characterBase.union == character.UnionEnemy)
                    {
                        characterBaseList.Add(characterBase);
                    }
                }
                else if (characterBase is ObjectBase)
                {
                    ObjectBase objectBase = (ObjectBase)characterBase;
                    if ((objectBase.unionhit || objectBase.union == character.union) && character.UnionEnemy == objectBase.StandPanel.color)
                    {
                        characterBaseList.Add(characterBase);
                    }
                }
            }
            bool flag = false;
            int  num  = character.union == Panel.COLOR.red ? 6 : -1;

            foreach (CharacterBase characterBase in characterBaseList)
            {
                flag = true;
                if (character.union == Panel.COLOR.red)
                {
                    if (num > characterBase.position.X)
                    {
                        num = characterBase.position.X;
                    }
                }
                else if (num < characterBase.position.X)
                {
                    num = characterBase.position.X;
                }
            }
            return(num);
        }